Changeset 272 for trunk/src/trinitycore

Show
Ignore:
Timestamp:
11/22/08 00:35:41 (17 years ago)
Author:
yumileroy
Message:

Delete possessed AI only on creature delete.

Original author: gvcoman
Date: 2008-11-16 14:38:02-05:00

Location:
trunk/src/trinitycore
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/trinitycore/CliRunnable.cpp

    r260 r272  
    170170{ 
    171171    SendSysMessage(LANG_COMMAND_EXIT); 
    172     World::StopNow(SHUTDOWN_EXIT_CODE); 
     172    World::m_stopEvent = true; 
    173173    return true; 
    174174} 
     
    311311 
    312312    ///- As long as the World is running (no World::m_stopEvent), get the command line and handle it 
    313     while (!World::IsStopped()) 
     313    while (!World::m_stopEvent) 
    314314    { 
    315315        fflush(stdout); 
    316316        #ifdef linux 
    317         while (!kb_hit_return() && !World::IsStopped()) 
     317        while (!kb_hit_return() && !World::m_stopEvent) 
    318318            // With this, we limit CLI to 10commands/second 
    319319            usleep(100); 
    320         if (World::IsStopped()) 
     320        if (World::m_stopEvent) 
    321321            break; 
    322322        #endif 
     
    349349        else if (feof(stdin)) 
    350350        { 
    351             World::StopNow(SHUTDOWN_EXIT_CODE); 
     351            World::m_stopEvent = true; 
    352352        } 
    353353    } 
  • trunk/src/trinitycore/Master.cpp

    r260 r272  
    7878        m_lastchange = 0; 
    7979        w_lastchange = 0; 
    80         while(!World::IsStopped()) 
     80        while(!World::m_stopEvent) 
    8181        { 
    8282            ZThread::Thread::sleep(1000); 
     
    173173    // if use ra spend time waiting for io, if not use ra ,just sleep 
    174174    if (usera) 
    175       while (!World::IsStopped()) 
     175      while (!World::m_stopEvent) 
    176176        { 
    177177          h.Select (0, socketSelecttime); 
     
    179179        } 
    180180    else 
    181       while (!World::IsStopped()) 
     181      while (!World::m_stopEvent) 
    182182        { 
    183183          ZThread::Thread::sleep (static_cast<unsigned long> (socketSelecttime / 1000)); 
     
    324324    { 
    325325      sLog.outError ("Failed to start network"); 
    326       World::StopNow(ERROR_EXIT_CODE); 
     326      World::m_stopEvent = true; 
    327327      // go down and shutdown the server 
    328328    } 
     
    395395    UnloadScriptingModule(); 
    396396 
    397     // Exit the process with specified return value 
    398     return World::GetExitCode(); 
     397    return sWorld.GetShutdownMask() & SHUTDOWN_MASK_RESTART ? 2 : 0; 
    399398} 
    400399 
     
    479478 
    480479/// Handle termination signals 
     480/** Put the World::m_stopEvent to 'true' if a termination signal is caught **/ 
    481481void Master::_OnSignal(int s) 
    482482{ 
     
    484484    { 
    485485        case SIGINT: 
    486             World::StopNow(RESTART_EXIT_CODE); 
    487             break; 
    488486        case SIGTERM: 
    489487        #ifdef _WIN32 
    490488        case SIGBREAK: 
    491489        #endif 
    492             World::StopNow(SHUTDOWN_EXIT_CODE); 
     490            World::m_stopEvent = true; 
    493491            break; 
    494492    } 
  • trunk/src/trinitycore/WorldRunnable.cpp

    r260 r272  
    5252 
    5353    ///- While we have not World::m_stopEvent, update the world 
    54     while (!World::IsStopped()) 
     54    while (!World::m_stopEvent) 
    5555    { 
    5656        ++World::m_worldLoopCounter;