- Added spam-prevention code. If someone sends the same message 5 times in a row, they will get the message "You are nearing the spam filter limit for identical messages." If they continue to send the same message (if they send it 10 times in total) they will get an auto-mute for the channel they are sending it through. The number of identical messages which triggers a warning and automute can be configured in setup.dm

- Added channel-specific admin muting. Admins can now mute someone from IC (say, me and whisper), OOC, PRAY, ADMINHELP (adminhelp, admin pm and asay) and DEADCHAT (say while dead and dsay)
- Added a (?) to adminhelps and prayers which displays the same quick overview that all the other (?)-s show, but for the person adminhelping or praying.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@3888 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
baloh.matevz@gmail.com
2012-06-22 05:54:43 +00:00
parent 7a95e5c2bc
commit 9a94312431
17 changed files with 193 additions and 78 deletions
+10 -2
View File
@@ -9,8 +9,16 @@
var/fakekey = null
var/seeprayers = 0
var/ooccolor = "#b82e00"
var/muted = null //Can't talk in OOC, say, whisper, emote... anything except for adminhelp and admin-pm. An admin punishment
var/muted_complete = null //Can't talk in any way shape or form (muted + can't adminhelp or respond to admin pm-s). An admin punishment
var/muted_ic //can't use 'say' while alive or emotes.
var/muted_ooc //can't speak in ooc
var/muted_deadchat //can't use 'say' while dead or DSAY
var/muted_pray //can't send prayers
var/muted_adminhelp //can't send adminhelps, PM-s or use ASAY
var/last_message = "" //Contains the last message sent by this client - used to protect against copy-paste spamming.
var/last_message_count = 0 //contins a number of how many times a message identical to last_message was sent.
var/warned = 0
var/sound_adminhelp = 0 //If set to 1 this will play a sound when adminhelps are received.
+14
View File
@@ -52,6 +52,20 @@
..() //redirect to [locate(hsrc)]/Topic()
/client/proc/handle_spam_prevention(var/message, var/mute_type)
if(src.last_message == message)
src.last_message_count++
if(src.last_message_count >= SPAM_TRIGGER_AUTOMUTE)
src << "\red You have exceeded the spam filter limit for identical messages. An auto-mute was applied."
cmd_admin_mute(src.mob, mute_type, 1)
return 1
if(src.last_message_count >= SPAM_TRIGGER_WARNING)
src << "\red You are nearing the spam filter limit for identical messages."
return 0
else
last_message = message
src.last_message_count = 0
return 0
//This stops files larger than UPLOAD_LIMIT being sent from client to server via input(), client.Import() etc.
/client/AllowUpload(filename, filelength)