From c3e74d344faada8433efb3a3d9171ed57da3fba7 Mon Sep 17 00:00:00 2001 From: hiker Date: Fri, 20 Nov 2015 08:07:31 +1100 Subject: [PATCH] Add warning message in case of an unknown command, and do not send it to the servrer (which typically just confuses it). --- src/network/network_console.cpp | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/src/network/network_console.cpp b/src/network/network_console.cpp index cb578eca7..e67168e94 100644 --- a/src/network/network_console.cpp +++ b/src/network/network_console.cpp @@ -151,20 +151,10 @@ void* NetworkConsole::mainLoop(void* data) } std::cout << "\n"; } - // FIXME - // If STK shuts down, but should receive an input after the network - // manager was deleted, the getInstance call will return NULL. - else if (NetworkConfig::get()->isclient() && - STKHost::get()->getPeerCount() > 0) + else { - NetworkString msg(1 + str.size()); - msg.ai8(0); - msg += str; - STKHost::get()->getPeers()[0]->sendPacket(msg); + Log::info("Console", "Unknown command '%s'.", str.c_str()); } - - - } // while !stop Protocol *p = new StopServer();