- Timestamp:
- Jul 31, 2011, 9:09:23 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note: See TracChangeset
for help on using the changeset viewer.