equal
deleted
inserted
replaced
46 } |
46 } |
47 |
47 |
48 -(void) engineProtocol { |
48 -(void) engineProtocol { |
49 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; |
49 NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; |
50 IPaddress ip; |
50 IPaddress ip; |
51 int idx, eProto; |
51 int eProto; |
52 BOOL clientQuit, serverQuit; |
52 BOOL clientQuit, serverQuit; |
53 char buffer[BUFFER_SIZE], string[BUFFER_SIZE]; |
53 char buffer[BUFFER_SIZE], string[BUFFER_SIZE]; |
54 Uint8 msgSize; |
54 Uint8 msgSize; |
55 Uint16 gameTicks; |
55 Uint16 gameTicks; |
56 |
56 |
179 } |
179 } |
180 |
180 |
181 while (!clientQuit){ |
181 while (!clientQuit){ |
182 /* Now we can communicate with the client using csd socket |
182 /* Now we can communicate with the client using csd socket |
183 * sd will remain opened waiting other connections */ |
183 * sd will remain opened waiting other connections */ |
184 idx = 0; |
|
185 msgSize = 0; |
184 msgSize = 0; |
186 memset(buffer, 0, BUFFER_SIZE); |
185 memset(buffer, 0, BUFFER_SIZE); |
187 memset(string, 0, BUFFER_SIZE); |
186 memset(string, 0, BUFFER_SIZE); |
188 if (SDLNet_TCP_Recv(csd, &msgSize, sizeof(Uint8)) <= 0) |
187 if (SDLNet_TCP_Recv(csd, &msgSize, sizeof(Uint8)) <= 0) |
189 clientQuit = YES; |
188 clientQuit = YES; |