summaryrefslogtreecommitdiff
path: root/src/actions/actions.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-08-23 19:54:53 +0300
committerAndrei Karas <akaras@inbox.ru>2014-08-23 19:54:53 +0300
commit0bda5a9018bb8a8b0511e86d6b0790a5b5127e42 (patch)
tree7b79a624486e94e862546e994d4f65720720aa14 /src/actions/actions.cpp
parentd6f58bee33ca548ea6fc125553aa8d4d2fdba91f (diff)
downloadmanaverse-0bda5a9018bb8a8b0511e86d6b0790a5b5127e42.tar.gz
manaverse-0bda5a9018bb8a8b0511e86d6b0790a5b5127e42.tar.bz2
manaverse-0bda5a9018bb8a8b0511e86d6b0790a5b5127e42.tar.xz
manaverse-0bda5a9018bb8a8b0511e86d6b0790a5b5127e42.zip
Move chat command /ipctoggle into actions.
Diffstat (limited to 'src/actions/actions.cpp')
-rw-r--r--src/actions/actions.cpp27
1 files changed, 27 insertions, 0 deletions
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