Changeset 1246
- Timestamp:
- May 7, 2008, 5:34:35 PM (17 years ago)
- Location:
- code/branches/network3/src/network
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/network3/src/network/Client.cc
r1245 r1246 235 235 COUT(4) << "client tick: sending gs " << gs << std::endl; 236 236 if(client_connection.addPacket(pck_gen.gstate(gs))) 237 if(!client_connection.sendPackets()) 238 COUT(3) << "Problem sending partial gamestate" << std::endl; 237 COUT(3) << "Problem adding partial gamestate to queue" << std::endl; 239 238 // now delete it to save memory 240 239 delete [] gs->data; … … 251 250 } 252 251 } 252 if(!client_connection.sendPackets()) 253 COUT(3) << "Problem sending packets to server" << std::endl; 253 254 return; 254 255 } … … 260 261 if(gamestate.pushGameState(data)){ 261 262 client_connection.addPacket(pck_gen.acknowledgement(id)); 262 if(!client_connection.sendPackets()) 263 COUT(2) << "Could not send acknowledgment" << std::endl; 263 // we do this at the end of a tick 264 // if(!client_connection.sendPackets()) 265 // COUT(2) << "Could not send acknowledgment" << std::endl; 264 266 } 265 267 // test_once=true; -
code/branches/network3/src/network/ConnectionManager.cc
r1245 r1246 199 199 break; 200 200 } 201 // usleep(1000);201 usleep(100); 202 202 //yield(); //TODO: find apropriate 203 203 } -
code/branches/network3/src/network/GameStateClient.cc
r1245 r1246 289 289 290 290 switch ( retval ) { 291 case Z_OK: COUT(5) << "G.St. Man: compress: successfully compressed" << std::endl; break;292 case Z_MEM_ERROR: COUT(1) << "G.St. Man: compress: not enough memory available in gamestate.compress" << std::endl;293 return NULL; 294 case Z_BUF_ERROR: COUT(2) << "G.St. Man: compress: not enough memory available in the buffer in gamestate.compress" << std::endl;295 return NULL; 296 case Z_DATA_ERROR: COUT(2) << "G.St. Man: compress: data corrupted in gamestate.compress" << std::endl;291 case Z_OK: COUT(5) << "G.St.Cl: compress: successfully compressed" << std::endl; break; 292 case Z_MEM_ERROR: COUT(1) << "G.St.Cl: compress: not enough memory available in gamestate.compress" << std::endl; 293 return NULL; 294 case Z_BUF_ERROR: COUT(2) << "G.St.Cl: compress: not enough memory available in the buffer in gamestate.compress" << std::endl; 295 return NULL; 296 case Z_DATA_ERROR: COUT(2) << "G.St.Cl: compress: data corrupted in gamestate.compress" << std::endl; 297 297 return NULL; 298 298 } -
code/branches/network3/src/network/GameStateManager.cc
r1245 r1246 260 260 ++it; 261 261 } 262 262 263 delete[] state->data; 264 delete state; 263 265 return true; 264 266 } -
code/branches/network3/src/network/Server.cc
r1245 r1246 210 210 added=true; 211 211 temp=temp->next(); 212 // now delete gamestate 213 delete[] gs->data; 214 delete gs; 212 215 } 213 216 if(added) { … … 222 225 COUT(4) << "Server: processing ack from client: " << clientID << "; ack-id: " << data->a << std::endl; 223 226 gamestates->ackGameState(clientID, data->a); 227 delete data; 224 228 } 225 229 … … 235 239 if(!gamestates->pushGameState(data, clientID)) 236 240 COUT(3) << "Could not push gamestate\t\t\t\t=====" << std::endl; 237 // delete[] data->data;238 // delete data;239 241 } 240 242
Note: See TracChangeset
for help on using the changeset viewer.