summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/client.cpp2
-rw-r--r--src/commandline.cpp3
-rw-r--r--src/net/ipc.cpp1
-rw-r--r--src/options.h4
4 files changed, 9 insertions, 1 deletions
diff --git a/src/client.cpp b/src/client.cpp
index a59490ba3..d379d8917 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -317,6 +317,8 @@ void Client::gameInit()
Fuzzer::init();
#endif // USE_FUZZER
+ if (settings.options.ipc == true)
+ IPC::start();
if (settings.options.test.empty())
ConfigManager::backupConfig("config.xml");
ConfigManager::initConfiguration();
diff --git a/src/commandline.cpp b/src/commandline.cpp
index 55bea5bd3..1a7ad7dba 100644
--- a/src/commandline.cpp
+++ b/src/commandline.cpp
@@ -157,6 +157,7 @@ void parseOptions(const int argc, char *const argv[])
{ "test", required_argument, nullptr, 't' },
{ "renderer", required_argument, nullptr, 'r' },
{ "server-type", required_argument, nullptr, 'y' },
+ { "enable-ipc", no_argument, nullptr, 'I' },
{ nullptr, 0, nullptr, 0 }
};
@@ -248,6 +249,8 @@ void parseOptions(const int argc, char *const argv[])
case 'y':
options.serverType = optarg;
break;
+ case 'I':
+ options.ipc = true;
default:
break;
}
diff --git a/src/net/ipc.cpp b/src/net/ipc.cpp
index 375e58ead..0137fa226 100644
--- a/src/net/ipc.cpp
+++ b/src/net/ipc.cpp
@@ -117,6 +117,7 @@ int IPC::acceptLoop(void *ptr)
std::string req(data);
trim(req);
+ logger->log_r("IPC command: %s", req.c_str());
ipc1->mThreadLocked = true;
SDL_mutexP(ipc1->mMutex);
diff --git a/src/options.h b/src/options.h
index bd6663de7..d0ee5c34b 100644
--- a/src/options.h
+++ b/src/options.h
@@ -63,7 +63,8 @@ struct Options final
chooseDefault(false),
noOpenGL(false),
safeMode(false),
- testMode(false)
+ testMode(false),
+ ipc(false)
{}
A_DELETE_COPY(Options)
@@ -92,6 +93,7 @@ struct Options final
bool noOpenGL;
bool safeMode;
bool testMode;
+ bool ipc;
};
#endif // OPTIONS_H