Handle linebreaking from motd if needed

This commit is contained in:
Benau 2018-09-15 23:06:28 +08:00
parent 28511c597e
commit 0c7475c6cf

View File

@ -636,9 +636,13 @@ void ClientLobby::handleServerInfo(Event* event)
// MOTD
core::stringw motd;
data.decodeString16(&motd);
if (!motd.empty())
NetworkingLobby::getInstance()->addMoreServerInfo(motd);
const std::vector<core::stringw>& motd_line = StringUtils::split(motd,
'\n');
if (!motd_line.empty())
{
for (const core::stringw& motd : motd_line)
NetworkingLobby::getInstance()->addMoreServerInfo(motd);
}
} // handleServerInfo
//-----------------------------------------------------------------------------