Ports TG/lummox fix to reduce impact of keysend floods

This commit is contained in:
Kyep
2020-01-05 00:01:08 -08:00
parent c721ecb8c5
commit 7dcb34577b
2 changed files with 6 additions and 5 deletions
+2 -2
View File
@@ -25,7 +25,7 @@
else
log_admin("Client [ckey] was just autokicked for flooding keysends; likely abuse but potentially lagspike.")
message_admins("Client [ckey] was just autokicked for flooding keysends; likely abuse but potentially lagspike.")
QDEL_IN(src, 1)
qdel(src)
return
///Check if the key is short enough to even be a real key
@@ -33,7 +33,7 @@
to_chat(src, "<span class='userdanger'>Invalid KeyDown detected! You have been disconnected from the server automatically.</span>")
log_admin("Client [ckey] just attempted to send an invalid keypress. Keymessage was over [MAX_KEYPRESS_COMMANDLENGTH] characters, autokicking due to likely abuse.")
message_admins("Client [ckey] just attempted to send an invalid keypress. Keymessage was over [MAX_KEYPRESS_COMMANDLENGTH] characters, autokicking due to likely abuse.")
QDEL_IN(src, 1)
qdel(src)
return
//offset by 1 because the buffer address is 0 indexed because the math was simpler
keys_held[current_key_address + 1] = _key