Changeset 8807 for code/branches/output/src/libraries/network/Server.cc
- Timestamp:
- Jul 31, 2011, 9:09:23 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/output/src/libraries/network/Server.cc
r8788 r8807 114 114 { 115 115 Host::setActive(true); 116 COUT(4) << "opening server" << endl;116 orxout(verbose, context::network) << "opening server" << endl; 117 117 this->openListener(); 118 118 … … 137 137 { 138 138 Host::setActive(false); 139 COUT(4) << "closing server" << endl;139 orxout(verbose, context::network) << "closing server" << endl; 140 140 this->disconnectClients(); 141 141 this->closeListener(); 142 142 143 143 /* tell master server we're closing */ 144 COUT(2) << "disconnecting." << endl;144 orxout(internal_info, context::network) << "disconnecting." << endl; 145 145 WANDiscoverable::setActivity(false); 146 COUT(2) << "disconnecting done" << endl;146 orxout(internal_info, context::network) << "disconnecting done" << endl; 147 147 148 148 LANDiscoverable::setActivity(false); … … 158 158 chat->setPeerID(NETWORK_PEER_ID_BROADCAST); 159 159 chat->send( static_cast<Host*>(this) ); 160 // COUT(3) << "could not send Chat message to client ID: " << temp->getID() << std::endl;160 // orxout(internal_warning, context::network) << "could not send Chat message to client ID: " << temp->getID() << endl; 161 161 // temp = temp->next(); 162 162 // } 163 // COUT(1) << "Player " << playerID << ": " << message << std::endl;163 // orxout(message) << "Player " << playerID << ": " << message << endl; 164 164 return true; 165 165 } … … 246 246 { 247 247 // for( ClientInformation* temp=ClientInformation::getBegin(); temp!=0; temp=temp->next() ) 248 // COUT(0) << "Round trip time to client with ID: " << temp->getID() << " is " << temp->getRTT() << " ms" << endl;248 // orxout(message) << "Round trip time to client with ID: " << temp->getID() << " is " << temp->getRTT() << " ms" << endl; 249 249 } 250 250 … … 268 268 return; 269 269 GamestateManager::update(); 270 // COUT(5) << "Server: one gamestate update complete, goig to sendGameState" << std::endl;271 // std::cout << "updated gamestate, sending it" << std::endl;270 // orxout(verbose_more, context::network) << "Server: one gamestate update complete, goig to sendGameState" << endl; 271 //orxout(verbose_more, context::network) << "updated gamestate, sending it" << endl; 272 272 //if(clients->getGamestateID()!=GAMESTATEID_INITIAL) 273 273 sendGameStates(); 274 274 sendObjectDeletes(); 275 // COUT(5) << "Server: one sendGameState turn complete, repeat in next tick" << std::endl;276 // std::cout << "sent gamestate" << std::endl;275 // orxout(verbose_more, context::network) << "Server: one sendGameState turn complete, repeat in next tick" << endl; 276 //orxout(verbose_more, context::network) << "sent gamestate" << endl; 277 277 } 278 278 … … 305 305 return true; //everything ok (no deletes this tick) 306 306 } 307 // COUT(3) << "sending DeleteObjects" << std::endl;307 // orxout(verbose, context::network) << "sending DeleteObjects" << endl; 308 308 // while(temp != NULL){ 309 309 // if( !(temp->getSynched()) ) 310 310 // { 311 // COUT(5) << "Server: not sending gamestate" << std::endl;311 // orxout(verbose_more, context::network) << "Server: not sending gamestate" << endl; 312 312 // temp=temp->next(); 313 313 // continue; … … 318 318 del->setPeerID(NETWORK_PEER_ID_BROADCAST); 319 319 if ( !del->send( static_cast<Host*>(this) ) ) 320 COUT(3) << "Server: could not broadcast deleteObjects packet" << std::endl;320 orxout(internal_warning, context::network) << "Server: could not broadcast deleteObjects packet" << endl; 321 321 // temp=temp->next(); 322 322 // gs gets automatically deleted by enet callback … … 331 331 // static unsigned int newid=1; 332 332 // 333 // COUT(2) << "Server: adding client" << std::endl;333 // orxout(internal_info, context::network) << "Server: adding client" << endl; 334 334 // ClientInformation *temp = ClientInformation::insertBack(new ClientInformation); 335 335 // if(!temp) 336 336 // { 337 // COUT(2) << "Server: could not add client" << std::endl;337 // orxout(internal_warning, context::network) << "Server: could not add client" << endl; 338 338 // } 339 339 // temp->setID(newid); … … 347 347 // ++newid; 348 348 349 COUT(3) << "Server: added client id: " << peerID << std::endl;349 orxout(internal_info, context::network) << "Server: added client id: " << peerID << endl; 350 350 createClient(peerID); 351 351 } … … 353 353 void Server::removePeer(uint32_t peerID) 354 354 { 355 COUT(4) << "removing client from list" << std::endl;355 orxout(verbose, context::network) << "removing client from list" << endl; 356 356 // ClientInformation *client = ClientInformation::findClient(&event->peer->address); 357 357 // if(!client) … … 395 395 // if(!temp) 396 396 // { 397 // COUT(2) << "Server. could not create client with id: " << clientID << std::endl;397 // orxout(internal_error, context::network) << "Server. could not create client with id: " << clientID << endl; 398 398 // return false; 399 399 // } 400 // COUT(4) << "Con.Man: creating client id: " << temp->getID() << std::endl;400 // orxout(verbose, context::network) << "Con.Man: creating client id: " << temp->getID() << endl; 401 401 402 402 // synchronise class ids … … 412 412 GamestateManager::setSynched(clientID); 413 413 414 COUT(4) << "sending welcome" << std::endl;414 orxout(verbose, context::network) << "sending welcome" << endl; 415 415 packet::Welcome *w = new packet::Welcome(clientID); 416 416 w->setPeerID(clientID); … … 457 457 chat->setPeerID(NETWORK_PEER_ID_BROADCAST); 458 458 chat->send( static_cast<Host*>(this) ); 459 // COUT(3) << "could not send Chat message to client ID: " << temp->getID() << std::endl;459 // orxout(internal_warning, context::network) << "could not send Chat message to client ID: " << temp->getID() << endl; 460 460 // temp = temp->next(); 461 461 } 462 // COUT(1) << "Player " << Host::getPlayerID() << ": " << message << std::endl;462 // orxout(message) << "Player " << Host::getPlayerID() << ": " << message << endl; 463 463 for (ObjectList<ChatListener>::iterator it = ObjectList<ChatListener>::begin(); it != ObjectList<ChatListener>::end(); ++it) 464 464 it->incomingChat(message, clientID); … … 476 476 } 477 477 assert(failures<10); 478 COUT(4) << "syncClassid:\tall synchClassID packets have been sent" << std::endl;478 orxout(verbose, context::network) << "syncClassid:\tall synchClassID packets have been sent" << endl; 479 479 } 480 480
Note: See TracChangeset
for help on using the changeset viewer.