Changeset 1901 for code/branches/network/src/network/Server.cc
- Timestamp:
- Oct 12, 2008, 12:15:30 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/network/src/network/Server.cc
r1834 r1901 72 72 connection = new ConnectionManager(); 73 73 gamestates_ = new GamestateManager(); 74 isServer_ = true;75 74 } 76 75 … … 79 78 connection = new ConnectionManager(port); 80 79 gamestates_ = new GamestateManager(); 81 isServer_ = true;82 80 } 83 81 … … 91 89 connection = new ConnectionManager(port, bindAddress); 92 90 gamestates_ = new GamestateManager(); 93 isServer_ = true;94 91 } 95 92 … … 103 100 connection = new ConnectionManager(port, bindAddress); 104 101 gamestates_ = new GamestateManager(); 105 isServer_ = true; 102 } 103 104 /** 105 * @brief Destructor 106 */ 107 Server::~Server(){ 108 if(connection) 109 delete connection; 110 if(gamestates_) 111 delete gamestates_; 106 112 } 107 113 … … 198 204 //std::cout << "updated gamestate, sending it" << std::endl; 199 205 //if(clients->getGamestateID()!=GAMESTATEID_INITIAL) 206 sendGameState(); 200 207 sendObjectDeletes(); 201 sendGameState();202 208 COUT(5) << "Server: one sendGameState turn complete, repeat in next tick" << std::endl; 203 209 //std::cout << "sent gamestate" << std::endl; … … 254 260 if(!del->fetchIDs()) 255 261 return true; //everything ok (no deletes this tick) 262 // COUT(3) << "sending DeleteObjects" << std::endl; 256 263 while(temp != NULL){ 257 264 if( !(temp->getSynched()) ){ … … 307 314 packet::Welcome *w = new packet::Welcome(temp->getID(), temp->getShipID()); 308 315 w->setClientID(temp->getID()); 309 assert(w->send()); 316 bool b = w->send(); 317 assert(b); 310 318 packet::Gamestate *g = new packet::Gamestate(); 311 319 g->setClientID(temp->getID()); 312 assert(g->collectData(0)); 313 assert(g->compressData()); 314 assert(g->send()); 320 b = g->collectData(0); 321 assert(b); 322 b = g->compressData(); 323 assert(b); 324 b = g->send(); 325 assert(b); 315 326 return true; 316 327 }
Note: See TracChangeset
for help on using the changeset viewer.