mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Send max number of characters instead of asserting in case of too long chat messages
This commit is contained in:
parent
5c6cf630de
commit
167df02e3d
1 changed files with 4 additions and 2 deletions
|
@ -2082,8 +2082,10 @@ void Client::sendChatMessage(const std::wstring &message)
|
||||||
|
|
||||||
// Write length
|
// Write length
|
||||||
size_t messagesize = message.size();
|
size_t messagesize = message.size();
|
||||||
assert(messagesize <= 0xFFFF);
|
if (messagesize > 0xFFFF) {
|
||||||
writeU16(buf, (u16) (messagesize & 0xFFFF));
|
messagesize = 0xFFFF;
|
||||||
|
}
|
||||||
|
writeU16(buf, (u16) messagesize);
|
||||||
os.write((char*)buf, 2);
|
os.write((char*)buf, 2);
|
||||||
|
|
||||||
// Write string
|
// Write string
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue