From 51891b766c733220b5267be1b4bcf6f04717e976 Mon Sep 17 00:00:00 2001 From: Anthony Birkett Date: Tue, 31 Mar 2015 14:50:03 +0100 Subject: Working as a Windows service. Starts and stops correctly. Added "/service" switch, to prompt the binary to attempt starting as a service. Added service* methods, to control service startup. Split up main() into universalMain(), which contains the startup code for both service and normal start. Added cRoot::m_RunningAsService bool, Added cRoot::SetStopping(bool) to allow a stop request to be sent by the service controller. Added cBlockIDMap::init() to avoid loading items.ini before the working directory has been set. --- src/Root.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/Root.h') diff --git a/src/Root.h b/src/Root.h index fdaf444bd..d552466dc 100644 --- a/src/Root.h +++ b/src/Root.h @@ -46,6 +46,7 @@ public: // tolua_end static bool m_TerminateEventRaised; + static bool m_RunAsService; cRoot(void); @@ -53,6 +54,9 @@ public: void Start(void); + // Added so the service handler can request a stop + void SetStopping(bool a_Stopping); + // tolua_begin cServer * GetServer(void) { return m_Server; } cWorld * GetDefaultWorld(void); -- cgit v1.2.3