- 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

View File

@@ -123,25 +123,73 @@
message_admins("[key_name_admin(usr)] has toggled [key_name_admin(M)]'s nodamage to [(M.nodamage ? "On" : "Off")]", 1)
feedback_add_details("admin_verb","GOD") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/proc/cmd_admin_mute(mob/M as mob in world)
set category = "Special Verbs"
set name = "Admin Mute"
if(!holder)
src << "Only administrators may use this command."
return
if (M.client && M.client.holder && (M.client.holder.level >= holder.level))
alert("You cannot perform this action. You must be of a higher administrative rank!", null, null, null, null, null)
return
proc/cmd_admin_mute(mob/M as mob, mute_type, automute = 0)
if(!automute)
if(usr && usr.client)
if(!usr.client.holder)
src << "Only administrators may use this command."
return
if (M.client && M.client.holder && (M.client.holder.level >= usr.client.holder.level))
alert("You cannot perform this action. You must be of a higher administrative rank!", null, null, null, null, null)
return
if(!M.client)
src << "This mob doesn't have a client tied to it."
return
M.client.muted = !M.client.muted
log_admin("[key_name(src)] has [(M.client.muted ? "muted" : "voiced")] [key_name(M)].")
message_admins("[key_name_admin(src)] has [(M.client.muted ? "muted" : "voiced")] [key_name_admin(M)].", 1)
var/muteunmute = 0 //0 = unmuted; 1 = muted
var/mute_string = "unknown"
M << "You have been [(M.client.muted ? "muted" : "voiced")]."
feedback_add_details("admin_verb","MUTE") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
//The '| automute' thing ensures that if an automute is being applied by code, it always mutes to prevent any potential for automute to unmute someone who was muted.
switch(mute_type)
if(MUTE_IC)
M.client.muted_ic = !M.client.muted_ic | automute
muteunmute = M.client.muted_ic
mute_string = "IC (say and emote)"
if(MUTE_OOC)
M.client.muted_ooc = !M.client.muted_ooc | automute
muteunmute = M.client.muted_ooc
mute_string = "OOC"
if(MUTE_PRAY)
M.client.muted_pray = !M.client.muted_pray | automute
muteunmute = M.client.muted_pray
mute_string = "pray"
if(MUTE_ADMINHELP)
M.client.muted_adminhelp = !M.client.muted_adminhelp | automute
muteunmute = M.client.muted_adminhelp
mute_string = "adminhelp, admin PM and ASAY"
if(MUTE_DEADCHAT)
M.client.muted_deadchat = !M.client.muted_deadchat | automute
muteunmute = M.client.muted_deadchat
mute_string = "deadchat and DSAY"
if(MUTE_ALL)
mute_string = "everything"
if( M.client.muted_ic )
M.client.muted_ic = 1
M.client.muted_ooc = 1
M.client.muted_pray = 1
M.client.muted_adminhelp = 1
M.client.muted_deadchat = 1
muteunmute = 1
else
M.client.muted_ic = 0
M.client.muted_ooc = 0
M.client.muted_pray = 0
M.client.muted_adminhelp = 0
M.client.muted_deadchat = 0
muteunmute = 0
if(!automute)
log_admin("[key_name(usr)] has [(muteunmute ? "muted" : "voiced")] [key_name(M)] from [mute_string]")
message_admins("[key_name_admin(usr)] has [(muteunmute ? "muted" : "voiced")] [key_name_admin(M)] from [mute_string].", 1)
M << "You have been [(muteunmute ? "muted" : "voiced")] from [mute_string] by [(usr.client.stealth)?"an admin":"[usr.client]"]."
feedback_add_details("admin_verb","MUTE") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
else
log_admin("SPAM AUTOMUTE: [(muteunmute ? "muted" : "voiced")] [key_name(M)] from [mute_string]")
message_admins("SPAM AUTOMUTE: [(muteunmute ? "muted" : "voiced")] [key_name_admin(M)] from [mute_string].", 1)
M << "You have been [(muteunmute ? "muted" : "voiced")] from [mute_string] by the SPAM AUTOMUTE system. Contact an admin."
feedback_add_details("admin_verb","AUTOMUTE") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/proc/cmd_admin_add_random_ai_law()