[7271] Implement mangosd stop and pause if it work as Windows service.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
rilex 2009-02-12 15:11:38 +03:00 committed by VladimirMangos
parent 671a942d14
commit d952b7ebcf
2 changed files with 11 additions and 1 deletions

View file

@ -37,6 +37,11 @@
#define WORLD_SLEEP_CONST 100 //Is this still needed?? [On linux some time ago not working 50ms] #define WORLD_SLEEP_CONST 100 //Is this still needed?? [On linux some time ago not working 50ms]
#endif #endif
#ifdef WIN32
#include "ServiceWin32.h"
extern int m_ServiceStatus;
#endif
/// Heartbeat for the World /// Heartbeat for the World
void WorldRunnable::run() void WorldRunnable::run()
{ {
@ -71,6 +76,11 @@ void WorldRunnable::run()
} }
else else
prevSleepTime = 0; 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 sWorld.KickAll(); // save and kick all players

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "7270" #define REVISION_NR "7271"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__