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

--HG--
branch : trunk
This commit is contained in:
megamage
2009-02-13 20:02:00 -06:00
parent a14ceffcd1
commit 3eb91683b0
2 changed files with 11 additions and 1 deletions

View File

@@ -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

View File

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