90 |
return [_clients objectForKey: playerName]; |
return [_clients objectForKey: playerName]; |
91 |
} |
} |
92 |
|
|
|
|
|
93 |
/** |
/** |
94 |
* Returns an array containing all the clients |
* Returns an array containing all the clients |
95 |
*/ |
*/ |
98 |
return _clients; |
return _clients; |
99 |
} |
} |
100 |
|
|
|
|
|
101 |
/** |
/** |
102 |
* Finishes a NetParty, disconnects all the clients, and unsubscribes |
* Finishes a NetParty, disconnects all the clients, and unsubscribes |
103 |
* from the server. |
* from the server. |
151 |
*/ |
*/ |
152 |
- (NSPort *) connectWithName: (NSString *)playerName |
- (NSPort *) connectWithName: (NSString *)playerName |
153 |
withPort: (NSPort *)sendPort |
withPort: (NSPort *)sendPort |
154 |
initGame: (HgGame *)game |
initGame: (HgGame **)game |
155 |
{ |
{ |
156 |
NSParameterAssert (playerName); |
NSParameterAssert (playerName); |
157 |
NSParameterAssert ([playerName length] != 0); |
NSParameterAssert ([playerName length] != 0); |
178 |
/* add a new player to the game */ |
/* add a new player to the game */ |
179 |
[_game addPlayer: [newClient player]]; |
[_game addPlayer: [newClient player]]; |
180 |
|
|
181 |
game = _game; |
printf(" Etat du jeu avant mise a jour : %s\n", [[*game name] cString]); |
182 |
|
|
183 |
|
//[*game modifWithGame: _game]; |
184 |
|
/* game renvoye bycopy */ |
185 |
|
*game = _game; |
186 |
|
|
187 |
|
printf(" Etat du jeu apres mise a jour : %s\n", [[*game name] cString]); |
188 |
|
|
189 |
return receivePort; |
return receivePort; |
190 |
} |
} |