]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - win/inspircd_namedpipe.cpp
erm, why are we doing this twice?
[user/henk/code/inspircd.git] / win / inspircd_namedpipe.cpp
index a460f41a2b9d0627f4996dde3ca8793e715215ad..76d16037bf721bb51fe1e9286fc2b6fefa2e440d 100644 (file)
@@ -6,7 +6,7 @@
 #include <psapi.h>\r
 \r
 \r
-IPCThread::IPCThread(InspIRCd* Instance) : Thread(), ServerInstance(Instance)\r
+IPCThread::IPCThread()\r
 {\r
        if (!initwmi())\r
                ServerInstance->Logs->Log("IPC", DEBUG, "Could not initialise WMI. CPU percantage reports will not be available.");\r
@@ -127,11 +127,11 @@ void IPCThread::SetResult(int newresult)
 }\r
 \r
 \r
-IPC::IPC(InspIRCd* Srv) : ServerInstance(Srv)\r
+IPC::IPC()\r
 {\r
        /* The IPC pipe is threaded */\r
-       thread = new IPCThread(Srv);\r
-       Srv->Threads->Create(thread);\r
+       thread = new IPCThread();\r
+       ServerInstance->Threads->Start(thread);\r
 }\r
 \r
 void IPC::Check()\r
@@ -161,6 +161,12 @@ void IPC::Check()
                        thread->ClearStatus();\r
                        ServerInstance->Restart("Restarting due to command from GUI");\r
                break;\r
+               case '4':\r
+                       /* Toggle debug */\r
+                       thread->SetResult(0);\r
+                       thread->ClearStatus();\r
+                       ServerInstance->Config->forcedebug = !ServerInstance->Config->forcedebug;\r
+               break;\r
        }\r
 }\r
 \r