Add warning message in case of an unknown command, and do not send

it to the servrer (which typically just confuses it).
This commit is contained in:
hiker 2015-11-20 08:07:31 +11:00
parent 683f0fdc07
commit c3e74d344f

View File

@ -151,20 +151,10 @@ void* NetworkConsole::mainLoop(void* data)
} }
std::cout << "\n"; std::cout << "\n";
} }
// FIXME else
// 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)
{ {
NetworkString msg(1 + str.size()); Log::info("Console", "Unknown command '%s'.", str.c_str());
msg.ai8(0);
msg += str;
STKHost::get()->getPeers()[0]->sendPacket(msg);
} }
} // while !stop } // while !stop
Protocol *p = new StopServer(); Protocol *p = new StopServer();