From 0c7475c6cf6a93d72a79e8bf8c42772bfca3928b Mon Sep 17 00:00:00 2001 From: Benau Date: Sat, 15 Sep 2018 23:06:28 +0800 Subject: [PATCH] Handle linebreaking from motd if needed --- src/network/protocols/client_lobby.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/network/protocols/client_lobby.cpp b/src/network/protocols/client_lobby.cpp index d521bbeaa..864fa91c4 100644 --- a/src/network/protocols/client_lobby.cpp +++ b/src/network/protocols/client_lobby.cpp @@ -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& motd_line = StringUtils::split(motd, + '\n'); + if (!motd_line.empty()) + { + for (const core::stringw& motd : motd_line) + NetworkingLobby::getInstance()->addMoreServerInfo(motd); + } } // handleServerInfo //-----------------------------------------------------------------------------