diff options
author | megamage <none@none> | 2009-02-13 20:02:00 -0600 |
---|---|---|
committer | megamage <none@none> | 2009-02-13 20:02:00 -0600 |
commit | 3eb91683b07e34c9591817d0fbbaed7799dea328 (patch) | |
tree | 20602afc2da7cc4f602adbab500f702c467075bc /src | |
parent | a14ceffcd16080c0676fa8edfdeb066483eb138e (diff) |
[7271] Implement mangosd stop and pause if it work as Windows service. Author: rilex
--HG--
branch : trunk
Diffstat (limited to 'src')
-rw-r--r-- | src/mangosd/WorldRunnable.cpp | 10 | ||||
-rw-r--r-- | src/shared/revision_nr.h | 2 |
2 files changed, 11 insertions, 1 deletions
diff --git a/src/mangosd/WorldRunnable.cpp b/src/mangosd/WorldRunnable.cpp index 0229f7f0f5c..0fb24577e32 100644 --- a/src/mangosd/WorldRunnable.cpp +++ b/src/mangosd/WorldRunnable.cpp @@ -39,6 +39,11 @@ #define WORLD_SLEEP_CONST 100 //Is this still needed?? [On linux some time ago not working 50ms] #endif +#ifdef WIN32 +#include "ServiceWin32.h" +extern int m_ServiceStatus; +#endif + /// Heartbeat for the World void WorldRunnable::run() { @@ -73,6 +78,11 @@ void WorldRunnable::run() } else prevSleepTime = 0; + + #ifdef WIN32 + if (m_ServiceStatus == 0) World::StopNow(SHUTDOWN_EXIT_CODE); + while (m_ServiceStatus == 2) Sleep(1000); + #endif } sWorld.KickAll(); // save and kick all players diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 8e527cfed75..2d4ab514c72 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "7270" + #define REVISION_NR "7271" #endif // __REVISION_NR_H__ |