Mutes are now in datum/preferences. That means they are persistent! You can't avoid them by logging out you naughty little spammers.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5124 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
elly1989@rocketmail.com
2012-11-19 17:09:05 +00:00
parent 599430c3ff
commit 14ed3f155b
15 changed files with 23 additions and 22 deletions

View File

@@ -33,7 +33,7 @@
if(!dooc_allowed && deadchat != 0)
usr << "\red OOC for dead mobs has been turned off."
return
if(muted & MUTE_OOC)
if(prefs.muted & MUTE_OOC)
src << "\red You cannot use OOC (muted)."
return
if(handle_spam_prevention(msg,MUTE_OOC))

View File

@@ -54,13 +54,14 @@ var/global/floorIsLava = 0
if(M.client)
body += "| <A HREF='?src=\ref[src];sendtoprison=\ref[M]'>Prison</A> | "
var/muted = M.client.prefs.muted
body += "<br><b>Mute: </b> "
body += "\[<A href='?src=\ref[src];mute=\ref[M];mute_type=[MUTE_IC]'><font color='[(M.client.muted & MUTE_IC)?"red":"blue"]'>IC</font></a> | "
body += "<A href='?src=\ref[src];mute=\ref[M];mute_type=[MUTE_OOC]'><font color='[(M.client.muted & MUTE_OOC)?"red":"blue"]'>OOC</font></a> | "
body += "<A href='?src=\ref[src];mute=\ref[M];mute_type=[MUTE_PRAY]'><font color='[(M.client.muted & MUTE_PRAY)?"red":"blue"]'>PRAY</font></a> | "
body += "<A href='?src=\ref[src];mute=\ref[M];mute_type=[MUTE_ADMINHELP]'><font color='[(M.client.muted & MUTE_ADMINHELP)?"red":"blue"]'>ADMINHELP</font></a> | "
body += "<A href='?src=\ref[src];mute=\ref[M];mute_type=[MUTE_DEADCHAT]'><font color='[(M.client.muted & MUTE_DEADCHAT)?"red":"blue"]'>DEADCHAT</font></a>\]"
body += "(<A href='?src=\ref[src];mute=\ref[M];mute_type=[MUTE_ALL]'><font color='[(M.client.muted & MUTE_ALL)?"red":"blue"]'>toggle all</font></a>)"
body += "\[<A href='?src=\ref[src];mute=\ref[M];mute_type=[MUTE_IC]'><font color='[(muted & MUTE_IC)?"red":"blue"]'>IC</font></a> | "
body += "<A href='?src=\ref[src];mute=\ref[M];mute_type=[MUTE_OOC]'><font color='[(muted & MUTE_OOC)?"red":"blue"]'>OOC</font></a> | "
body += "<A href='?src=\ref[src];mute=\ref[M];mute_type=[MUTE_PRAY]'><font color='[(muted & MUTE_PRAY)?"red":"blue"]'>PRAY</font></a> | "
body += "<A href='?src=\ref[src];mute=\ref[M];mute_type=[MUTE_ADMINHELP]'><font color='[(muted & MUTE_ADMINHELP)?"red":"blue"]'>ADMINHELP</font></a> | "
body += "<A href='?src=\ref[src];mute=\ref[M];mute_type=[MUTE_DEADCHAT]'><font color='[(muted & MUTE_DEADCHAT)?"red":"blue"]'>DEADCHAT</font></a>\]"
body += "(<A href='?src=\ref[src];mute=\ref[M];mute_type=[MUTE_ALL]'><font color='[(muted & MUTE_ALL)?"red":"blue"]'>toggle all</font></a>)"
body += "<br><br>"
body += "<A href='?src=\ref[src];jumpto=\ref[M]'><b>Jump to</b></A> | "

View File

@@ -8,7 +8,7 @@ var/list/adminhelp_ignored_words = list("unknown","the","a","an","of","monkey","
set name = "Adminhelp"
//handle muting and automuting
if(muted & MUTE_ADMINHELP)
if(prefs.muted & MUTE_ADMINHELP)
src << "<font color='red'>Error: Admin-PM: You cannot send adminhelps (Muted).</font>"
return
if(src.handle_spam_prevention(msg,MUTE_ADMINHELP))

View File

@@ -36,7 +36,7 @@
//takes input from cmd_admin_pm_context, cmd_admin_pm_panel or /client/Topic and sends them a PM.
//Fetching a message if needed. src is the sender and C is the target client
/client/proc/cmd_admin_pm(var/client/C, var/msg)
if(src.muted & MUTE_ADMINHELP)
if(prefs.muted & MUTE_ADMINHELP)
src << "<font color='red'>Error: Admin-PM: You are unable to use admin PM-s (muted).</font>"
return

View File

@@ -7,7 +7,7 @@
return
if(!src.mob)
return
if(src.muted & MUTE_DEADCHAT)
if(prefs.muted & MUTE_DEADCHAT)
src << "\red You cannot send DSAY messages (muted)."
return

View File

@@ -6,7 +6,7 @@
if(!msg) return
if(usr.client)
if(usr.client.muted & MUTE_PRAY)
if(usr.client.prefs.muted & MUTE_PRAY)
usr << "\red You cannot pray (muted)."
return
if(src.client.handle_spam_prevention(msg,MUTE_PRAY))

View File

@@ -154,19 +154,19 @@ proc/cmd_admin_mute(mob/M as mob, mute_type, automute = 0)
if(automute)
muteunmute = "auto-muted"
M.client.muted |= mute_type
M.client.prefs.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
if(M.client.muted & mute_type)
if(M.client.prefs.muted & mute_type)
muteunmute = "unmuted"
M.client.muted &= ~mute_type
M.client.prefs.muted &= ~mute_type
else
muteunmute = "muted"
M.client.muted |= mute_type
M.client.prefs.muted |= mute_type
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)

View File

@@ -6,7 +6,6 @@
var/buildmode = 0
var/seeprayers = 1
var/muted = 0
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.

View File

@@ -10,7 +10,7 @@
log_say("Ghost/[src.key] : [message]")
if (src.client)
if(src.client.muted & MUTE_DEADCHAT)
if(src.client.prefs.muted & MUTE_DEADCHAT)
src << "\red You cannot talk in deadchat (muted)."
return

View File

@@ -79,7 +79,7 @@
if(silent)
return
if (src.client)
if (client.muted & MUTE_IC)
if (client.prefs.muted & MUTE_IC)
src << "\red You cannot send IC messages (muted)."
return
if (src.client.handle_spam_prevention(message,MUTE_IC))

View File

@@ -8,7 +8,7 @@
log_whisper("[src.name]/[src.key] : [message]")
if (src.client)
if (src.client.muted & MUTE_IC)
if (src.client.prefs.muted & MUTE_IC)
src << "\red You cannot whisper (muted)."
return

View File

@@ -86,7 +86,7 @@ var/list/department_radio_keys = list(
return say_dead(message)
if (src.client)
if(client.muted & MUTE_IC)
if(client.prefs.muted & MUTE_IC)
src << "\red You cannot speak in IC (muted)."
return
if (src.client.handle_spam_prevention(message,MUTE_IC))

View File

@@ -72,7 +72,7 @@
if ("me")
if (src.client)
if(client.muted & MUTE_IC)
if(client.prefs.muted & MUTE_IC)
src << "You cannot send IC messages (muted)."
return
if (src.client.handle_spam_prevention(message,MUTE_IC))

View File

@@ -3,7 +3,7 @@
return
if (src.client)
if(client.muted & MUTE_IC)
if(client.prefs.muted & MUTE_IC)
src << "You cannot send IC messages (muted)."
return
if (src.client.handle_spam_prevention(message,MUTE_IC))

View File

@@ -43,6 +43,7 @@ datum/preferences
//non-preference stuff
var/warns = 0
var/muted = 0
var/last_ip
var/last_id