mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
[7271] Implement mangosd stop and pause if it work as Windows service.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
parent
671a942d14
commit
d952b7ebcf
2 changed files with 11 additions and 1 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue