71 |
self = [super init]; |
self = [super init]; |
72 |
if (self != nil) |
if (self != nil) |
73 |
{ |
{ |
74 |
_gameList = [[NSMutableArray init] alloc]; |
// _gameList = [[NSMutableArray init] alloc]; |
75 |
|
_gameList = [NSMutableArray array]; |
76 |
} |
} |
77 |
|
|
78 |
return self; |
return self; |
154 |
[infosServer objectForKey: @"address"]] |
[infosServer objectForKey: @"address"]] |
155 |
gameName: [infosServer objectForKey: @"game_name"] |
gameName: [infosServer objectForKey: @"game_name"] |
156 |
numPlayers: [[infosServer objectForKey: @"num_players"] |
numPlayers: [[infosServer objectForKey: @"num_players"] |
157 |
unsignedIntValue] |
intValue] |
158 |
maxNumPlayers: [[infosServer objectForKey: @"max_num_players"] |
maxNumPlayers: [[infosServer objectForKey: @"max_num_players"] |
159 |
unsignedIntValue] |
intValue] |
160 |
master: [infosServer objectForKey: @"master"] |
master: [infosServer objectForKey: @"master"] |
161 |
mapName: [infosServer objectForKey: @"map_name"]]; |
mapName: [infosServer objectForKey: @"map_name"]]; |
162 |
} |
} |
185 |
NSDistantObject<NetParty> *party; |
NSDistantObject<NetParty> *party; |
186 |
NSPort *receivePort; |
NSPort *receivePort; |
187 |
|
|
188 |
|
printf ("Entre ds connectToGame\n"); |
189 |
|
|
190 |
|
|
191 |
/** --- FIXE ME ---- Error message without cast **/ |
/** --- FIXE ME ---- Error message without cast **/ |
192 |
receivePort = (NSPort *)[NSPort port]; |
receivePort = (NSPort *)[NSPort port]; |
193 |
|
|
194 |
|
printf ("registeredName = %s\n", [[gameID gameName] cString]); |
195 |
|
printf ("hostAddress = %s\n", [[[gameID host] address] cString]); |
196 |
|
printf ("hostName = %s\n", [[[gameID host] name] cString]); |
197 |
|
|
198 |
|
|
199 |
party = [NetConnection rootProxyForConnectionWithRegisteredName: |
party = [NetConnection rootProxyForConnectionWithRegisteredName: |
200 |
[gameID gameName] |
[gameID gameName] |
201 |
host: [[gameID host] name]]; |
host: [[gameID host] name]]; |
202 |
|
|
203 |
|
printf ("Connexion etablie\n"); |
204 |
|
|
205 |
|
|
206 |
NSPort *sendPort = [party connectWithName: playerName |
NSPort *sendPort = [party connectWithName: playerName |
207 |
withPort: receivePort |
withPort: receivePort |
208 |
initGame: &game]; |
initGame: &game]; |