Send max number of characters instead of asserting in case of too long chat messages
parent
5c6cf630de
commit
167df02e3d
|
@ -2082,8 +2082,10 @@ void Client::sendChatMessage(const std::wstring &message)
|
|||
|
||||
// Write length
|
||||
size_t messagesize = message.size();
|
||||
assert(messagesize <= 0xFFFF);
|
||||
writeU16(buf, (u16) (messagesize & 0xFFFF));
|
||||
if (messagesize > 0xFFFF) {
|
||||
messagesize = 0xFFFF;
|
||||
}
|
||||
writeU16(buf, (u16) messagesize);
|
||||
os.write((char*)buf, 2);
|
||||
|
||||
// Write string
|
||||
|
|
Loading…
Reference in New Issue