Limit chat to 1000 characters
This commit is contained in:
parent
1397f3834f
commit
88adfbc8df
@ -1341,7 +1341,7 @@ void ClientLobby::sendChat(irr::core::stringw text)
|
||||
name = PlayerManager::getCurrentOnlineProfile()->getUserName();
|
||||
else
|
||||
name = player->getName();
|
||||
chat->encodeString16(name + L": " + text);
|
||||
chat->encodeString16(name + L": " + text, 1000/*max_len*/);
|
||||
|
||||
STKHost::get()->sendToServer(chat, true);
|
||||
delete chat;
|
||||
|
@ -595,7 +595,7 @@ void ServerLobby::handleChat(Event* event)
|
||||
event->getPeer()->updateLastActivity();
|
||||
const bool sender_in_game = event->getPeer()->isWaitingForGame();
|
||||
core::stringw message;
|
||||
event->data().decodeString16(&message);
|
||||
event->data().decodeString16(&message, 1000/*max_len*/);
|
||||
if (message.size() > 0)
|
||||
{
|
||||
NetworkString* chat = getNetworkString();
|
||||
|
Loading…
Reference in New Issue
Block a user