summaryrefslogtreecommitdiff
path: root/src/map/pc.c
diff options
context:
space:
mode:
authorMadCamel <madcamel@gmail.com>2009-08-23 10:52:01 -0400
committerMadCamel <madcamel@gmail.com>2009-08-23 11:08:57 -0400
commit415983958551f0e7ff72bec2921a67918d96d130 (patch)
tree1f01b40acb8bb3dae186939f4d63589e90bf67a1 /src/map/pc.c
parent3f230b8323518e90a0389d56ac0b4bbb5262f821 (diff)
downloadtmwa-415983958551f0e7ff72bec2921a67918d96d130.tar.gz
tmwa-415983958551f0e7ff72bec2921a67918d96d130.tar.bz2
tmwa-415983958551f0e7ff72bec2921a67918d96d130.tar.xz
tmwa-415983958551f0e7ff72bec2921a67918d96d130.zip
Improved chat spam detection
Repeats are now checked only to the length of the shortest line (last line, current line) so "SPAM!!" and "SPAM!!!!!" would be considered a repeat. Total repeats are now counted and a ban is triggered if they exceed battle_config.chat_spam_flood repeats, regardless of time frame.
Diffstat (limited to 'src/map/pc.c')
-rw-r--r--src/map/pc.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index 6f1cc86..0c304ce 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -816,11 +816,9 @@ int pc_authok(int id, int login_id2, time_t connect_until_time, short tmw_versio
}
}
- sd->chat_reset_due = sd->chat_lines_in = 0;
+ sd->chat_reset_due = sd->chat_lines_in = sd->chat_total_repeats = 0;
sd->chat_lastmsg[0] = '\0';
-
sd->trade_reset_due = sd->trades_in = 0;
-
sd->sit_reset_due = sd->sits_in = 0;
// message of the limited time of the account