project_files/HedgewarsMobile/Classes/GameSetup.m
changeset 3598 a8aa06bae895
parent 3573 c84067629035
child 3613 cfd3c6536a09
equal deleted inserted replaced
3597:978c30ef50fc 3598:a8aa06bae895
   271         if (SDLNet_TCP_Recv(csd, buffer, msgSize) <=0)
   271         if (SDLNet_TCP_Recv(csd, buffer, msgSize) <=0)
   272             clientQuit = YES;
   272             clientQuit = YES;
   273         
   273         
   274         switch (buffer[0]) {
   274         switch (buffer[0]) {
   275             case 'C':
   275             case 'C':
   276                 DLog(@"sending game config");
   276                 DLog(@"sending game config\n%@",self.gameConfig);
   277                 
   277                 
   278                 // local game
   278                 // local game
   279                 [self sendToEngine:@"TL"];
   279                 [self sendToEngine:@"TL"];
   280                 
   280                 
   281                 // seed info
   281                 // seed info
   299                                withHealth:health
   299                                withHealth:health
   300                                   ofColor:[teamData objectForKey:@"color"]];
   300                                   ofColor:[teamData objectForKey:@"color"]];
   301                 }
   301                 }
   302                 
   302                 
   303                 [self provideAmmoData:[self.gameConfig objectForKey:@"weapon"] forPlayingTeams:[teamsConfig count]];
   303                 [self provideAmmoData:[self.gameConfig objectForKey:@"weapon"] forPlayingTeams:[teamsConfig count]];
   304                 
       
   305                 clientQuit = NO;
       
   306                 break;
   304                 break;
   307             case '?':
   305             case '?':
   308                 // without this sleep sometimes frontend replies before engine has processed any flag (resulting in an error)
       
   309                 [NSThread sleepForTimeInterval:0.7];
       
   310                 DLog(@"Ping? Pong!");
   306                 DLog(@"Ping? Pong!");
   311                 [self sendToEngine:@"!"];
   307                 [self sendToEngine:@"!"];
   312                 break;
   308                 break;
   313             case 'E':
   309             case 'E':
   314                 DLog(@"ERROR - last console line: [%s]", &buffer[1]);
   310                 DLog(@"ERROR - last console line: [%s]", &buffer[1]);