From a638c330ec11fee74e2efcd11018bb321ddf2c53 Mon Sep 17 00:00:00 2001 From: athile Date: Tue, 6 Jul 2010 10:28:48 -0700 Subject: [PATCH] Add one more command server fix so it still works correctly on Windows and reeanble the command server by default. --- apps/openmw/main.cpp | 4 ++-- components/commandserver/server.cpp | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/openmw/main.cpp b/apps/openmw/main.cpp index 82d69fcd82..63ea7e4271 100644 --- a/apps/openmw/main.cpp +++ b/apps/openmw/main.cpp @@ -32,7 +32,7 @@ bool parseOptions (int argc, char**argv, OMW::Engine& engine) ( "debug", "debug mode" ) ( "script-verbose", "verbose script output" ) ( "new-game", "activate char gen/new game mechanics" ) - ( "enable-command-server", "turn on the command server" ) + ( "disable-command-server", "turn off the command server" ) ; bpo::variables_map variables; @@ -64,7 +64,7 @@ bool parseOptions (int argc, char**argv, OMW::Engine& engine) if (variables.count ("new-game")) engine.setNewGame(); - if (variables.count("enable-command-server")) + if (variables.count("disable-command-server") == 0) engine.enableCommandServer(); return true; diff --git a/components/commandserver/server.cpp b/components/commandserver/server.cpp index 26f328ecdf..53d7b2bf24 100755 --- a/components/commandserver/server.cpp +++ b/components/commandserver/server.cpp @@ -54,6 +54,7 @@ namespace OMW { namespace CommandServer { namespace Detail { void Connection::stop() { mSocket.shutdown(boost::asio::socket_base::shutdown_both); + mSocket.close(); mpThread->join(); }