- Timestamp:
- Dec 8, 2010, 2:33:54 PM (15 years ago)
- File:
-
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
code/branches/masterserver/src/libraries/network/MasterServer.cc
r7728 r7729 34 34 namespace orxonox 35 35 { 36 /* singleton stuff */37 //ManageScopedSingleton( MasterServer, ScopeID::Root, false );38 39 36 /* helpers */ 40 37 static void … … 225 222 /* tell people we're now initialized and blocking. */ 226 223 COUT(0) << "MasterServer initialized, waiting for connections.\n"; 227 228 /* create an iterator for the loop */ 229 while( enet_host_service( this->server, event, 1000 ) >= 0 ) 230 { /* check what type of event it is and react accordingly */ 231 switch (event->type) 232 { /* new connection */ 233 case ENET_EVENT_TYPE_CONNECT: 234 eventConnect( event ); break; 235 236 /* disconnect */ 237 case ENET_EVENT_TYPE_DISCONNECT: 238 eventDisconnect( event ); break; 239 240 /* incoming data */ 241 case ENET_EVENT_TYPE_RECEIVE: eventData( event ); break; 242 default: break; 224 225 /* endless loop until we quit */ 226 while( this->quit == false ) 227 { 228 /* create an iterator for the loop */ 229 while( enet_host_service( this->server, event, 1000 ) >= 0 ) 230 { /* check what type of event it is and react accordingly */ 231 switch (event->type) 232 { /* new connection */ 233 case ENET_EVENT_TYPE_CONNECT: 234 eventConnect( event ); break; 235 236 /* disconnect */ 237 case ENET_EVENT_TYPE_DISCONNECT: 238 eventDisconnect( event ); break; 239 240 /* incoming data */ 241 case ENET_EVENT_TYPE_RECEIVE: eventData( event ); break; 242 default: break; 243 } 243 244 } 244 245 } 245 246 /* free the event */247 if( event ) free( event );248 246 249 247 /* done */ … … 262 260 /* register deinitialization */ 263 261 atexit( enet_deinitialize ); 262 263 /* set the quit flag to false */ 264 this->quit = false; 264 265 265 266 /* Bind the server to the default localhost and port ORX_MSERVER_PORT */ … … 282 283 //this->mainlist = new ServerList(); 283 284 this->peers = new PeerList(); 284 //if( this->mainlist == NULL || this->peers == NULL )285 //{ COUT(1) << "Error creating server or peer list.\n";286 //exit( EXIT_FAILURE );287 //}288 289 /* run the main method */290 run();291 285 } 292 286
Note: See TracChangeset
for help on using the changeset viewer.