/[hegemonie]/hegemonie/Network/NetParty.m
ViewVC logotype

Diff of /hegemonie/Network/NetParty.m

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by nicov, Tue May 27 10:44:04 2003 UTC revision 1.3 by nicov, Tue Jun 10 08:53:57 2003 UTC
# Line 21  Line 21 
21   * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.   * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
22   */   */
23    
24    #include <Foundation/NSHost.h>
25  #include <Foundation/NSPort.h>  #include <Foundation/NSPort.h>
26  #include <Foundation/NSString.h>  #include <Foundation/NSString.h>
27  #include <Foundation/NSDictionary.h>  #include <Foundation/NSDictionary.h>
# Line 35  Line 36 
36  #include "GameEngine/HgGame.h"  #include "GameEngine/HgGame.h"
37  #include "GameEngine/HgPlayer.h"  #include "GameEngine/HgPlayer.h"
38    
39    
40  /**  /**
41   * This class represents a game on the server with the clients connected   * This class represents a game on the server with the clients connected
42   */   */
# Line 129  Line 131 
131  }  }
132    
133  /**  /**
134   * Returns the number of players in the party (ie: number of clients).   * Returns the number of clients in the party
135   */   */
136  - (unsigned) nbPlayers  - (unsigned) nbClients
137  {  {
138    return [_clients count];    return [_clients count];
139  }  }
140    
141  /**  /**
142     * Returns an array with the clients name.
143     */
144    - (NSArray *) allClientName
145    {
146      return [_clients allKeys];
147    }
148    
149    /**
150   * Connects the player named playerName to the NetParty   * Connects the player named playerName to the NetParty
151   * and returns the receive port on the server.   * and returns the receive port on the server.
152   * If the name is already in use, returns nil.   * If the name is already in use, returns nil.
# Line 148  Line 158 
158    NSParameterAssert (playerName);    NSParameterAssert (playerName);
159    NSParameterAssert ([playerName length] != 0);    NSParameterAssert ([playerName length] != 0);
160    
161    if (([playerName length] != 0)    if ([_clients objectForKey: playerName] == nil)
       && ([_clients objectForKey: playerName] == nil))  
162      {      {
163        /* FIXME - error message without cast */        NSPort *receivePort = [NSPort port];
       NSPort *receivePort = (NSPort *)[NSPort port];  
164                
165        NetConnection *conn = [NetConnection        NetConnection *conn = [NetConnection
166                               connectionWithReceivePort: receivePort                               connectionWithReceivePort: receivePort

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26