From 29fb4ebc5ca42095e6abbb7814abe18aff27acf3 Mon Sep 17 00:00:00 2001 From: MadCamel Date: Sun, 2 May 2010 14:19:23 -0400 Subject: ChangeDir packets are now rate limited Breakdancing is fun. Spinbotting isn't.. --- src/map/clif.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/map/clif.c b/src/map/clif.c index da26b5d..217c374 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -9337,7 +9337,7 @@ func_table clif_parse_func_table[0x220] = { NULL, 0 }, // 98 { clif_parse_GMmessage, 300 }, // 99 { NULL, 0 }, // 9a - { clif_parse_ChangeDir, -1 }, // 9b .29 clients spam this packet when walking into a blocked tile + { clif_parse_ChangeDir, 0 }, // 9b { NULL, 0 }, // 9c { NULL, 0 }, // 9d { NULL, 0 }, // 9e @@ -9763,6 +9763,16 @@ int clif_check_packet_flood(fd, cmd) rate = 1000; } + // ChangeDir - only apply limit if not walking + if (cmd == 0x9b) + { + // .29 clients spam this packet when walking into a blocked tile + if (RFIFOB(fd, 4) == sd->dir || sd->walktimer != -1) + return 0; + + rate = 500; + } + // They are flooding if (tick < sd->flood_rates[cmd] + rate) { -- cgit v1.2.3-60-g2f50