From 0bda5a9018bb8a8b0511e86d6b0790a5b5127e42 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 23 Aug 2014 19:54:53 +0300 Subject: Move chat command /ipctoggle into actions. --- src/actions/actions.cpp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'src/actions/actions.cpp') diff --git a/src/actions/actions.cpp b/src/actions/actions.cpp index 4fb6c7e1d..9273de8ab 100644 --- a/src/actions/actions.cpp +++ b/src/actions/actions.cpp @@ -70,6 +70,7 @@ #include "render/graphics.h" +#include "net/ipc.h" #include "net/net.h" #include "net/playerhandler.h" #include "net/tradehandler.h" @@ -495,4 +496,30 @@ impHandler0(openTrade) return false; } +impHandler0(ipcToggle) +{ + if (ipc) + { + IPC::stop(); + if (!ipc) + debugChatTab->chatLog("IPC service stopped."); + else + debugChatTab->chatLog("Unable to stop IPC service."); + } + else + { + IPC::start(); + if (ipc) + { + debugChatTab->chatLog(strprintf("IPC service available on port %d", + ipc->getPort())); + } + else + { + debugChatTab->chatLog("Unable to start IPC service"); + } + } + return true; +} + } // namespace Actions -- cgit v1.2.3-70-g09d2