Changeset 8807 for code/branches/output/src/libraries
- Timestamp:
- Jul 31, 2011, 9:09:23 PM (13 years ago)
- Location:
- code/branches/output/src/libraries
- Files:
-
- 26 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/output/src/libraries/network/ChatListener.cc
r7163 r8807 40 40 //unsigned int senderID ) 41 41 //{ 42 // COUT(0) << "Chat: \"" << message << "\"\n";42 //orxout(message) << "Chat: \"" << message << "\"" << endl; 43 43 44 44 -
code/branches/output/src/libraries/network/Client.cc
r8788 r8807 118 118 bool Client::processChat(const std::string& message, unsigned int playerID) 119 119 { 120 // COUT(1) << "Player " << playerID << ": " << message << std::endl;120 // orxout(message) << "Player " << playerID << ": " << message << endl; 121 121 return true; 122 122 } … … 124 124 void Client::printRTT() 125 125 { 126 COUT(0) << "Round trip time to server is " << ClientConnection::getRTT() << " ms" << endl;126 orxout(message) << "Round trip time to server is " << ClientConnection::getRTT() << " ms" << endl; 127 127 } 128 128 … … 150 150 { 151 151 timeSinceLastUpdate_ -= static_cast<unsigned int>( timeSinceLastUpdate_ / NETWORK_PERIOD ) * NETWORK_PERIOD; 152 // COUT(3) << '.';153 152 if ( isConnected() && isSynched_ ) 154 153 { 155 COUT(4) << "popping partial gamestate: " << std::endl;154 orxout(verbose, context::network) << "popping partial gamestate: " << endl; 156 155 // packet::Gamestate *gs = GamestateClient::getGamestate(); 157 156 if( GamestateManager::update() ) … … 166 165 //assert(gs); <--- there might be the case that no data has to be sent, so its commented out now 167 166 // if(gs){ 168 // COUT(4) << "client tick: sending gs " << gs << std::endl;167 // orxout(verbose, context::network) << "client tick: sending gs " << gs << endl; 169 168 // if( !gs->send() ) 170 // COUT(2) << "Problem adding partial gamestate to queue" << std::endl;169 // orxout(internal_warning, context::network) << "Problem adding partial gamestate to queue" << endl; 171 170 // // gs gets automatically deleted by enet callback 172 171 // } -
code/branches/output/src/libraries/network/ClientConnection.cc
r8788 r8807 60 60 void ClientConnection::setServerAddress( const std::string& serverAddress ) { 61 61 if (enet_address_set_host (this->serverAddress_, serverAddress.c_str()) < 0) 62 COUT(1) << "Error: Could not resolve \"" << serverAddress << "\"." << std::endl;62 orxout(internal_error, context::network) << "Could not resolve \"" << serverAddress << "\"." << endl; 63 63 } 64 64 … … 76 76 if ( this->host_ == NULL ) 77 77 { 78 COUT(1) << "ClientConnection: host_ == NULL" << std::endl;78 orxout(internal_error, context::network) << "ClientConnection: host_ == NULL" << endl; 79 79 // error handling 80 80 return false; … … 86 86 assert( this->host_->socket4 != ENET_SOCKET_NULL || this->host_->socket6 != ENET_SOCKET_NULL ); 87 87 if (this->host_->socket4 == ENET_SOCKET_NULL) 88 COUT(2) << "Warning: IPv4 Socket failed." << std::endl;88 orxout(internal_warning, context::network) << "IPv4 Socket failed." << endl; 89 89 else if (this->host_->socket6 == ENET_SOCKET_NULL) 90 COUT(2) << "Warning: IPv6 Socket failed." << std::endl;90 orxout(internal_warning, context::network) << "IPv6 Socket failed." << endl; 91 91 else 92 COUT(3) << "Info: Using IPv4 and IPv6 Sockets." << std::endl;92 orxout(internal_info, context::network) << "Using IPv4 and IPv6 Sockets." << endl; 93 93 94 94 this->server_ = enet_host_connect(this->host_, serverAddress_, NETWORK_CHANNEL_COUNT, 0); 95 95 if ( this->server_==NULL ) 96 96 { 97 COUT(1) << "ClientConnection: server_ == NULL" << std::endl;97 orxout(internal_error, context::network) << "ClientConnection: server_ == NULL" << endl; 98 98 // error handling 99 99 return false; … … 113 113 } 114 114 } 115 COUT(1) << "Could not connect to server" << endl;115 orxout(user_error, context::network) << "Could not connect to server" << endl; 116 116 return false; 117 117 } … … 140 140 break; 141 141 case ENET_EVENT_TYPE_DISCONNECT: 142 COUT(4) << "received disconnect confirmation from server" << endl;142 orxout(verbose, context::network) << "received disconnect confirmation from server" << endl; 143 143 this->connectionClosed(); 144 144 return true; … … 167 167 { 168 168 this->established_=false; 169 COUT(1) << "Received disconnect Packet from Server!" << endl;169 orxout(internal_error, context::network) << "Received disconnect Packet from Server!" << endl; 170 170 // server closed the connection 171 171 this->stopCommunicationThread(); -
code/branches/output/src/libraries/network/Connection.cc
r8327 r8807 144 144 while( outgoingEventsCount > 0 ) 145 145 { 146 // COUT(0) << "outgoing event" << endl;146 // orxout(verbose, context::network) << "outgoing event" << endl; 147 147 this->outgoingEventsMutex_->lock(); 148 148 outgoingEvent outEvent = this->outgoingEvents_.front(); -
code/branches/output/src/libraries/network/GamestateManager.cc
r8788 r8807 128 128 if( !this->sendPacket(ack)) 129 129 { 130 COUT(3) << "could not ack gamestate: " << gamestateID << std::endl;130 orxout(internal_warning, context::network) << "could not ack gamestate: " << gamestateID << endl; 131 131 return false; 132 132 } 133 133 else 134 134 { 135 COUT(5) << "acked a gamestate: " << gamestateID << std::endl;135 orxout(verbose_more, context::network) << "acked a gamestate: " << gamestateID << endl; 136 136 return true; 137 137 } … … 182 182 if( !peerIt->second.isSynched ) 183 183 { 184 COUT(5) << "Server: not sending gamestate" << std::endl;184 orxout(verbose_more, context::network) << "Server: not sending gamestate" << endl; 185 185 continue; 186 186 } 187 COUT(5) << "client id: " << peerIt->first << std::endl;188 COUT(5) << "Server: doing gamestate gamestate preparation" << std::endl;187 orxout(verbose_more, context::network) << "client id: " << peerIt->first << endl; 188 orxout(verbose_more, context::network) << "Server: doing gamestate gamestate preparation" << endl; 189 189 int peerID = peerIt->first; //get client id 190 190 … … 256 256 // OrxVerify(gs->compressData(), ""); 257 257 clock.capture(); 258 COUT(5) << "diff and compress time: " << clock.getDeltaTime() << endl;259 // COUT(5) << "sending gamestate with id " << gs->getID();258 orxout(verbose_more, context::network) << "diff and compress time: " << clock.getDeltaTime() << endl; 259 // orxout(verbose_more, context::network) << "sending gamestate with id " << gs->getID(); 260 260 // if(gamestate->isDiffed()) 261 // COUT(5) << " and baseid " << gs->getBaseID() << endl;261 // orxout(verbose_more, context::network) << " and baseid " << gs->getBaseID() << endl; 262 262 // else 263 // COUT(5) << endl;263 // orxout(verbose_more, context::network) << endl; 264 264 gs->setPeerID(peerID); 265 265 destgamestate = gs; … … 291 291 if( gamestateID <= curid && curid != GAMESTATEID_INITIAL ) 292 292 return true; 293 COUT(4) << "acking gamestate " << gamestateID << " for peerID: " << peerID << " curid: " << curid << std::endl;293 orxout(verbose, context::network) << "acking gamestate " << gamestateID << " for peerID: " << peerID << " curid: " << curid << endl; 294 294 std::map<uint32_t, packet::Gamestate*>::iterator it2; 295 295 for( it2=it->second.gamestates.begin(); it2!=it->second.gamestates.end(); ) -
code/branches/output/src/libraries/network/LANDiscoverable.cc
r8788 r8807 71 71 this->host_ = enet_host_create( &bindAddress, 10, 0, 0, 0 ); 72 72 if ( this->host_ == NULL ) 73 COUT(1) << "LANDiscoverable: host_ == NULL" << std::endl;73 orxout(internal_error, context::network) << "LANDiscoverable: host_ == NULL" << endl; 74 74 } 75 75 else … … 94 94 { 95 95 case ENET_EVENT_TYPE_CONNECT: 96 COUT(4) << "Received LAN discovery connect from client " << event.peer->host->receivedAddress << std::endl;96 orxout(verbose, context::network) << "Received LAN discovery connect from client " << event.peer->host->receivedAddress << endl; 97 97 break; 98 98 case ENET_EVENT_TYPE_DISCONNECT: … … 102 102 if( strcmp( LAN_DISCOVERY_MESSAGE, (char*)event.packet->data ) == 0 ) // check for a suitable orxonox client 103 103 { 104 COUT(3) << "Received LAN discovery message from client " << event.peer->host->receivedAddress << std::endl;104 orxout(internal_info, context::network) << "Received LAN discovery message from client " << event.peer->host->receivedAddress << endl; 105 105 packet::ServerInformation info; 106 106 info.setServerName("Orxonox Server"); -
code/branches/output/src/libraries/network/LANDiscovery.cc
r8706 r8807 44 44 this->host_ = enet_host_create(NULL, 10, 0, 0, 0 ); 45 45 if ( this->host_ == NULL ) 46 COUT(1) << "LANDiscovery: host_ == NULL" << std::endl;46 orxout(internal_error, context::network) << "LANDiscovery: host_ == NULL" << endl; 47 47 } 48 48 … … 66 66 peer = enet_host_connect(this->host_, &address, 0, 0); 67 67 if (peer == NULL) 68 COUT(1) << "Error: Could not send LAN discovery to IPv4 Broadcast." << std::endl;68 orxout(internal_error, context::network) << "Could not send LAN discovery to IPv4 Broadcast." << endl; 69 69 70 70 /* IPv6 */ … … 72 72 peer = enet_host_connect(this->host_, &address, 0, 0); 73 73 if (peer == NULL) 74 COUT(1) << "Error: Could not send LAN discovery to IPv6 Multicast." << std::endl;74 orxout(internal_error, context::network) << "Could not send LAN discovery to IPv6 Multicast." << endl; 75 75 76 76 ENetEvent event; … … 81 81 case ENET_EVENT_TYPE_CONNECT: 82 82 { 83 COUT(4) << "Received LAN discovery connect from server " << event.peer->host->receivedAddress << std::endl;83 orxout(verbose, context::network) << "Received LAN discovery connect from server " << event.peer->host->receivedAddress << endl; 84 84 ENetPacket* packet = enet_packet_create(LAN_DISCOVERY_MESSAGE, strlen(LAN_DISCOVERY_MESSAGE)+1, ENET_PACKET_FLAG_RELIABLE); 85 85 enet_peer_send(event.peer, 0, packet); … … 89 89 { 90 90 packet::ServerInformation info(&event); 91 COUT(3) << "Received LAN discovery server information; Name: " << info.getServerName() << ", Address: " << info.getServerIP() << ", RTT: " << info.getServerRTT() << endl;91 orxout(internal_info, context::network) << "Received LAN discovery server information; Name: " << info.getServerName() << ", Address: " << info.getServerIP() << ", RTT: " << info.getServerRTT() << endl; 92 92 std::vector<packet::ServerInformation>::iterator it; 93 93 for( it=this->servers_.begin(); it!=this->servers_.end(); ++it ) -
code/branches/output/src/libraries/network/MasterServer.cc
r8351 r8807 38 38 helper_output_debug( ENetEvent *event, char *addrconv ) 39 39 { 40 COUT(4) << "A packet of length" 40 orxout(verbose, context::master_server) 41 << "A packet of length" 41 42 << event->packet->dataLength 42 43 << " containing " … … 45 46 << addrconv 46 47 << " on channel " 47 << event->channelID << "\n";48 << event->channelID << endl; 48 49 } 49 50 … … 66 67 + MSPROTO_SERVERLIST_ITEM_LEN + 2,1 ); 67 68 if( !tosend ) 68 { COUT(2) << "Masterserver.cc: Memory allocation failed.\n";69 { orxout(internal_warning, context::master_server) << "Masterserver.cc: Memory allocation failed." << endl; 69 70 continue; 70 71 } … … 108 109 { /* check for bad parameters */ 109 110 if( !event ) 110 { COUT(2) << "MasterServer::eventConnect: No event given.\n";111 { orxout(internal_warning, context::master_server) << "MasterServer::eventConnect: No event given." << endl; 111 112 return -1; 112 113 } … … 117 118 118 119 /* output debug info */ 119 COUT(4) << "A new client connected from "120 orxout(verbose, context::master_server) << "A new client connected from " 120 121 << addrconv 121 122 << " on port " 122 << event->peer->address.port << "\n";123 << event->peer->address.port << endl; 123 124 124 125 /* store string form of address here */ … … 134 135 { /* check for bad parameters */ 135 136 if( !event ) 136 { COUT(2) << "No event given.\n";137 { orxout(internal_warning, context::master_server) << "No event given." << endl; 137 138 return -1; 138 139 } 139 140 140 141 /* output that the disconnect happened */ 141 COUT(4) << (char*)event->peer->data << " disconnected.\n";142 orxout(verbose, context::master_server) << (char*)event->peer->data << " disconnected." << endl; 142 143 143 144 /* create string from peer data */ … … 159 160 { /* validate packet */ 160 161 if( !event || !(event->packet) || !(event->peer) ) 161 { COUT(2) << "No complete event given.\n";162 { orxout(internal_warning, context::master_server) << "No complete event given." << endl; 162 163 return -1; 163 164 } … … 182 183 183 184 /* tell people we did so */ 184 COUT(2) << "Added new server to list: " <<185 packet::ServerInformation( event ).getServerIP() << "\n";185 orxout(internal_info, context::master_server) << "Added new server to list: " << 186 packet::ServerInformation( event ).getServerIP() << endl; 186 187 } 187 188 … … 197 198 198 199 /* tell the user */ 199 COUT(2) << "Removed server " << name << " from list.\n";200 orxout(internal_info, context::master_server) << "Removed server " << name << " from list." << endl; 200 201 } 201 202 … … 230 231 if( event == NULL ) 231 232 { 232 COUT(1) << "Could not create ENetEvent structure, exiting.\n";233 orxout(user_error, context::master_server) << "Could not create ENetEvent structure, exiting." << endl; 233 234 exit( EXIT_FAILURE ); 234 235 } … … 263 264 /***** INITIALIZE NETWORKING *****/ 264 265 if( enet_initialize () != 0) 265 { COUT(1) << "An error occurred while initializing ENet.\n";266 { orxout(user_error, context::master_server) << "An error occurred while initializing ENet." << endl; 266 267 exit( EXIT_FAILURE ); 267 268 } … … 285 286 /* see if creation worked */ 286 287 if( !this->server ) 287 { COUT(1) <<288 "An error occurred while trying to create an ENet server host. \n";288 { orxout(user_error, context::master_server) << 289 "An error occurred while trying to create an ENet server host." << endl; 289 290 exit( EXIT_FAILURE ); 290 291 } … … 294 295 295 296 /* tell people we're now initialized */ 296 COUT(0) << "MasterServer initialized, waiting for connections.\n";297 orxout(internal_status, context::master_server) << "MasterServer initialized, waiting for connections." << endl; 297 298 } 298 299 -
code/branches/output/src/libraries/network/MasterServerComm.cc
r8788 r8807 44 44 /* initialize Enet */ 45 45 if( enet_initialize () != 0 ) 46 { COUT(1) << "An error occurred while initializing ENet.\n";46 { orxout(internal_error, context::master_server) << "An error occurred while initializing ENet." << endl; 47 47 return 1; 48 48 } … … 61 61 /* see if it worked */ 62 62 if (this->client == NULL) 63 { COUT(1) << "An error occurred while trying to create an "64 << "ENet client host. \n";63 { orxout(internal_error, context::master_server) << "An error occurred while trying to create an " 64 << "ENet client host." << endl; 65 65 return 1; 66 66 } … … 85 85 86 86 if( this->peer == NULL ) 87 { COUT(2) << "ERROR:No available peers for initiating an ENet"88 << " connection. \n";87 { orxout(internal_error, context::master_server) << "No available peers for initiating an ENet" 88 << " connection." << endl; 89 89 return -1; 90 90 } … … 93 93 if (enet_host_service (this->client, &this->event, 500) > 0 && 94 94 this->event.type == ENET_EVENT_TYPE_CONNECT ) 95 COUT(3) << "Connection to master server succeeded.\n";95 orxout(internal_info, context::master_server) << "Connection to master server succeeded." << endl; 96 96 else 97 97 { 98 98 enet_peer_reset (this->peer); 99 COUT(2) << "ERROR: connection to " << address << " failed.\n";99 orxout(internal_warning, context::master_server) << "Connection to " << address << " failed." << endl; 100 100 return -1; 101 101 } … … 128 128 129 129 case ENET_EVENT_TYPE_DISCONNECT: 130 COUT(4) << "Disconnect from master server successful.\n";130 orxout(verbose, context::master_server) << "Disconnect from master server successful." << endl; 131 131 return 0; 132 132 default: break; … … 154 154 /* see whether anything happened */ 155 155 /* WORK MARK REMOVE THIS OUTPUT */ 156 COUT(2) << "polling masterserver...\n";156 orxout(verbose, context::master_server) << "polling masterserver..." << endl; 157 157 158 158 /* address buffer */ … … 176 176 addrconv = (char *) calloc( 50, 1 ); 177 177 if( !addrconv ) 178 { COUT(2) << "MasterServerComm.cc: Could not allocate memory!\n";178 { orxout(internal_warning, context::master_server) << "MasterServerComm.cc: Could not allocate memory!" << endl; 179 179 break; 180 180 } … … 185 185 186 186 /* DEBUG */ 187 COUT(3) << "MasterServer Debug: A packet of length "187 orxout(verbose, context::master_server) << "MasterServer Debug: A packet of length " 188 188 << this->event.packet->dataLength 189 189 << " containing " << this->event.packet->data -
code/branches/output/src/libraries/network/PeerList.cc
r8351 r8807 40 40 { /* error correction */ 41 41 if( toadd == NULL ) 42 { fprintf( stderr, "PeerList::addPeer: empty peer given.\n" );42 { orxout(internal_error, context::master_server) << "PeerList::addPeer: empty peer given." << endl; 43 43 return -1; 44 44 } -
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 -
code/branches/output/src/libraries/network/ServerConnection.cc
r8788 r8807 61 61 { 62 62 if (enet_address_set_host (this->bindAddress_, bindAddress.c_str()) < 0) 63 COUT(1) << "Error: Could not resolve \"" << bindAddress << "\"." << std::endl;63 orxout(internal_error, context::network) << "Could not resolve \"" << bindAddress << "\"." << endl; 64 64 } 65 65 … … 75 75 if ( this->host_ == NULL ) 76 76 { 77 COUT(1) << "ServerConnection: host_ == NULL" << std::endl;77 orxout(internal_error, context::network) << "ServerConnection: host_ == NULL" << endl; 78 78 return false; 79 79 } … … 83 83 assert( this->host_->socket4 != ENET_SOCKET_NULL || this->host_->socket6 != ENET_SOCKET_NULL ); 84 84 if (this->host_->socket4 == ENET_SOCKET_NULL) 85 COUT(2) << "Warning: IPv4 Socket failed." << std::endl;85 orxout(internal_warning, context::network) << "IPv4 Socket failed." << endl; 86 86 else if (this->host_->socket6 == ENET_SOCKET_NULL) 87 COUT(2) << "Warning: IPv6 Socket failed." << std::endl;87 orxout(internal_warning, context::network) << "IPv6 Socket failed." << endl; 88 88 else 89 COUT(3) << "Info: Using IPv4 and IPv6 Sockets." << std::endl;89 orxout(internal_info, context::network) << "Using IPv4 and IPv6 Sockets." << endl; 90 90 91 91 // start communication thread … … 114 114 // ClientInformation *temp = ClientInformation::findClient(clientID); 115 115 // if(!temp){ 116 // COUT(3) << "C.Man: addPacket findClient failed" << std::endl;116 // orxout(internal_warning, context::network) << "C.Man: addPacket findClient failed" << endl; 117 117 // } 118 118 Connection::addPacket(packet, clientID, channelID); -
code/branches/output/src/libraries/network/TrafficControl.cc
r6417 r8807 287 287 { 288 288 std::list<obj>::iterator it; 289 COUT(0) << "=========== Objectlist ===========" << endl;289 orxout(debug_output, context::network) << "=========== Objectlist ===========" << endl; 290 290 for( it=list.begin(); it!=list.end(); it++) 291 COUT(0) << "ObjectID: " << it->objID << " creatorID: " << it->objCreatorID << " Priority: " << clientListPerm_[clientID][it->objID].objValuePerm + clientListPerm_[clientID][it->objID].objValueSched << " size: " << it->objSize << endl;291 orxout(debug_output, context::network) << "ObjectID: " << it->objID << " creatorID: " << it->objCreatorID << " Priority: " << clientListPerm_[clientID][it->objID].objValuePerm + clientListPerm_[clientID][it->objID].objValueSched << " size: " << it->objSize << endl; 292 292 } 293 293 -
code/branches/output/src/libraries/network/WANDiscoverable.cc
r8351 r8807 44 44 { 45 45 /* debugging output */ 46 COUT(4) << "Creating WANDiscoverable.\n";46 orxout(verbose, context::master_server) << "Creating WANDiscoverable." << endl; 47 47 48 48 /* register object in orxonox */ … … 91 91 if( msc.initialize() ) 92 92 { 93 COUT(2) << "Error: could not initialize master server communications!\n";93 orxout(internal_error, context::master_server) << "Could not initialize master server communications!" << endl; 94 94 return false; 95 95 } … … 98 98 if( msc.connect( this->msaddress.c_str(), ORX_MSERVER_PORT ) ) 99 99 { 100 COUT(2) << "Error: could not connect to master server at "101 << this->msaddress << std::endl;100 orxout(internal_error, context::master_server) << "Could not connect to master server at " 101 << this->msaddress << endl; 102 102 return false; 103 103 } 104 104 105 105 /* debugging output */ 106 COUT(4) << "Initialization of WANDiscoverable complete.\n";106 orxout(verbose, context::master_server) << "Initialization of WANDiscoverable complete." << endl; 107 107 108 108 -
code/branches/output/src/libraries/network/WANDiscovery.cc
r8351 r8807 45 45 { 46 46 /* debugging output */ 47 COUT(4) << "Creating WANDiscovery.\n";47 orxout(verbose, context::master_server) << "Creating WANDiscovery." << endl; 48 48 49 49 /* register object in orxonox */ … … 55 55 /* initialize it and see if it worked */ 56 56 if( msc.initialize() ) 57 COUT(2) << "Error: could not initialize master server communications!\n";57 orxout(internal_error, context::master_server) << "Could not initialize master server communications!" << endl; 58 58 59 59 /* connect and see if it worked */ 60 60 if( msc.connect( this->msaddress.c_str(), ORX_MSERVER_PORT ) ) 61 COUT(2) << "Error: could not connect to master server at "62 << this->msaddress << std::endl;61 orxout(internal_error, context::master_server) << "Could not connect to master server at " 62 << this->msaddress << endl; 63 63 64 64 /* debugging output */ 65 COUT(4) << "Initialization of WANDiscovery complete.\n";65 orxout(verbose, context::master_server) << "Initialization of WANDiscovery complete." << endl; 66 66 } 67 67 … … 85 85 /* error recognition */ 86 86 if( !ev || !ev->packet || !ev->packet->data ) 87 { COUT(2) << "Bad arguments received in WANDiscovery's reply handler.\n";87 { orxout(internal_warning, context::master_server) << "Bad arguments received in WANDiscovery's reply handler." << endl; 88 88 return 0; 89 89 } -
code/branches/output/src/libraries/network/packet/Acknowledgement.cc
r8788 r8807 64 64 65 65 bool Acknowledgement::process(orxonox::Host* host){ 66 COUT(5) << "processing ACK with ID: " << getAckID() << endl;66 orxout(verbose_more, context::packets) << "processing ACK with ID: " << getAckID() << endl; 67 67 bool b = host->ackGamestate(getAckID(), peerID_); 68 68 delete this; -
code/branches/output/src/libraries/network/packet/ClassID.cc
r7801 r8807 92 92 assert(tempsize==packetSize); 93 93 94 COUT(5) << "classid packetSize is " << packetSize << endl;94 orxout(verbose_more, context::packets) << "classid packetSize is " << packetSize << endl; 95 95 96 96 } … … 131 131 Identifier::clearNetworkIDs(); 132 132 133 COUT(4) << "=== processing classids: " << endl;133 orxout(verbose, context::packets) << "=== processing classids: " << endl; 134 134 std::pair<uint32_t, std::string> tempPair; 135 135 Identifier *id; … … 143 143 classname = temp+2*sizeof(uint32_t); 144 144 id=ClassByString( std::string((const char*)classname) ); 145 COUT(3) << "processing classid: " << networkID << " name: " << classname << " id: " << id << std::endl;145 orxout(internal_info, context::packets) << "processing classid: " << networkID << " name: " << classname << " id: " << id << endl; 146 146 if(id==NULL){ 147 COUT(0) << "Received a bad classname" << endl;147 orxout(user_error, context::packets) << "Received a bad classname" << endl; 148 148 abort(); 149 149 } -
code/branches/output/src/libraries/network/packet/DeleteObjects.cc
r8788 r8807 62 62 if(number==0) 63 63 return false; 64 COUT(4) << "sending DeleteObjects: ";64 orxout(verbose, context::packets) << "sending DeleteObjects: "; 65 65 unsigned int size = sizeof(Type::Value) + sizeof(uint32_t)*(number+1); 66 66 data_ = new uint8_t[size]; … … 73 73 unsigned int temp = Synchronisable::popDeletedObject(); 74 74 *reinterpret_cast<uint32_t*>(tdata) = temp; 75 COUT(4) << temp << ' ';75 orxout(verbose, context::packets) << temp << ' '; 76 76 tdata += sizeof(uint32_t); 77 77 } 78 COUT(4) << std::endl;78 orxout(verbose, context::packets) << endl; 79 79 return true; 80 80 } … … 90 90 for(unsigned int i=0; i<*(unsigned int *)(data_+_QUANTITY); i++) 91 91 { 92 COUT(4) << "deleting object with id: " << *(uint32_t*)(data_+_OBJECTIDS+i*sizeof(uint32_t)) << std::endl;92 orxout(verbose, context::packets) << "deleting object with id: " << *(uint32_t*)(data_+_OBJECTIDS+i*sizeof(uint32_t)) << endl; 93 93 Synchronisable::deleteObject( *(uint32_t*)(data_+_OBJECTIDS+i*sizeof(uint32_t)) ); 94 94 } -
code/branches/output/src/libraries/network/packet/FunctionIDs.cc
r8788 r8807 88 88 } 89 89 90 COUT(5) << "FunctionIDs packetSize is " << packetSize << endl;90 orxout(verbose_more, context::packets) << "FunctionIDs packetSize is " << packetSize << endl; 91 91 92 92 } … … 126 126 unsigned char *functionname; 127 127 128 COUT(4) << "=== processing functionids: " << endl;128 orxout(verbose, context::packets) << "=== processing functionids: " << endl; 129 129 std::pair<uint32_t, std::string> tempPair; 130 130 // read the total number of classes … … 137 137 stringsize = *(uint32_t*)(temp+sizeof(uint32_t)); 138 138 functionname = temp+2*sizeof(uint32_t); 139 COUT(3) << "processing functionid: " << networkID << " name: " << functionname << std::endl;139 orxout(internal_info, context::packets) << "processing functionid: " << networkID << " name: " << functionname << endl; 140 140 NetworkFunctionBase::setNetworkID((const char*)functionname, networkID); 141 141 temp += 2*sizeof(uint32_t) + stringsize; -
code/branches/output/src/libraries/network/packet/Gamestate.cc
r8788 r8807 108 108 uint32_t size = calcGamestateSize(id, mode); 109 109 110 COUT(5) << "G.ST.Man: producing gamestate with id: " << id << std::endl;110 orxout(verbose_more, context::packets) << "G.ST.Man: producing gamestate with id: " << id << endl; 111 111 if(size==0) 112 112 return false; … … 114 114 if(!data_) 115 115 { 116 COUT(2) << "GameStateManager: could not allocate memory" << std::endl;116 orxout(internal_warning, context::packets) << "GameStateManager: could not allocate memory" << endl; 117 117 return false; 118 118 } … … 139 139 assert(0); // if we don't use multithreading this part shouldn't be neccessary 140 140 // start allocate additional memory 141 COUT(3) << "Gamestate: need additional memory" << std::endl;141 orxout(internal_info, context::packets) << "Gamestate: need additional memory" << endl; 142 142 ObjectList<Synchronisable>::iterator temp = it; 143 143 uint32_t addsize=tempsize; … … 167 167 //stop write gamestate header 168 168 169 COUT(5) << "Gamestate: Gamestate size: " << currentsize << std::endl;170 COUT(5) << "Gamestate: 'estimated' (and corrected) Gamestate size: " << size << std::endl;169 orxout(verbose_more, context::packets) << "Gamestate: Gamestate size: " << currentsize << endl; 170 orxout(verbose_more, context::packets) << "Gamestate: 'estimated' (and corrected) Gamestate size: " << size << endl; 171 171 return true; 172 172 } … … 175 175 bool Gamestate::spreadData(uint8_t mode) 176 176 { 177 COUT(5) << "processing gamestate with id " << header_.getID() << endl;177 orxout(verbose_more, context::packets) << "processing gamestate with id " << header_.getID() << endl; 178 178 assert(data_); 179 179 assert(!header_.isCompressed()); … … 195 195 else 196 196 { 197 // COUT(4) << "not creating object of classid " << objectheader.getClassID() << endl;197 // orxout(verbose, context::packets) << "not creating object of classid " << objectheader.getClassID() << endl; 198 198 mem += objectheader.getDataSize() + ( objectheader.isDiffed() ? SynchronisableHeaderLight::getSize() : SynchronisableHeader::getSize() ); 199 199 } … … 201 201 else 202 202 { 203 // COUT(4) << "updating object of classid " << objectheader.getClassID() << endl;203 // orxout(verbose, context::packets) << "updating object of classid " << objectheader.getClassID() << endl; 204 204 OrxVerify(s->updateData(mem, mode), "ERROR: could not update Synchronisable with Gamestate data"); 205 205 } … … 219 219 if (it->objectMode_ != 0x0) 220 220 { 221 COUT(0) << "Found object with OBJECTID_UNKNOWN on the client with objectMode != 0x0!" << std::endl;222 COUT(0) << "Possible reason for this error: Client created a synchronized object without the Server's approval." << std::endl;223 COUT(0) << "Objects class: " << it->getIdentifier()->getName() << std::endl;221 orxout(user_error, context::packets) << "Found object with OBJECTID_UNKNOWN on the client with objectMode != 0x0!" << endl; 222 orxout(user_error, context::packets) << "Possible reason for this error: Client created a synchronized object without the Server's approval." << endl; 223 orxout(user_error, context::packets) << "Objects class: " << it->getIdentifier()->getName() << endl; 224 224 assert(false); 225 225 } … … 232 232 if (it->getObjectID() == *it2) 233 233 { 234 COUT(0) << "Found duplicate objectIDs on the client!" << std::endl235 << "Are you sure you don't create a Sychnronisable objcect with 'new' \236 that doesn't have objectMode = 0x0?" << std::endl;234 orxout(user_error, context::packets) << "Found duplicate objectIDs on the client!" << endl 235 << "Are you sure you don't create a Sychnronisable objcect with 'new' \ 236 that doesn't have objectMode = 0x0?" << endl; 237 237 assert(false); 238 238 } … … 293 293 switch ( retval ) 294 294 { 295 case Z_OK: COUT(5) << "G.St.Man: compress: successfully compressed" << std::endl; break;296 case Z_MEM_ERROR: COUT(1) << "G.St.Man: compress: not enough memory available in gamestate.compress" << std::endl; return false;297 case Z_BUF_ERROR: COUT(2) << "G.St.Man: compress: not enough memory available in the buffer in gamestate.compress" << std::endl; return false;298 case Z_DATA_ERROR: COUT(2) << "G.St.Man: compress: data corrupted in gamestate.compress" << std::endl; return false;295 case Z_OK: orxout(verbose_more, context::packets) << "G.St.Man: compress: successfully compressed" << endl; break; 296 case Z_MEM_ERROR: orxout(internal_error, context::packets) << "G.St.Man: compress: not enough memory available in gamestate.compress" << endl; return false; 297 case Z_BUF_ERROR: orxout(internal_warning, context::packets) << "G.St.Man: compress: not enough memory available in the buffer in gamestate.compress" << endl; return false; 298 case Z_DATA_ERROR: orxout(internal_warning, context::packets) << "G.St.Man: compress: data corrupted in gamestate.compress" << endl; return false; 299 299 } 300 300 … … 310 310 header_.setCompSize( buffer ); 311 311 header_.setCompressed( true ); 312 COUT(4) << "gamestate compress datasize: " << header_.getDataSize() << " compsize: " << header_.getCompSize() << std::endl;312 orxout(verbose, context::packets) << "gamestate compress datasize: " << header_.getDataSize() << " compsize: " << header_.getCompSize() << endl; 313 313 return true; 314 314 } … … 319 319 assert(data_); 320 320 assert(header_.isCompressed()); 321 COUT(4) << "GameStateClient: uncompressing gamestate. id: " << header_.getID() << ", baseid: " << header_.getBaseID() << ", datasize: " << header_.getDataSize() << ", compsize: " << header_.getCompSize() << std::endl;321 orxout(verbose, context::packets) << "GameStateClient: uncompressing gamestate. id: " << header_.getID() << ", baseid: " << header_.getBaseID() << ", datasize: " << header_.getDataSize() << ", compsize: " << header_.getCompSize() << endl; 322 322 uint32_t datasize = header_.getDataSize(); 323 323 uint32_t compsize = header_.getCompSize(); … … 333 333 switch ( retval ) 334 334 { 335 case Z_OK: COUT(5) << "successfully decompressed" << std::endl; break;336 case Z_MEM_ERROR: COUT(1) << "not enough memory available" << std::endl; return false;337 case Z_BUF_ERROR: COUT(2) << "not enough memory available in the buffer" << std::endl; return false;338 case Z_DATA_ERROR: COUT(2) << "data corrupted (zlib)" << std::endl; return false;335 case Z_OK: orxout(verbose_more, context::packets) << "successfully decompressed" << endl; break; 336 case Z_MEM_ERROR: orxout(internal_error, context::packets) << "not enough memory available" << endl; return false; 337 case Z_BUF_ERROR: orxout(internal_warning, context::packets) << "not enough memory available in the buffer" << endl; return false; 338 case Z_DATA_ERROR: orxout(internal_warning, context::packets) << "data corrupted (zlib)" << endl; return false; 339 339 } 340 340 … … 375 375 if( memcmp( origDataPtr+objectOffset, baseDataPtr+objectOffset, objectHeader.getDataSize()) == 0 ) 376 376 { 377 // COUT(4) << "skip object " << Synchronisable::getSynchronisable(objectHeader.getObjectID())->getIdentifier()->getName() << endl;377 // orxout(verbose, context::packets) << "skip object " << Synchronisable::getSynchronisable(objectHeader.getObjectID())->getIdentifier()->getName() << endl; 378 378 origDataPtr += objectOffset + objectHeader.getDataSize(); // skip the whole object 379 379 baseDataPtr += objectOffset + objectHeader.getDataSize(); … … 431 431 inline void /*Gamestate::*/copyObject( uint8_t*& newData, uint8_t*& origData, uint8_t*& baseData, SynchronisableHeader& objectHeader, std::vector<uint32_t>::iterator& sizes ) 432 432 { 433 // COUT(4) << "docopy" << endl;433 // orxout(verbose, context::packets) << "docopy" << endl; 434 434 // Just copy over the whole Object 435 435 memcpy( newData, origData, objectHeader.getDataSize()+SynchronisableHeader::getSize() ); … … 440 440 // SynchronisableHeader baseHeader( baseData ); 441 441 // baseData += baseHeader.getDataSize()+SynchronisableHeader::getSize(); 442 // COUT(4) << "copy " << h.getObjectID() << endl;443 // COUT(4) << "copy " << h.getObjectID() << ":";442 // orxout(verbose, context::packets) << "copy " << h.getObjectID() << endl; 443 // orxout(verbose, context::packets) << "copy " << h.getObjectID() << ":"; 444 444 sizes += Synchronisable::getSynchronisable(objectHeader.getObjectID())->getNrOfVariables(); 445 445 // for( unsigned int i = 0; i < Synchronisable::getSynchronisable(objectHeader.getObjectID())->getNrOfVariables(); ++i ) 446 446 // { 447 // // COUT(4) << " " << *sizes;447 // // orxout(verbose, context::packets) << " " << *sizes; 448 448 // ++sizes; 449 449 // } 450 // COUT(4) << endl;450 // orxout(verbose, context::packets) << endl; 451 451 } 452 452 … … 541 541 if( SynchronisableHeader(baseDataPtr).getDataSize()==origHeader.getDataSize() ) 542 542 { 543 // COUT(4) << "diffing object in order: " << Synchronisable::getSynchronisable(origHeader.getObjectID())->getIdentifier()->getName() << endl;543 // orxout(verbose, context::packets) << "diffing object in order: " << Synchronisable::getSynchronisable(origHeader.getObjectID())->getIdentifier()->getName() << endl; 544 544 diffObject(destDataPtr, origDataPtr, baseDataPtr, origHeader, sizesIt); 545 545 diffedObject = true; … … 547 547 else 548 548 { 549 // COUT(4) << "copy object because of different data sizes (1): " << Synchronisable::getSynchronisable(origHeader.getObjectID())->getIdentifier()->getName() << endl;549 // orxout(verbose, context::packets) << "copy object because of different data sizes (1): " << Synchronisable::getSynchronisable(origHeader.getObjectID())->getIdentifier()->getName() << endl; 550 550 copyObject(destDataPtr, origDataPtr, baseDataPtr, origHeader, sizesIt); 551 551 assert(sizesIt != this->sizes_.end() || origDataPtr==origDataEnd); … … 565 565 if( SynchronisableHeader(baseDataPtr).getDataSize()==origHeader.getDataSize() ) 566 566 { 567 // COUT(4) << "diffing object out of order: " << Synchronisable::getSynchronisable(origHeader.getObjectID())->getIdentifier()->getName() << endl;567 // orxout(verbose, context::packets) << "diffing object out of order: " << Synchronisable::getSynchronisable(origHeader.getObjectID())->getIdentifier()->getName() << endl; 568 568 diffObject(destDataPtr, origDataPtr, baseDataPtr, origHeader, sizesIt); 569 569 diffedObject = true; … … 571 571 else 572 572 { 573 // COUT(4) << "copy object because of different data sizes (2): " << Synchronisable::getSynchronisable(origHeader.getObjectID())->getIdentifier()->getName() << endl;573 // orxout(verbose, context::packets) << "copy object because of different data sizes (2): " << Synchronisable::getSynchronisable(origHeader.getObjectID())->getIdentifier()->getName() << endl; 574 574 copyObject(destDataPtr, origDataPtr, baseDataPtr, origHeader, sizesIt); 575 575 assert(sizesIt != this->sizes_.end() || origDataPtr==origDataEnd); … … 578 578 else 579 579 { 580 // COUT(4) << "copy object: " << Synchronisable::getSynchronisable(origHeader.getObjectID())->getIdentifier()->getName() << endl;580 // orxout(verbose, context::packets) << "copy object: " << Synchronisable::getSynchronisable(origHeader.getObjectID())->getIdentifier()->getName() << endl; 581 581 assert(baseDataPtr == oldBaseDataPtr); 582 582 copyObject(destDataPtr, origDataPtr, baseDataPtr, origHeader, sizesIt); … … 718 718 //copy in the zeros 719 719 // std::list<obj>::iterator itt; 720 // COUT(0) << "myvector contains:";720 // orxout() << "myvector contains:"; 721 721 // for ( itt=dataVector_.begin() ; itt!=dataVector_.end(); itt++ ) 722 // COUT(0) << " " << (*itt).objID;723 // COUT(0) << endl;722 // orxout() << " " << (*itt).objID; 723 // orxout() << endl; 724 724 for(it=dataVector_.begin(); it!=dataVector_.end();){ 725 725 SynchronisableHeader oldobjectheader(origdata); … … 771 771 nrOfVariables += it->getNrOfVariables(); 772 772 } 773 // COUT(0) << "allocating " << nrOfVariables << " ints" << endl;773 // orxout() << "allocating " << nrOfVariables << " ints" << endl; 774 774 this->sizes_.reserve(nrOfVariables); 775 775 return size; -
code/branches/output/src/libraries/network/packet/Packet.cc
r8788 r8807 192 192 // peerID = NETWORK_PEER_ID_SERVER; 193 193 Packet *p = 0; 194 // COUT(6) << "packet type: " << *(Type::Value *)&data[_PACKETID] << std::endl;194 // orxout(verbose_ultra, context::packets) << "packet type: " << *(Type::Value *)&data[_PACKETID] << endl; 195 195 switch( *(Type::Value *)(data + _PACKETID) ) 196 196 { 197 197 case Type::Acknowledgement: 198 // COUT(5) << "ack" << std::endl;198 // orxout(verbose_more, context::packets) << "ack" << endl; 199 199 p = new Acknowledgement( data, peerID ); 200 200 break; 201 201 case Type::Chat: 202 // COUT(5) << "chat" << std::endl;202 // orxout(verbose_more, context::packets) << "chat" << endl; 203 203 p = new Chat( data, peerID ); 204 204 break; 205 205 case Type::ClassID: 206 // COUT(5) << "classid" << std::endl;206 // orxout(verbose_more, context::packets) << "classid" << endl; 207 207 p = new ClassID( data, peerID ); 208 208 break; 209 209 case Type::Gamestate: 210 // COUT(5) << "gamestate" << std::endl;210 // orxout(verbose_more, context::packets) << "gamestate" << endl; 211 211 p = new Gamestate( data, peerID ); 212 212 break; 213 213 case Type::Welcome: 214 // COUT(5) << "welcome" << std::endl;214 // orxout(verbose_more, context::packets) << "welcome" << endl; 215 215 p = new Welcome( data, peerID ); 216 216 break; 217 217 case Type::DeleteObjects: 218 // COUT(5) << "deleteobjects" << std::endl;218 // orxout(verbose_more, context::packets) << "deleteobjects" << endl; 219 219 p = new DeleteObjects( data, peerID ); 220 220 break; 221 221 case Type::FunctionCalls: 222 // COUT(5) << "functionCalls" << std::endl;222 // orxout(verbose_more, context::packets) << "functionCalls" << endl; 223 223 p = new FunctionCalls( data, peerID ); 224 224 break; 225 225 case Type::FunctionIDs: 226 // COUT(5) << "functionIDs" << std::endl;226 // orxout(verbose_more, context::packets) << "functionIDs" << endl; 227 227 p = new FunctionIDs( data, peerID ); 228 228 break; … … 255 255 packetMap_.erase(it); 256 256 Packet::packetMapMutex_.unlock(); 257 // COUT(6) << "PacketMap size: " << packetMap_.size() << std::endl;257 // orxout(verbose_ultra, context::packets) << "PacketMap size: " << packetMap_.size() << endl; 258 258 } 259 259 -
code/branches/output/src/libraries/network/packet/Welcome.cc
r8788 r8807 78 78 assert(*(uint32_t *)(data_ + _ENDIANTEST ) == 0xFEDC4321); 79 79 host->setClientID(clientID); 80 COUT(3) << "Welcome set clientId: " << clientID << endl;80 orxout(internal_info, context::packets) << "Welcome set clientId: " << clientID << endl; 81 81 Synchronisable::setClient(true); 82 82 delete this; -
code/branches/output/src/libraries/network/synchronisable/Synchronisable.cc
r8706 r8807 130 130 // assert( !header.isDiffed() ); 131 131 132 COUT(4) << "fabricating object with id: " << header.getObjectID() << std::endl;132 orxout(verbose, context::network) << "fabricating object with id: " << header.getObjectID() << endl; 133 133 134 134 Identifier* id = ClassByID(header.getClassID()); … … 136 136 { 137 137 for(int i = 0; i<160; i++) 138 COUT(0) << "classid: " << i << " identifier: " << ClassByID(i) << endl;139 COUT(0) << "Assertion failed: id" << std::endl;140 COUT(0) << "Possible reason for this error: Client received a synchronizable object whose class has no factory." << std::endl;138 orxout(user_error, context::network) << "classid: " << i << " identifier: " << ClassByID(i) << endl; 139 orxout(user_error, context::network) << "Assertion failed: id" << endl; 140 orxout(user_error, context::network) << "Possible reason for this error: Client received a synchronizable object whose class has no factory." << endl; 141 141 abort(); 142 142 } … … 168 168 bo->setLevel(creator->getLevel()); // Note: this ensures that the level is known on the client for child objects of the scene (and the scene itself) 169 169 //assert(no->classID_ == header.getClassID()); 170 COUT(4) << "fabricate objectID_: " << no->objectID_ << " classID_: " << no->classID_ << std::endl;170 orxout(verbose, context::network) << "fabricate objectID_: " << no->objectID_ << " classID_: " << no->classID_ << endl; 171 171 // update data and create object/entity... 172 172 bool b = no->updateData(mem, mode, true); … … 242 242 uint8_t* oldmem = mem; 243 243 if (this->classID_==0) 244 COUT(3) << "classid 0 " << this->getIdentifier()->getName() << std::endl;244 orxout(internal_info, context::network) << "classid 0 " << this->getIdentifier()->getName() << endl; 245 245 #endif 246 246 … … 258 258 // end copy header 259 259 260 CCOUT(5) << "getting data from objectID_: " << objectID_ << ", classID_: " << classID_ << std::endl;261 // COUT(4) << "objectid: " << this->objectID_ << ":";260 orxout(verbose_more, context::network) << "getting data from objectID_: " << objectID_ << ", classID_: " << classID_ << endl; 261 // orxout(verbose, context::network) << "objectid: " << this->objectID_ << ":"; 262 262 // copy to location 263 263 for(i=syncList_.begin(); i!=syncList_.end(); ++i) 264 264 { 265 265 uint32_t varsize = (*i)->getData( mem, mode ); 266 // COUT(4) << " " << varsize;266 // orxout(verbose, context::network) << " " << varsize; 267 267 tempsize += varsize; 268 268 sizes.push_back(varsize); … … 271 271 } 272 272 assert(tempsize!=0); // if this happens an empty object (with no variables) would be transmitted 273 // COUT(4) << endl;273 // orxout(verbose, context::network) << endl; 274 274 275 275 header.setObjectID( this->objectID_ ); … … 305 305 if(syncList_.empty()) 306 306 { 307 orxout(internal_warning, context::network) << "Synchronisable::updateData syncList_ is empty" << endl; 307 308 assert(0); 308 COUT(2) << "Synchronisable::updateData syncList_ is empty" << std::endl;309 309 return false; 310 310 } … … 326 326 } 327 327 328 // COUT(5) << "Synchronisable: objectID_ " << syncHeader.getObjectID() << ", classID_ " << syncHeader.getClassID() << " size: " << syncHeader.getDataSize() << " synchronising data" << std::endl;328 //orxout(verbose_more, context::network) << "Synchronisable: objectID_ " << syncHeader.getObjectID() << ", classID_ " << syncHeader.getClassID() << " size: " << syncHeader.getDataSize() << " synchronising data" << endl; 329 329 if( !syncHeaderLight.isDiffed() ) 330 330 { … … 344 344 { 345 345 mem += SynchronisableHeaderLight::getSize(); 346 // COUT(0) << "objectID: " << this->objectID_ << endl;346 // orxout(debug_output, context::network) << "objectID: " << this->objectID_ << endl; 347 347 while( mem < data+syncHeaderLight.getDataSize()+SynchronisableHeaderLight::getSize() ) 348 348 { 349 349 VariableID varID = *(VariableID*)mem; 350 // COUT(0) << "varID: " << varID << endl;350 // orxout(debug_output, context::network) << "varID: " << varID << endl; 351 351 assert( varID < syncList_.size() ); 352 352 mem += sizeof(VariableID); -
code/branches/output/src/libraries/network/synchronisable/Synchronisable.h
r8706 r8807 232 232 it++; 233 233 } 234 COUT(1) << "Tried to unregister not registered variable" << endl;234 orxout(internal_error, context::network) << "Tried to unregister not registered variable" << endl; 235 235 assert(false); //if we reach this point something went wrong: 236 236 // the variable has not been registered before -
code/branches/output/src/libraries/network/synchronisable/SynchronisableVariable.h
r7266 r8807 202 202 if ( *static_cast<uint8_t*>(mem) != this->varReference_ ) 203 203 { // wrong reference number, so discard the data 204 // COUT(0) << "discharding data" << endl;204 // orxout(debug_output, context::network) << "discharding data" << endl; 205 205 mem += getSize( mode ); // SynchronisableVariableBidirectional::getSize returns size of variable + reference 206 206 return; -
code/branches/output/src/libraries/util/output/OutputDefinitions.h
r8806 r8807 91 91 REGISTER_OUTPUT_CONTEXT(loader); 92 92 REGISTER_OUTPUT_CONTEXT(xml); 93 REGISTER_OUTPUT_CONTEXT(network); 94 REGISTER_OUTPUT_CONTEXT(packets); 95 REGISTER_OUTPUT_CONTEXT(master_server); 93 96 } 94 97 }
Note: See TracChangeset
for help on using the changeset viewer.