From 24a5dd797c6181adc4dcb4830575a9f95e4df984 Mon Sep 17 00:00:00 2001 From: Andrey Filipenkov Date: Tue, 26 Jul 2022 17:39:07 +0300 Subject: [PATCH] fix starting local server --- client/CServerHandler.cpp | 2 +- server/CVCMIServer.cpp | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/client/CServerHandler.cpp b/client/CServerHandler.cpp index 39024dc1b..cc9c8c477 100644 --- a/client/CServerHandler.cpp +++ b/client/CServerHandler.cpp @@ -195,7 +195,7 @@ void CServerHandler::startLocalServerAndConnect() threadRunLocalServer.reset(); CSH->campaignServerRestartLock.setn(false); }); -// threadRunLocalServer->detach(); + threadRunLocalServer->detach(); logNetwork->info("[ios] detach server thread"); #else threadRunLocalServer = std::make_shared(&CServerHandler::threadRunServer, this); //runs server executable; diff --git a/server/CVCMIServer.cpp b/server/CVCMIServer.cpp index c646d8afa..cfc2e1da2 100644 --- a/server/CVCMIServer.cpp +++ b/server/CVCMIServer.cpp @@ -855,6 +855,7 @@ void handleLinuxSignal(int sig) static void handleCommandOptions(int argc, char * argv[], boost::program_options::variables_map & options) { +#ifndef VCMI_IOS namespace po = boost::program_options; po::options_description opts("Allowed options"); opts.add_options() @@ -897,6 +898,7 @@ static void handleCommandOptions(int argc, char * argv[], boost::program_options std::cout << VCMIDirs::get().genHelpString(); exit(0); } +#endif } #ifdef VCMI_IOS @@ -921,11 +923,6 @@ int main(int argc, char * argv[]) logGlobal->info(SERVER_NAME); boost::program_options::variables_map opts; -#ifdef VCMI_IOS - argc = 1; - boost::condition_variable * cond = reinterpret_cast(argv[1]); - cond->notify_one(); -#else handleCommandOptions(argc, argv, opts); preinitDLL(console); settings.init(); @@ -933,7 +930,13 @@ int main(int argc, char * argv[]) loadDLLClasses(); srand((ui32)time(nullptr)); + +#ifdef VCMI_IOS + argc = 1; + boost::condition_variable * cond = reinterpret_cast(argv[1]); + cond->notify_one(); #endif + try { boost::asio::io_service io_service;