Reserve language info for translation

This commit is contained in:
Benau 2019-12-03 12:55:41 +08:00
parent a9684f31e6
commit 7c83a4f9f3
2 changed files with 4 additions and 1 deletions

View File

@ -1570,7 +1570,8 @@ void ClientLobby::handleClientCommand(const std::string& cmd)
{
// Send for server command
NetworkString* cmd_ns = getNetworkString(1);
cmd_ns->addUInt8(LE_COMMAND).encodeString(cmd);
const std::string& language = UserConfigParams::m_language;
cmd_ns->addUInt8(LE_COMMAND).encodeString(language).encodeString(cmd);
sendToServer(cmd_ns, /*reliable*/true);
delete cmd_ns;
}

View File

@ -4896,6 +4896,8 @@ bool ServerLobby::checkPeersReady(bool ignore_ai_peer) const
void ServerLobby::handleServerCommand(Event* event, STKPeer* peer) const
{
NetworkString& data = event->data();
std::string language;
data.decodeString(&language);
std::string cmd;
data.decodeString(&cmd);
auto argv = StringUtils::split(cmd, ' ');