summaryrefslogtreecommitdiff
path: root/src/actions
diff options
context:
space:
mode:
Diffstat (limited to 'src/actions')
-rw-r--r--src/actions/actions.cpp27
-rw-r--r--src/actions/actions.h1
2 files changed, 28 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
diff --git a/src/actions/actions.h b/src/actions/actions.h
index 6fb4fa01c..44812e826 100644
--- a/src/actions/actions.h
+++ b/src/actions/actions.h
@@ -54,6 +54,7 @@ namespace Actions
decHandler(showKeyboard);
decHandler(showWindows);
decHandler(openTrade);
+ decHandler(ipcToggle);
} // namespace Actions
#undef decHandler