#define ADMINHELP_DELAY 30 // 3 seconds //////////////////////////////// /mob/verb/adminhelp() set category = "Commands" set name = "adminhelp" if (IsGuestKey(src.key)) boutput(src, "You are not authorized to communicate over these channels.") gib(src) return if (client.cloud_available() && client.cloud_get("adminhelp_banner")) boutput(src, "You have been banned from using this command.") return if(src.client.last_adminhelp > (world.timeofday - ADMINHELP_DELAY)) if(abs(world.timeofday - src.client.last_adminhelp) < 1000) // some midnight rollover protection b/c byond is fucking stupid boutput(src, "You must wait [round((src.client.last_adminhelp + ADMINHELP_DELAY - world.timeofday)/10)] seconds before requesting help again.") return var/msg = input("Please enter your help request to admins:") as null|text msg = copytext(html_encode(msg), 1, MAX_MESSAGE_LEN) if (!msg) return if (src.mind) src.mind.karma -= 1 // for_no_raisin(usr, msg) if (src && src.client) src.client.last_adminhelp = world.timeofday for (var/mob/M in mobs) if (M.client && M.client.holder) if (M.client.player_mode && !M.client.player_mode_ahelp) continue else boutput(M, "HELP: [key_name(src,0,0)][(src.real_name ? "/"+src.real_name : "")] : [msg]") #ifdef DATALOGGER game_stats.Increment("adminhelps") game_stats.ScanText(msg) #endif boutput(usr, "HELP: You: [msg]") logTheThing("admin_help", src, null, "HELP: [msg]") logTheThing("diary", src, null, "HELP: [msg]", "ahelp") var/ircmsg[] = new() ircmsg["key"] = src.key ircmsg["name"] = src.real_name ircmsg["msg"] = html_decode(msg) ircbot.export("help", ircmsg) /mob/verb/mentorhelp() set category = "Commands" set name = "mentorhelp" if (IsGuestKey(src.key)) boutput(src, "You are not authorized to communicate over these channels.") gib(src) return if (client.cloud_available() && client.cloud_get("mentorhelp_banner")) boutput(src, "You have been banned from using this command.") return if(src.client.last_adminhelp > (world.timeofday - ADMINHELP_DELAY)) if(abs(world.timeofday - src.client.last_adminhelp) < 1000) // some midnight rollover protection b/c byond is fucking stupid boutput(src, "You must wait [round((src.client.last_adminhelp + ADMINHELP_DELAY - world.timeofday)/10)] seconds before requesting help again.") return var/msg = input("Please enter your help request to mentors:") as null|text msg = copytext(strip_html(msg), 1, MAX_MESSAGE_LEN) if (!msg) return if (usr.client && usr.client.ismuted()) return src.client.last_adminhelp = world.timeofday for (var/mob/M in mobs) if (M.client && M.client.holder) if (M.client.player_mode && !M.client.player_mode_mhelp) continue else boutput(M, "MENTORHELP: [key_name(src,0,0,1)][(src.real_name ? "/"+src.real_name : "")] : [msg]") else if (M.client && M.client.can_see_mentor_pms()) boutput(M, "MENTORHELP: [key_name(src,0,0,1)]: [msg]") boutput(usr, "MENTORHELP: You: [msg]") logTheThing("mentor_help", src, null, "MENTORHELP: [msg]") logTheThing("diary", src, null, "MENTORHELP: [msg]", "mhelp") var/ircmsg[] = new() ircmsg["key"] = src.key ircmsg["name"] = src.real_name ircmsg["msg"] = html_decode(msg) ircbot.export("mentorhelp", ircmsg) /mob/living/verb/pray() set category = "Commands" set name = "pray" set desc = "Attempt to gain the attention of a divine being. Note that it's not necessarily the kind of attention you want." if (IsGuestKey(src.key)) boutput(src, "You are not authorized to communicate over these channels.") gib(src) return if(src.client.last_adminhelp > (world.timeofday - ADMINHELP_DELAY)) if(abs(world.timeofday - src.client.last_adminhelp) < 1000) // some midnight rollover protection b/c byond is fucking stupid boutput(src, "You must wait [round((src.client.last_adminhelp + ADMINHELP_DELAY - world.timeofday)/10)] seconds before requesting help again.") return var/msg = input("Please enter your prayer to any gods that may be listening - be careful what you wish for as the gods may be the vengeful sort!") as null|text msg = copytext(strip_html(msg), 1, MAX_MESSAGE_LEN) if (!msg) return if (src.mind) src.mind.karma -= 1 src.client.last_adminhelp = world.timeofday boutput(src, "You whisper a silent prayer, \"[msg]\"") logTheThing("admin_help", src, null, "PRAYER: [msg]") logTheThing("diary", src, null, "PRAYER: [msg]", "ahelp") for (var/mob/M in mobs) if (M.client && M.client.holder) if (!M.client.holder.hear_prayers || (M.client.player_mode == 1 && M.client.player_mode_ahelp == 0)) //XOR for admin prayer setting and player mode w/ no ahelps continue else boutput(M, "PRAYER: [usr.key] / [usr.real_name ? usr.real_name : usr.name] : [msg]") /proc/do_admin_pm(var/C, var/mob/user) //C is a passed ckey var/mob/M = whois_ckey_to_mob_reference(C) if(M) if (!( ismob(M) )) return if (!user || !user.client) return if (!user.client.holder && !(M.client && M.client.holder)) return var/t = input("Message:", text("Private message to [admin_key(M.client, 1)]")) as null|text if(!(user && user.client && user.client.holder && user.client.holder.rank in list("Host", "Coder"))) t = copytext(html_encode(t), 1, MAX_MESSAGE_LEN) if (!( t )) return if (user.client.holder) // Sender is admin boutput(M, {"
Admin PM from [key_name(user, 0, 0)]
[t]
< Click to Reply >
"}) M << sound('sound/misc/adminhelp.ogg', volume=100, wait=0) boutput(user, "Admin PM to-[key_name(M, 0, 0)][(M.real_name ? "/"+M.real_name : "")] : [t]") else // Sender is not admin if (M.client && M.client.holder) // But recipient is boutput(M, "Reply PM from-[key_name(user, 0, 0)][(user.real_name ? "/"+user.real_name : "")] : [t]") M << sound('sound/misc/adminhelp.ogg', volume=100, wait=0) else boutput(M, "Reply PM from-[key_name(user, 0, 0)]: [t]") M << sound('sound/misc/adminhelp.ogg', volume=100, wait=0) boutput(user, "Reply PM to-[key_name(M, 0, 0)]: [t]") logTheThing("admin_help", user, M, "PM'd %target%: [t]") logTheThing("diary", user, M, "PM'd %target%: [t]", "ahelp") var/ircmsg[] = new() ircmsg["key"] = user && user.client ? user.client.key : "" ircmsg["name"] = user.real_name ircmsg["key2"] = (M != null && M.client != null && M.client.key != null) ? M.client.key : "" ircmsg["name2"] = (M != null && M.real_name != null) ? M.real_name : "" ircmsg["msg"] = html_decode(t) ircbot.export("pm", ircmsg) //we don't use message_admins here because the sender/receiver might get it too for (var/mob/K in mobs) if(K && K.client && K.client.holder && K.key != user.key && (M && K.key != M.key)) if (K.client.player_mode && !K.client.player_mode_ahelp) continue else boutput(K, "PM: [key_name(user,0,0)][(user.real_name ? "/"+user.real_name : "")] [key_name(M,0,0)][(M.real_name ? "/"+M.real_name : "")] : [t]")