Files
Bubberstation/code/game/verbs/ooc.dm
baloh.matevz@gmail.com 9a94312431 - 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
2012-06-22 05:54:43 +00:00

56 lines
2.5 KiB
Plaintext

/mob/verb/listen_ooc()
set name = "Un/Mute OOC"
set category = "OOC"
if (src.client)
src.client.listen_ooc = !src.client.listen_ooc
if (src.client.listen_ooc)
src << "\blue You are now listening to messages on the OOC channel."
else
src << "\blue You are no longer listening to messages on the OOC channel."
/mob/verb/ooc(msg as text)
set name = "OOC" //Gave this shit a shorter name so you only have to time out "ooc" rather than "ooc message" to use it --NeoFite
set category = "OOC"
if (IsGuestKey(src.key))
src << "You are not authorized to communicate over these channels."
return
msg = copytext(sanitize(msg), 1, MAX_MESSAGE_LEN)
if(!msg)
return
else if (!src.client.listen_ooc)
src << "\red You have OOC muted."
return
else if (!ooc_allowed && !src.client.holder)
src << "\red OOC is globally muted"
return
else if (!dooc_allowed && !src.client.holder && (src.client.deadchat != 0))
usr << "\red OOC for dead mobs has been turned off."
return
else if (src.client)
if(src.client.muted_ooc)
src << "\red You cannot use OOC (muted by admins)."
return
if (src.client.handle_spam_prevention(msg,MUTE_OOC))
return
else if (findtext(msg, "byond://") && !src.client.holder)
src << "<B>Advertising other servers is not allowed.</B>"
log_admin("[key_name(src)] has attempted to advertise in OOC: [msg]")
message_admins("[key_name_admin(src)] has attempted to advertise in OOC: [msg]")
return
log_ooc("[src.name]/[src.key] : [msg]")
for (var/client/C)
if(C.listen_ooc)
if (src.client.holder && (!src.client.stealth || C.holder))
if (src.client.holder.rank == "Admin Observer")
C << "<span class='adminobserverooc'><span class='prefix'>OOC:</span> <EM>[src.key][src.client.stealth ? "/([src.client.fakekey])" : ""]:</EM> <span class='message'>[msg]</span></span>"
else if (src.client.holder.level >= 5)
C << "<font color=[src.client.ooccolor]><b><span class='prefix'>OOC:</span> <EM>[src.key][src.client.stealth ? "/([src.client.fakekey])" : ""]:</EM> <span class='message'>[msg]</span></b></font>"
else
C << "<span class='adminooc'><span class='prefix'>OOC:</span> <EM>[src.key][src.client.stealth ? "/([src.client.fakekey])" : ""]:</EM> <span class='message'>[msg]</span></span>"
else
C << "<span class='ooc'><span class='prefix'>OOC:</span> <EM>[src.client.stealth ? src.client.fakekey : src.key]:</EM> <span class='message'>[msg]</span></span>"