summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHello TMW <hello@themanaworld.org>2022-12-15 15:38:47 +0000
committerJesusalva Jesusalva <jesusalva@themanaworld.org>2022-12-15 15:38:47 +0000
commit887dc62bbddd350371fec471aecca8e6e0e56813 (patch)
tree03471f36b6326c31b12dc0defd546eea2a2ab4da
parentfdc6b727e76a695daf225787181f249c390a1541 (diff)
downloadtmwa-887dc62bbddd350371fec471aecca8e6e0e56813.tar.gz
tmwa-887dc62bbddd350371fec471aecca8e6e0e56813.tar.bz2
tmwa-887dc62bbddd350371fec471aecca8e6e0e56813.tar.xz
tmwa-887dc62bbddd350371fec471aecca8e6e0e56813.zip
Hello=). Someone said its up to GMs to deal with users exploiting their servers.
-rw-r--r--src/map/clif.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/map/clif.cpp b/src/map/clif.cpp
index f71feb6..0eb2b8c 100644
--- a/src/map/clif.cpp
+++ b/src/map/clif.cpp
@@ -6083,6 +6083,17 @@ AString clif_validate_chat(dumb_ptr<map_session_data> sd, ChatType type, XString
WARN_MALFORMED_MSG(sd, "exceeded maximum message length"_s);
return AString();
}
+ // Try to grasp max allowed message for global accounting for CharName
+ if (type == ChatType::Global && \
+ (buf.size() >= (battle_config.chat_maxline - (2+sizeof(CharName)))) || \
+ buf.size() >= 486) // 486 is hard clamp if battle_config.chat_maxline too small, etc
+ {
+ WARN_MALFORMED_MSG(sd, "exceeded maximum Global message length"_s);
+ AString hack_msg = STRPRINTF("[GM] %s attempted oversized Global chat message"_fmt,
+ sd->status_key.name);
+ tmw_GmHackMsg(hack_msg); // alert GMs about possible exploit attempt.
+ return AString();
+ }
// Step beyond the separator. for older clients
if (type == ChatType::Global && sd->client_version < wrap<ClientVersion>(6))