mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-23 03:57:13 +01:00
- 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:
@@ -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.
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user