diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-05-08 20:27:17 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-05-08 20:27:17 +0300 |
commit | a0ea4c0ba04425c08c5e9fe15ed70745891f3f8a (patch) | |
tree | a668cdc502f965df4cc6eb9e1bb94db1f4f7c964 | |
parent | 652f2cca31626806dc536b4ee3d18aa1d654f569 (diff) | |
download | manaverse-a0ea4c0ba04425c08c5e9fe15ed70745891f3f8a.tar.gz manaverse-a0ea4c0ba04425c08c5e9fe15ed70745891f3f8a.tar.bz2 manaverse-a0ea4c0ba04425c08c5e9fe15ed70745891f3f8a.tar.xz manaverse-a0ea4c0ba04425c08c5e9fe15ed70745891f3f8a.zip |
Add command line parameter --enable-ipc for enable ipc at start.
-rw-r--r-- | src/client.cpp | 2 | ||||
-rw-r--r-- | src/commandline.cpp | 3 | ||||
-rw-r--r-- | src/net/ipc.cpp | 1 | ||||
-rw-r--r-- | src/options.h | 4 |
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 |