Merged var/muted_ic; var/muted_ooc; var/muted_deadchat; var/muted_pray; var/muted_adminhelp into var/muted as bitflags

Added a config option config.automute_on It toggles automuting.
Admins cannot be muted.
Made the proc/cmd_admin_mute code shorter.
Automuting defaults to off

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4758 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
elly1989@rocketmail.com
2012-09-25 21:23:02 +00:00
parent fc4a98ba39
commit cc2c4de49b
19 changed files with 93 additions and 105 deletions

View File

@@ -123,73 +123,55 @@
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!
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."
if(automute)
if(!config.automute_on) return
else
if(!usr || !usr.client)
return
if(!usr.client.holder)
usr << "<font color='red'>Error: cmd_admin_mute: You don't have permission to do this.</font>"
return
if(!M.client)
usr << "<font color='red'>Error: cmd_admin_mute: This mob doesn't have a client tied to it.</font>"
if(M.client.holder)
usr << "<font color='red'>Error: cmd_admin_mute: You cannot mute an admin.</font>"
if(!M.client) return
if(M.client.holder) return
var/muteunmute
var/mute_string
switch(mute_type)
if(MUTE_IC) mute_string = "IC (say and emote)"
if(MUTE_OOC) mute_string = "OOC"
if(MUTE_PRAY) mute_string = "pray"
if(MUTE_ADMINHELP) mute_string = "adminhelp, admin PM and ASAY"
if(MUTE_DEADCHAT) mute_string = "deadchat and DSAY"
if(MUTE_ALL) mute_string = "everything"
else return
if(automute)
muteunmute = "auto-muted"
M.client.muted |= mute_type
log_admin("SPAM AUTOMUTE: [muteunmute] [key_name(M)] from [mute_string]")
message_admins("SPAM AUTOMUTE: [muteunmute] [key_name_admin(M)] from [mute_string].", 1)
M << "You have been [muteunmute] 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!
return
var/muteunmute = 0 //0 = unmuted; 1 = muted
var/mute_string = "unknown"
//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]."
feedback_add_details("admin_verb","MUTE") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
if(M.client.muted & mute_type)
muteunmute = "unmuted"
M.client.muted &= ~mute_type
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)
muteunmute = "muted"
M.client.muted |= mute_type
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!
log_admin("[key_name(usr)] has [muteunmute] [key_name(M)] from [mute_string]")
message_admins("[key_name_admin(usr)] has [muteunmute] [key_name_admin(M)] from [mute_string].", 1)
M << "You have been [muteunmute] from [mute_string]."
feedback_add_details("admin_verb","MUTE") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/proc/cmd_admin_add_random_ai_law()