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();
|
name = PlayerManager::getCurrentOnlineProfile()->getUserName();
|
||||||
else
|
else
|
||||||
name = player->getName();
|
name = player->getName();
|
||||||
chat->encodeString16(name + L": " + text);
|
chat->encodeString16(name + L": " + text, 1000/*max_len*/);
|
||||||
|
|
||||||
STKHost::get()->sendToServer(chat, true);
|
STKHost::get()->sendToServer(chat, true);
|
||||||
delete chat;
|
delete chat;
|
||||||
|
@ -595,7 +595,7 @@ void ServerLobby::handleChat(Event* event)
|
|||||||
event->getPeer()->updateLastActivity();
|
event->getPeer()->updateLastActivity();
|
||||||
const bool sender_in_game = event->getPeer()->isWaitingForGame();
|
const bool sender_in_game = event->getPeer()->isWaitingForGame();
|
||||||
core::stringw message;
|
core::stringw message;
|
||||||
event->data().decodeString16(&message);
|
event->data().decodeString16(&message, 1000/*max_len*/);
|
||||||
if (message.size() > 0)
|
if (message.size() > 0)
|
||||||
{
|
{
|
||||||
NetworkString* chat = getNetworkString();
|
NetworkString* chat = getNetworkString();
|
||||||
|
Loading…
Reference in New Issue
Block a user