add: split long string into smaller pieces.

This commit is contained in:
ds 2020-10-14 20:08:06 +03:00
commit 2bef810ce6

View file

@ -440,7 +440,7 @@ void Game::sendClientMessage (bool console, edict_t *ent, StringRef message) {
}; };
// do not excess limit // do not excess limit
constexpr size_t maxSendLength = 187; constexpr size_t maxSendLength = 125;
// split up the string into chunks if needed (maybe check if it's multibyte?) // split up the string into chunks if needed (maybe check if it's multibyte?)
if (buffer.length () > maxSendLength) { if (buffer.length () > maxSendLength) {
@ -459,7 +459,7 @@ void Game::sendServerMessage (StringRef message) {
// helper to sending the client message // helper to sending the client message
// do not excess limit // do not excess limit
constexpr size_t maxSendLength = 250; constexpr size_t maxSendLength = 175;
// split up the string into chunks if needed (maybe check if it's multibyte?) // split up the string into chunks if needed (maybe check if it's multibyte?)
if (message.length () > maxSendLength) { if (message.length () > maxSendLength) {