Skip to content

Commit

Permalink
[7271] Implement mangosd stop and pause if it work as Windows service.
Browse files Browse the repository at this point in the history
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
  • Loading branch information
rilex authored and VladimirMangos committed Feb 12, 2009
1 parent 2305a97 commit 5d08617
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions src/mangosd/WorldRunnable.cpp
Expand Up @@ -37,6 +37,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()
{
Expand Down Expand Up @@ -71,6 +76,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
Expand Down
2 changes: 1 addition & 1 deletion 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__

0 comments on commit 5d08617

Please sign in to comment.