Changeset 279 for trunk/src/trinitycore/Master.cpp
- Timestamp:
- 11/22/08 00:36:22 (17 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/trinitycore/Master.cpp
r272 r279 78 78 m_lastchange = 0; 79 79 w_lastchange = 0; 80 while(!World:: m_stopEvent)80 while(!World::IsStopped()) 81 81 { 82 82 ZThread::Thread::sleep(1000); … … 173 173 // if use ra spend time waiting for io, if not use ra ,just sleep 174 174 if (usera) 175 while (!World:: m_stopEvent)175 while (!World::IsStopped()) 176 176 { 177 177 h.Select (0, socketSelecttime); … … 179 179 } 180 180 else 181 while (!World:: m_stopEvent)181 while (!World::IsStopped()) 182 182 { 183 183 ZThread::Thread::sleep (static_cast<unsigned long> (socketSelecttime / 1000)); … … 324 324 { 325 325 sLog.outError ("Failed to start network"); 326 World:: m_stopEvent = true;326 World::StopNow(ERROR_EXIT_CODE); 327 327 // go down and shutdown the server 328 328 } … … 395 395 UnloadScriptingModule(); 396 396 397 return sWorld.GetShutdownMask() & SHUTDOWN_MASK_RESTART ? 2 : 0; 397 // Exit the process with specified return value 398 return World::GetExitCode(); 398 399 } 399 400 … … 478 479 479 480 /// Handle termination signals 480 /** Put the World::m_stopEvent to 'true' if a termination signal is caught **/481 481 void Master::_OnSignal(int s) 482 482 { … … 484 484 { 485 485 case SIGINT: 486 World::StopNow(RESTART_EXIT_CODE); 487 break; 486 488 case SIGTERM: 487 489 #ifdef _WIN32 488 490 case SIGBREAK: 489 491 #endif 490 World:: m_stopEvent = true;492 World::StopNow(SHUTDOWN_EXIT_CODE); 491 493 break; 492 494 }