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

Diff of /hegemonie/Network/NetGameList.m

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

revision 1.11 by nicov, Mon Jul 21 12:28:26 2003 UTC revision 1.12 by nicov, Tue Jul 22 10:08:40 2003 UTC
# Line 71  NSString * const _gameListURL = @"http:/ Line 71  NSString * const _gameListURL = @"http:/
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];        _gameList = [NSMutableArray array];
76      }      }
77        
# Line 150  NSString * const _gameListURL = @"http:/ Line 150  NSString * const _gameListURL = @"http:/
150    NSDictionary *infosServer;    NSDictionary *infosServer;
151    
152    while ( (infosServer = [enumerator nextObject]) ) {    while ( (infosServer = [enumerator nextObject]) ) {
153        printf(" numplayers = %d\n", [[infosServer objectForKey: @"num_players"]
154               intValue]);
155      
156      [self _addGameIDWithHost: [NSHost hostWithAddress:      [self _addGameIDWithHost: [NSHost hostWithAddress:
157                                [infosServer objectForKey: @"address"]]                                [infosServer objectForKey: @"address"]]
158                      gameName: [infosServer objectForKey: @"game_name"]                      gameName: [infosServer objectForKey: @"game_name"]
# Line 185  NSString * const _gameListURL = @"http:/ Line 188  NSString * const _gameListURL = @"http:/
188    NSDistantObject<NetParty> *party;    NSDistantObject<NetParty> *party;
189    NSPort *receivePort;    NSPort *receivePort;
190        
191    printf ("Entre ds connectToGame\n");    game = [[HgGame init] alloc];
192        
   
193    /** --- FIXE ME ---- Error message without cast **/    /** --- FIXE ME ---- Error message without cast **/
194    receivePort = (NSPort *)[NSPort port];    receivePort = (NSPort *)[NSPort port];
195    
   printf ("registeredName = %s\n", [[gameID gameName] cString]);  
   printf ("hostAddress = %s\n", [[[gameID host] address] cString]);  
   printf ("hostName = %s\n", [[[gameID host] name] cString]);  
     
   
196    party = [NetConnection rootProxyForConnectionWithRegisteredName:    party = [NetConnection rootProxyForConnectionWithRegisteredName:
197                             [gameID gameName]                             [gameID gameName]
198                           host: [[gameID host] name]];                           host: [[gameID host] name]];
199    
   printf ("Connexion etablie\n");  
     
   
200    NSPort *sendPort = [party connectWithName: playerName    NSPort *sendPort = [party connectWithName: playerName
201                                     withPort: receivePort                                     withPort: receivePort
202                                     initGame: &game];                                     initGame: &game];
203    
204    RETAIN(game);    RETAIN(game);
# Line 255  NSString * const _gameListURL = @"http:/ Line 249  NSString * const _gameListURL = @"http:/
249    NSParameterAssert (master);    NSParameterAssert (master);
250    NSParameterAssert (mapName);    NSParameterAssert (mapName);
251    
252      printf ("AddGameID\n");
253      printf ("numPlayers = %d\n", numPlayers);
254      
255    
256    NetGameID *game = [[NetGameID alloc] initWithHost: host    NetGameID *game = [[NetGameID alloc] initWithHost: host
257                                             gameName: gameName                                             gameName: gameName
258                                           numPlayers: numPlayers                                           numPlayers: numPlayers

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.12

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