From 50fe648a9102a092f12ce15c659a84afeb5d35b0 Mon Sep 17 00:00:00 2001 From: "elly1989@rocketmail.com" Date: Fri, 2 Nov 2012 10:23:04 +0000 Subject: [PATCH] Admin ranks now use bitfields for permissions. Rather than checking the name of the rank, adminverbs will now check holder.rights to see if it has certain bits turned on. SERVER HOSTS: This commit replaces the existing admin-rank system. It is now more customizable. Admin.txt essentially works the same as it always has. Each line should look like: ckey - admin rank There is now however, an admin_ranks.txt. This textfile allows you to define ranks like so: admin rank +ADMIN +FUN +BUILD the +KEYWORD are flags adding permissions to that rank. There are brief descriptions in the text-file explaining what they do. You can now name the ranks anything you like, and give them the permissions you want them to have. This allows, for instance, ranks like: Game Admin on disciplinary +ADMIN +BAN This would give that game admin only the tools they need to admin. They would not have access to 'fun' verbs which control events and antags. There's lots of things you can do. For instance, a coder rank whom can debug stuff but cannot do admin tasks: Codermin +DEBUG +VAREDIT +SERVER There's lots you can do. As it evolves it will hopefully become more flexible. admin_ranks.txt defaults to use the old admin rank names. Apologies in advance as there will be a lot of anomalies, such as ranks losing verbs they once had. Please let me know about any problems. I can fix them quite easily simply by moving verbs between the lists or splitting the lists up into new flags. CODERS: There is now a check_rights(flags) proc. It check is usr is and admin and has -at least one of- the rights specified. It checks > usr < not src, so keep that in mind! If you need to check if something other than usr has specific tights, you can do if(holder.rights & R_ADMIN) etc. KNOWN ISSUES: +FUN probably needs to be split up into +MOBS and +EVENTS In-game promotion/demotion is currently disabled. It will be readded after everything else works ok. Erro's sql rights changes stuff is currently commented out. It will be re-added. There are still many many verbs which need updating. Apologies in advance for any inconvenience. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4991 316c924e-a436-60f5-8080-3fe189b3f50e --- code/WorkInProgress/buildmode.dm | 4 +- code/__HELPERS/type2type.dm | 16 + code/controllers/voting.dm | 2 +- code/datums/datumvars.dm | 621 ++-- code/datums/mind.dm | 20 +- .../gamemodes/events/holidays/Holidays.dm | 6 +- code/game/verbs/ooc.dm | 64 +- code/game/verbs/who.dm | 2 +- code/global.dm | 41 +- code/modules/admin/admin.dm | 324 +- code/modules/admin/admin_memo.dm | 15 +- code/modules/admin/admin_ranks.dm | 142 + code/modules/admin/admin_verbs.dm | 782 ++--- code/modules/admin/holder2.dm | 2683 +---------------- code/modules/admin/topic.dm | 2348 +++++++++++++++ code/modules/admin/verbs/adminpm.dm | 14 +- code/modules/admin/verbs/adminsay.dm | 30 +- code/modules/admin/verbs/debug.dm | 23 +- code/modules/admin/verbs/diagnostics.dm | 30 +- code/modules/admin/verbs/massmodvar.dm | 18 +- code/modules/admin/verbs/modifyvariables.dm | 32 +- code/modules/admin/verbs/playsound.dm | 41 +- code/modules/admin/verbs/randomverbs.dm | 12 +- code/modules/admin/verbs/ticklag.dm | 34 +- code/modules/client/client procs.dm | 5 +- code/modules/mob/login.dm | 4 - code/modules/mob/mob.dm | 8 +- code/modules/mob/new_player/preferences.dm | 4 +- code/stylesheet.dm | 2 + code/world.dm | 80 +- config/admin_ranks.txt | 39 + config/admins.txt | 7 + tgstation.dme | 285 +- 33 files changed, 3495 insertions(+), 4243 deletions(-) create mode 100644 code/modules/admin/admin_ranks.dm create mode 100644 code/modules/admin/topic.dm create mode 100644 config/admin_ranks.txt diff --git a/code/WorkInProgress/buildmode.dm b/code/WorkInProgress/buildmode.dm index 0c42c913d50..7bfafa80c59 100644 --- a/code/WorkInProgress/buildmode.dm +++ b/code/WorkInProgress/buildmode.dm @@ -149,13 +149,13 @@ if(objholder in removed_paths) alert("That path is not allowed.") objholder = "/obj/structure/closet" - else if (dd_hasprefix(objholder, "/mob") && !(usr.client.holder.rank in list("Game Master", "Game Admin", "Badmin"))) + else if (dd_hasprefix(objholder, "/mob") && !check_rights(R_DEBUG,0)) objholder = "/obj/structure/closet" if(3) var/list/locked = list("vars", "key", "ckey", "client", "firemut", "ishulk", "telekinesis", "xray", "virus", "viruses", "cuffed", "ka", "last_eaten", "urine") master.buildmode.varholder = input(usr,"Enter variable name:" ,"Name", "name") - if(master.buildmode.varholder in locked && !(usr.client.holder.rank in list("Game Master", "Game Admin"))) + if(master.buildmode.varholder in locked && !check_rights(R_DEBUG,0)) return var/thetype = input(usr,"Select variable type:" ,"Type") in list("text","number","mob-reference","obj-reference","turf-reference") if(!thetype) return diff --git a/code/__HELPERS/type2type.dm b/code/__HELPERS/type2type.dm index 6e9b9912215..901dd8754d7 100644 --- a/code/__HELPERS/type2type.dm +++ b/code/__HELPERS/type2type.dm @@ -247,3 +247,19 @@ proc/tg_list2text(list/list, glue=",") /proc/angle2text(var/degree) return dir2text(angle2dir(degree)) + +//Converts a rights bitfield into a string +/proc/rights2text(rights) + if(rights & R_BUILDMODE) . += "+BUILDMODE" + if(rights & R_ADMIN) . += "+ADMIN" + if(rights & R_BAN) . += "+BAN" + if(rights & R_FUN) . += "+FUN" + if(rights & R_SERVER) . += "+SERVER" + if(rights & R_DEBUG) . += "+DEBUG" + if(rights & R_POSSESS) . += "+POSSESS" + if(rights & R_PERMISSIONS) . += "+PERMISSIONS" + if(rights & R_STEALTH) . += "+STEALTH" + if(rights & R_REJUVINATE) . += "+REJUVINATE" + if(rights & R_VAREDIT) . += "+VAREDIT" + if(rights & R_SOUNDS) . += "+SOUND" + return . \ No newline at end of file diff --git a/code/controllers/voting.dm b/code/controllers/voting.dm index b4c8ac2f892..c03989afb6f 100644 --- a/code/controllers/voting.dm +++ b/code/controllers/voting.dm @@ -170,7 +170,7 @@ datum/controller/vote var/trialmin = 0 if(C.holder) admin = 1 - if (C.holder.level >= 3) + if (C.holder.rights & R_ADMIN) trialmin = 1 voting |= C diff --git a/code/datums/datumvars.dm b/code/datums/datumvars.dm index b53426a4a92..8631b7fbdae 100644 --- a/code/datums/datumvars.dm +++ b/code/datums/datumvars.dm @@ -402,14 +402,18 @@ client //This should all be moved over to datum/admins/Topic() or something ~Carn if( (usr.client == src) && src.holder ) . = 1 //default return - if (href_list["Vars"]) + if(href_list["Vars"]) debug_variables(locate(href_list["Vars"])) //~CARN: for renaming mobs (updates their name, real_name, mind.name, their ID/PDA and datacore records). - else if (href_list["rename"]) + else if(href_list["rename"]) + if(!check_rights(0)) return + var/mob/M = locate(href_list["rename"]) - if(!istype(M)) return - if(!admin_rank_check(src.holder.level, 3)) return + if(!istype(M)) + usr << "This can only be used on instances of type /mob" + return + var/new_name = copytext(sanitize(input(usr,"What would you like to name this mob?","Input a name",M.real_name) as text|null),1,MAX_NAME_LEN) if( !new_name || !M ) return @@ -417,431 +421,370 @@ client M.fully_replace_character_name(M.real_name,new_name) href_list["datumrefresh"] = href_list["rename"] - else if (href_list["varnameedit"]) - if(!href_list["datumedit"] || !href_list["varnameedit"]) - usr << "Varedit error: Not all information has been sent. Contact a coder." - return - var/DAT = locate(href_list["datumedit"]) - if(!DAT) - usr << "Item not found" - return - if(!istype(DAT,/datum) && !istype(DAT,/client)) - usr << "Can't edit an item of this type. Type must be /datum or /client, so anything except simple variables." - return - modify_variables(DAT, href_list["varnameedit"], 1) - else if (href_list["varnamechange"]) - if(!href_list["datumchange"] || !href_list["varnamechange"]) - usr << "Varedit error: Not all information has been sent. Contact a coder." - return - var/DAT = locate(href_list["datumchange"]) - if(!DAT) - usr << "Item not found" - return - if(!istype(DAT,/datum) && !istype(DAT,/client)) - usr << "Can't edit an item of this type. Type must be /datum or /client, so anything except simple variables." - return - modify_variables(DAT, href_list["varnamechange"], 0) - else if (href_list["varnamemass"]) - if(!href_list["datummass"] || !href_list["varnamemass"]) - usr << "Varedit error: Not all information has been sent. Contact a coder." - return - var/atom/A = locate(href_list["datummass"]) - if(!A) - usr << "Item not found" - return - if(!istype(A,/atom)) - usr << "Can't mass edit an item of this type. Type must be /atom, so an object, turf, mob or area. You cannot mass edit clients!" - return - cmd_mass_modify_object_variables(A, href_list["varnamemass"]) - else if (href_list["mob_player_panel"]) - if(!href_list["mob_player_panel"]) - return - var/mob/MOB = locate(href_list["mob_player_panel"]) - if(!MOB) - return - if(!ismob(MOB)) - return - if(!src.holder) - return - src.holder.show_player_panel(MOB) - href_list["datumrefresh"] = href_list["mob_player_panel"] - else if (href_list["give_spell"]) - if(!href_list["give_spell"]) - return - var/mob/MOB = locate(href_list["give_spell"]) - if(!MOB) - return - if(!ismob(MOB)) - return - if(!src.holder) - return - if(!admin_rank_check(src.holder.level, 3)) return - src.give_spell(MOB) - href_list["datumrefresh"] = href_list["give_spell"] - else if (href_list["give_disease"]) - if(!href_list["give_disease"]) - return - var/mob/MOB = locate(href_list["give_disease"]) - if(!MOB) - return - if(!ismob(MOB)) - return - if(!src.holder) - return - if(!admin_rank_check(src.holder.level, 3)) return - src.give_disease(MOB) - href_list["datumrefresh"] = href_list["give_spell"] - else if (href_list["ninja"]) - if(!href_list["ninja"]) - return - var/mob/MOB = locate(href_list["ninja"]) - if(!MOB) - return - if(!ismob(MOB)) - return - if(!src.holder) - return - if(!admin_rank_check(src.holder.level, 3)) return - src.cmd_admin_ninjafy(MOB) - href_list["datumrefresh"] = href_list["ninja"] - else if (href_list["godmode"]) - if(!href_list["godmode"]) - return - var/mob/MOB = locate(href_list["godmode"]) - if(!MOB) - return - if(!ismob(MOB)) - return - if(!src.holder) - return - if(!admin_rank_check(src.holder.level, 3)) return - src.cmd_admin_godmode(MOB) - href_list["datumrefresh"] = href_list["godmode"] - else if (href_list["gib"]) - if(!href_list["gib"]) - return - var/mob/MOB = locate(href_list["gib"]) - if(!MOB) - return - if(!ismob(MOB)) - return - if(!src.holder) - return - if(!admin_rank_check(src.holder.level, 3)) return - src.cmd_admin_gib(MOB) + else if(href_list["varnameedit"] && href_list["datumedit"]) + if(!check_rights(0)) return - else if (href_list["build_mode"]) - if(!href_list["build_mode"]) + var/D = locate(href_list["datumedit"]) + if(!istype(D,/datum) && !istype(D,/client)) + usr << "This can only be used on instances of types /client or /datum" return - var/mob/MOB = locate(href_list["build_mode"]) - if(!MOB) + + modify_variables(D, href_list["varnameedit"], 1) + + else if(href_list["varnamechange"] && href_list["datumchange"]) + if(!check_rights(0)) return + + var/D = locate(href_list["datumchange"]) + if(!istype(D,/datum) && !istype(D,/client)) + usr << "This can only be used on instances of types /client or /datum" return - if(!ismob(MOB)) + + modify_variables(D, href_list["varnamechange"], 0) + + else if(href_list["varnamemass"] && href_list["datummass"]) + if(!check_rights(0)) return + + var/atom/A = locate(href_list["datummass"]) + if(!istype(A)) + usr << "This can only be used on instances of type /atom" return - if(!src.holder) + + cmd_mass_modify_object_variables(A, href_list["varnamemass"]) + + else if(href_list["mob_player_panel"]) + if(!check_rights(0)) return + + var/mob/M = locate(href_list["mob_player_panel"]) + if(!istype(M)) + usr << "This can only be used on instances of type /mob" return - if(!admin_rank_check(src.holder.level, 3)) return - togglebuildmode(MOB) + + src.holder.show_player_panel(M) + href_list["datumrefresh"] = href_list["mob_player_panel"] + + else if(href_list["give_spell"]) + if(!check_rights(0)) return + + var/mob/M = locate(href_list["give_spell"]) + if(!istype(M)) + usr << "This can only be used on instances of type /mob" + return + + src.give_spell(M) + href_list["datumrefresh"] = href_list["give_spell"] + + else if(href_list["give_disease"]) + if(!check_rights(0)) return + + var/mob/M = locate(href_list["give_disease"]) + if(!istype(M)) + usr << "This can only be used on instances of type /mob" + return + + src.give_disease(M) + href_list["datumrefresh"] = href_list["give_spell"] + + else if(href_list["ninja"]) + if(!check_rights(0)) return + + var/mob/M = locate(href_list["ninja"]) + if(!istype(M)) + usr << "This can only be used on instances of type /mob" + return + + src.cmd_admin_ninjafy(M) + href_list["datumrefresh"] = href_list["ninja"] + + else if(href_list["godmode"]) + if(!check_rights(0)) return + + var/mob/M = locate(href_list["godmode"]) + if(!istype(M)) + usr << "This can only be used on instances of type /mob" + return + + src.cmd_admin_godmode(M) + href_list["datumrefresh"] = href_list["godmode"] + + else if(href_list["gib"]) + if(!check_rights(0)) return + + var/mob/M = locate(href_list["gib"]) + if(!istype(M)) + usr << "This can only be used on instances of type /mob" + return + + src.cmd_admin_gib(M) + + else if(href_list["build_mode"]) + if(!check_rights(0)) return + + var/mob/M = locate(href_list["build_mode"]) + if(!istype(M)) + usr << "This can only be used on instances of type /mob" + return + + togglebuildmode(M) href_list["datumrefresh"] = href_list["build_mode"] - else if (href_list["drop_everything"]) - if(!href_list["drop_everything"]) - return - var/mob/MOB = locate(href_list["drop_everything"]) - if(!MOB) - return - if(!ismob(MOB)) - return - if(!src.holder) + else if(href_list["drop_everything"]) + if(!check_rights(0)) return + + var/mob/M = locate(href_list["drop_everything"]) + if(!istype(M)) + usr << "This can only be used on instances of type /mob" return if(usr.client) - if(!admin_rank_check(src.holder.level, 3)) return - usr.client.cmd_admin_drop_everything(MOB) + usr.client.cmd_admin_drop_everything(M) - else if (href_list["direct_control"]) - if(!href_list["direct_control"]) - return - var/mob/MOB = locate(href_list["direct_control"]) - if(!MOB) - return - if(!ismob(MOB)) - return - if(!src.holder) + else if(href_list["direct_control"]) + if(!check_rights(0)) return + + var/mob/M = locate(href_list["direct_control"]) + if(!istype(M)) + usr << "This can only be used on instances of type /mob" return if(usr.client) - if(!admin_rank_check(src.holder.level, 3)) return - usr.client.cmd_assume_direct_control(MOB) + usr.client.cmd_assume_direct_control(M) - else if (href_list["make_skeleton"]) - if(!href_list["make_skeleton"]) - return - var/mob/MOB = locate(href_list["make_skeleton"]) - if(!MOB) - return - if(!ismob(MOB)) - return - if(!src.holder) + else if(href_list["make_skeleton"]) + if(!check_rights(0)) return + + var/mob/living/carbon/human/H = locate(href_list["make_skeleton"]) + if(!istype(H)) + usr << "This can only be used on instances of type /mob/living/carbon/human" return - if(ishuman(MOB)) - if(!admin_rank_check(src.holder.level, 3)) return - var/mob/living/carbon/human/HUMANMOB = MOB - HUMANMOB.makeSkeleton() + H.makeSkeleton() + href_list["datumrefresh"] = href_list["make_skeleton"] - else if (href_list["delall"]) - if(!href_list["delall"]) + else if(href_list["delall"]) + if(!check_rights(0)) return + + var/obj/O = locate(href_list["delall"]) + if(!isobj(O)) + usr << "This can only be used on instances of type /obj" return - var/atom/A = locate(href_list["delall"]) - if(!admin_rank_check(src.holder.level, 3)) return - if(!A) + + var/action_type = alert("Strict type ([O.type]) or type and all subtypes?",,"Strict type","Type and subtypes","Cancel") + if(action_type == "Cancel" || !action_type) return - if(!isobj(A)) - usr << "This can only be used on objects (of type /obj)" - return - if(!A.type) - return - var/action_type = alert("Strict type ([A.type]) or type and all subtypes?",,"Strict type","Type and subtypes","Cancel") - if(!action_type || action_type == "Cancel") - return - if(alert("Are you really sure you want to delete all objects of type [A.type]?",,"Yes","No") != "Yes") + + if(alert("Are you really sure you want to delete all objects of type [O.type]?",,"Yes","No") != "Yes") return + if(alert("Second confirmation required. Delete?",,"Yes","No") != "Yes") return - var/a_type = A.type - if(action_type == "Strict type") - var/i = 0 - for(var/obj/O in world) - if(O.type == a_type) - i++ - del(O) - if(!i) - usr << "No objects of this type exist" - return - log_admin("[key_name(usr)] deleted all objects of scrict type [a_type] ([i] objects deleted) ") - message_admins("\blue [key_name(usr)] deleted all objects of scrict type [a_type] ([i] objects deleted) ", 1) - else if(action_type == "Type and subtypes") - var/i = 0 - for(var/obj/O in world) - if(istype(O,a_type)) - i++ - del(O) - if(!i) - usr << "No objects of this type exist" - return - log_admin("[key_name(usr)] deleted all objects of scrict type with subtypes [a_type] ([i] objects deleted) ") - message_admins("\blue [key_name(usr)] deleted all objects of type with subtypes [a_type] ([i] objects deleted) ", 1) - else if (href_list["explode"]) - if(!href_list["explode"]) - return + var/O_type = O.type + switch(action_type) + if("Strict type") + var/i = 0 + for(var/obj/Obj in world) + if(Obj.type == O_type) + i++ + del(Obj) + if(!i) + usr << "No objects of this type exist" + return + log_admin("[key_name(usr)] deleted all objects of type [O_type] ([i] objects deleted) ") + message_admins("\blue [key_name(usr)] deleted all objects of type [O_type] ([i] objects deleted) ", 1) + if("Type and subtypes") + var/i = 0 + for(var/obj/Obj in world) + if(istype(Obj,O_type)) + i++ + del(Obj) + if(!i) + usr << "No objects of this type exist" + return + log_admin("[key_name(usr)] deleted all objects of type or subtype of [O_type] ([i] objects deleted) ") + message_admins("\blue [key_name(usr)] deleted all objects of type or subtype of [O_type] ([i] objects deleted) ", 1) + + else if(href_list["explode"]) + if(!check_rights(0)) return + var/atom/A = locate(href_list["explode"]) - if(!A) - return if(!isobj(A) && !ismob(A) && !isturf(A)) + usr << "This can only be done to instances of type /obj, /mob and /turf" return - if(!admin_rank_check(src.holder.level, 3)) return + src.cmd_admin_explosion(A) href_list["datumrefresh"] = href_list["explode"] - else if (href_list["emp"]) - if(!href_list["emp"]) - return + + else if(href_list["emp"]) + if(!check_rights(0)) return + var/atom/A = locate(href_list["emp"]) - if(!A) - return if(!isobj(A) && !ismob(A) && !isturf(A)) + usr << "This can only be done to instances of type /obj, /mob and /turf" return - if(!admin_rank_check(src.holder.level, 3)) return + src.cmd_admin_emp(A) href_list["datumrefresh"] = href_list["emp"] - else if (href_list["mark_object"]) - if(!href_list["mark_object"]) - return + + else if(href_list["mark_object"]) + if(!check_rights(0)) return + var/datum/D = locate(href_list["mark_object"]) - if(!D) + if(!istype(D)) + usr << "This can only be done to instances of type /datum" return - if(!src.holder) - return - if(!admin_rank_check(src.holder.level, 3)) return + src.holder.marked_datum = D href_list["datumrefresh"] = href_list["mark_object"] - else if (href_list["rotatedatum"]) - if(!admin_rank_check(src.holder.level, 3)) return - if(!href_list["rotatedir"]) - return + + else if(href_list["rotatedatum"]) + if(!check_rights(0)) return + var/atom/A = locate(href_list["rotatedatum"]) - if(!A) - return - if(!istype(A,/atom)) - usr << "This can only be done to objects of type /atom" - return - if(!src.holder) + if(!istype(A)) + usr << "This can only be done to instances of type /atom" return + switch(href_list["rotatedir"]) - if("right") - A.dir = turn(A.dir, -45) - if("left") - A.dir = turn(A.dir, 45) + if("right") A.dir = turn(A.dir, -45) + if("left") A.dir = turn(A.dir, 45) href_list["datumrefresh"] = href_list["rotatedatum"] - else if (href_list["makemonkey"]) - var/mob/M = locate(href_list["makemonkey"]) - if(!M) + + else if(href_list["makemonkey"]) + if(!check_rights(0)) return + + var/mob/living/carbon/human/H = locate(href_list["makemonkey"]) + if(!istype(H)) + usr << "This can only be done to instances of type /mob/living/carbon/human" return - if(!admin_rank_check(src.holder.level, 3)) return - if(!ishuman(M)) - usr << "This can only be done to objects of type /mob/living/carbon/human" - return - if(!src.holder) - usr << "You are not an administrator." - return - var/action_type = alert("Confirm mob type change?",,"Transform","Cancel") - if(!action_type || action_type == "Cancel") - return - if(!M) + + if(alert("Confirm mob type change?",,"Transform","Cancel") != "Transform") return + if(!H) usr << "Mob doesn't exist anymore" return holder.Topic(href, list("monkeyone"=href_list["makemonkey"])) - else if (href_list["makerobot"]) - var/mob/M = locate(href_list["makerobot"]) - if(!M) + + else if(href_list["makerobot"]) + if(!check_rights(0)) return + + var/mob/living/carbon/human/H = locate(href_list["makerobot"]) + if(!istype(H)) + usr << "This can only be done to instances of type /mob/living/carbon/human" return - if(!admin_rank_check(src.holder.level, 3)) return - if(!ishuman(M)) - usr << "This can only be done to objects of type /mob/living/carbon/human" - return - if(!src.holder) - usr << "You are not an administrator." - return - var/action_type = alert("Confirm mob type change?",,"Transform","Cancel") - if(!action_type || action_type == "Cancel") - return - if(!M) + + if(alert("Confirm mob type change?",,"Transform","Cancel") != "Transform") return + if(!H) usr << "Mob doesn't exist anymore" return holder.Topic(href, list("makerobot"=href_list["makerobot"])) - else if (href_list["makealien"]) - var/mob/M = locate(href_list["makealien"]) - if(!M) + + else if(href_list["makealien"]) + if(!check_rights(0)) return + + var/mob/living/carbon/human/H = locate(href_list["makealien"]) + if(!istype(H)) + usr << "This can only be done to instances of type /mob/living/carbon/human" return - if(!admin_rank_check(src.holder.level, 3)) return - if(!ishuman(M)) - usr << "This can only be done to objects of type /mob/living/carbon/human" - return - if(!src.holder) - usr << "You are not an administrator." - return - var/action_type = alert("Confirm mob type change?",,"Transform","Cancel") - if(!action_type || action_type == "Cancel") - return - if(!M) + + if(alert("Confirm mob type change?",,"Transform","Cancel") != "Transform") return + if(!H) usr << "Mob doesn't exist anymore" return holder.Topic(href, list("makealien"=href_list["makealien"])) - else if (href_list["makemetroid"]) - var/mob/M = locate(href_list["makemetroid"]) - if(!M) + + else if(href_list["makemetroid"]) + if(!check_rights(0)) return + + var/mob/living/carbon/human/H = locate(href_list["makemetroid"]) + if(!istype(H)) + usr << "This can only be done to instances of type /mob/living/carbon/human" return - if(!admin_rank_check(src.holder.level, 3)) return - if(!ishuman(M)) - usr << "This can only be done to objects of type /mob/living/carbon/human" - return - if(!src.holder) - usr << "You are not an administrator." - return - var/action_type = alert("Confirm mob type change?",,"Transform","Cancel") - if(!action_type || action_type == "Cancel") - return - if(!M) + + if(alert("Confirm mob type change?",,"Transform","Cancel") != "Transform") return + if(!H) usr << "Mob doesn't exist anymore" return holder.Topic(href, list("makemetroid"=href_list["makemetroid"])) - else if (href_list["makeai"]) - var/mob/M = locate(href_list["makeai"]) - if(!M) + + else if(href_list["makeai"]) + if(!check_rights(0)) return + + var/mob/living/carbon/human/H = locate(href_list["makeai"]) + if(!istype(H)) + usr << "This can only be done to instances of type /mob/living/carbon/human" return - if(!admin_rank_check(src.holder.level, 3)) return - if(!ishuman(M)) - usr << "This can only be done to objects of type /mob/living/carbon/human" - return - if(!src.holder) - usr << "You are not an administrator." - return - var/action_type = alert("Confirm mob type change?",,"Transform","Cancel") - if(!action_type || action_type == "Cancel") - return - if(!M) + + if(alert("Confirm mob type change?",,"Transform","Cancel") != "Transform") return + if(!H) usr << "Mob doesn't exist anymore" return holder.Topic(href, list("makeai"=href_list["makeai"])) - else if (href_list["setmutantrace"]) + + else if(href_list["setmutantrace"]) + if(!check_rights(0)) return + var/mob/living/carbon/human/H = locate(href_list["setmutantrace"]) - if(!admin_rank_check(src.holder.level, 3)) return if(!istype(H)) - usr << "This can only be done to objects of type /mob/living/carbon/human" - return - if(!src.holder) - usr << "You are not an administrator." + usr << "This can only be done to instances of type /mob/living/carbon/human" return + var/new_mutantrace = input("Please choose a new mutantrace","Mutantrace",null) as null|anything in list("NONE","golem","lizard","metroid","plant") switch(new_mutantrace) if(null) return if("NONE") new_mutantrace = "" - if(!H || !istype(H)) + if(!H) usr << "Mob doesn't exist anymore" return if(H.dna) H.dna.mutantrace = new_mutantrace H.update_mutantrace() - else if (href_list["regenerateicons"]) + + else if(href_list["regenerateicons"]) + if(!check_rights(0)) return + var/mob/M = locate(href_list["regenerateicons"]) - if(!admin_rank_check(src.holder.level, 3)) return - if(!istype(M)) - usr << "This can only be done to objects of type /mob" - return - if(!src.holder) - usr << "You are not an administrator." + if(!ismob(M)) + usr << "This can only be done to instances of type /mob" return M.regenerate_icons() - else if (href_list["adjustDamage"] && href_list["mobToDamage"]) - var/mob/M = locate(href_list["mobToDamage"]) - var/Text = locate(href_list["adjustDamage"]) - if(!isliving(M)) return - var/mob/living/L = M + else if(href_list["adjustDamage"] && href_list["mobToDamage"]) + if(!check_rights(0)) return - if(!admin_rank_check(src.holder.level, 3)) return + var/mob/living/L = locate(href_list["mobToDamage"]) + if(!istype(L)) return + + var/Text = href_list["adjustDamage"] var/amount = input("Deal how much damage to mob? (Negative values here heal)","Adjust [Text]loss",0) as num - if(Text == "brute") - L.adjustBruteLoss(amount) - else if(Text == "fire") - L.adjustFireLoss(amount) - else if(Text == "toxin") - L.adjustToxLoss(amount) - else if(Text == "oxygen") - L.adjustOxyLoss(amount) - else if(Text == "brain") - L.adjustBrainLoss(amount) - else if(Text == "clone") - L.adjustCloneLoss(amount) - else - usr << "You caused an error. DEBUG: Text:[Text] Mob:[M]" + + if(!L) + usr << "Mob doesn't exist anymore" return + switch(Text) + if("brute") L.adjustBruteLoss(amount) + if("fire") L.adjustFireLoss(amount) + if("toxin") L.adjustToxLoss(amount) + if("oxygen")L.adjustOxyLoss(amount) + if("brain") L.adjustBrainLoss(amount) + if("clone") L.adjustCloneLoss(amount) + else + usr << "You caused an error. DEBUG: Text:[Text] Mob:[L]" + return + if(amount != 0) - log_admin("[key_name(usr)] dealt [amount] amount of [Text] damage to [M] ") - message_admins("\blue [key_name(usr)] dealt [amount] amount of [Text] damage to [M] ", 1) + log_admin("[key_name(usr)] dealt [amount] amount of [Text] damage to [L] ") + message_admins("\blue [key_name(usr)] dealt [amount] amount of [Text] damage to [L] ", 1) href_list["datumrefresh"] = href_list["mobToDamage"] else . = 0 - if (href_list["datumrefresh"]) + + if(href_list["datumrefresh"]) var/datum/DAT = locate(href_list["datumrefresh"]) - if(!DAT) - return - if(!istype(DAT,/datum)) + if(!istype(DAT, /datum)) return src.debug_variables(DAT) . = 1 + return diff --git a/code/datums/mind.dm b/code/datums/mind.dm index 5334f454138..14b191a97b1 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -305,7 +305,7 @@ datum/mind crystals = suplink.uses if (suplink) text += "|take" - if (usr.client.holder.level >= 3) + if (usr.client.holder.rights & R_FUN) text += ", [crystals] crystals" else text += ", [crystals] crystals" @@ -332,17 +332,7 @@ datum/mind usr << browse(out, "window=edit_memory[src]") Topic(href, href_list) - if(!usr || !usr.client) - return - - if(!usr.client.holder) - message_admins("\red [key_name(usr)] tried to access [current]'s mind without authorization.") - log_admin("[key_name(usr)] tried to access [current]'s mind without authorization.") - return - - if (!(usr.client.holder.rank in list("Trial Admin", "Badmin", "Game Admin", "Game Master"))) - alert("You cannot perform this action. You must be of a higher administrative rank!") - return + if(!check_rights(R_ADMIN)) return if (href_list["role_edit"]) var/new_role = input("Select new role", "Assigned role", assigned_role) as null|anything in get_all_jobs() @@ -754,7 +744,7 @@ datum/mind return switch(href_list["monkey"]) if("healthy") - if (usr.client.holder.level >= 3) + if (usr.client.holder.rights & R_ADMIN) var/mob/living/carbon/human/H = current var/mob/living/carbon/monkey/M = current if (istype(H)) @@ -769,7 +759,7 @@ datum/mind D.cure(0) sleep(0) //because deleting of virus is done through spawn(0) if("infected") - if (usr.client.holder.level >= 3) + if (usr.client.holder.rights & R_ADMIN) var/mob/living/carbon/human/H = current var/mob/living/carbon/monkey/M = current if (istype(H)) @@ -873,7 +863,7 @@ datum/mind take_uplink() memory = null//Remove any memory they may have had. if("crystals") - if (usr.client.holder.level >= 3) + if (usr.client.holder.rights & R_FUN) var/obj/item/device/uplink/hidden/suplink = find_syndicate_uplink() var/crystals if (suplink) diff --git a/code/game/gamemodes/events/holidays/Holidays.dm b/code/game/gamemodes/events/holidays/Holidays.dm index beeecc28bf0..eed0a083324 100644 --- a/code/game/gamemodes/events/holidays/Holidays.dm +++ b/code/game/gamemodes/events/holidays/Holidays.dm @@ -118,13 +118,9 @@ var/global/Holiday = null set name = ".Set Holiday" set category = "Fun" set desc = "Force-set the Holiday variable to make the game think it's a certain day." - - if( !holder || !(holder.rank in list("Game Master","Game Admin")) ) - src << "Error: Set_Holiday: You hold insufficient rank to perform this action." - return + if(!check_rights(R_SERVER)) return if(!T) return - Holiday = T //get a new station name station_name = null diff --git a/code/game/verbs/ooc.dm b/code/game/verbs/ooc.dm index db744a1450c..e7d95e70319 100644 --- a/code/game/verbs/ooc.dm +++ b/code/game/verbs/ooc.dm @@ -9,53 +9,55 @@ else src << "\blue You are no longer listening to messages on the OOC channel." -/mob/verb/ooc(msg as text) +/client/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)) + + if(!mob) return + + if(IsGuestKey(key)) src << "Guests may not use OOC." return + msg = copytext(sanitize(msg), 1, MAX_MESSAGE_LEN) - if(!msg) - return - else if (!src.client.listen_ooc) + if(!msg) return + + if(!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 & MUTE_OOC) + + if(!holder) + if(!ooc_allowed) + src << "\red OOC is globally muted" + return + if(!dooc_allowed && deadchat != 0) + usr << "\red OOC for dead mobs has been turned off." + return + if(muted & MUTE_OOC) src << "\red You cannot use OOC (muted)." return - - if (src.client.handle_spam_prevention(msg,MUTE_OOC)) + if(handle_spam_prevention(msg,MUTE_OOC)) + return + if(findtext(msg, "byond://")) + src << "Advertising other servers is not allowed." + 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 - else if (findtext(msg, "byond://") && !src.client.holder) - src << "Advertising other servers is not allowed." - 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]") + log_ooc("[mob.name]/[key] : [msg]") - for (var/client/C) + for(var/client/C in clients) if(C.listen_ooc) - if (src.client.holder) - if(!src.client.holder.fakekey || C.holder) - if (src.client.holder.rank == "Admin Observer") - C << "OOC: [src.key][src.client.holder.fakekey ? "/([src.client.holder.fakekey])" : ""]: [msg]" - else if (src.client.holder.level >= 5) - C << "OOC: [src.key][src.client.holder.fakekey ? "/([src.client.holder.fakekey])" : ""]: [msg]" + if(holder) + if(!holder.fakekey || C.holder) + if(holder.rights & R_ADMIN) + C << "OOC: [key][holder.fakekey ? "/([holder.fakekey])" : ""]: [msg]" else - C << "OOC: [src.key][src.client.holder.fakekey ? "/([src.client.holder.fakekey])" : ""]: [msg]" + C << "OOC: [key][holder.fakekey ? "/([holder.fakekey])" : ""]: [msg]" else - C << "OOC: [src.client.holder.fakekey ? src.client.holder.fakekey : src.key]: [msg]" + C << "OOC: [holder.fakekey ? holder.fakekey : key]: [msg]" else - C << "OOC: [src.key]: [msg]" + C << "OOC: [key]: [msg]" var/global/normal_ooc_colour = "#002eb8" diff --git a/code/game/verbs/who.dm b/code/game/verbs/who.dm index 4c88dd127df..33c704545ab 100644 --- a/code/game/verbs/who.dm +++ b/code/game/verbs/who.dm @@ -7,7 +7,7 @@ var/list/Lines = list() - if(holder && holder.level >= 0) //Everything above admin-observers get this. + if(holder) for(var/client/C in clients) var/entry = "\t[C.key]" if(C.holder && C.holder.fakekey) diff --git a/code/global.dm b/code/global.dm index 3b17a71a811..1a34271d93c 100644 --- a/code/global.dm +++ b/code/global.dm @@ -1,3 +1,4 @@ +//#define TESTING //This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31 var/global/obj/effect/datacore/data_core = null @@ -206,29 +207,19 @@ var/forum_authenticated_group = "10" var/fileaccess_timer = 1800 //Cannot access files by ftp until the game is finished setting up and stuff. -#define BUILDMODE 1 -#define ADMIN 2 -#define BAN 4 -#define FUN 8 -#define SERVER 16 -#define ADMDEBUG 32 -#define POSSESS 64 -#define PERMISSIONS 128 -//Keep this list synced with the #defines above -var/global/list/permissionwords = list("BUILDMODE", "ADMIN", "BAN", "FUN", "SERVER", "DEBUG", "POSSESS", "EDITPERMISSIONS") +//Please don't edit these values without speaking to Errorage first ~Carn +//Admin Permissions +#define R_BUILDMODE 1 +#define R_ADMIN 2 +#define R_BAN 4 +#define R_FUN 8 +#define R_SERVER 16 +#define R_DEBUG 32 +#define R_POSSESS 64 +#define R_PERMISSIONS 128 +#define R_STEALTH 256 +#define R_REJUVINATE 512 +#define R_VAREDIT 1024 +#define R_SOUNDS 2048 - - -//Please do not edit these values. The database assigning proper rights relies on this. You can add new values, just don't change existing ones. -//This list is separate from the list used ingame, so that one can be edited with little consequence. This one is tied to the database -//The database admins should be consulted before any edits to this list. -#define SQL_BUILDMODE 1 -#define SQL_ADMIN 2 -#define SQL_BAN 4 -#define SQL_FUN 8 -#define SQL_SERVER 16 -#define SQL_DEBUG 32 -#define SQL_POSSESS 64 -#define SQL_PERMISSIONS 128 -//Same rules apply to this list as to the values above. You can only add stuff to it. -var/global/list/permissionwords_sql = list("BUILDMODE", "ADMIN", "BAN", "FUN", "SERVER", "DEBUG", "POSSESS", "EDITPERMISSIONS") \ No newline at end of file +#define R_HOST 65535 diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index 50295acfb02..b1a46fae1af 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -350,179 +350,128 @@ var/global/floorIsLava = 0 /datum/admins/proc/Jobbans() + if(!check_rights(R_BAN)) return - if ((src.rank in list( "Game Admin", "Game Master" ))) - var/dat = "Job Bans!
" - for(var/t in jobban_keylist) - var/r = t - if( findtext(r,"##") ) - r = copytext( r, 1, findtext(r,"##") )//removes the description - dat += text("") - dat += "
[t] (unban)
" - usr << browse(dat, "window=ban;size=400x400") + var/dat = "Job Bans!
" + for(var/t in jobban_keylist) + var/r = t + if( findtext(r,"##") ) + r = copytext( r, 1, findtext(r,"##") )//removes the description + dat += text("") + dat += "
[t] (unban)
" + usr << browse(dat, "window=ban;size=400x400") /datum/admins/proc/Game() - - var/dat - var/lvl = 0 - switch(src.rank) - if("Moderator") - lvl = 1 - if("Temporary Admin") - lvl = 2 - if("Admin Candidate") - lvl = 3 - if("Trial Admin") - lvl = 4 - if("Badmin") - lvl = 5 - if("Game Admin") - lvl = 6 - if("Game Master") - lvl = 7 - - dat += "
Game Panel

\n" - - if(lvl > 0) - -// if(lvl >= 2 ) - dat += "Change Game Mode
" - - if(lvl > 0 && master_mode == "secret") - dat += "(Force Secret Mode)
" - - dat += "
" - - if(lvl >= 3 ) - dat += "Create Object
" - dat += "Quick Create Object
" - dat += "Create Turf
" - if(lvl >= 5) - dat += "Create Mob
" -// if(lvl == 6 ) - usr << browse(dat, "window=admin2;size=210x180") - return -/* -/datum/admins/proc/goons() - var/dat = "
GOOOOOOONS
" - for(var/t in goon_keylist) - dat += text("") - dat += "
KeySA Username
[t][goon_keylist[ckey(t)]]
" - usr << browse(dat, "window=ban;size=300x400") - -/datum/admins/proc/beta_testers() - var/dat = "
Beta testers
" - for(var/t in beta_tester_keylist) - dat += text("") - dat += "
Key
[t]
" - usr << browse(dat, "window=ban;size=300x400") -*/ -/datum/admins/proc/Secrets() - if (!usr.client.holder) - return - - var/lvl = 0 - switch(src.rank) - if("Moderator") - lvl = 1 - if("Temporary Admin") - lvl = 2 - if("Admin Candidate") - lvl = 3 - if("Trial Admin") - lvl = 4 - if("Badmin") - lvl = 5 - if("Game Admin") - lvl = 6 - if("Game Master") - lvl = 7 + if(!check_rights(0)) return var/dat = {" -Choose a secret, any secret at all.
-Admin Secrets
-
-Remove all bombs currently in existence
-Bombing List
-Show current traitors and objectives
-Show last [length(lastsignalers)] signalers
-Show last [length(lawchanges)] law changes
-Show AI Laws
-Show Game Mode
-Show Crew Manifest
-List DNA (Blood)
-List Fingerprints

-
"} - if(lvl > 2) - dat += {" -'Random' Events
-
-Spawn a wave of meteors
-Spawn a gravitational anomaly (Untested)
-Spawn wormholes (Untested)
-Spawn blob(Untested)
-Trigger an Alien infestation
-Send in a space ninja
-Trigger an Carp migration
-Irradiate the station
-Trigger a Prison Break
-Trigger a Virus Outbreak
-Spawn an Immovable Rod
-Toggle a "lights out" event
-Spawn an Ion Storm
-Spawn Space-Vines
-Trigger a communication blackout
-
-Fun Secrets
-
-Remove 'internal' clothing
-Remove ALL clothing
-Toxic Air (WARNING: dangerous)
-Turn all humans into monkeys
-Remove firesuits, grilles, and pods
-Make all areas powered
-Make all areas unpowered
-Power all SMES
-Toggle Prison Shuttle Status(Use with S/R)
-Send Prison Shuttle
-Return Prison Shuttle
-Warp all Players to Prison
-Everyone is the traitor
-Ghost Mode
-Make all players retarded
-Make all items look like guns
-Japanese Animes Mode
-Move Administration Shuttle
-Move Ferry
-Move Alien Dinghy
-Move Mining Shuttle
-Break all lights
-Fix all lights
-Best Friend AI
-The floor is lava! (DANGEROUS)
"} -//Station Shockwave
- - if(lvl >= 6) - dat += {" -Toggle bomb cap
+
Game Panel

\n + Change Game Mode
"} + if(master_mode == "secret") + dat += "(Force Secret Mode)
" + + if(check_rights(R_ADMIN)) + dat += {" + "
" + Create Object
+ Quick Create Object
+ Create Turf
+ Create Mob
+ "} + + usr << browse(dat, "window=admin2;size=210x180") + return + +/datum/admins/proc/Secrets() + if(!check_rights(0)) return + + var/dat = {" + Choose a secret, any secret at all.
+ Admin Secrets
+
+ Remove all bombs currently in existence
+ Bombing List
+ Show current traitors and objectives
+ Show last [length(lastsignalers)] signalers
+ Show last [length(lawchanges)] law changes
+ Show AI Laws
+ Show Game Mode
+ Show Crew Manifest
+ List DNA (Blood)
+ List Fingerprints

+
+ "} + + if(check_rights(R_FUN,0)) + dat += {" + 'Random' Events
+
+ Spawn a wave of meteors
+ Spawn a gravitational anomaly (Untested)
+ Spawn wormholes (Untested)
+ Spawn blob(Untested)
+ Trigger an Alien infestation
+ Send in a space ninja
+ Trigger an Carp migration
+ Irradiate the station
+ Trigger a Prison Break
+ Trigger a Virus Outbreak
+ Spawn an Immovable Rod
+ Toggle a "lights out" event
+ Spawn an Ion Storm
+ Spawn Space-Vines
+ Trigger a communication blackout
+
+ Fun Secrets
+
+ Remove 'internal' clothing
+ Remove ALL clothing
+ Toxic Air (WARNING: dangerous)
+ Turn all humans into monkeys
+ Remove firesuits, grilles, and pods
+ Make all areas powered
+ Make all areas unpowered
+ Power all SMES
+ Toggle Prison Shuttle Status(Use with S/R)
+ Send Prison Shuttle
+ Return Prison Shuttle
+ Warp all Players to Prison
+ Everyone is the traitor
+ Ghost Mode
+ Make all players retarded
+ Make all items look like guns
+ Japanese Animes Mode
+ Move Administration Shuttle
+ Move Ferry
+ Move Alien Dinghy
+ Move Mining Shuttle
+ Break all lights
+ Fix all lights
+ Best Friend AI
+ The floor is lava! (DANGEROUS)
+ "} + + if(check_rights(R_SERVER,0)) + dat += "Toggle bomb cap
" dat += "
" - if(lvl >= 5) + if(check_rights(R_DEBUG,0)) dat += {" -Security Level Elevated
-
-Change all maintenance doors to engie/brig access only
-Change all maintenance doors to brig access only
-Remove cap on security officers
-
-Coder Secrets
-
-Show Job Debug
-Admin Log
-
-"} + Security Level Elevated
+
+ Change all maintenance doors to engie/brig access only
+ Change all maintenance doors to brig access only
+ Remove cap on security officers
+
+ Coder Secrets
+
+ Show Job Debug
+ Admin Log
+
+ "} + usr << browse(dat, "window=secrets") return @@ -559,10 +508,11 @@ var/global/floorIsLava = 0 set category = "Special Verbs" set name = "Announce" set desc="Announce your desires to the world" - if(!usr.client.holder) return + if(!check_rights(0)) return + var/message = input("Global message to send:", "Admin Announce", null, null) as message - if (message) - if(usr.client.holder.rank != "Game Admin" && usr.client.holder.rank != "Game Master") + if(message) + if(!check_rights(R_SERVER,0)) message = adminscrub(message,500) world << "\blue [usr.client.holder.fakekey ? "Administrator" : usr.key] Announces:\n \t [message]" log_admin("Announce: [key_name(usr)] : [message]") @@ -837,36 +787,32 @@ var/global/floorIsLava = 0 */ /datum/admins/proc/spawn_atom(var/object as text) set category = "Debug" - set desc= "(atom path) Spawn an atom" - set name= "Spawn" + set desc = "(atom path) Spawn an atom" + set name = "Spawn" - if(usr.client.holder.level >= 5) - var/list/types = typesof(/atom) + if(!check_rights(R_DEBUG)) return - var/list/matches = new() + var/list/types = typesof(/atom) + var/list/matches = new() - for(var/path in types) - if(findtext("[path]", object)) - matches += path + for(var/path in types) + if(findtext("[path]", object)) + matches += path - if(matches.len==0) + if(matches.len==0) + return + + var/chosen + if(matches.len==1) + chosen = matches[1] + else + chosen = input("Select an atom type", "Spawn Atom", matches[1]) as null|anything in matches + if(!chosen) return - var/chosen - if(matches.len==1) - chosen = matches[1] - else - chosen = input("Select an atom type", "Spawn Atom", matches[1]) as null|anything in matches - if(!chosen) - return + new chosen(usr.loc) - new chosen(usr.loc) - - log_admin("[key_name(usr)] spawned [chosen] at ([usr.x],[usr.y],[usr.z])") - - else - alert("You cannot perform this action. You must be of a higher administrative rank!", null, null, null, null, null) - return + log_admin("[key_name(usr)] spawned [chosen] at ([usr.x],[usr.y],[usr.z])") feedback_add_details("admin_verb","SA") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! diff --git a/code/modules/admin/admin_memo.dm b/code/modules/admin/admin_memo.dm index 3eaecb65422..b3f9e451ee3 100644 --- a/code/modules/admin/admin_memo.dm +++ b/code/modules/admin/admin_memo.dm @@ -5,15 +5,12 @@ /client/proc/admin_memo(task in list("write","show","delete")) set name = "Memo" set category = "Server" - if(!holder || !ENABLE_MEMOS) return + if(!ENABLE_MEMOS) return + if(!check_rights(0)) return switch(task) - if("write") - admin_memo_write() - if("show") - admin_memo_show() - if("delete") - admin_memo_delete() - + if("write") admin_memo_write() + if("show") admin_memo_show() + if("delete") admin_memo_delete() //write a message /client/proc/admin_memo_write() @@ -45,7 +42,7 @@ var/savefile/F = new(MEMOFILE) if(F) var/ckey - if( holder.rank == "Game Master" ) + if(check_rights(R_SERVER,0)) //high ranking admins can delete other admin's memos ckey = input(src,"Whose memo shall we remove?","Remove Memo",null) as null|anything in F.dir else ckey = src.ckey diff --git a/code/modules/admin/admin_ranks.dm b/code/modules/admin/admin_ranks.dm new file mode 100644 index 00000000000..af1208beea7 --- /dev/null +++ b/code/modules/admin/admin_ranks.dm @@ -0,0 +1,142 @@ +var/list/admin_ranks = list() //list of all ranks with associated rights + +//load our rank - > rights associations +/proc/load_admin_ranks() + admin_ranks.Cut() + + var/previous_rights = 0 + + //load text from file + var/list/Lines = file2list("config/admin_ranks.txt") + + //process each line seperately + for(var/line in Lines) + if(!length(line)) continue + if(copytext(line,1,2) == "#") continue + + var/list/List = text2list(line,"+") + if(!List.len) continue + + var/rank = ckeyEx(List[1]) + switch(rank) + if(null,"") continue + if("Removed") continue //Reserved + + var/rights = 0 + for(var/i=2, i<=List.len, i++) + switch(ckey(List[i])) + if("@","prev") rights |= previous_rights + if("buildmode","build") rights |= R_BUILDMODE + if("admin") rights |= R_ADMIN + if("ban") rights |= R_BAN + if("fun") rights |= R_FUN + if("server") rights |= R_SERVER + if("debug") rights |= R_DEBUG + if("permissions","rights") rights |= R_PERMISSIONS + if("possess") rights |= R_POSSESS + if("stealth") rights |= R_STEALTH + if("rejuv","rejuvinate") rights |= R_REJUVINATE + if("varedit") rights |= R_VAREDIT + if("everything","host","all") rights |= R_HOST + if("sound","sounds") rights |= R_SOUNDS + + admin_ranks[rank] = rights + previous_rights = rights + + #ifdef TESTING + var/msg = "Permission Sets Built:\n" + for(var/rank in admin_ranks) + msg += "\t[rank] - [admin_ranks[rank]]\n" + testing(msg) + #endif + + +/proc/load_admins() + //clear the datums references + admin_datums.Cut() + for(var/client/C in admins) + C.remove_admin_verbs() + C.holder = null + admins.Cut() + + if(config.admin_legacy_system) + load_admin_ranks() + + //load text from file + var/list/Lines = file2list("config/admins.txt") + + //process each line seperately + for(var/line in Lines) + if(!length(line)) continue + if(copytext(line,1,2) == "#") continue + + //Split the line at every "-" + var/list/List = text2list(line, "-") + if(!List.len) continue + + //ckey is before the first "-" + var/ckey = ckey(List[1]) + if(!ckey) continue + + //rank follows the first "-" + var/rank = "" + if(List.len >= 2) + rank = ckeyEx(List[2]) + + //load permissions associated with this rank + var/rights = admin_ranks[rank] + + //create the admin datum and store it for later use + var/datum/admins/D = new /datum/admins(rank, rights, ckey) + + //find the client for a ckey if they are connected and associate them with the new admin datum + D.associate(directory[ckey]) + + else + //The current admin system uses SQL + var/user = sqlfdbklogin + var/pass = sqlfdbkpass + var/db = sqlfdbkdb + var/address = sqladdress + var/port = sqlport + + var/DBConnection/dbcon = new() + + dbcon.Connect("dbi:mysql:[db]:[address]:[port]","[user]","[pass]") + if(!dbcon.IsConnected()) + diary << "Failed to connect to database in load_admins(). Reverting to legacy system." + config.admin_legacy_system = 1 + load_admins() + return + + var/DBQuery/query = dbcon.NewQuery("SELECT ckey, rank, level, flags FROM erro_admin") + query.Execute() + while(query.NextRow()) + var/ckey = query.item[1] + var/rank = query.item[2] + if(rank == "Removed") return //This person was de-adminned. They are only in the admin list for archive purposes. + + var/rights = query.item[4] + if(istext(rights)) rights = text2num(rights) + var/datum/admins/D = new /datum/admins(rank, rights, ckey) + + //find the client for a ckey if they are connected and associate them with the new admin datum + D.associate(directory[ckey]) + + if(!admin_datums) + diary << "The database query in load_admins() resulted in no admins being added to the list. Reverting to legacy system." + config.admin_legacy_system = 1 + load_admins() + return + + #ifdef TESTING + var/msg = "Admins Built:\n" + for(var/ckey in admin_datums) + var/rank + var/datum/admins/D = admin_datums[ckey] + if(D) rank = D.rank + msg += "\t[ckey] - [rank]\n" + testing(msg) + #endif + + diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 2a0cf6028ff..1012e92f1cf 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -1,403 +1,320 @@ -//GUYS REMEMBER TO ADD A += to UPDATE_ADMINS -//AND A -= TO CLEAR_ADMIN_VERBS +//admin verb groups - They can overlap if you so wish. Only one of each verb will exist in the verbs list regardless +var/list/admin_verbs_default = list( + /client/proc/toggleadminhelpsound, /*toggles whether we hear a sound when adminhelps/PMs are used*/ + /client/proc/deadmin_self, /*destroys our own admin datum so we can play as a regular player*/ + /client/proc/cmd_admin_say, /*admin-only ooc chat*/ + /client/proc/hide_verbs, /*hides all our adminverbs*/ + /client/proc/hide_most_verbs, /*hides all our hideable adminverbs*/ + /client/proc/debug_variables, /*allows us to -see- the variables of any instance in the game. +VAREDIT needed to modify*/ + /client/proc/check_ai_laws, /*shows AI and borg laws*/ + /client/proc/check_antagonists, /*shows all antags*/ + /client/proc/admin_memo, /*admin memo system. show/delete/write. +SERVER needed to delete admin memos of others*/ + /client/proc/deadchat, /*toggles deadchat on/off*/ + /client/proc/dsay, /*talk in deadchat using our ckey/fakekey*/ + /client/proc/toggleprayers, /*toggles prayers on/off*/ + /client/proc/toggle_hear_deadcast, /*toggles whether we hear deadchat*/ + /client/proc/toggle_hear_radio, /*toggles whether we hear the radio*/ + /client/proc/investigate_show /*various admintools for investigation. Such as a singulo grief-log*/ + ) +var/list/admin_verbs_admin = list( + /client/proc/game_panel, /*game panel, allows to change game-mode etc*/ + /client/proc/player_panel, /*shows an interface for all players, with links to various panels (old style)*/ + /client/proc/player_panel_new, /*shows an interface for all players, with links to various panels*/ + /client/proc/invisimin, /*allows our mob to go invisible/visible*/ + /datum/admins/proc/show_traitor_panel, /*interface which shows a mob's mind*/ + /datum/admins/proc/toggleenter, /*toggles whether people can join the current game*/ + /datum/admins/proc/toggleguests, /*toggles whether guests can join the current game*/ + /datum/admins/proc/show_player_panel, /*shows an interface for individual players, with various links (links require additional flags*/ + /datum/admins/proc/announce, /*priority announce something to all clients.*/ + /client/proc/colorooc, /*allows us to set a custom colour for everythign we say in ooc*/ + /client/proc/admin_ghost, /*allows us to ghost/reenter body at will*/ + /client/proc/toggle_view_range, /*changes how far we can see*/ + /datum/admins/proc/view_txt_log, /*shows the server log (diary) for today*/ +// /datum/admins/proc/view_atk_log, /*shows the server combat-log, doesn't do anything presently*/ + /client/proc/cmd_admin_pm_context, /*right-click amdinPM interface*/ + /client/proc/cmd_admin_pm_panel, /*admin-pm list*/ + /client/proc/cmd_admin_subtle_message, /*send an message to somebody as a 'voice in their head'*/ + /client/proc/cmd_admin_delete, /*delete an instance/object/mob/etc*/ + /client/proc/cmd_admin_check_contents, /*displays the contents of an instance*/ + /datum/admins/proc/access_news_network, /*allows access of newscasters*/ + /client/proc/giveruntimelog, /*allows us to give access to runtime logs to somebody*/ + /client/proc/getserverlog, /*allows us to fetch server logs (diary) for other days*/ + /client/proc/jumptocoord, /*we ghost and jump to a coordinate*/ + /client/proc/Getmob, /*teleports a mob to our location*/ + /client/proc/Getkey, /*teleports a mob with a certain ckey to our location*/ + /client/proc/sendmob, /*sends a mob somewhere*/ + /client/proc/Jump, + /client/proc/jumptokey, /*allows us to jump to the location of a mob with a certain ckey*/ + /client/proc/jumptomob, /*allows us to jump to a specific mob*/ + /client/proc/jumptoturf, /*allows us to jump to a specific turf*/ + /datum/admins/proc/spawn_atom, /*allows us to spawn instances*/ + /client/proc/admin_call_shuttle, /*allows us to call the emergency shuttle*/ + /client/proc/admin_cancel_shuttle, /*allows us to cancel the emergency shuttle, sending it back to centcomm*/ + /client/proc/cmd_admin_direct_narrate, /*send text directly to a player with no padding. Useful for narratives and fluff-text*/ + /client/proc/cmd_admin_world_narrate, /*sends text to all players with no padding*/ + /client/proc/check_words /*displays cult-words*/ + ) +var/list/admin_verbs_ban = list( + /client/proc/unban_panel, + /client/proc/jobbans, + /client/proc/unjobban_panel + ) +var/list/admin_verbs_sounds = list( + /client/proc/play_local_sound, + /client/proc/play_sound + ) +var/list/admin_verbs_fun = list( + /client/proc/object_talk, + /client/proc/cmd_admin_dress, + /client/proc/cmd_admin_gib_self, + /client/proc/drop_bomb, + /client/proc/toggle_gravity_on, + /client/proc/toggle_gravity_off, + /client/proc/secrets, + /client/proc/strike_team, + /client/proc/cinematic, + /client/proc/triple_ai, + /client/proc/one_click_antag, + /datum/admins/proc/toggle_aliens, + /datum/admins/proc/toggle_space_ninja, + /client/proc/spawn_xeno, + /client/proc/only_one, + /client/proc/send_space_ninja, + /client/proc/cmd_admin_add_freeform_ai_law, + /client/proc/cmd_admin_add_random_ai_law, + /client/proc/cmd_admin_create_centcom_report, + /client/proc/make_sound, + /client/proc/toggle_random_events, + /client/proc/cmd_admin_add_random_ai_law + ) +var/list/admin_verbs_server = list( + /client/proc/Set_Holiday, + /client/proc/ToRban, + /datum/admins/proc/startnow, + /datum/admins/proc/restart, + /datum/admins/proc/delay, + /datum/admins/proc/toggleaban, + /client/proc/toggle_log_hrefs, + /datum/admins/proc/immreboot, + /client/proc/everyone_random, + /datum/admins/proc/toggleAI, + /datum/admins/proc/toggleooc, + /datum/admins/proc/toggleoocdead, + /datum/admins/proc/adrev, + /datum/admins/proc/adspawn, + /datum/admins/proc/adjump + ) +var/list/admin_verbs_debug = list( + /client/proc/restart_controller, + /client/proc/cmd_admin_list_open_jobs, + /client/proc/callproc, + /client/proc/Debug2, + /client/proc/reload_admins, + /client/proc/kill_air, + /client/proc/cmd_debug_make_powernets, + /client/proc/kill_airgroup, + /client/proc/debug_controller, + /client/proc/startSinglo, + /client/proc/cmd_debug_mob_lists, + /client/proc/cmd_debug_del_all, + /client/proc/cmd_debug_tog_aliens, + /client/proc/air_report, + /client/proc/enable_debug_verbs + ) +var/list/admin_verbs_possess = list( + /proc/possess, + /proc/release + ) +var/list/admin_verbs_permissions = list( + ) +var/list/admin_verbs_rejuv = list( + /client/proc/cmd_admin_rejuvenate, + /client/proc/respawn_character + ) +//verbs which can be hidden +var/list/admin_verbs_hideable = list( + /client/proc/deadmin_self, + /client/proc/deadchat, + /client/proc/toggleprayers, + /client/proc/toggle_hear_deadcast, + /client/proc/toggle_hear_radio, + /datum/admins/proc/show_traitor_panel, + /datum/admins/proc/toggleenter, + /datum/admins/proc/toggleguests, + /datum/admins/proc/announce, + /client/proc/colorooc, + /client/proc/admin_ghost, + /client/proc/toggle_view_range, + /datum/admins/proc/view_txt_log, + /datum/admins/proc/view_atk_log, + /client/proc/cmd_admin_subtle_message, + /client/proc/cmd_admin_check_contents, + /datum/admins/proc/access_news_network, + /client/proc/giveruntimelog, + /client/proc/getserverlog, + /client/proc/admin_call_shuttle, + /client/proc/admin_cancel_shuttle, + /client/proc/cmd_admin_direct_narrate, + /client/proc/cmd_admin_world_narrate, + /client/proc/check_words, + /client/proc/play_local_sound, + /client/proc/play_sound, + /client/proc/object_talk, + /client/proc/cmd_admin_dress, + /client/proc/cmd_admin_gib_self, + /client/proc/drop_bomb, + /client/proc/toggle_gravity_on, + /client/proc/toggle_gravity_off, + /client/proc/strike_team, + /client/proc/cinematic, + /client/proc/triple_ai, + /datum/admins/proc/toggle_aliens, + /datum/admins/proc/toggle_space_ninja, + /client/proc/spawn_xeno, + /client/proc/only_one, + /client/proc/send_space_ninja, + /client/proc/cmd_admin_add_freeform_ai_law, + /client/proc/cmd_admin_add_random_ai_law, + /client/proc/cmd_admin_create_centcom_report, + /client/proc/make_sound, + /client/proc/toggle_random_events, + /client/proc/cmd_admin_add_random_ai_law, + /client/proc/Set_Holiday, + /client/proc/ToRban, + /datum/admins/proc/startnow, + /datum/admins/proc/restart, + /datum/admins/proc/delay, + /datum/admins/proc/toggleaban, + /client/proc/toggle_log_hrefs, + /datum/admins/proc/immreboot, + /client/proc/everyone_random, + /datum/admins/proc/toggleAI, + /datum/admins/proc/adrev, + /datum/admins/proc/adspawn, + /datum/admins/proc/adjump, + /client/proc/restart_controller, + /client/proc/cmd_admin_list_open_jobs, + /client/proc/callproc, + /client/proc/Debug2, + /client/proc/reload_admins, + /client/proc/kill_air, + /client/proc/cmd_debug_make_powernets, + /client/proc/kill_airgroup, + /client/proc/debug_controller, + /client/proc/startSinglo, + /client/proc/cmd_debug_mob_lists, + /client/proc/cmd_debug_del_all, + /client/proc/cmd_debug_tog_aliens, + /client/proc/air_report, + /client/proc/enable_debug_verbs, + /proc/possess, + /proc/release + ) +/client/proc/add_admin_verbs() + if(holder) + var/rights = holder.rights + verbs += admin_verbs_default + if(rights & R_BUILDMODE) verbs += /client/proc/togglebuildmodeself + if(rights & R_ADMIN) verbs += admin_verbs_admin + if(rights & R_BAN) verbs += admin_verbs_ban + if(rights & R_FUN) verbs += admin_verbs_fun + if(rights & R_SERVER) verbs += admin_verbs_server + if(rights & R_DEBUG) verbs += admin_verbs_debug + if(rights & R_POSSESS) verbs += admin_verbs_possess + if(rights & R_PERMISSIONS) verbs += admin_verbs_permissions + if(rights & R_STEALTH) verbs += /client/proc/stealth + if(rights & R_REJUVINATE) verbs += admin_verbs_rejuv + if(rights & R_SOUNDS) verbs += admin_verbs_sounds -//Some verbs that are still in the code but not used atm - // Debug -// verbs += /client/proc/radio_report //for radio debugging dont think its been used in a very long time -// verbs += /client/proc/fix_next_move //has not been an issue in a very very long time +/client/proc/remove_admin_verbs() + if(holder) + verbs.Remove( + admin_verbs_default, + /client/proc/togglebuildmodeself, + admin_verbs_admin, + admin_verbs_ban, + admin_verbs_fun, + admin_verbs_server, + admin_verbs_debug, + admin_verbs_possess, + admin_verbs_permissions, + /client/proc/stealth, + admin_verbs_rejuv, + /client/proc/Cell, + /client/proc/do_not_use_these, + /client/proc/camera_view, + /client/proc/sec_camera_report, + /client/proc/intercom_view, + /client/proc/air_status, + /client/proc/atmosscan, + /client/proc/powerdebug, + /client/proc/count_objects_on_z_level, + /client/proc/count_objects_all, + /client/proc/cmd_assume_direct_control, + /client/proc/jump_to_dead_group, + /client/proc/startSinglo, + /client/proc/ticklag, + /client/proc/cmd_admin_grantfullaccess, + /client/proc/kaboom, + /client/proc/splash, + /client/proc/cmd_admin_areatest, + admin_verbs_sounds + ) - // Mapping helpers added via enable_debug_verbs verb -// verbs += /client/proc/do_not_use_these -// verbs += /client/proc/camera_view -// verbs += /client/proc/sec_camera_report -// verbs += /client/proc/intercom_view -// verbs += /client/proc/air_status //Air things -// verbs += /client/proc/Cell //More air things +/client/proc/hide_most_verbs()//Allows you to keep some functionality while hiding some verbs + set name = "Adminverbs - Hide Most" + set category = "Admin" -/client/proc/admin_rank_check(var/rank, var/requested) - if(rank < requested) - alert("You cannot perform this action. You must be of a higher administrative rank!", null, null, null, null, null) - return(0) - return(1) + verbs.Remove( + /client/proc/hide_most_verbs, + admin_verbs_hideable + ) + verbs += /client/proc/show_verbs -/client/proc/update_admins(var/rank) - if(!holder) - holder = new /datum/admins(rank) - admins |= src - admin_datums[ckey] = holder - - var/need_update = 0 - //check if our rank has changed - if(holder.rank != rank) - holder.rank = rank - need_update = 1 - //check if our state has changed - if(istype(mob,/mob/living)) - if(holder.state != 1) - holder.state = 1 - need_update = 1 - else - if(holder.state != 2) - holder.state = 2 - need_update = 1 - - if(!need_update) return - - clear_admin_verbs() - handle_permission_verbs() - - switch(rank) - if("Game Master") - holder.level = 6 - - if ("Game Admin") - holder.level = 5 - - if ("Badmin") - holder.level = 4 - - if ("Trial Admin") - holder.level = 3 - if(holder.state == 2) // if observing - verbs += /client/proc/debug_variables - verbs += /client/proc/cmd_modify_ticker_variables - verbs += /client/proc/toggle_view_range - verbs += /client/proc/Getmob - verbs += /client/proc/Getkey - verbs += /client/proc/sendmob - verbs += /client/proc/Jump - verbs += /client/proc/jumptokey - verbs += /client/proc/jumptomob - verbs += /client/proc/jumptoturf - verbs += /client/proc/jumptocoord - verbs += /client/proc/cmd_admin_delete - verbs += /client/proc/cmd_admin_add_freeform_ai_law - verbs += /client/proc/cmd_admin_rejuvenate - - if ("Admin Candidate") - holder.level = 2 - if(holder.state == 2) // if observing - deadchat = 1 - verbs += /datum/admins/proc/toggleaban //abandon mob - verbs += /client/proc/deadchat //toggles deadchat - verbs += /client/proc/cmd_admin_check_contents - verbs += /client/proc/Jump - verbs += /client/proc/jumptokey - verbs += /client/proc/jumptomob - - if ("Temporary Admin") - holder.level = 1 - - if ("Moderator") - holder.level = 0 - - if ("Admin Observer") - holder.level = -1 - -// if ("Banned") -// holder.level = -2 -// del(src) -// return - - else - del(holder) - return - - if (holder) //THE BELOW handles granting powers. The above is for special cases only! - holder.owner = src - - //Admin Observer - if (holder.level >= -1) - seeprayers = 1 - - verbs += /client/proc/cmd_admin_say - verbs += /client/proc/deadmin_self - verbs += /client/proc/toggleadminhelpsound - else return - - //Moderator - if (holder.level >= 0) - verbs += /datum/admins/proc/announce - verbs += /datum/admins/proc/startnow - verbs += /datum/admins/proc/toggleAI //Toggle the AI - verbs += /datum/admins/proc/toggleenter //Toggle enterting - verbs += /datum/admins/proc/toggleguests //Toggle guests entering - verbs += /datum/admins/proc/toggleooc //toggle ooc - verbs += /datum/admins/proc/toggleoocdead //toggle ooc for dead/unc - verbs += /datum/admins/proc/show_player_panel - verbs += /client/proc/deadchat //toggles deadchat - verbs += /client/proc/cmd_admin_pm_context - verbs += /client/proc/cmd_admin_pm_panel - verbs += /client/proc/cmd_admin_subtle_message - verbs += /client/proc/dsay - verbs += /client/proc/admin_ghost - verbs += /client/proc/game_panel - verbs += /client/proc/player_panel - verbs += /client/proc/player_panel_new - verbs += /client/proc/unban_panel - verbs += /client/proc/jobbans - verbs += /client/proc/unjobban_panel - verbs += /client/proc/hide_verbs - verbs += /client/proc/general_report - verbs += /client/proc/air_report - verbs += /client/proc/check_ai_laws - verbs += /client/proc/investigate_show - verbs += /client/proc/cmd_admin_gib_self - - else return - - //Temporary Admin - if (holder.level >= 1) - verbs += /datum/admins/proc/delay //game start delay - verbs += /datum/admins/proc/immreboot //immediate reboot - verbs += /datum/admins/proc/restart //restart - verbs += /client/proc/cmd_admin_check_contents - verbs += /client/proc/cmd_admin_create_centcom_report - verbs += /client/proc/toggle_hear_deadcast - verbs += /client/proc/toggle_hear_radio - else return - - //Admin Candidate - if (holder.level >= 2) - verbs += /client/proc/cmd_admin_add_random_ai_law - verbs += /client/proc/secrets - verbs += /client/proc/check_antagonists - verbs += /client/proc/play_sound - verbs += /client/proc/stealth - else return - - //Trial Admin - if (holder.level >= 3) - deadchat = 1 - - verbs += /client/proc/invisimin - verbs += /datum/admins/proc/view_txt_log - verbs += /datum/admins/proc/view_atk_log - verbs += /datum/admins/proc/toggleaban //abandon mob - verbs += /datum/admins/proc/show_traitor_panel - verbs += /client/proc/getserverlog //fetch an old serverlog to look at - verbs += /client/proc/admin_call_shuttle - verbs += /client/proc/admin_cancel_shuttle - verbs += /client/proc/cmd_admin_dress - verbs += /client/proc/respawn_character - verbs += /client/proc/spawn_xeno - verbs += /client/proc/toggleprayers - verbs += /proc/possess - verbs += /proc/release - verbs += /client/proc/one_click_antag - - - else return - - //Badmin - if (holder.level >= 4) - verbs += /datum/admins/proc/adrev //toggle admin revives - verbs += /datum/admins/proc/adspawn //toggle admin item spawning - verbs += /client/proc/debug_variables - verbs += /datum/admins/proc/access_news_network //Admin access to the newscaster network - verbs += /client/proc/cmd_modify_ticker_variables - verbs += /client/proc/Debug2 //debug toggle switch - verbs += /client/proc/toggle_view_range - verbs += /client/proc/Getmob - verbs += /client/proc/Getkey - verbs += /client/proc/sendmob - verbs += /client/proc/Jump - verbs += /client/proc/jumptokey - verbs += /client/proc/jumptomob - verbs += /client/proc/jumptoturf - verbs += /client/proc/cmd_admin_delete - verbs += /client/proc/cmd_admin_add_freeform_ai_law - verbs += /client/proc/cmd_admin_add_random_ai_law - verbs += /client/proc/cmd_admin_rejuvenate - verbs += /client/proc/hide_most_verbs - verbs += /client/proc/jumptocoord - verbs += /client/proc/deadmin_self - verbs += /client/proc/giveruntimelog //used by coders to retrieve runtime logs - verbs += /client/proc/togglebuildmodeself - verbs += /client/proc/debug_controller - else return - - //Game Admin - if (holder.level >= 5) - verbs += /datum/admins/proc/spawn_atom - verbs += /client/proc/cmd_admin_list_open_jobs - verbs += /client/proc/cmd_admin_direct_narrate - verbs += /client/proc/colorooc - verbs += /client/proc/kill_air - verbs += /client/proc/cmd_admin_world_narrate - verbs += /client/proc/cmd_debug_del_all - verbs += /client/proc/cmd_debug_tog_aliens - verbs += /client/proc/check_words - verbs += /client/proc/drop_bomb - verbs += /client/proc/kill_airgroup - verbs += /client/proc/make_sound - verbs += /client/proc/play_local_sound - verbs += /client/proc/send_space_ninja - verbs += /client/proc/restart_controller //Can call via aproccall --I_hate_easy_things.jpg, Mport --Agouri - verbs += /client/proc/toggle_clickproc //TODO ERRORAGE (Temporary proc while the new clickproc is being tested) - verbs += /client/proc/toggle_gravity_on - verbs += /client/proc/toggle_gravity_off - verbs += /client/proc/toggle_random_events - verbs += /client/proc/deadmin_self - verbs += /client/proc/Set_Holiday //Force-set a Holiday - verbs += /client/proc/admin_memo - verbs += /client/proc/ToRban //ToRban frontend to access its features. - verbs += /client/proc/Blobize - else return - - //Game Master - if (holder.level >= 6) - verbs += /datum/admins/proc/toggle_aliens //toggle aliens - verbs += /datum/admins/proc/toggle_space_ninja //toggle ninjas - verbs += /datum/admins/proc/adjump - verbs += /client/proc/callproc - verbs += /client/proc/triple_ai - verbs += /client/proc/reload_admins - verbs += /client/proc/cmd_debug_make_powernets - verbs += /client/proc/object_talk - verbs += /client/proc/strike_team - verbs += /client/proc/enable_debug_verbs - verbs += /client/proc/everyone_random - verbs += /client/proc/only_one - verbs += /client/proc/cinematic //show a cinematic sequence - verbs += /client/proc/startSinglo //Used to prevent the station from losing power while testing stuff out. - verbs += /client/proc/toggle_log_hrefs - verbs += /client/proc/cmd_debug_mob_lists - verbs += /client/proc/set_ooc - else return + src << "Most of your adminverbs have been hidden." + feedback_add_details("admin_verb","HMV") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! return +/client/proc/hide_verbs() + set name = "Adminverbs - Hide All" + set category = "Admin" -/client/proc/clear_admin_verbs() - deadchat = 0 verbs.Remove( - /datum/admins/proc/announce, - /datum/admins/proc/startnow, - /datum/admins/proc/toggleAI, /*Toggle the AI*/ - /datum/admins/proc/toggleenter, /*Toggle enterting*/ - /datum/admins/proc/toggleguests, /*Toggle guests entering*/ - /datum/admins/proc/toggleooc, /*toggle ooc*/ - /datum/admins/proc/toggleoocdead, /*toggle ooc for dead/unc*/ - /datum/admins/proc/delay, /*game start delay*/ - /datum/admins/proc/immreboot, /*immediate reboot*/ - /datum/admins/proc/restart, /*restart*/ - /datum/admins/proc/show_traitor_panel, - /datum/admins/proc/show_player_panel, - /datum/admins/proc/toggle_aliens, /*toggle aliens*/ - /datum/admins/proc/toggle_space_ninja,/*toggle ninjas*/ - /datum/admins/proc/adjump, - /datum/admins/proc/view_txt_log, - /datum/admins/proc/view_atk_log, - /datum/admins/proc/spawn_atom, - /datum/admins/proc/adrev, /*toggle admin revives*/ - /datum/admins/proc/adspawn, /*toggle admin item spawning*/ - /datum/admins/proc/toggleaban, /*abandon mob*/ /client/proc/hide_verbs, /client/proc/hide_most_verbs, - /client/proc/show_verbs, - /client/proc/colorooc, - /client/proc/triple_ai, - /client/proc/reload_admins, - /client/proc/kill_air, - /client/proc/cmd_debug_make_powernets, - /client/proc/object_talk, - /client/proc/strike_team, - /client/proc/cmd_admin_list_open_jobs, - /client/proc/cmd_admin_direct_narrate, - /client/proc/cmd_admin_world_narrate, - /client/proc/callproc, - /client/proc/Cell, - /client/proc/cmd_debug_del_all, - /client/proc/cmd_debug_tog_aliens, - /client/proc/check_words, - /client/proc/drop_bomb, - /client/proc/make_sound, - /client/proc/only_one, - /client/proc/send_space_ninja, - /client/proc/debug_variables, - /client/proc/cmd_modify_ticker_variables, - /client/proc/Debug2, /*debug toggle switch*/ - /client/proc/toggle_view_range, - /client/proc/Getmob, - /client/proc/Getkey, - /client/proc/sendmob, - /client/proc/Jump, - /client/proc/jumptokey, - /client/proc/jumptomob, - /client/proc/jumptoturf, - /client/proc/cmd_admin_add_freeform_ai_law, - /client/proc/cmd_admin_add_random_ai_law, - /client/proc/cmd_admin_rejuvenate, - /client/proc/cmd_admin_delete, - /client/proc/toggleadminhelpsound, - /client/proc/admin_call_shuttle, - /client/proc/admin_cancel_shuttle, - /client/proc/cmd_admin_dress, - /client/proc/respawn_character, - /client/proc/spawn_xeno, - /client/proc/cmd_admin_add_random_ai_law, - /client/proc/secrets, - /client/proc/check_antagonists, - /client/proc/play_sound, - /client/proc/stealth, - /client/proc/cmd_admin_check_contents, - /client/proc/cmd_admin_create_centcom_report, - /client/proc/deadchat, /*toggles deadchat*/ - /client/proc/cmd_admin_pm_context, - /client/proc/cmd_admin_pm_panel, - /client/proc/cmd_admin_say, - /client/proc/cmd_admin_subtle_message, - /client/proc/dsay, - /client/proc/admin_ghost, - /client/proc/game_panel, - /client/proc/player_panel, - /client/proc/unban_panel, - /client/proc/jobbans, - /client/proc/unjobban_panel, - /client/proc/hide_verbs, - /client/proc/general_report, - /client/proc/air_report, - /client/proc/cmd_admin_say, - /client/proc/cmd_admin_gib_self, - /client/proc/restart_controller, - /client/proc/play_local_sound, - /client/proc/enable_debug_verbs, - /client/proc/toggleprayers, - /client/proc/toggle_clickproc, /*TODO ERRORAGE (Temporary proc while the enw clickproc is being tested)*/ - /client/proc/toggle_hear_deadcast, - /client/proc/toggle_hear_radio, - /client/proc/player_panel_new, - /client/proc/toggle_gravity_on, - /client/proc/toggle_gravity_off, - /client/proc/toggle_random_events, - /client/proc/deadmin_self, - /client/proc/jumptocoord, - /client/proc/everyone_random, - /client/proc/Set_Holiday, - /client/proc/giveruntimelog, /*used by coders to retrieve runtime logs*/ - /client/proc/getserverlog, - /client/proc/cinematic, /*show a cinematic sequence*/ - /client/proc/admin_memo, - /client/proc/investigate_show, /*investigate in-game mishaps using various logs.*/ - /client/proc/toggle_log_hrefs, - /client/proc/ToRban, - /proc/possess, - /proc/release, /client/proc/togglebuildmodeself, - /client/proc/kill_airgroup, - /client/proc/debug_controller, - /client/proc/startSinglo, - /client/proc/check_ai_laws, - /client/proc/cmd_debug_mob_lists, - /datum/admins/proc/access_news_network, - /client/proc/one_click_antag, - /client/proc/invisimin, - /client/proc/set_ooc - ) + admin_verbs_admin, + admin_verbs_ban, + admin_verbs_fun, + admin_verbs_server, + admin_verbs_debug, + admin_verbs_possess, + admin_verbs_permissions, + /client/proc/cmd_admin_rejuvenate, + /client/proc/stealth, + admin_verbs_rejuv + ) + verbs += /client/proc/show_verbs + + src << "Almost all of your adminverbs have been hidden." + feedback_add_details("admin_verb","TAVVH") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! return +/client/proc/show_verbs() + set name = "Adminverbs - Show" + set category = "Admin" + + verbs -= /client/proc/show_verbs + add_admin_verbs() + + src << "All of your adminverbs are now visible." + feedback_add_details("admin_verb","TAVVS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! + + + + /client/proc/admin_ghost() set category = "Admin" set name = "Aghost" @@ -418,19 +335,6 @@ body.key = "@[key]" //Haaaaaaaack. But the people have spoken. If it breaks; blame adminbus feedback_add_details("admin_verb","O") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -/* -/client/proc/get_admin_state() - set name = "Get Admin State" - set category = "Debug" - for(var/client/C in admins) - if(C.holder.state == 1) - src << "[C.key] is playing - [C.holder.state]" - else if(C.holder.state == 2) - src << "[C.key] is observing - [C.holder.state]" - else - src << "[C.key] is undefined - [C.holder.state]" - feedback_add_details("admin_verb","GAS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -*/ /client/proc/invisimin() set name = "Invisimin" @@ -527,17 +431,14 @@ message_admins("[key_name_admin(usr)] has turned stealth mode [holder.fakekey ? "ON" : "OFF"]", 1) feedback_add_details("admin_verb","SM") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! + #define AUTOBATIME 10 /client/proc/warn(var/mob/M in player_list) /*set category = "Special Verbs" set name = "Warn" set desc = "Warn a player"*/ //Based on the information I gathered via stat logging this verb was not used. Use the show player panel alternative. --erro - 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 + + if(!check_rights(R_ADMIN)) return if(!M.client.warned) M << "\red You have been warned by an administrator. This is the only warning you will recieve." M.client.warned = 1 @@ -662,17 +563,6 @@ log_admin("[key_name(usr)] used 'kill air'.") message_admins("\blue [key_name_admin(usr)] used 'kill air'.", 1) -/client/proc/show_verbs() - set name = "Toggle admin verb visibility" - set category = "Admin" - src << "Restoring admin verbs back" - - var/temp = deadchat - holder.state = null //forces a full verbs update - update_admins(holder.rank) - deadchat = temp - feedback_add_details("admin_verb","TAVVS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - /client/proc/toggle_clickproc() //TODO ERRORAGE (This is a temporary verb here while I test the new clicking proc) set name = "Toggle NewClickProc" set category = "Debug" @@ -704,72 +594,14 @@ set name = "De-admin self" set category = "Admin" - if(src.holder) + if(holder) if(alert("Confirm self-deadmin for the round? You can't re-admin yourself without someont promoting you.",,"Yes","No") == "Yes") log_admin("[src] deadmined themself.") message_admins("[src] deadmined themself.", 1) deadmin() - usr << "You are now a normal player." + src << "You are now a normal player." feedback_add_details("admin_verb","DAS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - -/client/proc/hide_most_verbs()//Allows you to keep some functionality while hiding some verbs - set name = "Toggle most admin verb visibility" - set category = "Admin" - src << "Hiding most admin verbs" - - var/temp = deadchat - clear_admin_verbs() - deadchat = temp - verbs -= /client/proc/hide_verbs - verbs -= /client/proc/hide_most_verbs - verbs += /client/proc/show_verbs - - if(holder.level >= 5)//Game Admin******************************************************************** - verbs += /client/proc/colorooc - - if(holder.level >= 4)//Badmin******************************************************************** - verbs += /client/proc/debug_variables - //verbs += /client/proc/cmd_modify_object_variables --merged with view vairiables - verbs += /client/proc/Jump - verbs += /client/proc/jumptoturf - verbs += /client/proc/togglebuildmodeself - - verbs += /client/proc/dsay - verbs += /client/proc/admin_ghost - verbs += /client/proc/game_panel - verbs += /client/proc/player_panel - verbs += /client/proc/cmd_admin_subtle_message - verbs += /client/proc/cmd_admin_pm_context - verbs += /client/proc/cmd_admin_pm_panel - verbs += /client/proc/cmd_admin_gib_self - - verbs += /client/proc/deadchat //toggles deadchat - verbs += /datum/admins/proc/toggleooc //toggle ooc - verbs += /client/proc/cmd_admin_say//asay - verbs += /client/proc/toggleadminhelpsound - feedback_add_details("admin_verb","HMV") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - return - - -/client/proc/hide_verbs() - set name = "Toggle admin verb visibility" - set category = "Admin" - src << "Hiding almost all admin verbs" - - var/temp = deadchat - clear_admin_verbs() - deadchat = temp - verbs -= /client/proc/hide_verbs - verbs -= /client/proc/hide_most_verbs - verbs += /client/proc/show_verbs - - verbs += /client/proc/deadchat //toggles deadchat - verbs += /datum/admins/proc/toggleooc //toggle ooc - verbs += /client/proc/cmd_admin_say//asay - feedback_add_details("admin_verb","TAVVH") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - return - /client/proc/toggle_log_hrefs() set name = "Toggle href logging" set category = "Server" diff --git a/code/modules/admin/holder2.dm b/code/modules/admin/holder2.dm index 526c1cc9db8..b50b67e2206 100644 --- a/code/modules/admin/holder2.dm +++ b/code/modules/admin/holder2.dm @@ -1,25 +1,14 @@ -/client/proc/deadmin() - admin_datums -= ckey - if(holder) del(holder) - clear_admin_verbs() - admins -= src - return 1 - var/list/admin_datums = list() /datum/admins - var/rank = null + var/rank = "Temporary Admin" var/client/owner = null - var/state = null //state = 1 for playing //state = 2 for observing - var/level = null -// var/permissions = 0 + var/rights = 0 -// var/stealth = 0 var/fakekey = null var/ooccolor = "#b82e00" var/sound_adminhelp = 0 //If set to 1 this will play a sound when adminhelps are received. - var/sql_permissions = 0 //Permissions for different admin command groups. Must not be editable ingame. var/datum/marked_datum @@ -28,2608 +17,78 @@ var/list/admin_datums = list() var/datum/feed_channel/admincaster_feed_channel = new /datum/feed_channel var/admincaster_signature //What you'll sign the newsfeeds as -/datum/admins/New(initial_rank) +/datum/admins/New(initial_rank = "Temporary Admin", initial_rights = 0, ckey) + if(!ckey) + error("Admin datum created without a ckey argument. Datum has been deleted") + del(src) + return admincaster_signature = "Nanotrasen Officer #[rand(0,9)][rand(0,9)][rand(0,9)]" rank = initial_rank - ..() - -/datum/admins/Del() - ..() - -/datum/admins/Topic(href, href_list) - ..() - if (usr.client != src.owner) - world << "\blue [usr.key] has attempted to override the admin panel!" - log_admin("[key_name(usr)] tried to use the admin panel without authorization.") - return - - if (!(usr.client.holder.rank in list("Moderator", "Temporary Admin", "Admin Candidate", "Trial Admin", "Badmin", "Game Admin", "Game Master"))) - usr << "\red You cannot perform this action. You must be of a higher administrative rank!" - return - - if(href_list["makeAntag"]) - switch(href_list["makeAntag"]) - if("1") - log_admin("[key_name(usr)] has spawned a traitor.") - if(!src.makeTratiors()) - usr << "\red Unfortunatly there were no candidates available" - if("2") - log_admin("[key_name(usr)] has spawned a changeling.") - if(!src.makeChanglings()) - usr << "\red Unfortunatly there were no candidates available" - if("3") - log_admin("[key_name(usr)] has spawned revolutionaries.") - if(!src.makeRevs()) - usr << "\red Unfortunatly there were no candidates available" - if("4") - log_admin("[key_name(usr)] has spawned a cultists.") - if(!src.makeCult()) - usr << "\red Unfortunatly there were no candidates available" - if("5") - log_admin("[key_name(usr)] has spawned a malf AI.") - if(!src.makeMalfAImode()) - usr << "\red Unfortunatly there were no candidates available" - if("6") - log_admin("[key_name(usr)] has spawned a wizard.") - if(!src.makeWizard()) - usr << "\red Unfortunatly there were no candidates available" - if("7") - log_admin("[key_name(usr)] has spawned a nuke team.") - if(!src.makeNukeTeam()) - usr << "\red Unfortunatly there were no candidates available" - if("8") - log_admin("[key_name(usr)] has spawned a ninja.") - src.makeSpaceNinja() - if("9") - log_admin("[key_name(usr)] has spawned aliens.") - src.makeAliens() - if("10") - log_admin("[key_name(usr)] has spawned a death squad.") - if(!src.makeDeathsquad()) - usr << "\red Unfortunatly there were no candidates available" - return - - if(href_list["editadminpermissions"]) - if(!usr.client) - return - - var/adm_ckey = href_list["editadminckey"] - if(!adm_ckey) - usr << "\red no valid ckey" - return - - if(!usr.client.holder || !(usr.client.holder.sql_permissions & PERMISSIONS)) - usr << "\red You do not have permission to do this!" - message_admins("[key_name_admin(usr)] attempted to edit the admin permissions of [adm_ckey] without authentication!") - log_admin("[key_name(usr)] attempted to edit the admin permissions of [adm_ckey] without authentication!") - return - - switch(href_list["editadminpermissions"]) - if("permissions") - usr << "Currently unavailable since nothing runs off of permissions" - if("rank") - var/new_rank = input("Please, select a rank", "New rank for player", null, null) as null|anything in list("Game Master","Game Admin", "Trial Admin", "Admin Observer") - if(!new_rank) - return - message_admins("[key_name_admin(usr)] edited the admin rank of [adm_ckey] to [new_rank]") - log_admin("[key_name(usr)] edited the admin rank of [adm_ckey] to [new_rank]") - log_admin_rank_modification(adm_ckey, new_rank) - if("remove") - if(alert("Are you sure you want to remove [adm_ckey]?","Message","Yes","Cancel") == "Yes") - message_admins("[key_name_admin(usr)] removed [adm_ckey] from the admins list") - log_admin("[key_name(usr)] removed [adm_ckey] from the admins list") - log_admin_rank_modification(adm_ckey, "Removed") - if("add") - var/new_ckey = input(usr,"New admin's ckey","Admin ckey", null) as text|null - if(!new_ckey) - return - var/new_rank = input("Please, select a rank", "New rank for player", null, null) as null|anything in list("Game Master","Game Admin", "Trial Admin", "Admin Observer") - if(!new_rank) - return - message_admins("[key_name_admin(usr)] added [new_ckey] as a new admin to the rank [new_rank]") - log_admin("[key_name(usr)] added [new_ckey] as a new admin to the rank [new_rank]") - log_admin_rank_modification(new_ckey, new_rank) - - - - if(href_list["call_shuttle"]) - if (src.rank in list("Trial Admin", "Badmin", "Game Admin", "Game Master")) - if( ticker.mode.name == "blob" ) - alert("You can't call the shuttle during blob!") - return - switch(href_list["call_shuttle"]) - if("1") - if ((!( ticker ) || emergency_shuttle.location)) - return - emergency_shuttle.incall() - captain_announce("The emergency shuttle has been called. It will arrive in [round(emergency_shuttle.timeleft()/60)] minutes.") - log_admin("[key_name(usr)] called the Emergency Shuttle") - message_admins("\blue [key_name_admin(usr)] called the Emergency Shuttle to the station", 1) - - if("2") - if ((!( ticker ) || emergency_shuttle.location || emergency_shuttle.direction == 0)) - return - switch(emergency_shuttle.direction) - if(-1) - emergency_shuttle.incall() - captain_announce("The emergency shuttle has been called. It will arrive in [round(emergency_shuttle.timeleft()/60)] minutes.") - log_admin("[key_name(usr)] called the Emergency Shuttle") - message_admins("\blue [key_name_admin(usr)] called the Emergency Shuttle to the station", 1) - if(1) - emergency_shuttle.recall() - log_admin("[key_name(usr)] sent the Emergency Shuttle back") - message_admins("\blue [key_name_admin(usr)] sent the Emergency Shuttle back", 1) - - href_list["secretsadmin"] = "check_antagonist" - else - alert("You cannot perform this action. You must be of a higher administrative rank!") - return - - if(href_list["edit_shuttle_time"]) - if (src.rank in list("Badmin", "Game Admin", "Game Master")) - emergency_shuttle.settimeleft( input("Enter new shuttle duration (seconds):","Edit Shuttle Timeleft", emergency_shuttle.timeleft() ) as num ) - log_admin("[key_name(usr)] edited the Emergency Shuttle's timeleft to [emergency_shuttle.timeleft()]") - captain_announce("The emergency shuttle has been called. It will arrive in [round(emergency_shuttle.timeleft()/60)] minutes.") - message_admins("\blue [key_name_admin(usr)] edited the Emergency Shuttle's timeleft to [emergency_shuttle.timeleft()]", 1) - href_list["secretsadmin"] = "check_antagonist" - else - alert("You cannot perform this action. You must be of a higher administrative rank!") - return - - if(href_list["delay_round_end"]) - if (src.rank in list("Badmin", "Game Admin", "Game Master")) - ticker.delay_end = !ticker.delay_end - log_admin("[key_name(usr)] [ticker.delay_end ? "delayed the round end" : "has made the round end normally"].") - message_admins("\blue [key_name(usr)] [ticker.delay_end ? "delayed the round end" : "has made the round end normally"].", 1) - href_list["secretsadmin"] = "check_antagonist" - - if(href_list["simplemake"]) - - if (!(src.rank in list("Trial Admin", "Badmin", "Game Admin", "Game Master"))) - alert("You cannot perform this action. You must be of a higher administrative rank!") - return - - if(!href_list["mob"]) - usr << "Invalid mob" - return - - var/mob/M = locate(href_list["mob"]) - - if(!M || !ismob(M)) - usr << "Cannot find mob" - return - - var/delmob = 0 - var/option = alert("Delete old mob?","Message","Yes","No","Cancel") - if(option == "Cancel") - return - if(option == "Yes") - delmob = 1 - - log_admin("[key_name(usr)] has used rudimentary transformation on [key_name(M)]. Transforming to [href_list["simplemake"]]; deletemob=[delmob]") - message_admins("\blue [key_name_admin(usr)] has used rudimentary transformation on [key_name_admin(M)]. Transforming to [href_list["simplemake"]]; deletemob=[delmob]", 1) - - switch(href_list["simplemake"]) - if("observer") - M.change_mob_type( /mob/dead/observer , null, null, delmob) - if("drone") - M.change_mob_type( /mob/living/carbon/alien/humanoid/drone , null, null, delmob) - if("hunter") - M.change_mob_type( /mob/living/carbon/alien/humanoid/hunter , null, null, delmob) - if("queen") - M.change_mob_type( /mob/living/carbon/alien/humanoid/queen , null, null, delmob) - if("sentinel") - M.change_mob_type( /mob/living/carbon/alien/humanoid/sentinel , null, null, delmob) - if("larva") - M.change_mob_type( /mob/living/carbon/alien/larva , null, null, delmob) - if("human") - M.change_mob_type( /mob/living/carbon/human , null, null, delmob) - if("metroid") - M.change_mob_type( /mob/living/carbon/metroid , null, null, delmob) - if("adultmetroid") - M.change_mob_type( /mob/living/carbon/metroid/adult , null, null, delmob) - if("monkey") - M.change_mob_type( /mob/living/carbon/monkey , null, null, delmob) - if("robot") - M.change_mob_type( /mob/living/silicon/robot , null, null, delmob) - if("cat") - M.change_mob_type( /mob/living/simple_animal/cat , null, null, delmob) - if("runtime") - M.change_mob_type( /mob/living/simple_animal/cat/Runtime , null, null, delmob) - if("corgi") - M.change_mob_type( /mob/living/simple_animal/corgi , null, null, delmob) - if("ian") - M.change_mob_type( /mob/living/simple_animal/corgi/Ian , null, null, delmob) - if("crab") - M.change_mob_type( /mob/living/simple_animal/crab , null, null, delmob) - if("coffee") - M.change_mob_type( /mob/living/simple_animal/crab/Coffee , null, null, delmob) - if("parrot") - M.change_mob_type( /mob/living/simple_animal/parrot , null, null, delmob) - if("polyparrot") - M.change_mob_type( /mob/living/simple_animal/parrot/Poly , null, null, delmob) - if("constructarmoured") - M.change_mob_type( /mob/living/simple_animal/construct/armoured , null, null, delmob) - if("constructbuilder") - M.change_mob_type( /mob/living/simple_animal/construct/builder , null, null, delmob) - if("constructwraith") - M.change_mob_type( /mob/living/simple_animal/construct/wraith , null, null, delmob) - if("shade") - M.change_mob_type( /mob/living/simple_animal/shade , null, null, delmob) - - - /////////////////////////////////////new ban stuff - if(href_list["unbanf"]) - var/banfolder = href_list["unbanf"] - Banlist.cd = "/base/[banfolder]" - var/key = Banlist["key"] - if(alert(usr, "Are you sure you want to unban [key]?", "Confirmation", "Yes", "No") == "Yes") - if (RemoveBan(banfolder)) - unbanpanel() - else - alert(usr,"This ban has already been lifted / does not exist.","Error","Ok") - unbanpanel() - - if(href_list["unbane"]) - UpdateTime() - var/reason - - var/banfolder = href_list["unbane"] - Banlist.cd = "/base/[banfolder]" - var/reason2 = Banlist["reason"] - var/temp = Banlist["temp"] - - var/minutes = Banlist["minutes"] - - var/banned_key = Banlist["key"] - Banlist.cd = "/base" - - var/duration - - switch(alert("Temporary Ban?",,"Yes","No")) - if("Yes") - temp = 1 - var/mins = 0 - if(minutes > CMinutes) - mins = minutes - CMinutes - mins = input(usr,"How long (in minutes)? (Default: 1440)","Ban time",mins ? mins : 1440) as num|null - if(!mins) return - mins = min(525599,mins) - minutes = CMinutes + mins - duration = GetExp(minutes) - reason = input(usr,"Reason?","reason",reason2) as text|null - if(!reason) return - if("No") - temp = 0 - duration = "Perma" - reason = input(usr,"Reason?","reason",reason2) as text|null - if(!reason) return - - log_admin("[key_name(usr)] edited [banned_key]'s ban. Reason: [reason] Duration: [duration]") - ban_unban_log_save("[key_name(usr)] edited [banned_key]'s ban. Reason: [reason] Duration: [duration]") - message_admins("\blue [key_name_admin(usr)] edited [banned_key]'s ban. Reason: [reason] Duration: [duration]", 1) - Banlist.cd = "/base/[banfolder]" - Banlist["reason"] << reason - Banlist["temp"] << temp - Banlist["minutes"] << minutes - Banlist["bannedby"] << usr.ckey - Banlist.cd = "/base" - feedback_inc("ban_edit",1) - unbanpanel() - - /////////////////////////////////////new ban stuff - - if(href_list["jobban2"]) - var/mob/M = locate(href_list["jobban2"]) - if(!M) //sanity - alert("Mob no longer exists!") - return - if(!M.ckey) //sanity - alert("Mob has no ckey") - return - if(!job_master) - usr << "Job Master has not been setup!" - return - var/dat = "" - var/header = "Job-Ban Panel: [M.name]" - var/body - var/jobs = "" - - /***********************************WARNING!************************************ - The jobban stuff looks mangled and disgusting - But it looks beautiful in-game - -Nodrak - ************************************WARNING!***********************************/ - var/counter = 0 -//Regular jobs - //Command (Blue) - jobs += "" - jobs += "" - for(var/jobPos in command_positions) - if(!jobPos) continue - var/datum/job/job = job_master.GetJob(jobPos) - if(!job) continue - - if(jobban_isbanned(M, job.title)) - jobs += "" - counter++ - else - jobs += "" - counter++ - - if(counter >= 6) //So things dont get squiiiiished! - jobs += "" - counter = 0 - jobs += "
Command Positions
[replacetext(job.title, " ", " ")][replacetext(job.title, " ", " ")]
" - - //Security (Red) - counter = 0 - jobs += "" - jobs += "" - for(var/jobPos in security_positions) - if(!jobPos) continue - var/datum/job/job = job_master.GetJob(jobPos) - if(!job) continue - - if(jobban_isbanned(M, job.title)) - jobs += "" - counter++ - else - jobs += "" - counter++ - - if(counter >= 5) //So things dont get squiiiiished! - jobs += "" - counter = 0 - jobs += "
Security Positions
[replacetext(job.title, " ", " ")][replacetext(job.title, " ", " ")]
" - - //Engineering (Yellow) - counter = 0 - jobs += "" - jobs += "" - for(var/jobPos in engineering_positions) - if(!jobPos) continue - var/datum/job/job = job_master.GetJob(jobPos) - if(!job) continue - - if(jobban_isbanned(M, job.title)) - jobs += "" - counter++ - else - jobs += "" - counter++ - - if(counter >= 5) //So things dont get squiiiiished! - jobs += "" - counter = 0 - jobs += "
Engineering Positions
[replacetext(job.title, " ", " ")][replacetext(job.title, " ", " ")]
" - - //Medical (White) - counter = 0 - jobs += "" - jobs += "" - for(var/jobPos in medical_positions) - if(!jobPos) continue - var/datum/job/job = job_master.GetJob(jobPos) - if(!job) continue - - if(jobban_isbanned(M, job.title)) - jobs += "" - counter++ - else - jobs += "" - counter++ - - if(counter >= 5) //So things dont get squiiiiished! - jobs += "" - counter = 0 - jobs += "
Medical Positions
[replacetext(job.title, " ", " ")][replacetext(job.title, " ", " ")]
" - - //Science (Purple) - counter = 0 - jobs += "" - jobs += "" - for(var/jobPos in science_positions) - if(!jobPos) continue - var/datum/job/job = job_master.GetJob(jobPos) - if(!job) continue - - if(jobban_isbanned(M, job.title)) - jobs += "" - counter++ - else - jobs += "" - counter++ - - if(counter >= 5) //So things dont get squiiiiished! - jobs += "" - counter = 0 - jobs += "
Science Positions
[replacetext(job.title, " ", " ")][replacetext(job.title, " ", " ")]
" - - //Civilian (Grey) - counter = 0 - jobs += "" - jobs += "" - for(var/jobPos in civilian_positions) - if(!jobPos) continue - var/datum/job/job = job_master.GetJob(jobPos) - if(!job) continue - - if(jobban_isbanned(M, job.title)) - jobs += "" - counter++ - else - jobs += "" - counter++ - - if(counter >= 5) //So things dont get squiiiiished! - jobs += "" - counter = 0 - jobs += "
Civilian Positions
[replacetext(job.title, " ", " ")][replacetext(job.title, " ", " ")]
" - - //Non-Human (Green) - counter = 0 - jobs += "" - jobs += "" - for(var/jobPos in nonhuman_positions) - if(!jobPos) continue - var/datum/job/job = job_master.GetJob(jobPos) - if(!job) continue - - if(jobban_isbanned(M, job.title)) - jobs += "" - counter++ - else - jobs += "" - counter++ - - if(counter >= 5) //So things dont get squiiiiished! - jobs += "" - counter = 0 - - //pAI isn't technically a job, but it goes in here. - if(jobban_isbanned(M, "pAI")) - jobs += "" - else - jobs += "" - - jobs += "
Non-human Positions
[replacetext(job.title, " ", " ")][replacetext(job.title, " ", " ")]
pAIpAI
" - - //Antagonist (Orange) - var/isbanned_dept = jobban_isbanned(M, "Syndicate") - jobs += "" - jobs += "" - - //Traitor - if(jobban_isbanned(M, "traitor") || isbanned_dept) - jobs += "" - else - jobs += "" - - //Changeling - if(jobban_isbanned(M, "changeling") || isbanned_dept) - jobs += "" - else - jobs += "" - - //Nuke Operative - if(jobban_isbanned(M, "operative") || isbanned_dept) - jobs += "" - else - jobs += "" - - //Revolutionary - if(jobban_isbanned(M, "revolutionary") || isbanned_dept) - jobs += "" - else - jobs += "" - - jobs += "" //Breaking it up so it fits nicer on the screen every 5 entries - - //Cultist - if(jobban_isbanned(M, "cultist") || isbanned_dept) - jobs += "" - else - jobs += "" - - //Wizard - if(jobban_isbanned(M, "wizard") || isbanned_dept) - jobs += "" - else - jobs += "" - -/* //Malfunctioning AI //Removed Malf-bans because they're a pain to impliment - if(jobban_isbanned(M, "malf AI") || isbanned_dept) - jobs += "" - else - jobs += "" - - //Alien - if(jobban_isbanned(M, "alien candidate") || isbanned_dept) - jobs += "" - else - jobs += "" - - //Infested Monkey - if(jobban_isbanned(M, "infested monkey") || isbanned_dept) - jobs += "" - else - jobs += "" + rights = initial_rights + admin_datums[ckey] = src + +/datum/admins/proc/associate(client/C) + if(C) + owner = C + owner.holder = src + owner.add_admin_verbs() //TODO + admins += src + +/datum/admins/proc/disassociate() + if(owner) + admins -= owner + owner.remove_admin_verbs() + owner.holder = null + owner = null + +/* +checks if usr is an admin with at least ONE of the flags in rights_required. (Note, they don't need all the flags) +if rights_required == 0, then it simply checks if they are an admin. +if it doesn't return 1 and show_msg=1 it will prints a message explaining why the check has failed +generally it would be used like so: + +proc/admin_proc() + if(!check_rights(R_ADMIN)) return + world << "you have enough rights!" + +NOTE: it checks usr! not src! So if you're checking somebody's rank in a proc which they did not call +you will have to do something like if(client.rights & R_ADMIN) yourself. */ - jobs += "
Antagonist Positions
[replacetext("Traitor", " ", " ")][replacetext("Traitor", " ", " ")][replacetext("Changeling", " ", " ")][replacetext("Changeling", " ", " ")][replacetext("Nuke Operative", " ", " ")][replacetext("Nuke Operative", " ", " ")][replacetext("Revolutionary", " ", " ")][replacetext("Revolutionary", " ", " ")]
[replacetext("Cultist", " ", " ")][replacetext("Cultist", " ", " ")][replacetext("Wizard", " ", " ")][replacetext("Wizard", " ", " ")][replacetext("Malf AI", " ", " ")][replacetext("Malf AI", " ", " ")][replacetext("Alien", " ", " ")][replacetext("Alien", " ", " ")][replacetext("Infested Monkey", " ", " ")][replacetext("Infested Monkey", " ", " ")]
" - - body = "[jobs]" - dat = "[header][body]" - usr << browse(dat, "window=jobban2;size=800x450") - return - - //JOBBAN'S INNARDS - if(href_list["jobban3"]) - if (src.rank in list( "Admin Candidate", "Temporary Admin", "Trial Admin", "Badmin", "Game Admin", "Game Master" )) - var/mob/M = locate(href_list["jobban4"]) - if(!M) - alert("Mob no longer exists!") - return - if ((M.client && M.client.holder && (M.client.holder.level > src.level))) - alert("You cannot perform this action. You must be of a higher administrative rank!") - return - if(!job_master) - usr << "Job Master has not been setup!" - return - - //get jobs for department if specified, otherwise just returnt he one job in a list. - var/list/joblist = list() - switch(href_list["jobban3"]) - if("commanddept") - for(var/jobPos in command_positions) - if(!jobPos) continue - var/datum/job/temp = job_master.GetJob(jobPos) - if(!temp) continue - joblist += temp.title - if("securitydept") - for(var/jobPos in security_positions) - if(!jobPos) continue - var/datum/job/temp = job_master.GetJob(jobPos) - if(!temp) continue - joblist += temp.title - if("engineeringdept") - for(var/jobPos in engineering_positions) - if(!jobPos) continue - var/datum/job/temp = job_master.GetJob(jobPos) - if(!temp) continue - joblist += temp.title - if("medicaldept") - for(var/jobPos in medical_positions) - if(!jobPos) continue - var/datum/job/temp = job_master.GetJob(jobPos) - if(!temp) continue - joblist += temp.title - if("sciencedept") - for(var/jobPos in science_positions) - if(!jobPos) continue - var/datum/job/temp = job_master.GetJob(jobPos) - if(!temp) continue - joblist += temp.title - if("civiliandept") - for(var/jobPos in civilian_positions) - if(!jobPos) continue - var/datum/job/temp = job_master.GetJob(jobPos) - if(!temp) continue - joblist += temp.title - if("nonhumandept") - joblist += "pAI" - for(var/jobPos in nonhuman_positions) - if(!jobPos) continue - var/datum/job/temp = job_master.GetJob(jobPos) - if(!temp) continue - joblist += temp.title - else - joblist += href_list["jobban3"] - - //Create a list of unbanned jobs within joblist - var/list/notbannedlist = list() - for(var/job in joblist) - if(!jobban_isbanned(M, job)) - notbannedlist += job - - //Banning comes first - if(notbannedlist.len) //at least 1 unbanned job exists in joblist so we have stuff to ban. - var/reason = input(usr,"Reason?","Please State Reason","") as text|null - if(reason) - var/msg - for(var/job in notbannedlist) - ban_unban_log_save("[key_name(usr)] jobbanned [key_name(M)] from [job]. reason: [reason]") - log_admin("[key_name(usr)] banned [key_name(M)] from [job]") - feedback_inc("ban_job",1) - DB_ban_record(BANTYPE_JOB_PERMA, M, -1, reason, job) - feedback_add_details("ban_job","- [job]") - jobban_fullban(M, job, "[reason]; By [usr.ckey] on [time2text(world.realtime)]") - if(!msg) msg = job - else msg += ", [job]" - notes_add(M.ckey, "Banned from [msg] - [reason]") - message_admins("\blue [key_name_admin(usr)] banned [key_name_admin(M)] from [msg]", 1) - M << "\redYou have been jobbanned by [usr.client.ckey] from: [msg]." - M << "\red The reason is: [reason]" - M << "\red Jobban can be lifted only upon request." - href_list["jobban2"] = 1 // lets it fall through and refresh +/proc/check_rights(rights_required, show_msg=1) + if(usr && usr.client) + if(rights_required) + if(usr.client.holder) + if(rights_required & usr.client.holder.rights) return 1 - - //Unbanning joblist - //all jobs in joblist are banned already OR we didn't give a reason (implying they shouldn't be banned) - if(joblist.len) //at least 1 banned job exists in joblist so we have stuff to unban. - var/msg - for(var/job in joblist) - var/reason = jobban_isbanned(M, job) - if(!reason) continue //skip if it isn't jobbanned anyway - switch(alert("Job: '[job]' Reason: '[reason]' Un-jobban?","Please Confirm","Yes","No")) - if("Yes") - ban_unban_log_save("[key_name(usr)] unjobbanned [key_name(M)] from [job]") - log_admin("[key_name(usr)] unbanned [key_name(M)] from [job]") - DB_ban_unban(M.ckey, BANTYPE_JOB_PERMA, job) - feedback_inc("ban_job_unban",1) - feedback_add_details("ban_job_unban","- [job]") - jobban_unban(M, job) - if(!msg) msg = job - else msg += ", [job]" - else - continue - if(msg) - message_admins("\blue [key_name_admin(usr)] unbanned [key_name_admin(M)] from [msg]", 1) - M << "\redYou have been un-jobbanned by [usr.client.ckey] from [msg]." - href_list["jobban2"] = 1 // lets it fall through and refresh + else + if(show_msg) + usr << "Error: You do not have sufficient rights to do that. You require one of the following flags: [rights2text(rights_required)]." + else + if(usr.client.holder) return 1 - return 0 //we didn't do anything! - - if (href_list["boot2"]) - if ((src.rank in list( "Moderator", "Temporary Admin", "Admin Candidate", "Trial Admin", "Badmin", "Game Admin", "Game Master" ))) - var/mob/M = locate(href_list["boot2"]) - if (ismob(M)) - if ((M.client && M.client.holder && (M.client.holder.level >= src.level))) - alert("You cannot perform this action. You must be of a higher administrative rank!", null, null, null, null, null) - return - M << "\red You have been kicked from the server" - log_admin("[key_name(usr)] booted [key_name(M)].") - message_admins("\blue [key_name_admin(usr)] booted [key_name_admin(M)].", 1) - //M.client = null - del(M.client) - - //Player Notes - if(href_list["notes"]) - var/ckey = href_list["ckey"] - if(!ckey) - var/mob/M = locate(href_list["mob"]) - if(ismob(M)) - ckey = M.ckey - - switch(href_list["notes"]) - if("show") - notes_show(ckey) - if("add") - notes_add(ckey,href_list["text"]) - notes_show(ckey) - if("remove") - notes_remove(ckey,text2num(href_list["from"]),text2num(href_list["to"])) - notes_show(ckey) - return - - - if (href_list["removejobban"]) - if ((src.rank in list("Game Admin", "Game Master" ))) - var/t = href_list["removejobban"] - if(t) - if((alert("Do you want to unjobban [t]?","Unjobban confirmation", "Yes", "No") == "Yes") && t) //No more misclicks! Unless you do it twice. - log_admin("[key_name(usr)] removed [t]") - message_admins("\blue [key_name_admin(usr)] removed [t]", 1) - jobban_remove(t) - href_list["ban"] = 1 // lets it fall through and refresh - var/t_split = text2list(t, " - ") - var/key = t_split[1] - var/job = t_split[2] - DB_ban_unban(ckey(key), BANTYPE_JOB_PERMA, job) - - if (href_list["newban"]) - if ((src.rank in list( "Temporary Admin", "Admin Candidate", "Trial Admin", "Badmin", "Game Admin", "Game Master" ))) - var/mob/M = locate(href_list["newban"]) - if(!ismob(M)) return - if ((M.client && M.client.holder && (M.client.holder.level >= src.level))) - alert("You cannot perform this action. You must be of a higher administrative rank!") - return - switch(alert("Temporary Ban?",,"Yes","No", "Cancel")) - if("Yes") - var/mins = input(usr,"How long (in minutes)?","Ban time",1440) as num|null - if(!mins) - return - if(mins >= 525600) mins = 525599 - var/reason = input(usr,"Reason?","reason","Griefer") as text|null - if(!reason) - return - AddBan(M.ckey, M.computer_id, reason, usr.ckey, 1, mins) - ban_unban_log_save("[usr.client.ckey] has banned [M.ckey]. - Reason: [reason] - This will be removed in [mins] minutes.") - M << "\redYou have been banned by [usr.client.ckey].\nReason: [reason]." - M << "\red This is a temporary ban, it will be removed in [mins] minutes." - feedback_inc("ban_tmp",1) - DB_ban_record(BANTYPE_TEMP, M, mins, reason) - feedback_inc("ban_tmp_mins",mins) - if(config.banappeals) - M << "\red To try to resolve this matter head to [config.banappeals]" - else - M << "\red No ban appeals URL has been set." - log_admin("[usr.client.ckey] has banned [M.ckey].\nReason: [reason]\nThis will be removed in [mins] minutes.") - message_admins("\blue[usr.client.ckey] has banned [M.ckey].\nReason: [reason]\nThis will be removed in [mins] minutes.") - - del(M.client) - //del(M) // See no reason why to delete mob. Important stuff can be lost. And ban can be lifted before round ends. - if("No") - var/reason = input(usr,"Reason?","reason","Griefer") as text|null - if(!reason) - return - switch(alert(usr,"IP ban?",,"Yes","No","Cancel")) - if("Cancel") return - if("Yes") - AddBan(M.ckey, M.computer_id, reason, usr.ckey, 0, 0, M.lastKnownIP) - if("No") - AddBan(M.ckey, M.computer_id, reason, usr.ckey, 0, 0) - M << "\redYou have been banned by [usr.client.ckey].\nReason: [reason]." - M << "\red This is a permanent ban." - if(config.banappeals) - M << "\red To try to resolve this matter head to [config.banappeals]" - else - M << "\red No ban appeals URL has been set." - ban_unban_log_save("[usr.client.ckey] has permabanned [M.ckey]. - Reason: [reason] - This is a permanent ban.") - log_admin("[usr.client.ckey] has banned [M.ckey].\nReason: [reason]\nThis is a permanent ban.") - message_admins("\blue[usr.client.ckey] has banned [M.ckey].\nReason: [reason]\nThis is a permanent ban.") - feedback_inc("ban_perma",1) - DB_ban_record(BANTYPE_PERMA, M, -1, reason) - - del(M.client) - //del(M) - if("Cancel") - return - if(href_list["unjobbanf"]) - var/banfolder = href_list["unjobbanf"] - Banlist.cd = "/base/[banfolder]" - var/key = Banlist["key"] - if(alert(usr, "Are you sure you want to unban [key]?", "Confirmation", "Yes", "No") == "Yes") - if (RemoveBanjob(banfolder)) - unjobbanpanel() else - alert(usr,"This ban has already been lifted / does not exist.","Error","Ok") - unjobbanpanel() - - if(href_list["unjobbane"]) - return -/* - if (href_list["remove"]) - if ((src.rank in list( "Admin Candidate", "Trial Admin", "Badmin", "Game Admin", "Game Master" ))) - var/t = href_list["remove"] - if(t && isgoon(t)) - log_admin("[key_name(usr)] removed [t] from the goonlist.") - message_admins("\blue [key_name_admin(usr)] removed [t] from the goonlist.") - remove_goon(t) -*/ - if (href_list["mute"]) - if ((src.rank in list( "Temporary Admin", "Admin Candidate", "Trial Admin", "Badmin", "Game Admin", "Game Master" ))) - var/mob/M = locate(href_list["mute"]) - var/mute_type = href_list["mute_type"] - if(istext(mute_type)) - mute_type = text2num(mute_type) - if(!isnum(mute_type)) - return - if (ismob(M)) - if(!M.client) - src << "This mob doesn't have a client tied to it." - return - if ((M.client && M.client.holder && (M.client.holder.level >= src.level))) - alert("You cannot perform this action. You must be of a higher administrative rank!", null, null, null, null, null) - return - - cmd_admin_mute(M, mute_type) - - if (href_list["c_mode"]) - if ((src.rank in list( "Temporary Admin", "Admin Candidate", "Trial Admin", "Badmin", "Game Admin", "Game Master" ))) - if (ticker && ticker.mode) - return alert(usr, "The game has already started.", null, null, null, null) - var/dat = {"What mode do you wish to play?
"} - for (var/mode in config.modes) - dat += {"[config.mode_names[mode]]
"} - dat += {"Secret
"} - dat += {"Random
"} - dat += {"Now: [master_mode]"} - usr << browse(dat, "window=c_mode") - - if (href_list["f_secret"]) - if ((src.rank in list( "Temporary Admin", "Admin Candidate", "Trial Admin", "Badmin", "Game Admin", "Game Master" ))) - if (ticker && ticker.mode) - return alert(usr, "The game has already started.", null, null, null, null) - if (master_mode != "secret") - return alert(usr, "The game mode has to be secret!", null, null, null, null) - var/dat = {"What game mode do you want to force secret to be? Use this if you want to change the game mode, but want the players to believe it's secret. This will only work if the current game mode is secret.
"} - for (var/mode in config.modes) - dat += {"[config.mode_names[mode]]
"} - dat += {"Random (default)
"} - dat += {"Now: [secret_force_mode]"} - usr << browse(dat, "window=f_secret") - - if (href_list["c_mode2"]) - if ((src.rank in list( "Temporary Admin", "Admin Candidate", "Trial Admin", "Badmin", "Game Admin", "Game Master" ))) - if (ticker && ticker.mode) - return alert(usr, "The game has already started.", null, null, null, null) - master_mode = href_list["c_mode2"] - log_admin("[key_name(usr)] set the mode as [master_mode].") - message_admins("\blue [key_name_admin(usr)] set the mode as [master_mode].", 1) - world << "\blue The mode is now: [master_mode]" - Game() // updates the main game menu - world.save_mode(master_mode) - .(href, list("c_mode"=1)) - - if (href_list["f_secret2"]) - if ((src.rank in list( "Temporary Admin", "Admin Candidate", "Trial Admin", "Badmin", "Game Admin", "Game Master" ))) - if (ticker && ticker.mode) - return alert(usr, "The game has already started.", null, null, null, null) - if (master_mode != "secret") - return alert(usr, "The game mode has to be secret!", null, null, null, null) - secret_force_mode = href_list["f_secret2"] - log_admin("[key_name(usr)] set the forced secret mode as [secret_force_mode].") - message_admins("\blue [key_name_admin(usr)] set the forced secret mode as [secret_force_mode].", 1) - Game() // updates the main game menu - .(href, list("f_secret"=1)) - - if (href_list["monkeyone"]) - if ((src.rank in list( "Admin Candidate", "Trial Admin", "Badmin", "Game Admin", "Game Master" ))) - var/mob/M = locate(href_list["monkeyone"]) - if(!ismob(M)) - return - if(istype(M, /mob/living/carbon/human)) - var/mob/living/carbon/human/N = M - log_admin("[key_name(usr)] attempting to monkeyize [key_name(M)]") - message_admins("\blue [key_name_admin(usr)] attempting to monkeyize [key_name_admin(M)]", 1) - N.monkeyize() - if(istype(M, /mob/living/silicon)) - alert("The AI can't be monkeyized!", null, null, null, null, null) - return - - if (href_list["corgione"]) - if ((src.rank in list( "Admin Candidate", "Trial Admin", "Badmin", "Game Admin", "Game Master" ))) - var/mob/M = locate(href_list["corgione"]) - if(!ismob(M)) - return - if(istype(M, /mob/living/carbon/human)) - var/mob/living/carbon/human/N = M - log_admin("[key_name(usr)] attempting to corgize [key_name(M)]") - message_admins("\blue [key_name_admin(usr)] attempting to corgize [key_name_admin(M)]", 1) - N.corgize() - if(istype(M, /mob/living/silicon)) - alert("The AI can't be corgized!", null, null, null, null, null) - return - - if (href_list["forcespeech"]) - if ((src.rank in list( "Trial Admin", "Badmin", "Game Admin", "Game Master" ))) - var/mob/M = locate(href_list["forcespeech"]) - if (ismob(M)) - var/speech = input("What will [key_name(M)] say?.", "Force speech", "")// Don't need to sanitize, since it does that in say(), we also trust our admins. - if(!speech) - return - M.say(speech) - speech = sanitize(speech) // Nah, we don't trust them - log_admin("[key_name(usr)] forced [key_name(M)] to say: [speech]") - message_admins("\blue [key_name_admin(usr)] forced [key_name_admin(M)] to say: [speech]") - else - alert("You cannot perform this action. You must be of a higher administrative rank!", null, null, null, null, null) - return - - if (href_list["sendtoprison"]) - if ((src.rank in list( "Moderator", "Admin Candidate", "Temporary Admin", "Trial Admin", "Badmin", "Game Admin", "Game Master" ))) - - var/confirm = alert(usr, "Send to admin prison for the round?", "Message", "Yes", "No") - if(confirm != "Yes") - return - - var/mob/M = locate(href_list["sendtoprison"]) - if (ismob(M)) - if(istype(M, /mob/living/silicon/ai)) - alert("The AI can't be sent to prison you jerk!", null, null, null, null, null) - return - //strip their stuff before they teleport into a cell :downs: - for(var/obj/item/weapon/W in M) - if(istype(W, /datum/organ/external)) - continue - //don't strip organs - M.u_equip(W) - if (M.client) - M.client.screen -= W - if (W) - W.loc = M.loc - W.dropped(M) - W.layer = initial(W.layer) - //teleport person to cell - M.Paralyse(5) - sleep(5) //so they black out before warping - M.loc = pick(prisonwarp) - if(istype(M, /mob/living/carbon/human)) - var/mob/living/carbon/human/prisoner = M - prisoner.equip_to_slot_or_del(new /obj/item/clothing/under/color/orange(prisoner), slot_w_uniform) - prisoner.equip_to_slot_or_del(new /obj/item/clothing/shoes/orange(prisoner), slot_shoes) - spawn(50) - M << "\red You have been sent to the prison station!" - log_admin("[key_name(usr)] sent [key_name(M)] to the prison station.") - message_admins("\blue [key_name_admin(usr)] sent [key_name_admin(M)] to the prison station.", 1) - else - alert("You cannot perform this action. You must be of a higher administrative rank!", null, null, null, null, null) - return - -/* - if (href_list["sendtomaze"]) - if ((src.rank in list( "Admin Candidate", "Temporary Admin", "Trial Admin", "Badmin", "Game Admin", "Game Master" ))) - var/mob/M = locate(href_list["sendtomaze"]) - if (ismob(M)) - if(istype(M, /mob/living/silicon/ai)) - alert("The AI can't be sent to the maze you jerk!", null, null, null, null, null) - return - //strip their stuff before they teleport into a cell :downs: - for(var/obj/item/weapon/W in M) - if(istype(W, /datum/organ/external)) - continue - //don't strip organs - M.u_equip(W) - if (M.client) - M.client.screen -= W - if (W) - W.loc = M.loc - W.dropped(M) - W.layer = initial(W.layer) - //teleport person to cell - M.paralysis += 5 - sleep(5) - //so they black out before warping - M.loc = pick(mazewarp) - spawn(50) - M << "\red You have been sent to the maze! Try and get out alive. In the maze everyone is free game. Kill or be killed." - log_admin("[key_name(usr)] sent [key_name(M)] to the maze.") - message_admins("\blue [key_name_admin(usr)] sent [key_name_admin(M)] to the maze.", 1) - else - alert("You cannot perform this action. You must be of a higher administrative rank!", null, null, null, null, null) - return -*/ - - if (href_list["tdome1"]) - if ((src.rank in list( "Admin Candidate", "Temporary Admin", "Trial Admin", "Badmin", "Game Admin", "Game Master" ))) - - var/confirm = alert(usr, "Confirm?", "Message", "Yes", "No") - if(confirm != "Yes") - return - - var/mob/M = locate(href_list["tdome1"]) - if (ismob(M)) - if(istype(M, /mob/living/silicon/ai)) - alert("The AI can't be sent to the thunderdome you jerk!", null, null, null, null, null) - return - for(var/obj/item/W in M) - if (istype(W,/obj/item)) - if(istype(W, /datum/organ/external)) - continue - M.u_equip(W) - if (M.client) - M.client.screen -= W - if (W) - W.loc = M.loc - W.dropped(M) - W.layer = initial(W.layer) - M.Paralyse(5) - sleep(5) - M.loc = pick(tdome1) - spawn(50) - M << "\blue You have been sent to the Thunderdome." - log_admin("[key_name(usr)] has sent [key_name(M)] to the thunderdome. (Team 1)") - message_admins("[key_name_admin(usr)] has sent [key_name_admin(M)] to the thunderdome. (Team 1)", 1) - - if (href_list["tdome2"]) - if ((src.rank in list( "Admin Candidate", "Temporary Admin", "Trial Admin", "Badmin", "Game Admin", "Game Master" ))) - - var/confirm = alert(usr, "Confirm?", "Message", "Yes", "No") - if(confirm != "Yes") - return - - var/mob/M = locate(href_list["tdome2"]) - if (ismob(M)) - if(istype(M, /mob/living/silicon/ai)) - alert("The AI can't be sent to the thunderdome you jerk!", null, null, null, null, null) - return - for(var/obj/item/W in M) - if (istype(W,/obj/item)) - if(istype(W, /datum/organ/external)) - continue - M.u_equip(W) - if (M.client) - M.client.screen -= W - if (W) - W.loc = M.loc - W.dropped(M) - W.layer = initial(W.layer) - M.Paralyse(5) - sleep(5) - M.loc = pick(tdome2) - spawn(50) - M << "\blue You have been sent to the Thunderdome." - log_admin("[key_name(usr)] has sent [key_name(M)] to the thunderdome. (Team 2)") - message_admins("[key_name_admin(usr)] has sent [key_name_admin(M)] to the thunderdome. (Team 2)", 1) - - if (href_list["tdomeadmin"]) - if ((src.rank in list( "Admin Candidate", "Temporary Admin", "Trial Admin", "Badmin", "Game Admin", "Game Master" ))) - - var/confirm = alert(usr, "Confirm?", "Message", "Yes", "No") - if(confirm != "Yes") - return - - var/mob/M = locate(href_list["tdomeadmin"]) - if (ismob(M)) - if(istype(M, /mob/living/silicon/ai)) - alert("The AI can't be sent to the thunderdome you jerk!", null, null, null, null, null) - return - M.Paralyse(5) - sleep(5) - M.loc = pick(tdomeadmin) - spawn(50) - M << "\blue You have been sent to the Thunderdome." - log_admin("[key_name(usr)] has sent [key_name(M)] to the thunderdome. (Admin.)") - message_admins("[key_name_admin(usr)] has sent [key_name_admin(M)] to the thunderdome. (Admin.)", 1) - - if (href_list["tdomeobserve"]) - if ((src.rank in list( "Admin Candidate", "Temporary Admin", "Trial Admin", "Badmin", "Game Admin", "Game Master" ))) - - var/confirm = alert(usr, "Confirm?", "Message", "Yes", "No") - if(confirm != "Yes") - return - - var/mob/M = locate(href_list["tdomeobserve"]) - if (ismob(M)) - if(istype(M, /mob/living/silicon/ai)) - alert("The AI can't be sent to the thunderdome you jerk!", null, null, null, null, null) - return - for(var/obj/item/W in M) - if (istype(W,/obj/item)) - if(istype(W, /datum/organ/external)) - continue - M.u_equip(W) - if (M.client) - M.client.screen -= W - if (W) - W.loc = M.loc - W.dropped(M) - W.layer = initial(W.layer) - if(istype(M, /mob/living/carbon/human)) - var/mob/living/carbon/human/observer = M - observer.equip_to_slot_or_del(new /obj/item/clothing/under/suit_jacket(observer), slot_w_uniform) - observer.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(observer), slot_shoes) - M.Paralyse(5) - sleep(5) - M.loc = pick(tdomeobserve) - spawn(50) - M << "\blue You have been sent to the Thunderdome." - log_admin("[key_name(usr)] has sent [key_name(M)] to the thunderdome. (Observer.)") - message_admins("[key_name_admin(usr)] has sent [key_name_admin(M)] to the thunderdome. (Observer.)", 1) - -// if (href_list["adminauth"]) -// if ((src.rank in list( "Admin Candidate", "Temporary Admin", "Trial Admin", "Badmin", "Game Admin", "Game Master" ))) -// var/mob/M = locate(href_list["adminauth"]) -// if (ismob(M) && !M.client.authenticated && !M.client.authenticating) -// M.client.verbs -= /client/proc/authorize -// M.client.authenticated = text("admin/[]", usr.client.authenticated) -// log_admin("[key_name(usr)] authorized [key_name(M)]") -// message_admins("\blue [key_name_admin(usr)] authorized [key_name_admin(M)]", 1) -// M.client << text("You have been authorized by []", usr.key) - - if (href_list["revive"]) - if ((src.rank in list( "Trial Admin", "Badmin", "Game Admin", "Game Master" ))) - var/mob/living/M = locate(href_list["revive"]) - if (isliving(M)) - if(config.allow_admin_rev) - M.revive() - message_admins("\red Admin [key_name_admin(usr)] healed / revived [key_name_admin(M)]!", 1) - log_admin("[key_name(usr)] healed / Rrvived [key_name(M)]") - return - else - alert("Admin revive disabled") - else - alert("You cannot perform this action. You must be of a higher administrative rank!", null, null, null, null, null) - return - - if (href_list["makeai"]) //Yes, im fucking lazy, so what? it works ... hopefully - if (src.level>=3) - var/mob/M = locate(href_list["makeai"]) - if(istype(M, /mob/living/carbon/human)) - var/mob/living/carbon/human/H = M - message_admins("\red Admin [key_name_admin(usr)] AIized [key_name_admin(M)]!", 1) -// if (ticker.mode.name == "AI malfunction") -// var/obj/O = locate("landmark*ai") -// M << "\blue You have been teleported to your new starting location!" -// M.loc = O.loc -// M.buckled = null -// else -// var/obj/S = locate(text("start*AI")) -// if ((istype(S, /obj/effect/landmark/start) && istype(S.loc, /turf))) -// M << "\blue You have been teleported to your new starting location!" -// M.loc = S.loc -// M.buckled = null - // world << "[M.real_name] is the AI!" - log_admin("[key_name(usr)] AIized [key_name(M)]") - H.AIize() - else - alert("I cannot allow this.") - return - else - alert("You cannot perform this action. You must be of a higher administrative rank!", null, null, null, null, null) - return - - if (href_list["makealien"]) - if (src.level>=3) - var/mob/M = locate(href_list["makealien"]) - if(istype(M, /mob/living/carbon/human)) - usr.client.cmd_admin_alienize(M) - else - alert("Wrong mob. Must be human.") - return - else - alert("You cannot perform this action. You must be of a higher administrative rank!") - return - - if (href_list["makemetroid"]) - if (src.level>=3) - var/mob/M = locate(href_list["makemetroid"]) - if(istype(M, /mob/living/carbon/human)) - usr.client.cmd_admin_metroidize(M) - else - alert("Wrong mob. Must be human.") - return - else - alert("You cannot perform this action. You must be of a higher administrative rank!") - return - - if (href_list["makerobot"]) - if (src.level>=3) - var/mob/M = locate(href_list["makerobot"]) - if(istype(M, /mob/living/carbon/human)) - usr.client.cmd_admin_robotize(M) - else - alert("Wrong mob. Must be human.") - return - else - alert("You cannot perform this action. You must be of a higher administrative rank!") - return - if (href_list["makeanimal"]) - if(src.level>=3) - var/mob/M = locate(href_list["makeanimal"]) - if(!istype(M, /mob/new_player)) - usr.client.cmd_admin_animalize(M) - else - alert("The mob must not be a new_player.") - return - else - alert("You cannot perform this action. You must be of a higher administrative rank!") - return -/***************** BEFORE************** - - if (href_list["l_players"]) - var/dat = "Name/Real Name/Key/IP:
" - for(var/mob/M in world) - var/foo = "" - if (ismob(M) && M.client) - if(!M.client.authenticated && !M.client.authenticating) - foo += text("\[ Authorize | ", src, M) - else - foo += text("\[ Authorized | ") - if(M.start) - if(!istype(M, /mob/living/carbon/monkey)) - foo += text("Monkeyize | ", src, M) - else - foo += text("Monkeyized | ") - if(istype(M, /mob/living/silicon/ai)) - foo += text("Is an AI | ") - else - foo += text("Make AI | ", src, M) - if(M.z != 2) - foo += text("Prison | ", src, M) - foo += text("Maze | ", src, M) - else - foo += text("On Z = 2 | ") - else - foo += text("Hasn't Entered Game | ") - foo += text("Heal/Revive | ", src, M) - - foo += text("Say \]", src, M) - dat += text("N: [] R: [] (K: []) (IP: []) []
", M.name, M.real_name, (M.client ? M.client : "No client"), M.lastKnownIP, foo) - - usr << browse(dat, "window=players;size=900x480") - -*****************AFTER******************/ - -// Now isn't that much better? IT IS NOW A PROC, i.e. kinda like a big panel like unstable - - if (href_list["adminplayeropts"]) - var/mob/M = locate(href_list["adminplayeropts"]) - show_player_panel(M) - - if (href_list["adminplayervars"]) - var/mob/M = locate(href_list["adminplayervars"]) - if(src && src.owner) - if(istype(src.owner,/client)) - var/client/cl = src.owner - cl.debug_variables(M) - else if(ismob(src.owner)) - var/mob/MO = src.owner - if(MO.client) - var/client/cl = MO.client - cl.debug_variables(M) - - if (href_list["adminplayersubtlemessage"]) - var/mob/M = locate(href_list["adminplayersubtlemessage"]) - if(src && src.owner) - if(istype(src.owner,/client)) - var/client/cl = src.owner - cl.cmd_admin_subtle_message(M) - else if(ismob(src.owner)) - var/mob/MO = src.owner - if(MO.client) - var/client/cl = MO.client - cl.cmd_admin_subtle_message(M) - - if (href_list["adminplayerobservejump"]) - var/mob/M = locate(href_list["adminplayerobservejump"]) - if(src && src.owner) - var/client/C - if(istype(src.owner,/client)) - C = src.owner - else if(ismob(src.owner)) - var/mob/MO = src.owner - C = MO.client - if(C) - if(state == 1) - C.admin_ghost() - sleep(2) - C.jumptomob(M) - - if (href_list["adminplayerobservecoodjump"]) - - var/x = text2num(href_list["X"]) - var/y = text2num(href_list["Y"]) - var/z = text2num(href_list["Z"]) - - if(src && src.owner) - var/client/C - if(istype(src.owner,/client)) - C = src.owner - else if(ismob(src.owner)) - var/mob/MO = src.owner - C = MO.client - if(C) - if(state == 1) - C.admin_ghost() - sleep(2) - C.jumptocoord(x, y, z) - - if (href_list["adminchecklaws"]) - if(src && src.owner) - output_ai_laws() - - if (href_list["adminmoreinfo"]) - var/mob/M = locate(href_list["adminmoreinfo"]) - if(!M) - usr << "\blue The mob no longer exists." - return - - if(src && src.owner) -// //world <<"Passed the owner-check. Owner is [src.owner]. The mob is [M]." - var/location_description = "" - var/special_role_description = "" - var/health_description = "" - var/gender_description = "" - var/turf/T = get_turf(M) - - //Location - if(T && isturf(T)) -// //world <<"Has a location." - if(T.loc && isarea(T.loc)) - location_description = "([M.loc == T ? "at coordinates " : "in [M.loc] at coordinates "] [T.x], [T.y], [T.z] in area [T.loc])" - else - location_description = "([M.loc == T ? "at coordinates " : "in [M.loc] at coordinates "] [T.x], [T.y], [T.z])" - - //Job + antagonist - if(M.mind) - special_role_description = "Role: [M.mind.assigned_role]; Antagonist: [M.mind.special_role]; Has been rev: [(M.mind.has_been_rev)?"Yes":"No"]" - else - special_role_description = "Role: Mind datum missing Antagonist: Mind datum missing; Has been rev: Mind datum missing;" - - //Health - if(isliving(M)) - var/mob/living/L = M - var/status - switch (M.stat) - if (0) status = "Alive" - if (1) status = "Unconscious" - if (2) status = "Dead" - health_description = "Status = [status]" - health_description += "
Oxy: [L.getOxyLoss()] - Tox: [L.getToxLoss()] - Fire: [L.getFireLoss()] - Brute: [L.getBruteLoss()] - Clone: [L.getCloneLoss()] - Brain: [L.getBrainLoss()]" - else -// world <<"Has no health." - health_description = "This mob type has no health to speak of." - - //Gener - if(M.gender in list(MALE,FEMALE)) - gender_description = "[M.gender]" - else - gender_description = "[M.gender]" - -// world <<"Displaying info about the mob..." - src.owner << "Info about [M.name]: " - src.owner << "Mob type = [M.type]; Gender = [gender_description] Damage = [health_description]" - src.owner << "Name = [M.name]; Real_name = [M.real_name]; Mind_name = [M.mind?"[M.mind.name]":""]; Key = [M.key];" - src.owner << "Location = [location_description];" - src.owner << "[special_role_description]" - src.owner << "(PM) (PP) (VV) (SM) (JMP) (CA)" - - if (href_list["adminspawncookie"]) - var/mob/M = locate(href_list["adminspawncookie"]) - if(M && ishuman(M)) - var/mob/living/carbon/human/H = M - H.equip_to_slot_or_del( new /obj/item/weapon/reagent_containers/food/snacks/cookie(H), slot_l_hand ) - if(!(istype(H.l_hand,/obj/item/weapon/reagent_containers/food/snacks/cookie))) - H.equip_to_slot_or_del( new /obj/item/weapon/reagent_containers/food/snacks/cookie(H), slot_r_hand ) - if(!(istype(H.r_hand,/obj/item/weapon/reagent_containers/food/snacks/cookie))) - log_admin("[key_name(H)] has their hands full, so they did not receive their cookie, spawned by [key_name(src.owner)].") - message_admins("[key_name(H)] has their hands full, so they did not receive their cookie, spawned by [key_name(src.owner)].") - return - else - H.update_inv_r_hand()//To ensure the icon appears in the HUD - else - H.update_inv_l_hand() - log_admin("[key_name(H)] got their cookie, spawned by [key_name(src.owner)]") - message_admins("[key_name(H)] got their cookie, spawned by [key_name(src.owner)]") - feedback_inc("admin_cookies_spawned",1) - H << "\blue Your prayers have been answered!! You received the best cookie!" - else - src << "\blue The person who prayed is not a human. Cookies cannot be spawned." - - - if (href_list["traitor_panel_pp"]) - var/mob/M = locate(href_list["traitor_panel_pp"]) - if(isnull(M)) - usr << "Mob doesn't seem to exist." - return - if(!ismob(M)) - usr << "This doen't seem to be a mob." - return - show_traitor_panel(M) - - if (href_list["BlueSpaceArtillery"]) - var/mob/target = locate(href_list["BlueSpaceArtillery"]) - if(!target) - return - - if(!isliving(target)) - src.owner << "That is not a valid target." - return - - var/mob/living/M = target - - var/choice = alert(src.owner, "Are you sure you wish to hit [key_name(M)] with Blue Space Artillery?", "Confirm Firing?" , "Yes" , "No") - if (choice == "No") - return - - if(BSACooldown) - src.owner << "Standby! Reload cycle in progress! Gunnary crews ready in five seconds!" - return - - BSACooldown = 1 - spawn(50) - BSACooldown = 0 - - - M << "You've been hit by bluespace artillery!" - log_admin("[key_name(M)] has been hit by Bluespace Artillery fired by [src.owner]") - message_admins("[key_name(M)] has been hit by Bluespace Artillery fired by [src.owner]") - var/obj/effect/stop/S - S = new /obj/effect/stop - S.victim = M - S.loc = M.loc - spawn(20) - del(S) - - var/turf/T = get_turf(M) - if(T && (istype(T,/turf/simulated/floor/))) - if(prob(80)) - T:break_tile_to_plating() - else - T:break_tile() - - if(M.health == 1) - M.gib() - else - M.adjustBruteLoss( min( 99 , (M.health - 1) ) ) - M.Stun(20) - M.Weaken(20) - M.stuttering = 20 - - if (href_list["CentcommReply"]) - var/mob/M = locate(href_list["CentcommReply"]) - if(!M) - return - if(!ishuman(M)) - alert("Centcomm cannot transmit to non-humans.") - return - var/mob/living/carbon/human/H = M - if(!istype(H.ears, /obj/item/device/radio/headset)) - alert("The person you're trying to reply to doesn't have a headset! Centcomm cannot transmit directly to them.") - return - var/input = input(src.owner, "Please enter a message to reply to [key_name(M)] via their headset.","Outgoing message from Centcomm", "") - if(!input) - return - - src.owner << "You sent [input] to [M] via a secure channel." - - log_admin("[src.owner] replied to [key_name(M)]'s Centcomm message with the message [input].") - message_admins("[src.owner] replied to [key_name(M)]'s Centcom message with: \"[input]\"") - M << "You hear something crackle in your headset for a moment before a voice speaks. \"Please stand by for a message from Central Command. Message as follows. [input]. Message ends.\"" - - return - - if (href_list["SyndicateReply"]) - var/mob/M = locate(href_list["SyndicateReply"]) - if(!M) - return - if(!istype(M, /mob/living/carbon/human)) - alert("The Syndicate cannot transmit to non-humans.") - return - if(!istype(M:ears, /obj/item/device/radio/headset)) - alert("The person you're trying to reply to doesn't have a headset! The Syndicate cannot transmit directly to them.") - return - var/input = input(src.owner, "Please enter a message to reply to [key_name(M)] via their headset.","Outgoing message from The Syndicate", "") - if(!input) - return - - src.owner << "You sent [input] to [M] via a secure channel." - log_admin("[src.owner] replied to [key_name(M)]'s Syndicate message with the message [input].") - M << "You hear something crackle in your headset for a moment before a voice speaks. \"Please stand by for a message from your benefactor. Message as follows, agent. [input]. Message ends.\"" - - return - - if (href_list["jumpto"]) - if(rank in list("Badmin", "Game Admin", "Game Master")) - var/mob/M = locate(href_list["jumpto"]) - usr.client.jumptomob(M) - else - alert("You cannot perform this action. You must be of a higher administrative rank!") - return - - if (href_list["getmob"]) - if(rank in list( "Trial Admin", "Badmin", "Game Admin", "Game Master")) - - var/confirm = alert(usr, "Confirm?", "Message", "Yes", "No") - if(confirm != "Yes") - return - - var/mob/M = locate(href_list["getmob"]) - usr.client.Getmob(M) - else - alert("You cannot perform this action. You must be of a higher administrative rank!") - return - - if (href_list["sendmob"]) - if(rank in list( "Trial Admin", "Badmin", "Game Admin", "Game Master")) - var/mob/M = locate(href_list["sendmob"]) - usr.client.sendmob(M) - else - alert("You cannot perform this action. You must be of a higher administrative rank!") - return - - if (href_list["narrateto"]) - var/mob/M = locate(href_list["narrateto"]) - usr.client.cmd_admin_direct_narrate(M) - - if (href_list["subtlemessage"]) - var/mob/M = locate(href_list["subtlemessage"]) - usr.client.cmd_admin_subtle_message(M) - - if (href_list["traitor"]) - if(!ticker || !ticker.mode) - alert("The game hasn't started yet!") - return - var/mob/M = locate(href_list["traitor"]) - if (!istype(M)) - player_panel_new() - return - if(isalien(M)) - alert("Is an [M.mind ? M.mind.special_role : "Alien"]!", "[M.key]") - return - if (M:mind) - M:mind.edit_memory() - return - alert("Cannot make this mob a traitor! It has no mind!") - - if (href_list["create_object"]) - if (src.rank in list("Admin Candidate", "Trial Admin", "Badmin", "Game Admin", "Game Master")) - return create_object(usr) - else - alert("You are not a high enough administrator! Sorry!!!!") - - if (href_list["quick_create_object"]) - if (src.rank in list("Admin Candidate", "Trial Admin", "Badmin", "Game Admin", "Game Master")) - return quick_create_object(usr) - else - alert("You are not a high enough administrator! Sorry!!!!") - - - if (href_list["create_turf"]) - if (src.rank in list("Admin Candidate", "Trial Admin", "Badmin", "Game Admin", "Game Master")) - return create_turf(usr) - else - alert("You are not a high enough administrator! Sorry!!!!") - - if (href_list["create_mob"]) - if (src.rank in list("Badmin", "Game Admin", "Game Master")) - return create_mob(usr) - else - alert("You are not a high enough administrator! Sorry!!!!") - - if (href_list["prom_demot"]) - if ((src.rank in list("Trial Admin", "Badmin", "Game Admin", "Game Master" ))) - var/client/C = locate(href_list["prom_demot"]) - if(C.holder && (C.holder.level >= src.level)) - alert("This cannot be done as [C] is a [C.holder.rank]") - return - var/dat = "[C] is a [C.holder ? "[C.holder.rank]" : "non-admin"]

Change [C]'s rank?
" - if(src.level == 6) - //host - dat += {" - Game Admin //coder
- Badmin // Shit Guy
- Trial Admin // Primary Administrator
- Admin Candidate // // Administrator
- Temporary Admin // Secondary Admin
- Moderator // Moderator
- Admin Observer // Filthy Xeno
- Remove Admin
"} - else if(src.level == 5) - //coder - dat += {" - Badmin // Shit Guy
- Trial Admin // Primary Administrator
- Admin Candidate // // Administrator
- Temporary Admin // Secondary Admin
- Moderator // Moderator
- Admin Observer // Filthy Xeno
- Remove Admin
"} - else - alert("Not a high enough level admin, sorry.") - return - usr << browse(dat, "window=prom_demot;size=480x300") - - if (href_list["chgadlvl"]) - //change admin level - var/rank = href_list["chgadlvl"] - var/client/C = locate(href_list["client4ad"]) - if(!istype(C)) return - if(rank == "Remove") - log_admin("[key_name(usr)] has removed [C]'s adminship") - message_admins("[key_name_admin(usr)] has removed [C]'s adminship", 1) - C.deadmin() - else - if(C == owner) //no promoting/demoting yourself - message_admins("[C] tried to change their own admin-rank >:(") - return - C.update_admins(rank) - log_admin("[key_name(usr)] has made [C] a [rank]") - message_admins("[key_name_admin(usr)] has made [C] a [rank]", 1) - - if (href_list["object_list"]) - if (src.rank in list("Admin Candidate", "Trial Admin", "Badmin", "Game Admin", "Game Master")) - if (config.allow_admin_spawning && ((src.state == 2) || (src.rank in list("Badmin", "Game Admin", "Game Master")))) - var/atom/loc = usr.loc - - var/dirty_paths - if (istext(href_list["object_list"])) - dirty_paths = list(href_list["object_list"]) - else if (istype(href_list["object_list"], /list)) - dirty_paths = href_list["object_list"] - - var/paths = list() - var/removed_paths = list() - for (var/dirty_path in dirty_paths) - var/path = text2path(dirty_path) - if (!path) - removed_paths += dirty_path - else if (!ispath(path, /obj) && !ispath(path, /turf) && !ispath(path, /mob)) - removed_paths += dirty_path - else if (ispath(path, /obj/item/weapon/gun/energy/pulse_rifle) && !(src.rank in list("Game Admin", "Game Master"))) - removed_paths += dirty_path - else if (ispath(path, /obj/item/weapon/melee/energy/blade))//Not an item one should be able to spawn./N - removed_paths += dirty_path - else if (ispath(path, /obj/effect/bhole) && !(src.rank in list("Game Admin", "Game Master"))) - removed_paths += dirty_path - else if (ispath(path, /mob) && !(src.rank in list("Badmin", "Game Admin", "Game Master"))) - removed_paths += dirty_path - - else - paths += path - - if (!paths) - return - else if (length(paths) > 5) - alert("Select fewer object types, (max 5)") - return - else if (length(removed_paths)) - alert("Removed:\n" + dd_list2text(removed_paths, "\n")) - - var/list/offset = text2list(href_list["offset"],",") - var/number = dd_range(1, 100, text2num(href_list["object_count"])) - var/X = offset.len > 0 ? text2num(offset[1]) : 0 - var/Y = offset.len > 1 ? text2num(offset[2]) : 0 - var/Z = offset.len > 2 ? text2num(offset[3]) : 0 - var/tmp_dir = href_list["object_dir"] - var/obj_dir = tmp_dir ? text2num(tmp_dir) : 2 - if(!obj_dir || !(obj_dir in list(1,2,4,8,5,6,9,10))) - obj_dir = 2 - var/obj_name = sanitize(href_list["object_name"]) - var/where = href_list["object_where"] - if (!( where in list("onfloor","inhand","inmarked") )) - where = "onfloor" - - //TODO ERRORAGE - if( where == "inhand" ) - usr << "Support for inhand not available yet. Will spawn on floor." - where = "onfloor" - //END TODO ERRORAGE - - if ( where == "inhand" ) //Can only give when human or monkey - if ( !( ishuman(usr) || ismonkey(usr) ) ) - usr << "Can only spawn in hand when you're a human or a monkey." - where = "onfloor" - else if ( usr.get_active_hand() ) - usr << "Your active hand is full. Spawning on floor." - where = "onfloor" - if ( where == "inmarked" ) - if ( !marked_datum ) - usr << "You don't have any object marked. Abandoning spawn." - return - else - if ( !istype(marked_datum,/atom) ) - usr << "The object you have marked cannot be used as a target. Target must be of type /atom. Abandoning spawn." - return - - var/atom/target //Where the object will be spawned - switch ( where ) - if ( "onfloor" ) - switch (href_list["offset_type"]) - if ("absolute") - target = locate(0 + X,0 + Y,0 + Z) - if ("relative") - target = locate(loc.x + X,loc.y + Y,loc.z + Z) - if ( "inmarked" ) - target = marked_datum - - - //TODO ERRORAGE - Give support for "inhand" - - if(target) - for (var/path in paths) - for (var/i = 0; i < number; i++) - var/atom/O = new path(target) - if(O) - O.dir = obj_dir - if(obj_name) - O.name = obj_name - if(istype(O,/mob)) - var/mob/M = O - M.real_name = obj_name - - if (number == 1) - log_admin("[key_name(usr)] created a [english_list(paths)]") - for(var/path in paths) - if(ispath(path, /mob)) - message_admins("[key_name_admin(usr)] created a [english_list(paths)]", 1) - break - else - log_admin("[key_name(usr)] created [number]ea [english_list(paths)]") - for(var/path in paths) - if(ispath(path, /mob)) - message_admins("[key_name_admin(usr)] created [number]ea [english_list(paths)]", 1) - break - return - else - alert("You cannot spawn items right now.") - return - - if (href_list["secretsfun"]) - if ((src.rank in list( "Admin Candidate", "Trial Admin", "Badmin", "Game Admin", "Game Master" ))) - var/ok = 0 - switch(href_list["secretsfun"]) - if("sec_clothes") - feedback_inc("admin_secrets_fun_used",1) - feedback_add_details("admin_secrets_fun_used","SC") - for(var/obj/item/clothing/under/O in world) - del(O) - ok = 1 - if("sec_all_clothes") - feedback_inc("admin_secrets_fun_used",1) - feedback_add_details("admin_secrets_fun_used","SAC") - for(var/obj/item/clothing/O in world) - del(O) - ok = 1 - if("sec_classic1") - feedback_inc("admin_secrets_fun_used",1) - feedback_add_details("admin_secrets_fun_used","SC1") - for(var/obj/item/clothing/suit/fire/O in world) - del(O) - for(var/obj/structure/grille/O in world) - del(O) -/* for(var/obj/machinery/vehicle/pod/O in world) - for(var/mob/M in src) - M.loc = src.loc - if (M.client) - M.client.perspective = MOB_PERSPECTIVE - M.client.eye = M - del(O) - ok = 1*/ - if("toxic") - /* - feedback_inc("admin_secrets_fun_used",1) - feedback_add_details("admin_secrets_fun_used","T") - for(var/obj/machinery/atmoalter/siphs/fullairsiphon/O in world) - O.t_status = 3 - for(var/obj/machinery/atmoalter/siphs/scrubbers/O in world) - O.t_status = 1 - O.t_per = 1000000.0 - for(var/obj/machinery/atmoalter/canister/O in world) - if (!( istype(O, /obj/machinery/atmoalter/canister/oxygencanister) )) - O.t_status = 1 - O.t_per = 1000000.0 - else - O.t_status = 3 - */ - usr << "HEH" - if("monkey") - feedback_inc("admin_secrets_fun_used",1) - feedback_add_details("admin_secrets_fun_used","M") - for(var/mob/living/carbon/human/H in mob_list) - spawn(0) - H.monkeyize() - ok = 1 - if("corgi") - feedback_inc("admin_secrets_fun_used",1) - feedback_add_details("admin_secrets_fun_used","M") - for(var/mob/living/carbon/human/H in mob_list) - spawn(0) - H.corgize() - ok = 1 - if("power") - feedback_inc("admin_secrets_fun_used",1) - feedback_add_details("admin_secrets_fun_used","P") - log_admin("[key_name(usr)] made all areas powered", 1) - message_admins("\blue [key_name_admin(usr)] made all areas powered", 1) - power_restore() - if("unpower") - feedback_inc("admin_secrets_fun_used",1) - feedback_add_details("admin_secrets_fun_used","UP") - log_admin("[key_name(usr)] made all areas unpowered", 1) - message_admins("\blue [key_name_admin(usr)] made all areas unpowered", 1) - power_failure() - if("quickpower") - feedback_inc("admin_secrets_fun_used",1) - feedback_add_details("admin_secrets_fun_used","QP") - log_admin("[key_name(usr)] made all SMESs powered", 1) - message_admins("\blue [key_name_admin(usr)] made all SMESs powered", 1) - power_restore_quick() - if("activateprison") - feedback_inc("admin_secrets_fun_used",1) - feedback_add_details("admin_secrets_fun_used","AP") - world << "\blue Transit signature detected." - world << "\blue Incoming shuttle." - /* - var/A = locate(/area/shuttle_prison) - for(var/atom/movable/AM as mob|obj in A) - AM.z = 1 - AM.Move() - */ - message_admins("\blue [key_name_admin(usr)] sent the prison shuttle to the station.", 1) - if("deactivateprison") - /* - feedback_inc("admin_secrets_fun_used",1) - feedback_add_details("admin_secrets_fun_used","DP") - var/A = locate(/area/shuttle_prison) - for(var/atom/movable/AM as mob|obj in A) - AM.z = 2 - AM.Move() - */ - message_admins("\blue [key_name_admin(usr)] sent the prison shuttle back.", 1) - if("toggleprisonstatus") - feedback_inc("admin_secrets_fun_used",1) - feedback_add_details("admin_secrets_fun_used","TPS") - for(var/obj/machinery/computer/prison_shuttle/PS in world) - PS.allowedtocall = !(PS.allowedtocall) - message_admins("\blue [key_name_admin(usr)] toggled status of prison shuttle to [PS.allowedtocall].", 1) - if("prisonwarp") - if(!ticker) - alert("The game hasn't started yet!", null, null, null, null, null) - return - feedback_inc("admin_secrets_fun_used",1) - feedback_add_details("admin_secrets_fun_used","PW") - message_admins("\blue [key_name_admin(usr)] teleported all players to the prison station.", 1) - for(var/mob/living/carbon/human/H in mob_list) - var/turf/loc = find_loc(H) - var/security = 0 - if(loc.z > 1 || prisonwarped.Find(H)) - //don't warp them if they aren't ready or are already there - continue - H.Paralyse(5) - if(H.wear_id) - var/obj/item/weapon/card/id/id = H.get_idcard() - for(var/A in id.access) - if(A == access_security) - security++ - if(!security) - //strip their stuff before they teleport into a cell :downs: - for(var/obj/item/weapon/W in H) - if(istype(W, /datum/organ/external)) - continue - //don't strip organs - H.u_equip(W) - if (H.client) - H.client.screen -= W - if (W) - W.loc = H.loc - W.dropped(H) - W.layer = initial(W.layer) - //teleport person to cell - H.loc = pick(prisonwarp) - H.equip_to_slot_or_del(new /obj/item/clothing/under/color/orange(H), slot_w_uniform) - H.equip_to_slot_or_del(new /obj/item/clothing/shoes/orange(H), slot_shoes) - else - //teleport security person - H.loc = pick(prisonsecuritywarp) - prisonwarped += H - if("traitor_all") - if ((src.rank in list( "Admin Candidate", "Trial Admin", "Badmin", "Game Admin", "Game Master" ))) - if(!ticker) - alert("The game hasn't started yet!") - return - var/objective = copytext(sanitize(input("Enter an objective")),1,MAX_MESSAGE_LEN) - if(!objective) - return - feedback_inc("admin_secrets_fun_used",1) - feedback_add_details("admin_secrets_fun_used","TA([objective])") - for(var/mob/living/carbon/human/H in player_list) - if(H.stat == 2 || !H.client || !H.mind) continue - if(is_special_character(H)) continue - //traitorize(H, objective, 0) - ticker.mode.traitors += H.mind - H.mind.special_role = "traitor" - var/datum/objective/new_objective = new - new_objective.owner = H - new_objective.explanation_text = objective - H.mind.objectives += new_objective - ticker.mode.greet_traitor(H.mind) - //ticker.mode.forge_traitor_objectives(H.mind) - ticker.mode.finalize_traitor(H.mind) - for(var/mob/living/silicon/A in player_list) - ticker.mode.traitors += A.mind - A.mind.special_role = "traitor" - var/datum/objective/new_objective = new - new_objective.owner = A - new_objective.explanation_text = objective - A.mind.objectives += new_objective - ticker.mode.greet_traitor(A.mind) - ticker.mode.finalize_traitor(A.mind) - message_admins("\blue [key_name_admin(usr)] used everyone is a traitor secret. Objective is [objective]", 1) - log_admin("[key_name(usr)] used everyone is a traitor secret. Objective is [objective]") - else - alert("You're not of a high enough rank to do this") - if("moveminingshuttle") - if ((src.rank in list( "Admin Candidate", "Trial Admin", "Badmin", "Game Admin", "Game Master" ))) - if(mining_shuttle_moving) - return - feedback_inc("admin_secrets_fun_used",1) - feedback_add_details("admin_secrets_fun_used","ShM") - move_mining_shuttle() - message_admins("\blue [key_name_admin(usr)] moved mining shuttle", 1) - log_admin("[key_name(usr)] moved the mining shuttle") - else - alert("You're not of a high enough rank to do this") - if("moveadminshuttle") - if ((src.rank in list( "Admin Candidate", "Trial Admin", "Badmin", "Game Admin", "Game Master" ))) - feedback_inc("admin_secrets_fun_used",1) - feedback_add_details("admin_secrets_fun_used","ShA") - move_admin_shuttle() - message_admins("\blue [key_name_admin(usr)] moved the centcom administration shuttle", 1) - log_admin("[key_name(usr)] moved the centcom administration shuttle") - else - alert("You're not of a high enough rank to do this") - if("moveferry") - if ((src.rank in list( "Admin Candidate", "Trial Admin", "Badmin", "Game Admin", "Game Master" ))) - feedback_inc("admin_secrets_fun_used",1) - feedback_add_details("admin_secrets_fun_used","ShF") - move_ferry() - message_admins("\blue [key_name_admin(usr)] moved the centcom ferry", 1) - log_admin("[key_name(usr)] moved the centcom ferry") - else - alert("You're not of a high enough rank to do this") - if("movealienship") - if ((src.rank in list( "Admin Candidate", "Trial Admin", "Badmin", "Game Admin", "Game Master" ))) - feedback_inc("admin_secrets_fun_used",1) - feedback_add_details("admin_secrets_fun_used","ShX") - move_alien_ship() - message_admins("\blue [key_name_admin(usr)] moved the alien dinghy", 1) - log_admin("[key_name(usr)] moved the alien dinghy") - else - alert("You're not of a high enough rank to do this") - if("togglebombcap") - if (src.rank in list( "Game Admin", "Game Master" )) - feedback_inc("admin_secrets_fun_used",1) - feedback_add_details("admin_secrets_fun_used","BC") - switch(MAX_EXPLOSION_RANGE) - if(14) - MAX_EXPLOSION_RANGE = 16 - if(16) - MAX_EXPLOSION_RANGE = 20 - if(20) - MAX_EXPLOSION_RANGE = 28 - if(28) - MAX_EXPLOSION_RANGE = 56 - if(56) - MAX_EXPLOSION_RANGE = 128 - if(128) - MAX_EXPLOSION_RANGE = 14 - var/range_dev = MAX_EXPLOSION_RANGE *0.25 - var/range_high = MAX_EXPLOSION_RANGE *0.5 - var/range_low = MAX_EXPLOSION_RANGE - message_admins("\red [key_name_admin(usr)] changed the bomb cap to [range_dev], [range_high], [range_low]", 1) - log_admin("[key_name_admin(usr)] changed the bomb cap to [MAX_EXPLOSION_RANGE]") - else - alert("No way. You're not of a high enough rank to do this.") - - if("flicklights") - feedback_inc("admin_secrets_fun_used",1) - feedback_add_details("admin_secrets_fun_used","FL") - while(!usr.stat) - //knock yourself out to stop the ghosts - for(var/mob/M in player_list) - if(M.stat != 2 && prob(25)) - var/area/AffectedArea = get_area(M) - if(AffectedArea.name != "Space" && AffectedArea.name != "Engine Walls" && AffectedArea.name != "Chemical Lab Test Chamber" && AffectedArea.name != "Escape Shuttle" && AffectedArea.name != "Arrival Area" && AffectedArea.name != "Arrival Shuttle" && AffectedArea.name != "start area" && AffectedArea.name != "Engine Combustion Chamber") - AffectedArea.power_light = 0 - AffectedArea.power_change() - spawn(rand(55,185)) - AffectedArea.power_light = 1 - AffectedArea.power_change() - var/Message = rand(1,4) - switch(Message) - if(1) - M.show_message(text("\blue You shudder as if cold..."), 1) - if(2) - M.show_message(text("\blue You feel something gliding across your back..."), 1) - if(3) - M.show_message(text("\blue Your eyes twitch, you feel like something you can't see is here..."), 1) - if(4) - M.show_message(text("\blue You notice something moving out of the corner of your eye, but nothing is there..."), 1) - for(var/obj/W in orange(5,M)) - if(prob(25) && !W.anchored) - step_rand(W) - sleep(rand(100,1000)) - for(var/mob/M in player_list) - if(M.stat != 2) - M.show_message(text("\blue The chilling wind suddenly stops..."), 1) - /* if("shockwave") - ok = 1 - world << "\red ALERT: STATION STRESS CRITICAL" - sleep(60) - world << "\red ALERT: STATION STRESS CRITICAL. TOLERABLE LEVELS EXCEEDED!" - sleep(80) - world << "\red ALERT: STATION STRUCTURAL STRESS CRITICAL. SAFETY MECHANISMS FAILED!" - sleep(40) - for(var/mob/M in world) - shake_camera(M, 400, 1) - for(var/obj/structure/window/W in world) - spawn(0) - sleep(rand(10,400)) - W.ex_act(rand(2,1)) - for(var/obj/structure/grille/G in world) - spawn(0) - sleep(rand(20,400)) - G.ex_act(rand(2,1)) - for(var/obj/machinery/door/D in world) - spawn(0) - sleep(rand(20,400)) - D.ex_act(rand(2,1)) - for(var/turf/station/floor/Floor in world) - spawn(0) - sleep(rand(30,400)) - Floor.ex_act(rand(2,1)) - for(var/obj/structure/cable/Cable in world) - spawn(0) - sleep(rand(30,400)) - Cable.ex_act(rand(2,1)) - for(var/obj/structure/closet/Closet in world) - spawn(0) - sleep(rand(30,400)) - Closet.ex_act(rand(2,1)) - for(var/obj/machinery/Machinery in world) - spawn(0) - sleep(rand(30,400)) - Machinery.ex_act(rand(1,3)) - for(var/turf/station/wall/Wall in world) - spawn(0) - sleep(rand(30,400)) - Wall.ex_act(rand(2,1)) */ - if("wave") - feedback_inc("admin_secrets_fun_used",1) - feedback_add_details("admin_secrets_fun_used","MW") - if ((src.rank in list("Trial Admin", "Badmin", "Game Admin", "Game Master" ))) - meteor_wave() - message_admins("[key_name_admin(usr)] has spawned meteors", 1) - command_alert("Meteors have been detected on collision course with the station.", "Meteor Alert") - world << sound('sound/AI/meteors.ogg') - else - alert("You cannot perform this action. You must be of a higher administrative rank!", null, null, null, null, null) - return - if("gravanomalies") - feedback_inc("admin_secrets_fun_used",1) - feedback_add_details("admin_secrets_fun_used","GA") - command_alert("Gravitational anomalies detected on the station. There is no additional data.", "Anomaly Alert") - world << sound('sound/AI/granomalies.ogg') - var/turf/T = pick(blobstart) - var/obj/effect/bhole/bh = new /obj/effect/bhole( T.loc, 30 ) - spawn(rand(100, 600)) - del(bh) - - if("timeanomalies") //dear god this code was awful :P Still needs further optimisation - feedback_inc("admin_secrets_fun_used",1) - feedback_add_details("admin_secrets_fun_used","STA") - //moved to its own dm so I could split it up and prevent the spawns copying variables over and over - //can be found in code\game\game_modes\events\wormholes.dm - wormhole_event() - - if("goblob") - feedback_inc("admin_secrets_fun_used",1) - feedback_add_details("admin_secrets_fun_used","BL") - mini_blob_event() - message_admins("[key_name_admin(usr)] has spawned blob", 1) - if("aliens") - feedback_inc("admin_secrets_fun_used",1) - feedback_add_details("admin_secrets_fun_used","AL") - if(aliens_allowed) - alien_infestation() - message_admins("[key_name_admin(usr)] has spawned aliens", 1) - if("comms_blackout") - feedback_inc("admin_secrets_fun_used",1) - feedback_add_details("admin_secrets_fun_used","CB") - var/answer = alert(usr, "Would you like to alert the crew?", "Alert", "Yes", "No") - if(answer == "Yes") - communications_blackout(0) - else - communications_blackout(1) - message_admins("[key_name_admin(usr)] triggered a communications blackout.", 1) - if("spaceninja") - feedback_inc("admin_secrets_fun_used",1) - feedback_add_details("admin_secrets_fun_used","SN") - if(toggle_space_ninja) - if(space_ninja_arrival())//If the ninja is actually spawned. They may not be depending on a few factors. - message_admins("[key_name_admin(usr)] has sent in a space ninja", 1) - if("carp") - feedback_inc("admin_secrets_fun_used",1) - feedback_add_details("admin_secrets_fun_used","C") - var/choice = input("You sure you want to spawn carp?") in list("Badmin", "Cancel") - if(choice == "Badmin") - message_admins("[key_name_admin(usr)] has spawned carp.", 1) - carp_migration() - if("radiation") - feedback_inc("admin_secrets_fun_used",1) - feedback_add_details("admin_secrets_fun_used","R") - message_admins("[key_name_admin(usr)] has has irradiated the station", 1) - high_radiation_event() - if("immovable") - feedback_inc("admin_secrets_fun_used",1) - feedback_add_details("admin_secrets_fun_used","IR") - message_admins("[key_name_admin(usr)] has sent an immovable rod to the station", 1) - immovablerod() - if("prison_break") - feedback_inc("admin_secrets_fun_used",1) - feedback_add_details("admin_secrets_fun_used","PB") - message_admins("[key_name_admin(usr)] has allowed a prison break", 1) - prison_break() - if("lightout") - feedback_inc("admin_secrets_fun_used",1) - feedback_add_details("admin_secrets_fun_used","LO") - message_admins("[key_name_admin(usr)] has broke a lot of lights", 1) - lightsout(1,2) - if("blackout") - feedback_inc("admin_secrets_fun_used",1) - feedback_add_details("admin_secrets_fun_used","BO") - message_admins("[key_name_admin(usr)] broke all lights", 1) - lightsout(0,0) - if("whiteout") - feedback_inc("admin_secrets_fun_used",1) - feedback_add_details("admin_secrets_fun_used","WO") - for(var/obj/machinery/light/L in world) - L.fix() - message_admins("[key_name_admin(usr)] fixed all lights", 1) - if("friendai") - feedback_inc("admin_secrets_fun_used",1) - feedback_add_details("admin_secrets_fun_used","FA") - for(var/mob/aiEye/aE in mob_list) - aE.icon_state = "ai_friend" - for(var/obj/machinery/M in machines) - if(istype(M, /obj/machinery/ai_status_display)) - var/obj/machinery/ai_status_display/A = M - A.emotion = "Friend Computer" - else if(istype(M, /obj/machinery/status_display)) - var/obj/machinery/status_display/A = M - A.friendc = 1 - message_admins("[key_name_admin(usr)] turned all AIs into best friends.", 1) - if("floorlava") - if(floorIsLava) - usr << "The floor is lava already." - return - feedback_inc("admin_secrets_fun_used",1) - feedback_add_details("admin_secrets_fun_used","LF") - - //Options - var/length = input(usr, "How long will the lava last? (in seconds)", "Length", 180) as num - length = min(abs(length), 1200) - - var/damage = input(usr, "How deadly will the lava be?", "Damage", 2) as num - damage = min(abs(damage), 100) - - var/sure = alert(usr, "Are you sure you want to do this?", "Confirmation", "YES!", "Nah") - if(sure == "Nah") - return - floorIsLava = 1 - - message_admins("[key_name_admin(usr)] made the floor LAVA! It'll last [length] seconds and it will deal [damage] damage to everyone.", 1) - - for(var/turf/simulated/floor/F in world) - if(F.z == 1) - F.name = "lava" - F.desc = "The floor is LAVA!" - F.overlays += "lava" - F.lava = 1 - - spawn(0) - for(var/i = i, i < length, i++) // 180 = 3 minutes - if(damage) - for(var/mob/living/carbon/L in living_mob_list) - if(istype(L.loc, /turf/simulated/floor)) // Are they on LAVA?! - var/turf/simulated/floor/F = L.loc - if(F.lava) - var/safe = 0 - for(var/obj/structure/O in F.contents) - if(O.level > F.level && !istype(O, /obj/structure/window)) // Something to stand on and it isn't under the floor! - safe = 1 - break - if(!safe) - L.adjustFireLoss(damage) - - - sleep(10) - - for(var/turf/simulated/floor/F in world) // Reset everything. - if(F.z == 1) - F.name = initial(F.name) - F.desc = initial(F.desc) - F.overlays = null - F.lava = 0 - F.update_icon() - floorIsLava = 0 - return - if("virus") - feedback_inc("admin_secrets_fun_used",1) - feedback_add_details("admin_secrets_fun_used","V") - var/answer = alert("Do you want this to be a random disease or do you have something in mind?",,"Virus2","Random","Choose") - if(answer=="Random") - viral_outbreak() - message_admins("[key_name_admin(usr)] has triggered a virus outbreak", 1) - else if(answer == "Choose") - var/list/viruses = list("fake gbs","gbs","magnitis","wizarditis",/*"beesease",*/"brain rot","cold","retrovirus","flu","pierrot's throat","rhumba beat") - var/V = input("Choose the virus to spread", "BIOHAZARD") in viruses - viral_outbreak(V) - message_admins("[key_name_admin(usr)] has triggered a virus outbreak of [V]", 1) - else - usr << "Nope" - /* - var/lesser = (alert("Do you want to infect the mob with a major or minor disease?",,"Major","Minor") == "Minor") - var/mob/living/carbon/victim = input("Select a mob to infect", "Virus2") as null|mob in world - if(!istype(victim)) return - if(lesser) - infect_mob_random_lesser(victim) - else - infect_mob_random_greater(victim) - message_admins("[key_name_admin(usr)] has infected [victim] with a [lesser ? "minor" : "major"] virus2.", 1) - */ - if("retardify") - if (src.rank in list("Badmin", "Game Admin", "Game Master")) - feedback_inc("admin_secrets_fun_used",1) - feedback_add_details("admin_secrets_fun_used","RET") - for(var/mob/living/carbon/human/H in player_list) - H << "\red You suddenly feel stupid." - H.setBrainLoss(60) - message_admins("[key_name_admin(usr)] made everybody retarded") - else - alert("You cannot perform this action. You must be of a higher administrative rank!") - return - if("fakeguns") - if (src.rank in list("Badmin", "Game Admin", "Game Master")) - feedback_inc("admin_secrets_fun_used",1) - feedback_add_details("admin_secrets_fun_used","FG") - for(var/obj/item/W in world) - if(istype(W, /obj/item/clothing) || istype(W, /obj/item/weapon/card/id) || istype(W, /obj/item/weapon/disk) || istype(W, /obj/item/weapon/tank)) - continue - W.icon = 'icons/obj/gun.dmi' - W.icon_state = "revolver" - W.item_state = "gun" - message_admins("[key_name_admin(usr)] made every item look like a gun") - else - alert("You cannot perform this action. You must be of a higher administrative rank!") - return - if("schoolgirl") - if (src.rank in list("Badmin", "Game Admin", "Game Master")) - feedback_inc("admin_secrets_fun_used",1) - feedback_add_details("admin_secrets_fun_used","SG") - for(var/obj/item/clothing/under/W in world) - W.icon_state = "schoolgirl" - W.item_state = "w_suit" - W.color = "schoolgirl" - message_admins("[key_name_admin(usr)] activated Japanese Animes mode") - world << sound('sound/AI/animes.ogg') - else - alert("You cannot perform this action. You must be of a higher administrative rank!") - return - if("dorf") - if (src.rank in list("Badmin","Game Admin", "Game Master")) - feedback_inc("admin_secrets_fun_used",1) - feedback_add_details("admin_secrets_fun_used","DF") - for(var/mob/living/carbon/human/B in mob_list) - B.f_style = "Dward Beard" - B.update_hair() - message_admins("[key_name_admin(usr)] activated dorf mode") - else - alert("You cannot perform this action. You must be of a higher administrative rank!") - return - if("ionstorm") - if (src.rank in list("Badmin","Game Admin", "Game Master")) - feedback_inc("admin_secrets_fun_used",1) - feedback_add_details("admin_secrets_fun_used","I") - IonStorm() - message_admins("[key_name_admin(usr)] triggered an ion storm") - var/show_log = alert(usr, "Show ion message?", "Message", "Yes", "No") - if(show_log == "Yes") - command_alert("Ion storm detected near the station. Please check all AI-controlled equipment for errors.", "Anomaly Alert") - world << sound('sound/AI/ionstorm.ogg') - else - alert("You cannot perform this action. You must be of a higher administrative rank!") - return - if("spacevines") - feedback_inc("admin_secrets_fun_used",1) - feedback_add_details("admin_secrets_fun_used","K") - spacevine_infestation() - message_admins("[key_name_admin(usr)] has spawned spacevines", 1) - if (usr) - log_admin("[key_name(usr)] used secret [href_list["secretsfun"]]") - if (ok) - world << text("A secret has been activated by []!", usr.key) - return - - if (href_list["secretsadmin"]) - if ((src.rank in list( "Moderator", "Temporary Admin", "Admin Candidate", "Trial Admin", "Badmin", "Game Admin", "Game Master" ))) - var/ok = 0 - switch(href_list["secretsadmin"]) - if("clear_bombs") - //I do nothing - if("list_bombers") - var/dat = "Bombing List
" - for(var/l in bombers) - dat += text("[l]
") - usr << browse(dat, "window=bombers") - if("list_signalers") - var/dat = "Showing last [length(lastsignalers)] signalers.
" - for(var/sig in lastsignalers) - dat += "[sig]
" - usr << browse(dat, "window=lastsignalers;size=800x500") - if("list_lawchanges") - var/dat = "Showing last [length(lawchanges)] law changes.
" - for(var/sig in lawchanges) - dat += "[sig]
" - usr << browse(dat, "window=lawchanges;size=800x500") - if("list_job_debug") - var/dat = "Job Debug info.
" - if(job_master) - for(var/line in job_master.job_debug) - dat += "[line]
" - dat+= "*******

" - for(var/datum/job/job in job_master.occupations) - if(!job) continue - dat += "job: [job.title], current_positions: [job.current_positions], total_positions: [job.total_positions]
" - usr << browse(dat, "window=jobdebug;size=600x500") - if("check_antagonist") - check_antagonists() - if("showailaws") - output_ai_laws() - if("showgm") - if(!ticker) - alert("The game hasn't started yet!") - else if (ticker.mode) - alert("The game mode is [ticker.mode.name]") - else alert("For some reason there's a ticker, but not a game mode") - if("manifest") - var/dat = "Showing Crew Manifest.
" - dat += "" - for(var/mob/living/carbon/human/H in mob_list) - if(H.ckey) - dat += text("", H.name, H.get_assignment()) - dat += "
NamePosition
[][]
" - usr << browse(dat, "window=manifest;size=440x410") - if("DNA") - var/dat = "Showing DNA from blood.
" - dat += "" - for(var/mob/living/carbon/human/H in mob_list) - if(H.dna && H.ckey) - dat += "" - dat += "
NameDNABlood Type
[H][H.dna.unique_enzymes][H.b_type]
" - usr << browse(dat, "window=DNA;size=440x410") - if("fingerprints") - var/dat = "Showing Fingerprints.
" - dat += "" - for(var/mob/living/carbon/human/H in mob_list) - if(H.ckey) - if(H.dna && H.dna.uni_identity) - dat += "" - else if(H.dna && !H.dna.uni_identity) - dat += "" - else if(!H.dna) - dat += "" - dat += "
NameFingerprints
[H][md5(H.dna.uni_identity)]
[H]H.dna.uni_identity = null
[H]H.dna = null
" - usr << browse(dat, "window=fingerprints;size=440x410") - else - if (usr) - log_admin("[key_name(usr)] used secret [href_list["secretsadmin"]]") - if (ok) - world << text("A secret has been activated by []!", usr.key) - return - if (href_list["secretscoder"]) - if ((src.rank in list( "Badmin", "Game Admin", "Game Master" ))) - switch(href_list["secretscoder"]) - if("spawn_objects") - var/dat = "Admin Log
" - for(var/l in admin_log) - dat += "
  • [l]
  • " - if(!admin_log.len) - dat += "No-one has done anything this round!" - usr << browse(dat, "window=admin_log") - if("maint_access_brig") - for(var/obj/machinery/door/airlock/maintenance/M in world) - if (access_maint_tunnels in M.req_access) - M.req_access = list(access_brig) - message_admins("[key_name_admin(usr)] made all maint doors brig access-only.") - if("maint_access_engiebrig") - for(var/obj/machinery/door/airlock/maintenance/M in world) - if (access_maint_tunnels in M.req_access) - M.req_access = list() - M.req_one_access = list(access_brig,access_engine) - message_admins("[key_name_admin(usr)] made all maint doors engineering and brig access-only.") - if("infinite_sec") - var/datum/job/J = job_master.GetJob("Security Officer") - if(!J) return - J.total_positions = -1 - J.spawn_positions = -1 - message_admins("[key_name_admin(usr)] has removed the cap on security officers.") - return - //hahaha - - - if(href_list["ac_view_wanted"]) //Admin newscaster Topic() stuff be here - src.admincaster_screen = 18 //The ac_ prefix before the hrefs stands for AdminCaster. - src.access_news_network() - if(href_list["ac_set_channel_name"]) - src.admincaster_feed_channel.channel_name = strip_html_simple(input(usr, "Provide a Feed Channel Name", "Network Channel Handler", "")) - while (findtext(src.admincaster_feed_channel.channel_name," ") == 1) - src.admincaster_feed_channel.channel_name = copytext(src.admincaster_feed_channel.channel_name,2,lentext(src.admincaster_feed_channel.channel_name)+1) - src.access_news_network() - - if(href_list["ac_set_channel_lock"]) - src.admincaster_feed_channel.locked = !src.admincaster_feed_channel.locked - src.access_news_network() - - if(href_list["ac_submit_new_channel"]) - var/check = 0 - for(var/datum/feed_channel/FC in news_network.network_channels) - if(FC.channel_name == src.admincaster_feed_channel.channel_name) - check = 1 - break - if(src.admincaster_feed_channel.channel_name == "" || src.admincaster_feed_channel.channel_name == "\[REDACTED\]" || check ) - src.admincaster_screen=7 - else - var/choice = alert("Please confirm Feed channel creation","Network Channel Handler","Confirm","Cancel") - if(choice=="Confirm") - var/datum/feed_channel/newChannel = new /datum/feed_channel - newChannel.channel_name = src.admincaster_feed_channel.channel_name - newChannel.author = src.admincaster_signature - newChannel.locked = src.admincaster_feed_channel.locked - newChannel.is_admin_channel = 1 - feedback_inc("newscaster_channels",1) - news_network.network_channels += newChannel //Adding channel to the global network - log_admin("[key_name_admin(usr)] created command feed channel: [src.admincaster_feed_channel.channel_name]!") - src.admincaster_screen=5 - src.access_news_network() - - if(href_list["ac_set_channel_receiving"]) - var/list/available_channels = list() - for(var/datum/feed_channel/F in news_network.network_channels) - available_channels += F.channel_name - src.admincaster_feed_channel.channel_name = adminscrub(input(usr, "Choose receiving Feed Channel", "Network Channel Handler") in available_channels ) - src.access_news_network() - - if(href_list["ac_set_new_message"]) - src.admincaster_feed_message.body = adminscrub(input(usr, "Write your Feed story", "Network Channel Handler", "")) - while (findtext(src.admincaster_feed_message.body," ") == 1) - src.admincaster_feed_message.body = copytext(src.admincaster_feed_message.body,2,lentext(src.admincaster_feed_message.body)+1) - src.access_news_network() - - if(href_list["ac_submit_new_message"]) - if(src.admincaster_feed_message.body =="" || src.admincaster_feed_message.body =="\[REDACTED\]" || src.admincaster_feed_channel.channel_name == "" ) - src.admincaster_screen = 6 - else - var/datum/feed_message/newMsg = new /datum/feed_message - newMsg.author = src.admincaster_signature - newMsg.body = src.admincaster_feed_message.body - newMsg.is_admin_message = 1 - feedback_inc("newscaster_stories",1) - for(var/datum/feed_channel/FC in news_network.network_channels) - if(FC.channel_name == src.admincaster_feed_channel.channel_name) - FC.messages += newMsg //Adding message to the network's appropriate feed_channel - break - src.admincaster_screen=4 - - for(var/obj/machinery/newscaster/NEWSCASTER in allCasters) - NEWSCASTER.newsAlert(src.admincaster_feed_channel.channel_name) - - log_admin("[key_name_admin(usr)] submitted a feed story to channel: [src.admincaster_feed_channel.channel_name]!") - src.access_news_network() - - if(href_list["ac_create_channel"]) - src.admincaster_screen=2 - src.access_news_network() - - if(href_list["ac_create_feed_story"]) - src.admincaster_screen=3 - src.access_news_network() - - if(href_list["ac_menu_censor_story"]) - src.admincaster_screen=10 - src.access_news_network() - - if(href_list["ac_menu_censor_channel"]) - src.admincaster_screen=11 - src.access_news_network() - - if(href_list["ac_menu_wanted"]) - var/already_wanted = 0 - if(news_network.wanted_issue) - already_wanted = 1 - - if(already_wanted) - src.admincaster_feed_message.author = news_network.wanted_issue.author - src.admincaster_feed_message.body = news_network.wanted_issue.body - src.admincaster_screen = 14 - src.access_news_network() - - if(href_list["ac_set_wanted_name"]) - src.admincaster_feed_message.author = adminscrub(input(usr, "Provide the name of the Wanted person", "Network Security Handler", "")) - while (findtext(src.admincaster_feed_message.author," ") == 1) - src.admincaster_feed_message.author = copytext(admincaster_feed_message.author,2,lentext(admincaster_feed_message.author)+1) - src.access_news_network() - - if(href_list["ac_set_wanted_desc"]) - src.admincaster_feed_message.body = adminscrub(input(usr, "Provide the a description of the Wanted person and any other details you deem important", "Network Security Handler", "")) - while (findtext(src.admincaster_feed_message.body," ") == 1) - src.admincaster_feed_message.body = copytext(src.admincaster_feed_message.body,2,lentext(src.admincaster_feed_message.body)+1) - src.access_news_network() - - if(href_list["ac_submit_wanted"]) - var/input_param = text2num(href_list["ac_submit_wanted"]) - if(src.admincaster_feed_message.author == "" || src.admincaster_feed_message.body == "") - src.admincaster_screen = 16 - else - var/choice = alert("Please confirm Wanted Issue [(input_param==1) ? ("creation.") : ("edit.")]","Network Security Handler","Confirm","Cancel") - if(choice=="Confirm") - if(input_param==1) //If input_param == 1 we're submitting a new wanted issue. At 2 we're just editing an existing one. See the else below - var/datum/feed_message/WANTED = new /datum/feed_message - WANTED.author = src.admincaster_feed_message.author //Wanted name - WANTED.body = src.admincaster_feed_message.body //Wanted desc - WANTED.backup_author = src.admincaster_signature //Submitted by - WANTED.is_admin_message = 1 - news_network.wanted_issue = WANTED - for(var/obj/machinery/newscaster/NEWSCASTER in allCasters) - NEWSCASTER.newsAlert() - NEWSCASTER.update_icon() - src.admincaster_screen = 15 - else - news_network.wanted_issue.author = src.admincaster_feed_message.author - news_network.wanted_issue.body = src.admincaster_feed_message.body - news_network.wanted_issue.backup_author = src.admincaster_feed_message.backup_author - src.admincaster_screen = 19 - log_admin("[key_name_admin(usr)] issued a Station-wide Wanted Notification for [src.admincaster_feed_message.author]!") - src.access_news_network() - - if(href_list["ac_cancel_wanted"]) - var/choice = alert("Please confirm Wanted Issue removal","Network Security Handler","Confirm","Cancel") - if(choice=="Confirm") - news_network.wanted_issue = null - for(var/obj/machinery/newscaster/NEWSCASTER in allCasters) - NEWSCASTER.update_icon() - src.admincaster_screen=17 - src.access_news_network() - - if(href_list["ac_censor_channel_author"]) - var/datum/feed_channel/FC = locate(href_list["ac_censor_channel_author"]) - if(FC.author != "\[REDACTED\]") - FC.backup_author = FC.author - FC.author = "\[REDACTED\]" - else - FC.author = FC.backup_author - src.access_news_network() - - if(href_list["ac_censor_channel_story_author"]) - var/datum/feed_message/MSG = locate(href_list["ac_censor_channel_story_author"]) - if(MSG.author != "\[REDACTED\]") - MSG.backup_author = MSG.author - MSG.author = "\[REDACTED\]" - else - MSG.author = MSG.backup_author - src.access_news_network() - - if(href_list["ac_censor_channel_story_body"]) - var/datum/feed_message/MSG = locate(href_list["ac_censor_channel_story_body"]) - if(MSG.body != "\[REDACTED\]") - MSG.backup_body = MSG.body - MSG.body = "\[REDACTED\]" - else - MSG.body = MSG.backup_body - src.access_news_network() - - if(href_list["ac_pick_d_notice"]) - var/datum/feed_channel/FC = locate(href_list["ac_pick_d_notice"]) - src.admincaster_feed_channel = FC - src.admincaster_screen=13 - src.access_news_network() - - if(href_list["ac_toggle_d_notice"]) - var/datum/feed_channel/FC = locate(href_list["ac_toggle_d_notice"]) - FC.censored = !FC.censored - src.access_news_network() - - if(href_list["ac_view"]) - src.admincaster_screen=1 - src.access_news_network() - - if(href_list["ac_setScreen"]) //Brings us to the main menu and resets all fields~ - src.admincaster_screen = text2num(href_list["ac_setScreen"]) - if (src.admincaster_screen == 0) - if(src.admincaster_feed_channel) - src.admincaster_feed_channel = new /datum/feed_channel - if(src.admincaster_feed_message) - src.admincaster_feed_message = new /datum/feed_message - src.access_news_network() - - if(href_list["ac_show_channel"]) - var/datum/feed_channel/FC = locate(href_list["ac_show_channel"]) - src.admincaster_feed_channel = FC - src.admincaster_screen = 9 - src.access_news_network() - - if(href_list["ac_pick_censor_channel"]) - var/datum/feed_channel/FC = locate(href_list["ac_pick_censor_channel"]) - src.admincaster_feed_channel = FC - src.admincaster_screen = 12 - src.access_news_network() - - if(href_list["ac_refresh"]) - src.access_news_network() - - if(href_list["ac_set_signature"]) - src.admincaster_signature = adminscrub(input(usr, "Provide your desired signature", "Network Identity Handler", "")) - src.access_news_network() \ No newline at end of file + if(show_msg) + usr << "Error: You are not an admin." + return 0 + +/proc/check_if_greater_rights_than(client/other) + if(usr && usr.client) + if(usr.client.holder) + if(!other || !other.holder) + return 1 + if(usr.client.holder.rights != other.holder.rights) + if( (usr.client.holder.rights & other.holder.rights) == other.holder.rights ) + return 1 //we have all the rights they have and more + usr << "Error: Cannot proceed. They have more or equal rights to us." + return 0 + +/client/proc/update_admin() + add_admin_verbs() + + +/client/proc/deadmin() + admin_datums -= ckey + if(holder) + holder.disassociate() + del(holder) + return 1 \ No newline at end of file diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm new file mode 100644 index 00000000000..96b6beb0d10 --- /dev/null +++ b/code/modules/admin/topic.dm @@ -0,0 +1,2348 @@ +/datum/admins/Topic(href, href_list) + ..() + if(usr.client != src.owner) + world << "\blue [usr.key] has attempted to override the admin panel!" + log_admin("[key_name(usr)] tried to use the admin panel without authorization.") + return + + if(!check_rights(0)) return //check they are an admin + + if(href_list["makeAntag"]) + switch(href_list["makeAntag"]) + if("1") + log_admin("[key_name(usr)] has spawned a traitor.") + if(!src.makeTratiors()) + usr << "\red Unfortunatly there were no candidates available" + if("2") + log_admin("[key_name(usr)] has spawned a changeling.") + if(!src.makeChanglings()) + usr << "\red Unfortunatly there were no candidates available" + if("3") + log_admin("[key_name(usr)] has spawned revolutionaries.") + if(!src.makeRevs()) + usr << "\red Unfortunatly there were no candidates available" + if("4") + log_admin("[key_name(usr)] has spawned a cultists.") + if(!src.makeCult()) + usr << "\red Unfortunatly there were no candidates available" + if("5") + log_admin("[key_name(usr)] has spawned a malf AI.") + if(!src.makeMalfAImode()) + usr << "\red Unfortunatly there were no candidates available" + if("6") + log_admin("[key_name(usr)] has spawned a wizard.") + if(!src.makeWizard()) + usr << "\red Unfortunatly there were no candidates available" + if("7") + log_admin("[key_name(usr)] has spawned a nuke team.") + if(!src.makeNukeTeam()) + usr << "\red Unfortunatly there were no candidates available" + if("8") + log_admin("[key_name(usr)] has spawned a ninja.") + src.makeSpaceNinja() + if("9") + log_admin("[key_name(usr)] has spawned aliens.") + src.makeAliens() + if("10") + log_admin("[key_name(usr)] has spawned a death squad.") + if(!src.makeDeathsquad()) + usr << "\red Unfortunatly there were no candidates available" + +/* Temporarily commented out + if(href_list["editadminpermissions"]) + if(!usr.client) + return + + var/adm_ckey = href_list["editadminckey"] + if(!adm_ckey) + usr << "\red no valid ckey" + return + + if(!usr.client.holder || !(usr.client.holder.sql_permissions & PERMISSIONS)) + usr << "\red You do not have permission to do this!" + message_admins("[key_name_admin(usr)] attempted to edit the admin permissions of [adm_ckey] without authentication!") + log_admin("[key_name(usr)] attempted to edit the admin permissions of [adm_ckey] without authentication!") + return + + switch(href_list["editadminpermissions"]) + if("permissions") + usr << "Currently unavailable since nothing runs off of permissions" + if("rank") + var/new_rank = input("Please, select a rank", "New rank for player", null, null) as null|anything in list("Game Master","Game Admin", "Trial Admin", "Admin Observer") + if(!new_rank) + return + message_admins("[key_name_admin(usr)] edited the admin rank of [adm_ckey] to [new_rank]") + log_admin("[key_name(usr)] edited the admin rank of [adm_ckey] to [new_rank]") + log_admin_rank_modification(adm_ckey, new_rank) + if("remove") + if(alert("Are you sure you want to remove [adm_ckey]?","Message","Yes","Cancel") == "Yes") + message_admins("[key_name_admin(usr)] removed [adm_ckey] from the admins list") + log_admin("[key_name(usr)] removed [adm_ckey] from the admins list") + log_admin_rank_modification(adm_ckey, "Removed") + if("add") + var/new_ckey = input(usr,"New admin's ckey","Admin ckey", null) as text|null + if(!new_ckey) + return + var/new_rank = input("Please, select a rank", "New rank for player", null, null) as null|anything in list("Game Master","Game Admin", "Trial Admin", "Admin Observer") + if(!new_rank) + return + message_admins("[key_name_admin(usr)] added [new_ckey] as a new admin to the rank [new_rank]") + log_admin("[key_name(usr)] added [new_ckey] as a new admin to the rank [new_rank]") + log_admin_rank_modification(new_ckey, new_rank) +*/ + + + else if(href_list["call_shuttle"]) + if(!check_rights(R_ADMIN)) return + + if( ticker.mode.name == "blob" ) + alert("You can't call the shuttle during blob!") + return + + switch(href_list["call_shuttle"]) + if("1") + if ((!( ticker ) || emergency_shuttle.location)) + return + emergency_shuttle.incall() + captain_announce("The emergency shuttle has been called. It will arrive in [round(emergency_shuttle.timeleft()/60)] minutes.") + log_admin("[key_name(usr)] called the Emergency Shuttle") + message_admins("\blue [key_name_admin(usr)] called the Emergency Shuttle to the station", 1) + + if("2") + if ((!( ticker ) || emergency_shuttle.location || emergency_shuttle.direction == 0)) + return + switch(emergency_shuttle.direction) + if(-1) + emergency_shuttle.incall() + captain_announce("The emergency shuttle has been called. It will arrive in [round(emergency_shuttle.timeleft()/60)] minutes.") + log_admin("[key_name(usr)] called the Emergency Shuttle") + message_admins("\blue [key_name_admin(usr)] called the Emergency Shuttle to the station", 1) + if(1) + emergency_shuttle.recall() + log_admin("[key_name(usr)] sent the Emergency Shuttle back") + message_admins("\blue [key_name_admin(usr)] sent the Emergency Shuttle back", 1) + + href_list["secretsadmin"] = "check_antagonist" + + else if(href_list["edit_shuttle_time"]) + if(!check_rights(R_SERVER)) return + + emergency_shuttle.settimeleft( input("Enter new shuttle duration (seconds):","Edit Shuttle Timeleft", emergency_shuttle.timeleft() ) as num ) + log_admin("[key_name(usr)] edited the Emergency Shuttle's timeleft to [emergency_shuttle.timeleft()]") + captain_announce("The emergency shuttle has been called. It will arrive in [round(emergency_shuttle.timeleft()/60)] minutes.") + message_admins("\blue [key_name_admin(usr)] edited the Emergency Shuttle's timeleft to [emergency_shuttle.timeleft()]", 1) + href_list["secretsadmin"] = "check_antagonist" + + else if(href_list["delay_round_end"]) + if(!check_rights(R_SERVER)) return + + ticker.delay_end = !ticker.delay_end + log_admin("[key_name(usr)] [ticker.delay_end ? "delayed the round end" : "has made the round end normally"].") + message_admins("\blue [key_name(usr)] [ticker.delay_end ? "delayed the round end" : "has made the round end normally"].", 1) + href_list["secretsadmin"] = "check_antagonist" + + else if(href_list["simplemake"]) + if(!check_rights(R_FUN)) return + + var/mob/M = locate(href_list["mob"]) + if(!ismob(M)) + usr << "This can only be used on instances of type /mob" + return + + var/delmob = 0 + switch(alert("Delete old mob?","Message","Yes","No","Cancel")) + if("Cancel") return + if("Yes") delmob = 1 + + log_admin("[key_name(usr)] has used rudimentary transformation on [key_name(M)]. Transforming to [href_list["simplemake"]]; deletemob=[delmob]") + message_admins("\blue [key_name_admin(usr)] has used rudimentary transformation on [key_name_admin(M)]. Transforming to [href_list["simplemake"]]; deletemob=[delmob]", 1) + + switch(href_list["simplemake"]) + if("observer") M.change_mob_type( /mob/dead/observer , null, null, delmob ) + if("drone") M.change_mob_type( /mob/living/carbon/alien/humanoid/drone , null, null, delmob ) + if("hunter") M.change_mob_type( /mob/living/carbon/alien/humanoid/hunter , null, null, delmob ) + if("queen") M.change_mob_type( /mob/living/carbon/alien/humanoid/queen , null, null, delmob ) + if("sentinel") M.change_mob_type( /mob/living/carbon/alien/humanoid/sentinel , null, null, delmob ) + if("larva") M.change_mob_type( /mob/living/carbon/alien/larva , null, null, delmob ) + if("human") M.change_mob_type( /mob/living/carbon/human , null, null, delmob ) + if("metroid") M.change_mob_type( /mob/living/carbon/metroid , null, null, delmob ) + if("adultmetroid") M.change_mob_type( /mob/living/carbon/metroid/adult , null, null, delmob ) + if("monkey") M.change_mob_type( /mob/living/carbon/monkey , null, null, delmob ) + if("robot") M.change_mob_type( /mob/living/silicon/robot , null, null, delmob ) + if("cat") M.change_mob_type( /mob/living/simple_animal/cat , null, null, delmob ) + if("runtime") M.change_mob_type( /mob/living/simple_animal/cat/Runtime , null, null, delmob ) + if("corgi") M.change_mob_type( /mob/living/simple_animal/corgi , null, null, delmob ) + if("ian") M.change_mob_type( /mob/living/simple_animal/corgi/Ian , null, null, delmob ) + if("crab") M.change_mob_type( /mob/living/simple_animal/crab , null, null, delmob ) + if("coffee") M.change_mob_type( /mob/living/simple_animal/crab/Coffee , null, null, delmob ) + if("parrot") M.change_mob_type( /mob/living/simple_animal/parrot , null, null, delmob ) + if("polyparrot") M.change_mob_type( /mob/living/simple_animal/parrot/Poly , null, null, delmob ) + if("constructarmoured") M.change_mob_type( /mob/living/simple_animal/construct/armoured , null, null, delmob ) + if("constructbuilder") M.change_mob_type( /mob/living/simple_animal/construct/builder , null, null, delmob ) + if("constructwraith") M.change_mob_type( /mob/living/simple_animal/construct/wraith , null, null, delmob ) + if("shade") M.change_mob_type( /mob/living/simple_animal/shade , null, null, delmob ) + + + /////////////////////////////////////new ban stuff + else if(href_list["unbanf"]) + if(!check_rights(R_BAN)) return + + var/banfolder = href_list["unbanf"] + Banlist.cd = "/base/[banfolder]" + var/key = Banlist["key"] + if(alert(usr, "Are you sure you want to unban [key]?", "Confirmation", "Yes", "No") == "Yes") + if(RemoveBan(banfolder)) + unbanpanel() + else + alert(usr, "This ban has already been lifted / does not exist.", "Error", "Ok") + unbanpanel() + + else if(href_list["unbane"]) + if(!check_rights(R_BAN)) return + + UpdateTime() + var/reason + + var/banfolder = href_list["unbane"] + Banlist.cd = "/base/[banfolder]" + var/reason2 = Banlist["reason"] + var/temp = Banlist["temp"] + + var/minutes = Banlist["minutes"] + + var/banned_key = Banlist["key"] + Banlist.cd = "/base" + + var/duration + + switch(alert("Temporary Ban?",,"Yes","No")) + if("Yes") + temp = 1 + var/mins = 0 + if(minutes > CMinutes) + mins = minutes - CMinutes + mins = input(usr,"How long (in minutes)? (Default: 1440)","Ban time",mins ? mins : 1440) as num|null + if(!mins) return + mins = min(525599,mins) + minutes = CMinutes + mins + duration = GetExp(minutes) + reason = input(usr,"Reason?","reason",reason2) as text|null + if(!reason) return + if("No") + temp = 0 + duration = "Perma" + reason = input(usr,"Reason?","reason",reason2) as text|null + if(!reason) return + + log_admin("[key_name(usr)] edited [banned_key]'s ban. Reason: [reason] Duration: [duration]") + ban_unban_log_save("[key_name(usr)] edited [banned_key]'s ban. Reason: [reason] Duration: [duration]") + message_admins("\blue [key_name_admin(usr)] edited [banned_key]'s ban. Reason: [reason] Duration: [duration]", 1) + Banlist.cd = "/base/[banfolder]" + Banlist["reason"] << reason + Banlist["temp"] << temp + Banlist["minutes"] << minutes + Banlist["bannedby"] << usr.ckey + Banlist.cd = "/base" + feedback_inc("ban_edit",1) + unbanpanel() + + /////////////////////////////////////new ban stuff + + else if(href_list["jobban2"]) +// if(!check_rights(R_BAN)) return + + var/mob/M = locate(href_list["jobban2"]) + if(!ismob(M)) + usr << "This can only be used on instances of type /mob" + return + + if(!M.ckey) //sanity + usr << "This mob has no ckey" + return + if(!job_master) + usr << "Job Master has not been setup!" + return + + var/dat = "" + var/header = "Job-Ban Panel: [M.name]" + var/body + var/jobs = "" + + /***********************************WARNING!************************************ + The jobban stuff looks mangled and disgusting + But it looks beautiful in-game + -Nodrak + ************************************WARNING!***********************************/ + var/counter = 0 +//Regular jobs + //Command (Blue) + jobs += "" + jobs += "" + for(var/jobPos in command_positions) + if(!jobPos) continue + var/datum/job/job = job_master.GetJob(jobPos) + if(!job) continue + + if(jobban_isbanned(M, job.title)) + jobs += "" + counter++ + else + jobs += "" + counter++ + + if(counter >= 6) //So things dont get squiiiiished! + jobs += "" + counter = 0 + jobs += "
    Command Positions
    [replacetext(job.title, " ", " ")][replacetext(job.title, " ", " ")]
    " + + //Security (Red) + counter = 0 + jobs += "" + jobs += "" + for(var/jobPos in security_positions) + if(!jobPos) continue + var/datum/job/job = job_master.GetJob(jobPos) + if(!job) continue + + if(jobban_isbanned(M, job.title)) + jobs += "" + counter++ + else + jobs += "" + counter++ + + if(counter >= 5) //So things dont get squiiiiished! + jobs += "" + counter = 0 + jobs += "
    Security Positions
    [replacetext(job.title, " ", " ")][replacetext(job.title, " ", " ")]
    " + + //Engineering (Yellow) + counter = 0 + jobs += "" + jobs += "" + for(var/jobPos in engineering_positions) + if(!jobPos) continue + var/datum/job/job = job_master.GetJob(jobPos) + if(!job) continue + + if(jobban_isbanned(M, job.title)) + jobs += "" + counter++ + else + jobs += "" + counter++ + + if(counter >= 5) //So things dont get squiiiiished! + jobs += "" + counter = 0 + jobs += "
    Engineering Positions
    [replacetext(job.title, " ", " ")][replacetext(job.title, " ", " ")]
    " + + //Medical (White) + counter = 0 + jobs += "" + jobs += "" + for(var/jobPos in medical_positions) + if(!jobPos) continue + var/datum/job/job = job_master.GetJob(jobPos) + if(!job) continue + + if(jobban_isbanned(M, job.title)) + jobs += "" + counter++ + else + jobs += "" + counter++ + + if(counter >= 5) //So things dont get squiiiiished! + jobs += "" + counter = 0 + jobs += "
    Medical Positions
    [replacetext(job.title, " ", " ")][replacetext(job.title, " ", " ")]
    " + + //Science (Purple) + counter = 0 + jobs += "" + jobs += "" + for(var/jobPos in science_positions) + if(!jobPos) continue + var/datum/job/job = job_master.GetJob(jobPos) + if(!job) continue + + if(jobban_isbanned(M, job.title)) + jobs += "" + counter++ + else + jobs += "" + counter++ + + if(counter >= 5) //So things dont get squiiiiished! + jobs += "" + counter = 0 + jobs += "
    Science Positions
    [replacetext(job.title, " ", " ")][replacetext(job.title, " ", " ")]
    " + + //Civilian (Grey) + counter = 0 + jobs += "" + jobs += "" + for(var/jobPos in civilian_positions) + if(!jobPos) continue + var/datum/job/job = job_master.GetJob(jobPos) + if(!job) continue + + if(jobban_isbanned(M, job.title)) + jobs += "" + counter++ + else + jobs += "" + counter++ + + if(counter >= 5) //So things dont get squiiiiished! + jobs += "" + counter = 0 + jobs += "
    Civilian Positions
    [replacetext(job.title, " ", " ")][replacetext(job.title, " ", " ")]
    " + + //Non-Human (Green) + counter = 0 + jobs += "" + jobs += "" + for(var/jobPos in nonhuman_positions) + if(!jobPos) continue + var/datum/job/job = job_master.GetJob(jobPos) + if(!job) continue + + if(jobban_isbanned(M, job.title)) + jobs += "" + counter++ + else + jobs += "" + counter++ + + if(counter >= 5) //So things dont get squiiiiished! + jobs += "" + counter = 0 + + //pAI isn't technically a job, but it goes in here. + if(jobban_isbanned(M, "pAI")) + jobs += "" + else + jobs += "" + + jobs += "
    Non-human Positions
    [replacetext(job.title, " ", " ")][replacetext(job.title, " ", " ")]
    pAIpAI
    " + + //Antagonist (Orange) + var/isbanned_dept = jobban_isbanned(M, "Syndicate") + jobs += "" + jobs += "" + + //Traitor + if(jobban_isbanned(M, "traitor") || isbanned_dept) + jobs += "" + else + jobs += "" + + //Changeling + if(jobban_isbanned(M, "changeling") || isbanned_dept) + jobs += "" + else + jobs += "" + + //Nuke Operative + if(jobban_isbanned(M, "operative") || isbanned_dept) + jobs += "" + else + jobs += "" + + //Revolutionary + if(jobban_isbanned(M, "revolutionary") || isbanned_dept) + jobs += "" + else + jobs += "" + + jobs += "" //Breaking it up so it fits nicer on the screen every 5 entries + + //Cultist + if(jobban_isbanned(M, "cultist") || isbanned_dept) + jobs += "" + else + jobs += "" + + //Wizard + if(jobban_isbanned(M, "wizard") || isbanned_dept) + jobs += "" + else + jobs += "" + +/* //Malfunctioning AI //Removed Malf-bans because they're a pain to impliment + if(jobban_isbanned(M, "malf AI") || isbanned_dept) + jobs += "" + else + jobs += "" + + //Alien + if(jobban_isbanned(M, "alien candidate") || isbanned_dept) + jobs += "" + else + jobs += "" + + //Infested Monkey + if(jobban_isbanned(M, "infested monkey") || isbanned_dept) + jobs += "" + else + jobs += "" +*/ + jobs += "
    Antagonist Positions
    [replacetext("Traitor", " ", " ")][replacetext("Traitor", " ", " ")][replacetext("Changeling", " ", " ")][replacetext("Changeling", " ", " ")][replacetext("Nuke Operative", " ", " ")][replacetext("Nuke Operative", " ", " ")][replacetext("Revolutionary", " ", " ")][replacetext("Revolutionary", " ", " ")]
    [replacetext("Cultist", " ", " ")][replacetext("Cultist", " ", " ")][replacetext("Wizard", " ", " ")][replacetext("Wizard", " ", " ")][replacetext("Malf AI", " ", " ")][replacetext("Malf AI", " ", " ")][replacetext("Alien", " ", " ")][replacetext("Alien", " ", " ")][replacetext("Infested Monkey", " ", " ")][replacetext("Infested Monkey", " ", " ")]
    " + + body = "[jobs]" + dat = "[header][body]" + usr << browse(dat, "window=jobban2;size=800x450") + return + + //JOBBAN'S INNARDS + else if(href_list["jobban3"]) + if(!check_rights(R_BAN)) return + + var/mob/M = locate(href_list["jobban4"]) + if(!ismob(M)) + usr << "This can only be used on instances of type /mob" + return + + if(M != usr) //we can jobban ourselves + if(M.client && M.client.holder && (M.client.holder.rights & R_BAN)) //they can ban too. So we can't ban them + alert("You cannot perform this action. You must be of a higher administrative rank!") + return + + if(!job_master) + usr << "Job Master has not been setup!" + return + + //get jobs for department if specified, otherwise just returnt he one job in a list. + var/list/joblist = list() + switch(href_list["jobban3"]) + if("commanddept") + for(var/jobPos in command_positions) + if(!jobPos) continue + var/datum/job/temp = job_master.GetJob(jobPos) + if(!temp) continue + joblist += temp.title + if("securitydept") + for(var/jobPos in security_positions) + if(!jobPos) continue + var/datum/job/temp = job_master.GetJob(jobPos) + if(!temp) continue + joblist += temp.title + if("engineeringdept") + for(var/jobPos in engineering_positions) + if(!jobPos) continue + var/datum/job/temp = job_master.GetJob(jobPos) + if(!temp) continue + joblist += temp.title + if("medicaldept") + for(var/jobPos in medical_positions) + if(!jobPos) continue + var/datum/job/temp = job_master.GetJob(jobPos) + if(!temp) continue + joblist += temp.title + if("sciencedept") + for(var/jobPos in science_positions) + if(!jobPos) continue + var/datum/job/temp = job_master.GetJob(jobPos) + if(!temp) continue + joblist += temp.title + if("civiliandept") + for(var/jobPos in civilian_positions) + if(!jobPos) continue + var/datum/job/temp = job_master.GetJob(jobPos) + if(!temp) continue + joblist += temp.title + if("nonhumandept") + joblist += "pAI" + for(var/jobPos in nonhuman_positions) + if(!jobPos) continue + var/datum/job/temp = job_master.GetJob(jobPos) + if(!temp) continue + joblist += temp.title + else + joblist += href_list["jobban3"] + + //Create a list of unbanned jobs within joblist + var/list/notbannedlist = list() + for(var/job in joblist) + if(!jobban_isbanned(M, job)) + notbannedlist += job + + //Banning comes first + if(notbannedlist.len) //at least 1 unbanned job exists in joblist so we have stuff to ban. + var/reason = input(usr,"Reason?","Please State Reason","") as text|null + if(reason) + var/msg + for(var/job in notbannedlist) + ban_unban_log_save("[key_name(usr)] jobbanned [key_name(M)] from [job]. reason: [reason]") + log_admin("[key_name(usr)] banned [key_name(M)] from [job]") + feedback_inc("ban_job",1) + DB_ban_record(BANTYPE_JOB_PERMA, M, -1, reason, job) + feedback_add_details("ban_job","- [job]") + jobban_fullban(M, job, "[reason]; By [usr.ckey] on [time2text(world.realtime)]") + if(!msg) msg = job + else msg += ", [job]" + notes_add(M.ckey, "Banned from [msg] - [reason]") + message_admins("\blue [key_name_admin(usr)] banned [key_name_admin(M)] from [msg]", 1) + M << "\redYou have been jobbanned by [usr.client.ckey] from: [msg]." + M << "\red The reason is: [reason]" + M << "\red Jobban can be lifted only upon request." + href_list["jobban2"] = 1 // lets it fall through and refresh + return 1 + + //Unbanning joblist + //all jobs in joblist are banned already OR we didn't give a reason (implying they shouldn't be banned) + if(joblist.len) //at least 1 banned job exists in joblist so we have stuff to unban. + var/msg + for(var/job in joblist) + var/reason = jobban_isbanned(M, job) + if(!reason) continue //skip if it isn't jobbanned anyway + switch(alert("Job: '[job]' Reason: '[reason]' Un-jobban?","Please Confirm","Yes","No")) + if("Yes") + ban_unban_log_save("[key_name(usr)] unjobbanned [key_name(M)] from [job]") + log_admin("[key_name(usr)] unbanned [key_name(M)] from [job]") + DB_ban_unban(M.ckey, BANTYPE_JOB_PERMA, job) + feedback_inc("ban_job_unban",1) + feedback_add_details("ban_job_unban","- [job]") + jobban_unban(M, job) + if(!msg) msg = job + else msg += ", [job]" + else + continue + if(msg) + message_admins("\blue [key_name_admin(usr)] unbanned [key_name_admin(M)] from [msg]", 1) + M << "\redYou have been un-jobbanned by [usr.client.ckey] from [msg]." + href_list["jobban2"] = 1 // lets it fall through and refresh + return 1 + return 0 //we didn't do anything! + + else if(href_list["boot2"]) + var/mob/M = locate(href_list["boot2"]) + if (ismob(M)) + if(!check_if_greater_rights_than(M.client)) + return + M << "\red You have been kicked from the server" + log_admin("[key_name(usr)] booted [key_name(M)].") + message_admins("\blue [key_name_admin(usr)] booted [key_name_admin(M)].", 1) + //M.client = null + del(M.client) + + //Player Notes + else if(href_list["notes"]) + var/ckey = href_list["ckey"] + if(!ckey) + var/mob/M = locate(href_list["mob"]) + if(ismob(M)) + ckey = M.ckey + + switch(href_list["notes"]) + if("show") + notes_show(ckey) + if("add") + notes_add(ckey,href_list["text"]) + notes_show(ckey) + if("remove") + notes_remove(ckey,text2num(href_list["from"]),text2num(href_list["to"])) + notes_show(ckey) + + else if(href_list["removejobban"]) + if(!check_rights(R_BAN)) return + + var/t = href_list["removejobban"] + if(t) + if((alert("Do you want to unjobban [t]?","Unjobban confirmation", "Yes", "No") == "Yes") && t) //No more misclicks! Unless you do it twice. + log_admin("[key_name(usr)] removed [t]") + message_admins("\blue [key_name_admin(usr)] removed [t]", 1) + jobban_remove(t) + href_list["ban"] = 1 // lets it fall through and refresh + var/t_split = text2list(t, " - ") + var/key = t_split[1] + var/job = t_split[2] + DB_ban_unban(ckey(key), BANTYPE_JOB_PERMA, job) + + else if(href_list["newban"]) + if(!check_rights(R_BAN)) return + + var/mob/M = locate(href_list["newban"]) + if(!ismob(M)) return + + if(M.client && M.client.holder) return //admins cannot be banned. Even if they could, the ban doesn't affect them anyway + + switch(alert("Temporary Ban?",,"Yes","No", "Cancel")) + if("Yes") + var/mins = input(usr,"How long (in minutes)?","Ban time",1440) as num|null + if(!mins) + return + if(mins >= 525600) mins = 525599 + var/reason = input(usr,"Reason?","reason","Griefer") as text|null + if(!reason) + return + AddBan(M.ckey, M.computer_id, reason, usr.ckey, 1, mins) + ban_unban_log_save("[usr.client.ckey] has banned [M.ckey]. - Reason: [reason] - This will be removed in [mins] minutes.") + M << "\redYou have been banned by [usr.client.ckey].\nReason: [reason]." + M << "\red This is a temporary ban, it will be removed in [mins] minutes." + feedback_inc("ban_tmp",1) + DB_ban_record(BANTYPE_TEMP, M, mins, reason) + feedback_inc("ban_tmp_mins",mins) + if(config.banappeals) + M << "\red To try to resolve this matter head to [config.banappeals]" + else + M << "\red No ban appeals URL has been set." + log_admin("[usr.client.ckey] has banned [M.ckey].\nReason: [reason]\nThis will be removed in [mins] minutes.") + message_admins("\blue[usr.client.ckey] has banned [M.ckey].\nReason: [reason]\nThis will be removed in [mins] minutes.") + + del(M.client) + //del(M) // See no reason why to delete mob. Important stuff can be lost. And ban can be lifted before round ends. + if("No") + var/reason = input(usr,"Reason?","reason","Griefer") as text|null + if(!reason) + return + switch(alert(usr,"IP ban?",,"Yes","No","Cancel")) + if("Cancel") return + if("Yes") + AddBan(M.ckey, M.computer_id, reason, usr.ckey, 0, 0, M.lastKnownIP) + if("No") + AddBan(M.ckey, M.computer_id, reason, usr.ckey, 0, 0) + M << "\redYou have been banned by [usr.client.ckey].\nReason: [reason]." + M << "\red This is a permanent ban." + if(config.banappeals) + M << "\red To try to resolve this matter head to [config.banappeals]" + else + M << "\red No ban appeals URL has been set." + ban_unban_log_save("[usr.client.ckey] has permabanned [M.ckey]. - Reason: [reason] - This is a permanent ban.") + log_admin("[usr.client.ckey] has banned [M.ckey].\nReason: [reason]\nThis is a permanent ban.") + message_admins("\blue[usr.client.ckey] has banned [M.ckey].\nReason: [reason]\nThis is a permanent ban.") + feedback_inc("ban_perma",1) + DB_ban_record(BANTYPE_PERMA, M, -1, reason) + + del(M.client) + //del(M) + if("Cancel") + return + + else if(href_list["unjobbanf"]) + if(!check_rights(R_BAN)) return + + var/banfolder = href_list["unjobbanf"] + Banlist.cd = "/base/[banfolder]" + var/key = Banlist["key"] + if(alert(usr, "Are you sure you want to unban [key]?", "Confirmation", "Yes", "No") == "Yes") + if (RemoveBanjob(banfolder)) + unjobbanpanel() + else + alert(usr,"This ban has already been lifted / does not exist.","Error","Ok") + unjobbanpanel() + + else if(href_list["mute"]) + if(!check_rights(R_ADMIN)) return + + var/mob/M = locate(href_list["mute"]) + if(!ismob(M)) return + if(!M.client) return + + var/mute_type = href_list["mute_type"] + if(istext(mute_type)) mute_type = text2num(mute_type) + if(!isnum(mute_type)) return + + cmd_admin_mute(M, mute_type) + + else if(href_list["c_mode"]) + if(!check_rights(R_ADMIN)) return + + if(ticker && ticker.mode) + return alert(usr, "The game has already started.", null, null, null, null) + var/dat = {"What mode do you wish to play?
    "} + for(var/mode in config.modes) + dat += {"[config.mode_names[mode]]
    "} + dat += {"Secret
    "} + dat += {"Random
    "} + dat += {"Now: [master_mode]"} + usr << browse(dat, "window=c_mode") + + else if(href_list["f_secret"]) + if(!check_rights(R_ADMIN)) return + + if(ticker && ticker.mode) + return alert(usr, "The game has already started.", null, null, null, null) + if(master_mode != "secret") + return alert(usr, "The game mode has to be secret!", null, null, null, null) + var/dat = {"What game mode do you want to force secret to be? Use this if you want to change the game mode, but want the players to believe it's secret. This will only work if the current game mode is secret.
    "} + for(var/mode in config.modes) + dat += {"[config.mode_names[mode]]
    "} + dat += {"Random (default)
    "} + dat += {"Now: [secret_force_mode]"} + usr << browse(dat, "window=f_secret") + + else if(href_list["c_mode2"]) + if(!check_rights(R_ADMIN)) return + + if (ticker && ticker.mode) + return alert(usr, "The game has already started.", null, null, null, null) + master_mode = href_list["c_mode2"] + log_admin("[key_name(usr)] set the mode as [master_mode].") + message_admins("\blue [key_name_admin(usr)] set the mode as [master_mode].", 1) + world << "\blue The mode is now: [master_mode]" + Game() // updates the main game menu + world.save_mode(master_mode) + .(href, list("c_mode"=1)) + + else if(href_list["f_secret2"]) + if(!check_rights(R_ADMIN)) return + + if(ticker && ticker.mode) + return alert(usr, "The game has already started.", null, null, null, null) + if(master_mode != "secret") + return alert(usr, "The game mode has to be secret!", null, null, null, null) + secret_force_mode = href_list["f_secret2"] + log_admin("[key_name(usr)] set the forced secret mode as [secret_force_mode].") + message_admins("\blue [key_name_admin(usr)] set the forced secret mode as [secret_force_mode].", 1) + Game() // updates the main game menu + .(href, list("f_secret"=1)) + + else if(href_list["monkeyone"]) + if(!check_rights(R_FUN)) return + + var/mob/living/carbon/human/H = locate(href_list["monkeyone"]) + if(!istype(H)) + usr << "This can only be used on instances of type /mob/living/carbon/human" + return + + log_admin("[key_name(usr)] attempting to monkeyize [key_name(H)]") + message_admins("\blue [key_name_admin(usr)] attempting to monkeyize [key_name_admin(H)]", 1) + H.monkeyize() + + else if(href_list["corgione"]) + if(!check_rights(R_FUN)) return + + var/mob/living/carbon/human/H = locate(href_list["corgione"]) + if(!istype(H)) + usr << "This can only be used on instances of type /mob/living/carbon/human" + return + + log_admin("[key_name(usr)] attempting to corgize [key_name(H)]") + message_admins("\blue [key_name_admin(usr)] attempting to corgize [key_name_admin(H)]", 1) + H.corgize() + + else if(href_list["forcespeech"]) + if(!check_rights(R_FUN)) return + + var/mob/M = locate(href_list["forcespeech"]) + if(!ismob(M)) + usr << "this can only be used on instances of type /mob" + + var/speech = input("What will [key_name(M)] say?.", "Force speech", "")// Don't need to sanitize, since it does that in say(), we also trust our admins. + if(!speech) return + M.say(speech) + speech = sanitize(speech) // Nah, we don't trust them + log_admin("[key_name(usr)] forced [key_name(M)] to say: [speech]") + message_admins("\blue [key_name_admin(usr)] forced [key_name_admin(M)] to say: [speech]") + + else if(href_list["sendtoprison"]) + if(!check_rights(R_ADMIN)) return + + if(alert(usr, "Send to admin prison for the round?", "Message", "Yes", "No") != "Yes") + return + + var/mob/M = locate(href_list["sendtoprison"]) + if(!ismob(M)) + usr << "This can only be used on instances of type /mob" + return + if(istype(M, /mob/living/silicon/ai)) + usr << "This cannot be used on instances of type /mob/living/silicon/ai" + return + + var/turf/prison_cell = pick(prisonwarp) + if(!prison_cell) return + + var/obj/structure/closet/secure_closet/brig/locker = new /obj/structure/closet/secure_closet/brig(prison_cell) + locker.opened = 0 + locker.locked = 1 + + //strip their stuff and stick it in the crate + for(var/obj/item/I in M) + M.u_equip(I) + if(I) + I.loc = locker + I.layer = initial(I.layer) + I.dropped(M) + M.update_icons() + + //so they black out before warping + M.Paralyse(5) + sleep(5) + if(!M) return + + M.loc = prison_cell + if(istype(M, /mob/living/carbon/human)) + var/mob/living/carbon/human/prisoner = M + prisoner.equip_to_slot_or_del(new /obj/item/clothing/under/color/orange(prisoner), slot_w_uniform) + prisoner.equip_to_slot_or_del(new /obj/item/clothing/shoes/orange(prisoner), slot_shoes) + + M << "\red You have been sent to the prison station!" + log_admin("[key_name(usr)] sent [key_name(M)] to the prison station.") + message_admins("\blue [key_name_admin(usr)] sent [key_name_admin(M)] to the prison station.", 1) + + else if(href_list["tdome1"]) + if(!check_rights(R_FUN)) return + + if(alert(usr, "Confirm?", "Message", "Yes", "No") != "Yes") + return + + var/mob/M = locate(href_list["tdome1"]) + if(!ismob(M)) + usr << "This can only be used on instances of type /mob" + return + if(istype(M, /mob/living/silicon/ai)) + usr << "This cannot be used on instances of type /mob/living/silicon/ai" + return + + for(var/obj/item/I in M) + M.u_equip(I) + if(I) + I.loc = M.loc + I.layer = initial(I.layer) + I.dropped(M) + + M.Paralyse(5) + sleep(5) + M.loc = pick(tdome1) + spawn(50) + M << "\blue You have been sent to the Thunderdome." + log_admin("[key_name(usr)] has sent [key_name(M)] to the thunderdome. (Team 1)") + message_admins("[key_name_admin(usr)] has sent [key_name_admin(M)] to the thunderdome. (Team 1)", 1) + + else if(href_list["tdome2"]) + if(!check_rights(R_FUN)) return + + if(alert(usr, "Confirm?", "Message", "Yes", "No") != "Yes") + return + + var/mob/M = locate(href_list["tdome2"]) + if(!ismob(M)) + usr << "This can only be used on instances of type /mob" + return + if(istype(M, /mob/living/silicon/ai)) + usr << "This cannot be used on instances of type /mob/living/silicon/ai" + return + + for(var/obj/item/I in M) + M.u_equip(I) + if(I) + I.loc = M.loc + I.layer = initial(I.layer) + I.dropped(M) + + M.Paralyse(5) + sleep(5) + M.loc = pick(tdome2) + spawn(50) + M << "\blue You have been sent to the Thunderdome." + log_admin("[key_name(usr)] has sent [key_name(M)] to the thunderdome. (Team 2)") + message_admins("[key_name_admin(usr)] has sent [key_name_admin(M)] to the thunderdome. (Team 2)", 1) + + else if(href_list["tdomeadmin"]) + if(!check_rights(R_FUN)) return + + if(alert(usr, "Confirm?", "Message", "Yes", "No") != "Yes") + return + + var/mob/M = locate(href_list["tdomeadmin"]) + if(!ismob(M)) + usr << "This can only be used on instances of type /mob" + return + if(istype(M, /mob/living/silicon/ai)) + usr << "This cannot be used on instances of type /mob/living/silicon/ai" + return + + M.Paralyse(5) + sleep(5) + M.loc = pick(tdomeadmin) + spawn(50) + M << "\blue You have been sent to the Thunderdome." + log_admin("[key_name(usr)] has sent [key_name(M)] to the thunderdome. (Admin.)") + message_admins("[key_name_admin(usr)] has sent [key_name_admin(M)] to the thunderdome. (Admin.)", 1) + + else if(href_list["tdomeobserve"]) + if(!check_rights(R_FUN)) return + + if(alert(usr, "Confirm?", "Message", "Yes", "No") != "Yes") + return + + var/mob/M = locate(href_list["tdomeobserve"]) + if(!ismob(M)) + usr << "This can only be used on instances of type /mob" + return + if(istype(M, /mob/living/silicon/ai)) + usr << "This cannot be used on instances of type /mob/living/silicon/ai" + return + + for(var/obj/item/I in M) + M.u_equip(I) + if(I) + I.loc = M.loc + I.layer = initial(I.layer) + I.dropped(M) + + if(istype(M, /mob/living/carbon/human)) + var/mob/living/carbon/human/observer = M + observer.equip_to_slot_or_del(new /obj/item/clothing/under/suit_jacket(observer), slot_w_uniform) + observer.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(observer), slot_shoes) + M.Paralyse(5) + sleep(5) + M.loc = pick(tdomeobserve) + spawn(50) + M << "\blue You have been sent to the Thunderdome." + log_admin("[key_name(usr)] has sent [key_name(M)] to the thunderdome. (Observer.)") + message_admins("[key_name_admin(usr)] has sent [key_name_admin(M)] to the thunderdome. (Observer.)", 1) + + else if(href_list["revive"]) + if(!check_rights(R_REJUVINATE)) return + + var/mob/living/L = locate(href_list["revive"]) + if(!istype(L)) + usr << "This can only be used on instances of type /mob/living" + return + + if(config.allow_admin_rev) + L.revive() + message_admins("\red Admin [key_name_admin(usr)] healed / revived [key_name_admin(L)]!", 1) + log_admin("[key_name(usr)] healed / Rrvived [key_name(L)]") + else + usr << "Admin Rejuvinates have been disabled" + + else if(href_list["makeai"]) + if(!check_rights(R_FUN)) return + + var/mob/living/carbon/human/H = locate(href_list["makeai"]) + if(!istype(H)) + usr << "This can only be used on instances of type /mob/living/carbon/human" + return + + message_admins("\red Admin [key_name_admin(usr)] AIized [key_name_admin(H)]!", 1) + log_admin("[key_name(usr)] AIized [key_name(H)]") + H.AIize() + + else if(href_list["makealien"]) + if(!check_rights(R_FUN)) return + + var/mob/living/carbon/human/H = locate(href_list["makealien"]) + if(!istype(H)) + usr << "This can only be used on instances of type /mob/living/carbon/human" + return + + usr.client.cmd_admin_alienize(H) + + else if(href_list["makemetroid"]) + if(!check_rights(R_FUN)) return + + var/mob/living/carbon/human/H = locate(href_list["makemetroid"]) + if(!istype(H)) + usr << "This can only be used on instances of type /mob/living/carbon/human" + return + + usr.client.cmd_admin_metroidize(H) + + else if(href_list["makerobot"]) + if(!check_rights(R_FUN)) return + + var/mob/living/carbon/human/H = locate(href_list["makerobot"]) + if(!istype(H)) + usr << "This can only be used on instances of type /mob/living/carbon/human" + return + + usr.client.cmd_admin_robotize(H) + + else if(href_list["makeanimal"]) + if(!check_rights(R_FUN)) return + + var/mob/M = locate(href_list["makeanimal"]) + if(istype(M, /mob/new_player)) + usr << "This cannot be used on instances of type /mob/new_player" + return + + usr.client.cmd_admin_animalize(M) + +/***************** BEFORE************** + + if (href_list["l_players"]) + var/dat = "Name/Real Name/Key/IP:
    " + for(var/mob/M in world) + var/foo = "" + if (ismob(M) && M.client) + if(!M.client.authenticated && !M.client.authenticating) + foo += text("\[ Authorize | ", src, M) + else + foo += text("\[ Authorized | ") + if(M.start) + if(!istype(M, /mob/living/carbon/monkey)) + foo += text("Monkeyize | ", src, M) + else + foo += text("Monkeyized | ") + if(istype(M, /mob/living/silicon/ai)) + foo += text("Is an AI | ") + else + foo += text("Make AI | ", src, M) + if(M.z != 2) + foo += text("Prison | ", src, M) + foo += text("Maze | ", src, M) + else + foo += text("On Z = 2 | ") + else + foo += text("Hasn't Entered Game | ") + foo += text("Heal/Revive | ", src, M) + + foo += text("Say \]", src, M) + dat += text("N: [] R: [] (K: []) (IP: []) []
    ", M.name, M.real_name, (M.client ? M.client : "No client"), M.lastKnownIP, foo) + + usr << browse(dat, "window=players;size=900x480") + +*****************AFTER******************/ + +// Now isn't that much better? IT IS NOW A PROC, i.e. kinda like a big panel like unstable + + else if(href_list["adminplayeropts"]) + var/mob/M = locate(href_list["adminplayeropts"]) + show_player_panel(M) + + else if(href_list["adminplayervars"]) + var/mob/M = locate(href_list["adminplayervars"]) + usr.client.debug_variables(M) + + else if(href_list["adminplayersubtlemessage"]) + var/mob/M = locate(href_list["adminplayersubtlemessage"]) + usr.client.cmd_admin_subtle_message(M) + + else if(href_list["adminplayerobservejump"]) + var/mob/M = locate(href_list["adminplayerobservejump"]) + + var/client/C = usr.client + if(!isobserver(usr)) C.admin_ghost() + sleep(2) + C.jumptomob(M) + + else if(href_list["adminplayerobservecoodjump"]) + var/x = text2num(href_list["X"]) + var/y = text2num(href_list["Y"]) + var/z = text2num(href_list["Z"]) + + var/client/C = usr.client + if(!isobserver(usr)) C.admin_ghost() + sleep(2) + C.jumptocoord(x,y,z) + + else if(href_list["adminchecklaws"]) + output_ai_laws() + + else if(href_list["adminmoreinfo"]) + var/mob/M = locate(href_list["adminmoreinfo"]) + if(!ismob(M)) + usr << "This can only be used on instances of type /mob" + return + + var/location_description = "" + var/special_role_description = "" + var/health_description = "" + var/gender_description = "" + var/turf/T = get_turf(M) + + //Location + if(isturf(T)) + if(isarea(T.loc)) + location_description = "([M.loc == T ? "at coordinates " : "in [M.loc] at coordinates "] [T.x], [T.y], [T.z] in area [T.loc])" + else + location_description = "([M.loc == T ? "at coordinates " : "in [M.loc] at coordinates "] [T.x], [T.y], [T.z])" + + //Job + antagonist + if(M.mind) + special_role_description = "Role: [M.mind.assigned_role]; Antagonist: [M.mind.special_role]; Has been rev: [(M.mind.has_been_rev)?"Yes":"No"]" + else + special_role_description = "Role: Mind datum missing Antagonist: Mind datum missing; Has been rev: Mind datum missing;" + + //Health + if(isliving(M)) + var/mob/living/L = M + var/status + switch (M.stat) + if (0) status = "Alive" + if (1) status = "Unconscious" + if (2) status = "Dead" + health_description = "Status = [status]" + health_description += "
    Oxy: [L.getOxyLoss()] - Tox: [L.getToxLoss()] - Fire: [L.getFireLoss()] - Brute: [L.getBruteLoss()] - Clone: [L.getCloneLoss()] - Brain: [L.getBrainLoss()]" + else + health_description = "This mob type has no health to speak of." + + //Gener + switch(M.gender) + if(MALE,FEMALE) gender_description = "[M.gender]" + else gender_description = "[M.gender]" + + src.owner << "Info about [M.name]: " + src.owner << "Mob type = [M.type]; Gender = [gender_description] Damage = [health_description]" + src.owner << "Name = [M.name]; Real_name = [M.real_name]; Mind_name = [M.mind?"[M.mind.name]":""]; Key = [M.key];" + src.owner << "Location = [location_description];" + src.owner << "[special_role_description]" + src.owner << "(PM) (PP) (VV) (SM) (JMP) (CA)" + + else if(href_list["adminspawncookie"]) + var/mob/living/carbon/human/H = locate(href_list["adminspawncookie"]) + if(!ishuman(H)) + usr << "This can only be used on instances of type /mob/living/carbon/human" + return + + H.equip_to_slot_or_del( new /obj/item/weapon/reagent_containers/food/snacks/cookie(H), slot_l_hand ) + if(!(istype(H.l_hand,/obj/item/weapon/reagent_containers/food/snacks/cookie))) + H.equip_to_slot_or_del( new /obj/item/weapon/reagent_containers/food/snacks/cookie(H), slot_r_hand ) + if(!(istype(H.r_hand,/obj/item/weapon/reagent_containers/food/snacks/cookie))) + log_admin("[key_name(H)] has their hands full, so they did not receive their cookie, spawned by [key_name(src.owner)].") + message_admins("[key_name(H)] has their hands full, so they did not receive their cookie, spawned by [key_name(src.owner)].") + return + else + H.update_inv_r_hand()//To ensure the icon appears in the HUD + else + H.update_inv_l_hand() + log_admin("[key_name(H)] got their cookie, spawned by [key_name(src.owner)]") + message_admins("[key_name(H)] got their cookie, spawned by [key_name(src.owner)]") + feedback_inc("admin_cookies_spawned",1) + H << "\blue Your prayers have been answered!! You received the best cookie!" + + else if(href_list["traitor_panel_pp"]) + var/mob/M = locate(href_list["traitor_panel_pp"]) + if(!ismob(M)) + usr << "This can only be used on instances of type /mob." + return + show_traitor_panel(M) + + else if(href_list["BlueSpaceArtillery"]) + var/mob/living/M = locate(href_list["BlueSpaceArtillery"]) + if(!isliving(M)) + usr << "This can only be used on instances of type /mob/living" + return + + if(alert(src.owner, "Are you sure you wish to hit [key_name(M)] with Blue Space Artillery?", "Confirm Firing?" , "Yes" , "No") != "Yes") + return + + if(BSACooldown) + src.owner << "Standby! Reload cycle in progress! Gunnary crews ready in five seconds!" + return + + BSACooldown = 1 + spawn(50) + BSACooldown = 0 + + M << "You've been hit by bluespace artillery!" + log_admin("[key_name(M)] has been hit by Bluespace Artillery fired by [src.owner]") + message_admins("[key_name(M)] has been hit by Bluespace Artillery fired by [src.owner]") + + var/obj/effect/stop/S + S = new /obj/effect/stop + S.victim = M + S.loc = M.loc + spawn(20) + del(S) + + var/turf/simulated/floor/T = get_turf(M) + if(istype(T)) + if(prob(80)) T.break_tile_to_plating() + else T.break_tile() + + if(M.health == 1) + M.gib() + else + M.adjustBruteLoss( min( 99 , (M.health - 1) ) ) + M.Stun(20) + M.Weaken(20) + M.stuttering = 20 + + else if(href_list["CentcommReply"]) + var/mob/living/carbon/human/H = locate(href_list["CentcommReply"]) + if(!istype(H)) + usr << "This can only be used on instances of type /mob/living/carbon/human" + return + if(!istype(H.ears, /obj/item/device/radio/headset)) + usr << "The person you are trying to contact is not wearing a headset" + return + + var/input = input(src.owner, "Please enter a message to reply to [key_name(H)] via their headset.","Outgoing message from Centcomm", "") + if(!input) return + + src.owner << "You sent [input] to [H] via a secure channel." + log_admin("[src.owner] replied to [key_name(H)]'s Centcomm message with the message [input].") + message_admins("[src.owner] replied to [key_name(H)]'s Centcom message with: \"[input]\"") + H << "You hear something crackle in your headset for a moment before a voice speaks. \"Please stand by for a message from Central Command. Message as follows. [input]. Message ends.\"" + + else if(href_list["SyndicateReply"]) + var/mob/living/carbon/human/H = locate(href_list["SyndicateReply"]) + if(!istype(H)) + usr << "This can only be used on instances of type /mob/living/carbon/human" + return + if(!istype(H.ears, /obj/item/device/radio/headset)) + usr << "The person you are trying to contact is not wearing a headset" + return + + var/input = input(src.owner, "Please enter a message to reply to [key_name(H)] via their headset.","Outgoing message from The Syndicate", "") + if(!input) return + + src.owner << "You sent [input] to [H] via a secure channel." + log_admin("[src.owner] replied to [key_name(H)]'s Syndicate message with the message [input].") + H << "You hear something crackle in your headset for a moment before a voice speaks. \"Please stand by for a message from your benefactor. Message as follows, agent. [input]. Message ends.\"" + + else if(href_list["jumpto"]) + if(!check_rights(R_ADMIN)) return + + var/mob/M = locate(href_list["jumpto"]) + usr.client.jumptomob(M) + + else if(href_list["getmob"]) + if(!check_rights(R_ADMIN)) return + + if(alert(usr, "Confirm?", "Message", "Yes", "No") != "Yes") return + + var/mob/M = locate(href_list["getmob"]) + usr.client.Getmob(M) + + else if(href_list["sendmob"]) + if(!check_rights(R_ADMIN)) return + + var/mob/M = locate(href_list["sendmob"]) + usr.client.sendmob(M) + + else if(href_list["narrateto"]) + var/mob/M = locate(href_list["narrateto"]) + usr.client.cmd_admin_direct_narrate(M) + + else if(href_list["subtlemessage"]) + var/mob/M = locate(href_list["subtlemessage"]) + usr.client.cmd_admin_subtle_message(M) + + else if(href_list["traitor"]) + if(!ticker || !ticker.mode) + alert("The game hasn't started yet!") + return + + var/mob/M = locate(href_list["traitor"]) + if(!istype(M)) + player_panel_new() + return + if(isalien(M)) + alert("Is an [M.mind ? M.mind.special_role : "Alien"]!", "[M.key]") + return + if(M.mind) + M.mind.edit_memory() + return + alert("Cannot make this mob a traitor! It has no mind!") + + else if(href_list["create_object"]) + if(!check_rights(R_ADMIN)) return + return create_object(usr) + + else if(href_list["quick_create_object"]) + if(!check_rights(R_ADMIN)) return + return quick_create_object(usr) + + else if(href_list["create_turf"]) + if(!check_rights(R_ADMIN)) return + return create_turf(usr) + + else if(href_list["create_mob"]) + if(!check_rights(R_ADMIN)) return + return create_mob(usr) + + //Promote or Demote a client. + else if(href_list["prom_demot"]) + if(!check_rights(R_PERMISSIONS)) return + + var/client/C = locate(href_list["prom_demot"]) + if(!istype(C)) + usr << "This can only be used on instances of type /client" + return + + var/dat = "[C] is a " + if(C.holder) + dat += "[C.holder.rank]" + else + dat += "non-admin" + dat += "

    Change [C]'s rank?
    " + + for(var/rank in admin_ranks) + dat += "[rank]
    " + dat += "Deadmin" + + usr << browse(dat, "window=prom_demot;size=480x300") + + else if(href_list["object_list"]) + if(!check_rights(R_ADMIN)) return + + if(!config.allow_admin_spawning) + usr << "Spawning of items is not allowed." + return + + var/atom/loc = usr.loc + + var/dirty_paths + if (istext(href_list["object_list"])) + dirty_paths = list(href_list["object_list"]) + else if (istype(href_list["object_list"], /list)) + dirty_paths = href_list["object_list"] + + var/paths = list() + var/removed_paths = list() + + for(var/dirty_path in dirty_paths) + var/path = text2path(dirty_path) + if(!path) + removed_paths += dirty_path + else if(!ispath(path, /obj) && !ispath(path, /turf) && !ispath(path, /mob)) + removed_paths += dirty_path + else if(ispath(path, /obj/item/weapon/gun/energy/pulse_rifle)) + if(!check_rights(R_FUN,0)) + removed_paths += dirty_path + else if(ispath(path, /obj/item/weapon/melee/energy/blade))//Not an item one should be able to spawn./N + if(!check_rights(R_FUN,0)) + removed_paths += dirty_path + else if(ispath(path, /obj/effect/bhole)) + if(!check_rights(R_FUN,0)) + removed_paths += dirty_path + else if(ispath(path, /mob)) + if(!check_rights(R_FUN,0)) + removed_paths += dirty_path + else + paths += path + + if(!paths) return + else if (length(paths) > 5) + alert("Select fewer object types, (max 5)") + return + else if (length(removed_paths)) + alert("Removed:\n" + dd_list2text(removed_paths, "\n")) + + var/list/offset = text2list(href_list["offset"],",") + var/number = dd_range(1, 100, text2num(href_list["object_count"])) + var/X = offset.len > 0 ? text2num(offset[1]) : 0 + var/Y = offset.len > 1 ? text2num(offset[2]) : 0 + var/Z = offset.len > 2 ? text2num(offset[3]) : 0 + var/tmp_dir = href_list["object_dir"] + var/obj_dir = tmp_dir ? text2num(tmp_dir) : 2 + if(!obj_dir || !(obj_dir in list(1,2,4,8,5,6,9,10))) + obj_dir = 2 + var/obj_name = sanitize(href_list["object_name"]) + var/where = href_list["object_where"] + if (!( where in list("onfloor","inhand","inmarked") )) + where = "onfloor" + + //TODO ERRORAGE + if( where == "inhand" ) + usr << "Support for inhand not available yet. Will spawn on floor." + where = "onfloor" + //END TODO ERRORAGE + + if ( where == "inhand" ) //Can only give when human or monkey + if ( !( ishuman(usr) || ismonkey(usr) ) ) + usr << "Can only spawn in hand when you're a human or a monkey." + where = "onfloor" + else if ( usr.get_active_hand() ) + usr << "Your active hand is full. Spawning on floor." + where = "onfloor" + if ( where == "inmarked" ) + if ( !marked_datum ) + usr << "You don't have any object marked. Abandoning spawn." + return + else + if ( !istype(marked_datum,/atom) ) + usr << "The object you have marked cannot be used as a target. Target must be of type /atom. Abandoning spawn." + return + + var/atom/target //Where the object will be spawned + switch ( where ) + if ( "onfloor" ) + switch (href_list["offset_type"]) + if ("absolute") + target = locate(0 + X,0 + Y,0 + Z) + if ("relative") + target = locate(loc.x + X,loc.y + Y,loc.z + Z) + if ( "inmarked" ) + target = marked_datum + + + //TODO ERRORAGE - Give support for "inhand" + + if(target) + for (var/path in paths) + for (var/i = 0; i < number; i++) + var/atom/O = new path(target) + if(O) + O.dir = obj_dir + if(obj_name) + O.name = obj_name + if(istype(O,/mob)) + var/mob/M = O + M.real_name = obj_name + + if (number == 1) + log_admin("[key_name(usr)] created a [english_list(paths)]") + for(var/path in paths) + if(ispath(path, /mob)) + message_admins("[key_name_admin(usr)] created a [english_list(paths)]", 1) + break + else + log_admin("[key_name(usr)] created [number]ea [english_list(paths)]") + for(var/path in paths) + if(ispath(path, /mob)) + message_admins("[key_name_admin(usr)] created [number]ea [english_list(paths)]", 1) + break + return + + else if(href_list["secretsfun"]) + if(!check_rights(R_FUN)) return + + var/ok = 0 + switch(href_list["secretsfun"]) + if("sec_clothes") + feedback_inc("admin_secrets_fun_used",1) + feedback_add_details("admin_secrets_fun_used","SC") + for(var/obj/item/clothing/under/O in world) + del(O) + ok = 1 + if("sec_all_clothes") + feedback_inc("admin_secrets_fun_used",1) + feedback_add_details("admin_secrets_fun_used","SAC") + for(var/obj/item/clothing/O in world) + del(O) + ok = 1 + if("sec_classic1") + feedback_inc("admin_secrets_fun_used",1) + feedback_add_details("admin_secrets_fun_used","SC1") + for(var/obj/item/clothing/suit/fire/O in world) + del(O) + for(var/obj/structure/grille/O in world) + del(O) +/* for(var/obj/machinery/vehicle/pod/O in world) + for(var/mob/M in src) + M.loc = src.loc + if (M.client) + M.client.perspective = MOB_PERSPECTIVE + M.client.eye = M + del(O) + ok = 1*/ + if("toxic") + /* + feedback_inc("admin_secrets_fun_used",1) + feedback_add_details("admin_secrets_fun_used","T") + for(var/obj/machinery/atmoalter/siphs/fullairsiphon/O in world) + O.t_status = 3 + for(var/obj/machinery/atmoalter/siphs/scrubbers/O in world) + O.t_status = 1 + O.t_per = 1000000.0 + for(var/obj/machinery/atmoalter/canister/O in world) + if (!( istype(O, /obj/machinery/atmoalter/canister/oxygencanister) )) + O.t_status = 1 + O.t_per = 1000000.0 + else + O.t_status = 3 + */ + usr << "HEH" + if("monkey") + feedback_inc("admin_secrets_fun_used",1) + feedback_add_details("admin_secrets_fun_used","M") + for(var/mob/living/carbon/human/H in mob_list) + spawn(0) + H.monkeyize() + ok = 1 + if("corgi") + feedback_inc("admin_secrets_fun_used",1) + feedback_add_details("admin_secrets_fun_used","M") + for(var/mob/living/carbon/human/H in mob_list) + spawn(0) + H.corgize() + ok = 1 + if("power") + feedback_inc("admin_secrets_fun_used",1) + feedback_add_details("admin_secrets_fun_used","P") + log_admin("[key_name(usr)] made all areas powered", 1) + message_admins("\blue [key_name_admin(usr)] made all areas powered", 1) + power_restore() + if("unpower") + feedback_inc("admin_secrets_fun_used",1) + feedback_add_details("admin_secrets_fun_used","UP") + log_admin("[key_name(usr)] made all areas unpowered", 1) + message_admins("\blue [key_name_admin(usr)] made all areas unpowered", 1) + power_failure() + if("quickpower") + feedback_inc("admin_secrets_fun_used",1) + feedback_add_details("admin_secrets_fun_used","QP") + log_admin("[key_name(usr)] made all SMESs powered", 1) + message_admins("\blue [key_name_admin(usr)] made all SMESs powered", 1) + power_restore_quick() + if("activateprison") + feedback_inc("admin_secrets_fun_used",1) + feedback_add_details("admin_secrets_fun_used","AP") + world << "\blue Transit signature detected." + world << "\blue Incoming shuttle." + /* + var/A = locate(/area/shuttle_prison) + for(var/atom/movable/AM as mob|obj in A) + AM.z = 1 + AM.Move() + */ + message_admins("\blue [key_name_admin(usr)] sent the prison shuttle to the station.", 1) + if("deactivateprison") + /* + feedback_inc("admin_secrets_fun_used",1) + feedback_add_details("admin_secrets_fun_used","DP") + var/A = locate(/area/shuttle_prison) + for(var/atom/movable/AM as mob|obj in A) + AM.z = 2 + AM.Move() + */ + message_admins("\blue [key_name_admin(usr)] sent the prison shuttle back.", 1) + if("toggleprisonstatus") + feedback_inc("admin_secrets_fun_used",1) + feedback_add_details("admin_secrets_fun_used","TPS") + for(var/obj/machinery/computer/prison_shuttle/PS in world) + PS.allowedtocall = !(PS.allowedtocall) + message_admins("\blue [key_name_admin(usr)] toggled status of prison shuttle to [PS.allowedtocall].", 1) + if("prisonwarp") + if(!ticker) + alert("The game hasn't started yet!", null, null, null, null, null) + return + feedback_inc("admin_secrets_fun_used",1) + feedback_add_details("admin_secrets_fun_used","PW") + message_admins("\blue [key_name_admin(usr)] teleported all players to the prison station.", 1) + for(var/mob/living/carbon/human/H in mob_list) + var/turf/loc = find_loc(H) + var/security = 0 + if(loc.z > 1 || prisonwarped.Find(H)) +//don't warp them if they aren't ready or are already there + continue + H.Paralyse(5) + if(H.wear_id) + var/obj/item/weapon/card/id/id = H.get_idcard() + for(var/A in id.access) + if(A == access_security) + security++ + if(!security) + //strip their stuff before they teleport into a cell :downs: + for(var/obj/item/weapon/W in H) + if(istype(W, /datum/organ/external)) + continue + //don't strip organs + H.u_equip(W) + if (H.client) + H.client.screen -= W + if (W) + W.loc = H.loc + W.dropped(H) + W.layer = initial(W.layer) + //teleport person to cell + H.loc = pick(prisonwarp) + H.equip_to_slot_or_del(new /obj/item/clothing/under/color/orange(H), slot_w_uniform) + H.equip_to_slot_or_del(new /obj/item/clothing/shoes/orange(H), slot_shoes) + else + //teleport security person + H.loc = pick(prisonsecuritywarp) + prisonwarped += H + if("traitor_all") + if(!ticker) + alert("The game hasn't started yet!") + return + var/objective = copytext(sanitize(input("Enter an objective")),1,MAX_MESSAGE_LEN) + if(!objective) + return + feedback_inc("admin_secrets_fun_used",1) + feedback_add_details("admin_secrets_fun_used","TA([objective])") + for(var/mob/living/carbon/human/H in player_list) + if(H.stat == 2 || !H.client || !H.mind) continue + if(is_special_character(H)) continue + //traitorize(H, objective, 0) + ticker.mode.traitors += H.mind + H.mind.special_role = "traitor" + var/datum/objective/new_objective = new + new_objective.owner = H + new_objective.explanation_text = objective + H.mind.objectives += new_objective + ticker.mode.greet_traitor(H.mind) + //ticker.mode.forge_traitor_objectives(H.mind) + ticker.mode.finalize_traitor(H.mind) + for(var/mob/living/silicon/A in player_list) + ticker.mode.traitors += A.mind + A.mind.special_role = "traitor" + var/datum/objective/new_objective = new + new_objective.owner = A + new_objective.explanation_text = objective + A.mind.objectives += new_objective + ticker.mode.greet_traitor(A.mind) + ticker.mode.finalize_traitor(A.mind) + message_admins("\blue [key_name_admin(usr)] used everyone is a traitor secret. Objective is [objective]", 1) + log_admin("[key_name(usr)] used everyone is a traitor secret. Objective is [objective]") + if("moveminingshuttle") + if(mining_shuttle_moving) + return + feedback_inc("admin_secrets_fun_used",1) + feedback_add_details("admin_secrets_fun_used","ShM") + move_mining_shuttle() + message_admins("\blue [key_name_admin(usr)] moved mining shuttle", 1) + log_admin("[key_name(usr)] moved the mining shuttle") + if("moveadminshuttle") + feedback_inc("admin_secrets_fun_used",1) + feedback_add_details("admin_secrets_fun_used","ShA") + move_admin_shuttle() + message_admins("\blue [key_name_admin(usr)] moved the centcom administration shuttle", 1) + log_admin("[key_name(usr)] moved the centcom administration shuttle") + if("moveferry") + feedback_inc("admin_secrets_fun_used",1) + feedback_add_details("admin_secrets_fun_used","ShF") + move_ferry() + message_admins("\blue [key_name_admin(usr)] moved the centcom ferry", 1) + log_admin("[key_name(usr)] moved the centcom ferry") + if("movealienship") + feedback_inc("admin_secrets_fun_used",1) + feedback_add_details("admin_secrets_fun_used","ShX") + move_alien_ship() + message_admins("\blue [key_name_admin(usr)] moved the alien dinghy", 1) + log_admin("[key_name(usr)] moved the alien dinghy") + if("togglebombcap") + feedback_inc("admin_secrets_fun_used",1) + feedback_add_details("admin_secrets_fun_used","BC") + switch(MAX_EXPLOSION_RANGE) + if(14) + MAX_EXPLOSION_RANGE = 16 + if(16) + MAX_EXPLOSION_RANGE = 20 + if(20) + MAX_EXPLOSION_RANGE = 28 + if(28) + MAX_EXPLOSION_RANGE = 56 + if(56) + MAX_EXPLOSION_RANGE = 128 + if(128) + MAX_EXPLOSION_RANGE = 14 + var/range_dev = MAX_EXPLOSION_RANGE *0.25 + var/range_high = MAX_EXPLOSION_RANGE *0.5 + var/range_low = MAX_EXPLOSION_RANGE + message_admins("\red [key_name_admin(usr)] changed the bomb cap to [range_dev], [range_high], [range_low]", 1) + log_admin("[key_name_admin(usr)] changed the bomb cap to [MAX_EXPLOSION_RANGE]") + + if("flicklights") + feedback_inc("admin_secrets_fun_used",1) + feedback_add_details("admin_secrets_fun_used","FL") + while(!usr.stat) +//knock yourself out to stop the ghosts + for(var/mob/M in player_list) + if(M.stat != 2 && prob(25)) + var/area/AffectedArea = get_area(M) + if(AffectedArea.name != "Space" && AffectedArea.name != "Engine Walls" && AffectedArea.name != "Chemical Lab Test Chamber" && AffectedArea.name != "Escape Shuttle" && AffectedArea.name != "Arrival Area" && AffectedArea.name != "Arrival Shuttle" && AffectedArea.name != "start area" && AffectedArea.name != "Engine Combustion Chamber") + AffectedArea.power_light = 0 + AffectedArea.power_change() + spawn(rand(55,185)) + AffectedArea.power_light = 1 + AffectedArea.power_change() + var/Message = rand(1,4) + switch(Message) + if(1) + M.show_message(text("\blue You shudder as if cold..."), 1) + if(2) + M.show_message(text("\blue You feel something gliding across your back..."), 1) + if(3) + M.show_message(text("\blue Your eyes twitch, you feel like something you can't see is here..."), 1) + if(4) + M.show_message(text("\blue You notice something moving out of the corner of your eye, but nothing is there..."), 1) + for(var/obj/W in orange(5,M)) + if(prob(25) && !W.anchored) + step_rand(W) + sleep(rand(100,1000)) + for(var/mob/M in player_list) + if(M.stat != 2) + M.show_message(text("\blue The chilling wind suddenly stops..."), 1) +/* if("shockwave") + ok = 1 + world << "\red ALERT: STATION STRESS CRITICAL" + sleep(60) + world << "\red ALERT: STATION STRESS CRITICAL. TOLERABLE LEVELS EXCEEDED!" + sleep(80) + world << "\red ALERT: STATION STRUCTURAL STRESS CRITICAL. SAFETY MECHANISMS FAILED!" + sleep(40) + for(var/mob/M in world) + shake_camera(M, 400, 1) + for(var/obj/structure/window/W in world) + spawn(0) + sleep(rand(10,400)) + W.ex_act(rand(2,1)) + for(var/obj/structure/grille/G in world) + spawn(0) + sleep(rand(20,400)) + G.ex_act(rand(2,1)) + for(var/obj/machinery/door/D in world) + spawn(0) + sleep(rand(20,400)) + D.ex_act(rand(2,1)) + for(var/turf/station/floor/Floor in world) + spawn(0) + sleep(rand(30,400)) + Floor.ex_act(rand(2,1)) + for(var/obj/structure/cable/Cable in world) + spawn(0) + sleep(rand(30,400)) + Cable.ex_act(rand(2,1)) + for(var/obj/structure/closet/Closet in world) + spawn(0) + sleep(rand(30,400)) + Closet.ex_act(rand(2,1)) + for(var/obj/machinery/Machinery in world) + spawn(0) + sleep(rand(30,400)) + Machinery.ex_act(rand(1,3)) + for(var/turf/station/wall/Wall in world) + spawn(0) + sleep(rand(30,400)) + Wall.ex_act(rand(2,1)) */ + if("wave") + feedback_inc("admin_secrets_fun_used",1) + feedback_add_details("admin_secrets_fun_used","MW") + meteor_wave() + message_admins("[key_name_admin(usr)] has spawned meteors", 1) + command_alert("Meteors have been detected on collision course with the station.", "Meteor Alert") + world << sound('sound/AI/meteors.ogg') + if("gravanomalies") + feedback_inc("admin_secrets_fun_used",1) + feedback_add_details("admin_secrets_fun_used","GA") + command_alert("Gravitational anomalies detected on the station. There is no additional data.", "Anomaly Alert") + world << sound('sound/AI/granomalies.ogg') + var/turf/T = pick(blobstart) + var/obj/effect/bhole/bh = new /obj/effect/bhole( T.loc, 30 ) + spawn(rand(100, 600)) + del(bh) + + if("timeanomalies") //dear god this code was awful :P Still needs further optimisation + feedback_inc("admin_secrets_fun_used",1) + feedback_add_details("admin_secrets_fun_used","STA") + //moved to its own dm so I could split it up and prevent the spawns copying variables over and over + //can be found in code\game\game_modes\events\wormholes.dm + wormhole_event() + + if("goblob") + feedback_inc("admin_secrets_fun_used",1) + feedback_add_details("admin_secrets_fun_used","BL") + mini_blob_event() + message_admins("[key_name_admin(usr)] has spawned blob", 1) + if("aliens") + feedback_inc("admin_secrets_fun_used",1) + feedback_add_details("admin_secrets_fun_used","AL") + if(aliens_allowed) + alien_infestation() + message_admins("[key_name_admin(usr)] has spawned aliens", 1) + if("comms_blackout") + feedback_inc("admin_secrets_fun_used",1) + feedback_add_details("admin_secrets_fun_used","CB") + var/answer = alert(usr, "Would you like to alert the crew?", "Alert", "Yes", "No") + if(answer == "Yes") + communications_blackout(0) + else + communications_blackout(1) + message_admins("[key_name_admin(usr)] triggered a communications blackout.", 1) + if("spaceninja") + feedback_inc("admin_secrets_fun_used",1) + feedback_add_details("admin_secrets_fun_used","SN") + if(toggle_space_ninja) + if(space_ninja_arrival())//If the ninja is actually spawned. They may not be depending on a few factors. + message_admins("[key_name_admin(usr)] has sent in a space ninja", 1) + if("carp") + feedback_inc("admin_secrets_fun_used",1) + feedback_add_details("admin_secrets_fun_used","C") + var/choice = input("You sure you want to spawn carp?") in list("Badmin", "Cancel") + if(choice == "Badmin") + message_admins("[key_name_admin(usr)] has spawned carp.", 1) + carp_migration() + if("radiation") + feedback_inc("admin_secrets_fun_used",1) + feedback_add_details("admin_secrets_fun_used","R") + message_admins("[key_name_admin(usr)] has has irradiated the station", 1) + high_radiation_event() + if("immovable") + feedback_inc("admin_secrets_fun_used",1) + feedback_add_details("admin_secrets_fun_used","IR") + message_admins("[key_name_admin(usr)] has sent an immovable rod to the station", 1) + immovablerod() + if("prison_break") + feedback_inc("admin_secrets_fun_used",1) + feedback_add_details("admin_secrets_fun_used","PB") + message_admins("[key_name_admin(usr)] has allowed a prison break", 1) + prison_break() + if("lightout") + feedback_inc("admin_secrets_fun_used",1) + feedback_add_details("admin_secrets_fun_used","LO") + message_admins("[key_name_admin(usr)] has broke a lot of lights", 1) + lightsout(1,2) + if("blackout") + feedback_inc("admin_secrets_fun_used",1) + feedback_add_details("admin_secrets_fun_used","BO") + message_admins("[key_name_admin(usr)] broke all lights", 1) + lightsout(0,0) + if("whiteout") + feedback_inc("admin_secrets_fun_used",1) + feedback_add_details("admin_secrets_fun_used","WO") + for(var/obj/machinery/light/L in world) + L.fix() + message_admins("[key_name_admin(usr)] fixed all lights", 1) + if("friendai") + feedback_inc("admin_secrets_fun_used",1) + feedback_add_details("admin_secrets_fun_used","FA") + for(var/mob/aiEye/aE in mob_list) + aE.icon_state = "ai_friend" + for(var/obj/machinery/M in machines) + if(istype(M, /obj/machinery/ai_status_display)) + var/obj/machinery/ai_status_display/A = M + A.emotion = "Friend Computer" + else if(istype(M, /obj/machinery/status_display)) + var/obj/machinery/status_display/A = M + A.friendc = 1 + message_admins("[key_name_admin(usr)] turned all AIs into best friends.", 1) + if("floorlava") + if(floorIsLava) + usr << "The floor is lava already." + return + feedback_inc("admin_secrets_fun_used",1) + feedback_add_details("admin_secrets_fun_used","LF") + + //Options + var/length = input(usr, "How long will the lava last? (in seconds)", "Length", 180) as num + length = min(abs(length), 1200) + + var/damage = input(usr, "How deadly will the lava be?", "Damage", 2) as num + damage = min(abs(damage), 100) + + var/sure = alert(usr, "Are you sure you want to do this?", "Confirmation", "YES!", "Nah") + if(sure == "Nah") + return + floorIsLava = 1 + + message_admins("[key_name_admin(usr)] made the floor LAVA! It'll last [length] seconds and it will deal [damage] damage to everyone.", 1) + + for(var/turf/simulated/floor/F in world) + if(F.z == 1) + F.name = "lava" + F.desc = "The floor is LAVA!" + F.overlays += "lava" + F.lava = 1 + + spawn(0) + for(var/i = i, i < length, i++) // 180 = 3 minutes + if(damage) + for(var/mob/living/carbon/L in living_mob_list) + if(istype(L.loc, /turf/simulated/floor)) // Are they on LAVA?! + var/turf/simulated/floor/F = L.loc + if(F.lava) + var/safe = 0 + for(var/obj/structure/O in F.contents) + if(O.level > F.level && !istype(O, /obj/structure/window)) // Something to stand on and it isn't under the floor! + safe = 1 + break + if(!safe) + L.adjustFireLoss(damage) + + + sleep(10) + + for(var/turf/simulated/floor/F in world) // Reset everything. + if(F.z == 1) + F.name = initial(F.name) + F.desc = initial(F.desc) + F.overlays = null + F.lava = 0 + F.update_icon() + floorIsLava = 0 + return + if("virus") + feedback_inc("admin_secrets_fun_used",1) + feedback_add_details("admin_secrets_fun_used","V") + var/answer = alert("Do you want this to be a random disease or do you have something in mind?",,"Virus2","Random","Choose") + if(answer=="Random") + viral_outbreak() + message_admins("[key_name_admin(usr)] has triggered a virus outbreak", 1) + else if(answer == "Choose") + var/list/viruses = list("fake gbs","gbs","magnitis","wizarditis",/*"beesease",*/"brain rot","cold","retrovirus","flu","pierrot's throat","rhumba beat") + var/V = input("Choose the virus to spread", "BIOHAZARD") in viruses + viral_outbreak(V) + message_admins("[key_name_admin(usr)] has triggered a virus outbreak of [V]", 1) + else + usr << "Nope" + /* + var/lesser = (alert("Do you want to infect the mob with a major or minor disease?",,"Major","Minor") == "Minor") + var/mob/living/carbon/victim = input("Select a mob to infect", "Virus2") as null|mob in world + if(!istype(victim)) return + if(lesser) + infect_mob_random_lesser(victim) + else + infect_mob_random_greater(victim) + message_admins("[key_name_admin(usr)] has infected [victim] with a [lesser ? "minor" : "major"] virus2.", 1) + */ + if("retardify") + feedback_inc("admin_secrets_fun_used",1) + feedback_add_details("admin_secrets_fun_used","RET") + for(var/mob/living/carbon/human/H in player_list) + H << "\red You suddenly feel stupid." + H.setBrainLoss(60) + message_admins("[key_name_admin(usr)] made everybody retarded") + if("fakeguns") + feedback_inc("admin_secrets_fun_used",1) + feedback_add_details("admin_secrets_fun_used","FG") + for(var/obj/item/W in world) + if(istype(W, /obj/item/clothing) || istype(W, /obj/item/weapon/card/id) || istype(W, /obj/item/weapon/disk) || istype(W, /obj/item/weapon/tank)) + continue + W.icon = 'icons/obj/gun.dmi' + W.icon_state = "revolver" + W.item_state = "gun" + message_admins("[key_name_admin(usr)] made every item look like a gun") + if("schoolgirl") + feedback_inc("admin_secrets_fun_used",1) + feedback_add_details("admin_secrets_fun_used","SG") + for(var/obj/item/clothing/under/W in world) + W.icon_state = "schoolgirl" + W.item_state = "w_suit" + W.color = "schoolgirl" + message_admins("[key_name_admin(usr)] activated Japanese Animes mode") + world << sound('sound/AI/animes.ogg') + if("dorf") + feedback_inc("admin_secrets_fun_used",1) + feedback_add_details("admin_secrets_fun_used","DF") + for(var/mob/living/carbon/human/B in mob_list) + B.f_style = "Dward Beard" + B.update_hair() + message_admins("[key_name_admin(usr)] activated dorf mode") + if("ionstorm") + feedback_inc("admin_secrets_fun_used",1) + feedback_add_details("admin_secrets_fun_used","I") + IonStorm() + message_admins("[key_name_admin(usr)] triggered an ion storm") + var/show_log = alert(usr, "Show ion message?", "Message", "Yes", "No") + if(show_log == "Yes") + command_alert("Ion storm detected near the station. Please check all AI-controlled equipment for errors.", "Anomaly Alert") + world << sound('sound/AI/ionstorm.ogg') + if("spacevines") + feedback_inc("admin_secrets_fun_used",1) + feedback_add_details("admin_secrets_fun_used","K") + spacevine_infestation() + message_admins("[key_name_admin(usr)] has spawned spacevines", 1) + if(usr) + log_admin("[key_name(usr)] used secret [href_list["secretsfun"]]") + if (ok) + world << text("A secret has been activated by []!", usr.key) + + if(href_list["secretsadmin"]) + if(!check_rights(R_ADMIN)) return + + var/ok = 0 + switch(href_list["secretsadmin"]) + if("clear_bombs") + //I do nothing + if("list_bombers") + var/dat = "Bombing List
    " + for(var/l in bombers) + dat += text("[l]
    ") + usr << browse(dat, "window=bombers") + if("list_signalers") + var/dat = "Showing last [length(lastsignalers)] signalers.
    " + for(var/sig in lastsignalers) + dat += "[sig]
    " + usr << browse(dat, "window=lastsignalers;size=800x500") + if("list_lawchanges") + var/dat = "Showing last [length(lawchanges)] law changes.
    " + for(var/sig in lawchanges) + dat += "[sig]
    " + usr << browse(dat, "window=lawchanges;size=800x500") + if("list_job_debug") + var/dat = "Job Debug info.
    " + if(job_master) + for(var/line in job_master.job_debug) + dat += "[line]
    " + dat+= "*******

    " + for(var/datum/job/job in job_master.occupations) + if(!job) continue + dat += "job: [job.title], current_positions: [job.current_positions], total_positions: [job.total_positions]
    " + usr << browse(dat, "window=jobdebug;size=600x500") + if("check_antagonist") + check_antagonists() + if("showailaws") + output_ai_laws() + if("showgm") + if(!ticker) + alert("The game hasn't started yet!") + else if (ticker.mode) + alert("The game mode is [ticker.mode.name]") + else alert("For some reason there's a ticker, but not a game mode") + if("manifest") + var/dat = "Showing Crew Manifest.
    " + dat += "" + for(var/mob/living/carbon/human/H in mob_list) + if(H.ckey) + dat += text("", H.name, H.get_assignment()) + dat += "
    NamePosition
    [][]
    " + usr << browse(dat, "window=manifest;size=440x410") + if("DNA") + var/dat = "Showing DNA from blood.
    " + dat += "" + for(var/mob/living/carbon/human/H in mob_list) + if(H.dna && H.ckey) + dat += "" + dat += "
    NameDNABlood Type
    [H][H.dna.unique_enzymes][H.b_type]
    " + usr << browse(dat, "window=DNA;size=440x410") + if("fingerprints") + var/dat = "Showing Fingerprints.
    " + dat += "" + for(var/mob/living/carbon/human/H in mob_list) + if(H.ckey) + if(H.dna && H.dna.uni_identity) + dat += "" + else if(H.dna && !H.dna.uni_identity) + dat += "" + else if(!H.dna) + dat += "" + dat += "
    NameFingerprints
    [H][md5(H.dna.uni_identity)]
    [H]H.dna.uni_identity = null
    [H]H.dna = null
    " + usr << browse(dat, "window=fingerprints;size=440x410") + else + if (usr) + log_admin("[key_name(usr)] used secret [href_list["secretsadmin"]]") + if (ok) + world << text("A secret has been activated by []!", usr.key) + + else if(href_list["secretscoder"]) + if(!check_rights(R_DEBUG)) return + + switch(href_list["secretscoder"]) + if("spawn_objects") + var/dat = "Admin Log
    " + for(var/l in admin_log) + dat += "
  • [l]
  • " + if(!admin_log.len) + dat += "No-one has done anything this round!" + usr << browse(dat, "window=admin_log") + if("maint_access_brig") + for(var/obj/machinery/door/airlock/maintenance/M in world) + if (access_maint_tunnels in M.req_access) + M.req_access = list(access_brig) + message_admins("[key_name_admin(usr)] made all maint doors brig access-only.") + if("maint_access_engiebrig") + for(var/obj/machinery/door/airlock/maintenance/M in world) + if (access_maint_tunnels in M.req_access) + M.req_access = list() + M.req_one_access = list(access_brig,access_engine) + message_admins("[key_name_admin(usr)] made all maint doors engineering and brig access-only.") + if("infinite_sec") + var/datum/job/J = job_master.GetJob("Security Officer") + if(!J) return + J.total_positions = -1 + J.spawn_positions = -1 + message_admins("[key_name_admin(usr)] has removed the cap on security officers.") + + else if(href_list["ac_view_wanted"]) //Admin newscaster Topic() stuff be here + src.admincaster_screen = 18 //The ac_ prefix before the hrefs stands for AdminCaster. + src.access_news_network() + + else if(href_list["ac_set_channel_name"]) + src.admincaster_feed_channel.channel_name = strip_html_simple(input(usr, "Provide a Feed Channel Name", "Network Channel Handler", "")) + while (findtext(src.admincaster_feed_channel.channel_name," ") == 1) + src.admincaster_feed_channel.channel_name = copytext(src.admincaster_feed_channel.channel_name,2,lentext(src.admincaster_feed_channel.channel_name)+1) + src.access_news_network() + + else if(href_list["ac_set_channel_lock"]) + src.admincaster_feed_channel.locked = !src.admincaster_feed_channel.locked + src.access_news_network() + + else if(href_list["ac_submit_new_channel"]) + var/check = 0 + for(var/datum/feed_channel/FC in news_network.network_channels) + if(FC.channel_name == src.admincaster_feed_channel.channel_name) + check = 1 + break + if(src.admincaster_feed_channel.channel_name == "" || src.admincaster_feed_channel.channel_name == "\[REDACTED\]" || check ) + src.admincaster_screen=7 + else + var/choice = alert("Please confirm Feed channel creation","Network Channel Handler","Confirm","Cancel") + if(choice=="Confirm") + var/datum/feed_channel/newChannel = new /datum/feed_channel + newChannel.channel_name = src.admincaster_feed_channel.channel_name + newChannel.author = src.admincaster_signature + newChannel.locked = src.admincaster_feed_channel.locked + newChannel.is_admin_channel = 1 + feedback_inc("newscaster_channels",1) + news_network.network_channels += newChannel //Adding channel to the global network + log_admin("[key_name_admin(usr)] created command feed channel: [src.admincaster_feed_channel.channel_name]!") + src.admincaster_screen=5 + src.access_news_network() + + else if(href_list["ac_set_channel_receiving"]) + var/list/available_channels = list() + for(var/datum/feed_channel/F in news_network.network_channels) + available_channels += F.channel_name + src.admincaster_feed_channel.channel_name = adminscrub(input(usr, "Choose receiving Feed Channel", "Network Channel Handler") in available_channels ) + src.access_news_network() + + else if(href_list["ac_set_new_message"]) + src.admincaster_feed_message.body = adminscrub(input(usr, "Write your Feed story", "Network Channel Handler", "")) + while (findtext(src.admincaster_feed_message.body," ") == 1) + src.admincaster_feed_message.body = copytext(src.admincaster_feed_message.body,2,lentext(src.admincaster_feed_message.body)+1) + src.access_news_network() + + else if(href_list["ac_submit_new_message"]) + if(src.admincaster_feed_message.body =="" || src.admincaster_feed_message.body =="\[REDACTED\]" || src.admincaster_feed_channel.channel_name == "" ) + src.admincaster_screen = 6 + else + var/datum/feed_message/newMsg = new /datum/feed_message + newMsg.author = src.admincaster_signature + newMsg.body = src.admincaster_feed_message.body + newMsg.is_admin_message = 1 + feedback_inc("newscaster_stories",1) + for(var/datum/feed_channel/FC in news_network.network_channels) + if(FC.channel_name == src.admincaster_feed_channel.channel_name) + FC.messages += newMsg //Adding message to the network's appropriate feed_channel + break + src.admincaster_screen=4 + + for(var/obj/machinery/newscaster/NEWSCASTER in allCasters) + NEWSCASTER.newsAlert(src.admincaster_feed_channel.channel_name) + + log_admin("[key_name_admin(usr)] submitted a feed story to channel: [src.admincaster_feed_channel.channel_name]!") + src.access_news_network() + + else if(href_list["ac_create_channel"]) + src.admincaster_screen=2 + src.access_news_network() + + else if(href_list["ac_create_feed_story"]) + src.admincaster_screen=3 + src.access_news_network() + + else if(href_list["ac_menu_censor_story"]) + src.admincaster_screen=10 + src.access_news_network() + + else if(href_list["ac_menu_censor_channel"]) + src.admincaster_screen=11 + src.access_news_network() + + else if(href_list["ac_menu_wanted"]) + var/already_wanted = 0 + if(news_network.wanted_issue) + already_wanted = 1 + + if(already_wanted) + src.admincaster_feed_message.author = news_network.wanted_issue.author + src.admincaster_feed_message.body = news_network.wanted_issue.body + src.admincaster_screen = 14 + src.access_news_network() + + else if(href_list["ac_set_wanted_name"]) + src.admincaster_feed_message.author = adminscrub(input(usr, "Provide the name of the Wanted person", "Network Security Handler", "")) + while (findtext(src.admincaster_feed_message.author," ") == 1) + src.admincaster_feed_message.author = copytext(admincaster_feed_message.author,2,lentext(admincaster_feed_message.author)+1) + src.access_news_network() + + else if(href_list["ac_set_wanted_desc"]) + src.admincaster_feed_message.body = adminscrub(input(usr, "Provide the a description of the Wanted person and any other details you deem important", "Network Security Handler", "")) + while (findtext(src.admincaster_feed_message.body," ") == 1) + src.admincaster_feed_message.body = copytext(src.admincaster_feed_message.body,2,lentext(src.admincaster_feed_message.body)+1) + src.access_news_network() + + else if(href_list["ac_submit_wanted"]) + var/input_param = text2num(href_list["ac_submit_wanted"]) + if(src.admincaster_feed_message.author == "" || src.admincaster_feed_message.body == "") + src.admincaster_screen = 16 + else + var/choice = alert("Please confirm Wanted Issue [(input_param==1) ? ("creation.") : ("edit.")]","Network Security Handler","Confirm","Cancel") + if(choice=="Confirm") + if(input_param==1) //If input_param == 1 we're submitting a new wanted issue. At 2 we're just editing an existing one. See the else below + var/datum/feed_message/WANTED = new /datum/feed_message + WANTED.author = src.admincaster_feed_message.author //Wanted name + WANTED.body = src.admincaster_feed_message.body //Wanted desc + WANTED.backup_author = src.admincaster_signature //Submitted by + WANTED.is_admin_message = 1 + news_network.wanted_issue = WANTED + for(var/obj/machinery/newscaster/NEWSCASTER in allCasters) + NEWSCASTER.newsAlert() + NEWSCASTER.update_icon() + src.admincaster_screen = 15 + else + news_network.wanted_issue.author = src.admincaster_feed_message.author + news_network.wanted_issue.body = src.admincaster_feed_message.body + news_network.wanted_issue.backup_author = src.admincaster_feed_message.backup_author + src.admincaster_screen = 19 + log_admin("[key_name_admin(usr)] issued a Station-wide Wanted Notification for [src.admincaster_feed_message.author]!") + src.access_news_network() + + else if(href_list["ac_cancel_wanted"]) + var/choice = alert("Please confirm Wanted Issue removal","Network Security Handler","Confirm","Cancel") + if(choice=="Confirm") + news_network.wanted_issue = null + for(var/obj/machinery/newscaster/NEWSCASTER in allCasters) + NEWSCASTER.update_icon() + src.admincaster_screen=17 + src.access_news_network() + + else if(href_list["ac_censor_channel_author"]) + var/datum/feed_channel/FC = locate(href_list["ac_censor_channel_author"]) + if(FC.author != "\[REDACTED\]") + FC.backup_author = FC.author + FC.author = "\[REDACTED\]" + else + FC.author = FC.backup_author + src.access_news_network() + + else if(href_list["ac_censor_channel_story_author"]) + var/datum/feed_message/MSG = locate(href_list["ac_censor_channel_story_author"]) + if(MSG.author != "\[REDACTED\]") + MSG.backup_author = MSG.author + MSG.author = "\[REDACTED\]" + else + MSG.author = MSG.backup_author + src.access_news_network() + + else if(href_list["ac_censor_channel_story_body"]) + var/datum/feed_message/MSG = locate(href_list["ac_censor_channel_story_body"]) + if(MSG.body != "\[REDACTED\]") + MSG.backup_body = MSG.body + MSG.body = "\[REDACTED\]" + else + MSG.body = MSG.backup_body + src.access_news_network() + + else if(href_list["ac_pick_d_notice"]) + var/datum/feed_channel/FC = locate(href_list["ac_pick_d_notice"]) + src.admincaster_feed_channel = FC + src.admincaster_screen=13 + src.access_news_network() + + else if(href_list["ac_toggle_d_notice"]) + var/datum/feed_channel/FC = locate(href_list["ac_toggle_d_notice"]) + FC.censored = !FC.censored + src.access_news_network() + + else if(href_list["ac_view"]) + src.admincaster_screen=1 + src.access_news_network() + + else if(href_list["ac_setScreen"]) //Brings us to the main menu and resets all fields~ + src.admincaster_screen = text2num(href_list["ac_setScreen"]) + if (src.admincaster_screen == 0) + if(src.admincaster_feed_channel) + src.admincaster_feed_channel = new /datum/feed_channel + if(src.admincaster_feed_message) + src.admincaster_feed_message = new /datum/feed_message + src.access_news_network() + + else if(href_list["ac_show_channel"]) + var/datum/feed_channel/FC = locate(href_list["ac_show_channel"]) + src.admincaster_feed_channel = FC + src.admincaster_screen = 9 + src.access_news_network() + + else if(href_list["ac_pick_censor_channel"]) + var/datum/feed_channel/FC = locate(href_list["ac_pick_censor_channel"]) + src.admincaster_feed_channel = FC + src.admincaster_screen = 12 + src.access_news_network() + + else if(href_list["ac_refresh"]) + src.access_news_network() + + else if(href_list["ac_set_signature"]) + src.admincaster_signature = adminscrub(input(usr, "Provide your desired signature", "Network Identity Handler", "")) + src.access_news_network() \ No newline at end of file diff --git a/code/modules/admin/verbs/adminpm.dm b/code/modules/admin/verbs/adminpm.dm index e7b2eae3d7d..c2f6067657d 100644 --- a/code/modules/admin/verbs/adminpm.dm +++ b/code/modules/admin/verbs/adminpm.dm @@ -40,9 +40,9 @@ src << "Error: Admin-PM: You are unable to use admin PM-s (muted)." return - if( !C || !istype(C,/client) ) - if(holder) src << "Error: Admin-PM: Client not found." - else adminhelp(msg) //admin we are replying to left. adminhelp instead + if(!istype(C,/client)) + if(holder) src << "Error: Admin-PM: Client not found." + else adminhelp(msg) //admin we are replying to left. adminhelp instead return //get message text, limit it's length.and clean/escape html @@ -58,8 +58,8 @@ if (src.handle_spam_prevention(msg,MUTE_ADMINHELP)) return - //clean the message if it's not sent by a GA or GM - if( !holder || !(holder.rank in list("Game Admin", "Game Master")) ) + //clean the message if it's not sent by a high-rank admin + if(!check_rights(R_SERVER|R_DEBUG,0)) msg = sanitize(copytext(msg,1,MAX_MESSAGE_LEN)) if(!msg) return @@ -106,6 +106,6 @@ log_admin("PM: [key_name(src)]->[key_name(C)]: [msg]") //we don't use message_admins here because the sender/receiver might get it too - for(var/client/X) //there are fewer clients than mobs - if(X.holder && X.key!=key && X.key!=C.key) //check client/X is an admin and isn't the sender or recipient + for(var/client/X in admins) + if(X.key!=key && X.key!=C.key) //check client/X is an admin and isn't the sender or recipient X << "PM: [key_name(src, X, 0)]->[key_name(C, X, 0)]: \blue [msg]" //inform X diff --git a/code/modules/admin/verbs/adminsay.dm b/code/modules/admin/verbs/adminsay.dm index d29ab0de161..835665aaba4 100644 --- a/code/modules/admin/verbs/adminsay.dm +++ b/code/modules/admin/verbs/adminsay.dm @@ -2,30 +2,18 @@ set category = "Special Verbs" set name = "Asay" //Gave this shit a shorter name so you only have to time out "asay" rather than "admin say" to use it --NeoFite set hidden = 1 - - if (!src.holder) - src << "Only administrators may use this command." - return - - if (src.muted & MUTE_ADMINHELP) - src << "You cannot send ASAY messages (muted)." - return - - if (src.handle_spam_prevention(msg,MUTE_ADMINHELP)) - return + if(!check_rights(0)) return msg = copytext(sanitize(msg), 1, MAX_MESSAGE_LEN) - log_admin("[key_name(src)] : [msg]") + if(!msg) return - - if (!msg) - return - feedback_add_details("admin_verb","M") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - - if(holder.rank == "Admin Observer") - for(var/client/C in admins) - C << "ADMIN: [key_name(usr, C)]: [msg]" - else + if(check_rights(R_ADMIN,0)) for(var/client/C in admins) C << "ADMIN: [key_name(usr, C)] (JMP): [msg]" + else + for(var/client/C in admins) + C << "ADMIN: [key_name(usr, C)]: [msg]" + + log_admin("[key_name(src)] : [msg]") + feedback_add_details("admin_verb","M") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm index 95068c13308..c5889686c88 100644 --- a/code/modules/admin/verbs/debug.dm +++ b/code/modules/admin/verbs/debug.dm @@ -1,22 +1,17 @@ /client/proc/Debug2() set category = "Debug" set name = "Debug-Game" - if(!holder) - src << "Only administrators may use this command." - return - if(holder.rank == "Game Admin") - Debug2 = !Debug2 + if(!check_rights(R_DEBUG)) return - world << "Debugging [Debug2 ? "On" : "Off"]" - log_admin("[key_name(src)] toggled debugging to [Debug2]") - else if(holder.rank == "Game Master") - Debug2 = !Debug2 - - world << "Debugging [Debug2 ? "On" : "Off"]" - log_admin("[key_name(src)] toggled debugging to [Debug2]") + if(Debug2) + Debug2 = 0 + message_admins("[key_name(src)] toggled debugging off.") + log_admin("[key_name(src)] toggled debugging off.") else - alert("Coders only baby") - return + Debug2 = 1 + message_admins("[key_name(src)] toggled debugging on.") + log_admin("[key_name(src)] toggled debugging on.") + feedback_add_details("admin_verb","DG2") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! diff --git a/code/modules/admin/verbs/diagnostics.dm b/code/modules/admin/verbs/diagnostics.dm index ba1d7e5960a..24caef1b420 100644 --- a/code/modules/admin/verbs/diagnostics.dm +++ b/code/modules/admin/verbs/diagnostics.dm @@ -1,27 +1,4 @@ /client/proc - general_report() - set category = "Debug" - set name = "Show General Report" - - if(!master_controller) - usr << alert("Master_controller not found.") - - var/mobs = 0 - for(var/mob/M in mob_list) - mobs++ - - var/output = {"GENERAL SYSTEMS REPORT
    -General Processing Data
    -# of Machines: [machines.len]
    -# of Pipe Networks: [pipe_networks.len]
    -# of Processing Items: [processing_objects.len]
    -# of Power Nets: [powernets.len]
    -# of Mobs: [mobs]
    -"} - - usr << browse(output,"window=generalreport") - feedback_add_details("admin_verb","SGR") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - air_report() set category = "Debug" set name = "Show Air Report" @@ -156,13 +133,10 @@ set name = "Reload Admins" set category = "Debug" - if(!(usr.client.holder && usr.client.holder.level >= 6)) // protect and prevent - usr << "\red Not a good cop" - return + if(!check_rights(R_SERVER)) return message_admins("[usr] manually reloaded admins.txt") - usr << "You reload admins.txt" - world.load_admins() + load_admins() feedback_add_details("admin_verb","RLDA") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! diff --git a/code/modules/admin/verbs/massmodvar.dm b/code/modules/admin/verbs/massmodvar.dm index b5e15dc6d20..a35fb151745 100644 --- a/code/modules/admin/verbs/massmodvar.dm +++ b/code/modules/admin/verbs/massmodvar.dm @@ -5,7 +5,7 @@ var/method = 0 //0 means strict type detection while 1 means this type and all subtypes (IE: /obj/item with this set to 1 will set it to ALL itms) - if(!admin_rank_check(src.holder.level, 3)) return + if(!check_rights(R_VAREDIT)) return if(A && A.type) if(typesof(A.type)) @@ -24,11 +24,9 @@ /client/proc/massmodify_variables(var/atom/O, var/var_name = "", var/method = 0) - var/list/locked = list("vars", "key", "ckey", "client") + if(!check_rights(R_VAREDIT)) return - if(!src.holder) - src << "Only administrators may use this command." - return + var/list/locked = list("vars", "key", "ckey", "client") for(var/p in forbidden_varedit_object_types) if( istype(O,p) ) @@ -48,17 +46,13 @@ else variable = var_name - if(!variable) - return + if(!variable) return var/default var/var_value = O.vars[variable] var/dir - if (locked.Find(variable) && !(src.holder.rank in list("Game Master", "Game Admin"))) - return - - if (variable == "holder" && holder.rank != "Game Master") //Hotfix, a bit ugly but that exploit has been there for ages and now somebody just had to go and tell everyone of it bluh bluh - U - return + if(variable == "holder" || (variable in locked)) + if(!check_rights(R_DEBUG)) return if(isnull(var_value)) usr << "Unable to determine variable type." diff --git a/code/modules/admin/verbs/modifyvariables.dm b/code/modules/admin/verbs/modifyvariables.dm index 6771f00f9b4..49ded54e4c5 100644 --- a/code/modules/admin/verbs/modifyvariables.dm +++ b/code/modules/admin/verbs/modifyvariables.dm @@ -126,6 +126,8 @@ var/list/forbidden_varedit_object_types = list( L += var_value /client/proc/mod_list(var/list/L) + if(!check_rights(R_VAREDIT)) return + if(!istype(L,/list)) src << "Not a List." var/list/locked = list("vars", "key", "ckey", "client", "firemut", "ishulk", "telekinesis", "xray", "virus", "viruses", "cuffed", "ka", "last_eaten", "urine", "poo", "icon", "icon_state") @@ -144,8 +146,8 @@ var/list/forbidden_varedit_object_types = list( var/dir - if (locked.Find(variable) && !(src.holder.rank in list("Game Master", "Game Admin"))) - return + if(variable in locked) + if(!check_rights(R_DEBUG)) return if(isnull(variable)) usr << "Unable to determine variable type." @@ -264,12 +266,9 @@ var/list/forbidden_varedit_object_types = list( /client/proc/modify_variables(var/atom/O, var/param_var_name = null, var/autodetect_class = 0) - var/list/locked = list("vars", "key", "ckey", "client", "firemut", "ishulk", "telekinesis", "xray", "virus", "cuffed", "ka", "last_eaten", "icon", "icon_state", "mutantrace") + if(!check_rights(R_VAREDIT)) return - if(!src.holder) - src << "Only administrators may use this command." - return - if(!admin_rank_check(src.holder.level, 3)) return + var/list/locked = list("vars", "key", "ckey", "client", "firemut", "ishulk", "telekinesis", "xray", "virus", "cuffed", "ka", "last_eaten", "icon", "icon_state", "mutantrace") for(var/p in forbidden_varedit_object_types) if( istype(O,p) ) @@ -285,13 +284,8 @@ var/list/forbidden_varedit_object_types = list( src << "A variable with this name ([param_var_name]) doesn't exist in this atom ([O])" return - if (param_var_name == "holder" && holder.rank != "Game Master") - src << "No. Stop being stupid." - return - - if (locked.Find(param_var_name) && !(src.holder.rank in list("Game Master", "Game Admin"))) - src << "Editing this variable requires you to be a game master or game admin." - return + if(param_var_name == "holder" || (param_var_name in locked)) + if(!check_rights(R_DEBUG)) return variable = param_var_name @@ -345,15 +339,11 @@ var/list/forbidden_varedit_object_types = list( names = sortList(names) variable = input("Which var?","Var") as null|anything in names - if(!variable) - return + if(!variable) return var_value = O.vars[variable] - if (locked.Find(variable) && !(src.holder.rank in list("Game Master", "Game Admin"))) - return - - if (variable == "holder" && holder.rank != "Game Master") //Hotfix, a bit ugly but that exploit has been there for ages and now somebody just had to go and tell everyone of it bluh bluh - U - return + if(variable == "holder" || (variable in locked)) + if(!check_rights(R_DEBUG)) return if(!autodetect_class) diff --git a/code/modules/admin/verbs/playsound.dm b/code/modules/admin/verbs/playsound.dm index ff2c0a8dc57..17fb8c9a446 100644 --- a/code/modules/admin/verbs/playsound.dm +++ b/code/modules/admin/verbs/playsound.dm @@ -1,47 +1,28 @@ /client/proc/play_sound(S as sound) set category = "Fun" set name = "Play Global Sound" - - if(!src.holder) - src << "Only administrators may use this command." - return + if(!check_rights(R_SOUNDS)) return var/sound/uploaded_sound = sound(S, repeat = 0, wait = 1, channel = 777) uploaded_sound.priority = 250 - if(src.holder.rank == "Game Master" || src.holder.rank == "Game Admin" || src.holder.rank == "Badmin") - log_admin("[key_name(src)] played sound [S]") - message_admins("[key_name_admin(src)] played sound [S]", 1) - for(var/mob/M in player_list) - if(M.client.midis) - M << uploaded_sound - else - if(usr.client.canplaysound) - usr.client.canplaysound = 0 - log_admin("[key_name(src)] played sound [S]") - message_admins("[key_name_admin(src)] played sound [S]", 1) - for(var/mob/M in player_list) - if(M.client.midis) - M << uploaded_sound - else - usr << "You already used up your jukebox monies this round!" - del(uploaded_sound) + log_admin("[key_name(src)] played sound [S]") + message_admins("[key_name_admin(src)] played sound [S]", 1) + for(var/mob/M in player_list) + if(M.client.midis) + M << uploaded_sound + feedback_add_details("admin_verb","PGS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /client/proc/play_local_sound(S as sound) set category = "Fun" set name = "Play Local Sound" + if(!check_rights(R_SOUNDS)) return - if(!src.holder) - src << "Only administrators may use this command." - return - - if(src.holder.rank == "Game Master" || src.holder.rank == "Game Admin") - log_admin("[key_name(src)] played a local sound [S]") - message_admins("[key_name_admin(src)] played a local sound [S]", 1) - playsound(get_turf_loc(src.mob), S, 50, 0, 0) - return + log_admin("[key_name(src)] played a local sound [S]") + message_admins("[key_name_admin(src)] played a local sound [S]", 1) + playsound(get_turf_loc(src.mob), S, 50, 0, 0) feedback_add_details("admin_verb","PLS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index 18b6ce317b1..ba95ab8b184 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -787,20 +787,14 @@ Traitors and the like can also be revived with the previous role mostly intact. return /client/proc/admin_cancel_shuttle() - set category = "Admin" set name = "Cancel Shuttle" + if(!check_rights(0)) return + if(alert(src, "You sure?", "Confirm", "Yes", "No") != "Yes") return - if ((!( ticker ) || emergency_shuttle.location || emergency_shuttle.direction == 0)) + if(!ticker || emergency_shuttle.location || emergency_shuttle.direction == 0) return - if (!holder) - src << "Only administrators may use this command." - return - - var/confirm = alert(src, "You sure?", "Confirm", "Yes", "No") - if(confirm != "Yes") return - emergency_shuttle.recall() feedback_add_details("admin_verb","CCSHUT") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! log_admin("[key_name(usr)] admin-recalled the emergency shuttle.") diff --git a/code/modules/admin/verbs/ticklag.dm b/code/modules/admin/verbs/ticklag.dm index 1d9afa57a42..928ba733caa 100644 --- a/code/modules/admin/verbs/ticklag.dm +++ b/code/modules/admin/verbs/ticklag.dm @@ -5,28 +5,20 @@ set name = "Set Ticklag" set desc = "Sets a new tick lag. Recommend you don't mess with this too much! Stable, time-tested ticklag value is 0.9" - if(src.holder) - if(!src.mob) return + if(!check_rights(R_DEBUG)) return - if(src.holder.rank in list("Game Admin", "Game Master")) - var/newtick = input("Sets a new tick lag. Please don't mess with this too much! The stable, time-tested ticklag value is 0.9","Lag of Tick", world.tick_lag) as num|null - //I've used ticks of 2 before to help with serious singulo lags - if(newtick && newtick <= 2 && newtick > 0) - log_admin("[key_name(src)] has modified world.tick_lag to [newtick]", 0) - message_admins("[key_name(src)] has modified world.tick_lag to [newtick]", 0) - world.tick_lag = newtick - feedback_add_details("admin_verb","TICKLAG") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! + var/newtick = input("Sets a new tick lag. Please don't mess with this too much! The stable, time-tested ticklag value is 0.9","Lag of Tick", world.tick_lag) as num|null + //I've used ticks of 2 before to help with serious singulo lags + if(newtick && newtick <= 2 && newtick > 0) + log_admin("[key_name(src)] has modified world.tick_lag to [newtick]", 0) + message_admins("[key_name(src)] has modified world.tick_lag to [newtick]", 0) + world.tick_lag = newtick + feedback_add_details("admin_verb","TICKLAG") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - switch(alert("Enable Tick Compensation?","Tick Comp is currently: [config.Tickcomp]","Yes","No")) - if("Yes") - config.Tickcomp = 1 - else - config.Tickcomp = 0 + switch(alert("Enable Tick Compensation?","Tick Comp is currently: [config.Tickcomp]","Yes","No")) + if("Yes") config.Tickcomp = 1 + else config.Tickcomp = 0 + else + src << "\red Error: ticklag(): Invalid world.ticklag value. No changes made." - return - src << "\red Error: ticklag(): Invalid world.ticklag value. No changes made." - return - - src << "\red Error: ticklag(): You are not authorised to use this. Game Admins and higher only." - return diff --git a/code/modules/client/client procs.dm b/code/modules/client/client procs.dm index 7003eb6cae8..c82c4e751a1 100644 --- a/code/modules/client/client procs.dm +++ b/code/modules/client/client procs.dm @@ -103,7 +103,6 @@ if(holder) admins += src holder.owner = src - holder.state = null . = ..() //calls mob.Login() @@ -112,6 +111,7 @@ world.update_status() if(holder) + update_admin() admin_memo_show() log_client_to_db() @@ -122,7 +122,6 @@ ////////////// /client/Del() if(holder) - holder.state = null holder.owner = null admins -= src directory -= ckey @@ -175,12 +174,10 @@ if(sql_id) //Player already identified previously, we need to just update the 'lastseen', 'ip' and 'computer_id' variables - var/DBQuery/query_update = dbcon.NewQuery("UPDATE erro_player SET lastseen = Now(), ip = '[sql_ip]', computerid = '[sql_computerid]', lastadminrank = '[sql_admin_rank]' WHERE id = [sql_id]") query_update.Execute() else //New player!! Need to insert all the stuff - var/DBQuery/query_insert = dbcon.NewQuery("INSERT INTO erro_player (id, ckey, firstseen, lastseen, ip, computerid, lastadminrank) VALUES (null, '[sql_ckey]', Now(), Now(), '[sql_ip]', '[sql_computerid]', '[sql_admin_rank]')") query_insert.Execute() diff --git a/code/modules/mob/login.dm b/code/modules/mob/login.dm index 01229de0a69..1c3498802d1 100644 --- a/code/modules/mob/login.dm +++ b/code/modules/mob/login.dm @@ -1,9 +1,5 @@ //handles setting lastKnownIP and computer_id for use by the ban systems as well as checking for multikeying /mob/proc/update_Login_details() - //trigger admin holder updates. This is hear as all Login() calls this proc. - if(client.holder) - client.update_admins(client.holder.rank) - //Multikey checks and logging lastKnownIP = client.address computer_id = client.computer_id diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 3bf0f0537c3..851166c5e47 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -427,20 +427,20 @@ var/list/slot_equipment_priority = list( \ set category = "OOC" var/is_admin = 0 - if (client.holder && client.holder.level >= 1 && ( client.holder.state == 2 || client.holder.level > 3 )) + if(client.holder && (client.holder.rights & R_ADMIN)) is_admin = 1 - else if (istype(src, /mob/new_player) || stat != 2) + else if(stat != DEAD || istype(src, /mob/new_player)) usr << "\blue You must be observing to use this!" return - if (is_admin && stat == 2) + if(is_admin && stat == DEAD) is_admin = 0 var/list/names = list() var/list/namecounts = list() var/list/creatures = list() - for(var/obj/O in world) + for(var/obj/O in world) //EWWWWWWWWWWWWWWWWWWWWWWWW ~needs to be optimised if(!O.loc) continue if(istype(O, /obj/item/weapon/disk/nuclear)) diff --git a/code/modules/mob/new_player/preferences.dm b/code/modules/mob/new_player/preferences.dm index c217d2e6739..de01b3e38a5 100644 --- a/code/modules/mob/new_player/preferences.dm +++ b/code/modules/mob/new_player/preferences.dm @@ -176,11 +176,11 @@ datum/preferences if(config.allow_Metadata) dat += "OOC Notes: Edit
    " - if((user.client) && (user.client.holder) && (user.client.holder.rank)) + if(user.client && user.client.holder) dat += "Adminhelp sound: " dat += "[(sound_adminhelp)?"On":"Off"] toggle
    " - if(user.client.holder.level >= 5) + if(user.client.holder.rights & R_FUN) dat += "
    OOC
    " dat += "Change color
    __

    " diff --git a/code/stylesheet.dm b/code/stylesheet.dm index a84e818494f..78a05bc27da 100644 --- a/code/stylesheet.dm +++ b/code/stylesheet.dm @@ -49,4 +49,6 @@ h1.alert, h2.alert {color: #000000;} .alien {color: #543354;} .newscaster {color: #800000;} +.interface {color: #330033;} + "} diff --git a/code/world.dm b/code/world.dm index 4c936fade2f..dcc9add5ece 100644 --- a/code/world.dm +++ b/code/world.dm @@ -18,7 +18,7 @@ src.load_mode() src.load_motd() - src.load_admins() + load_admins() investigate_reset() if (config.usewhitelist) load_whitelist() @@ -188,84 +188,6 @@ Starting up. [time2text(world.timeofday, "hh:mm.ss")] /world/proc/load_motd() join_motd = file2text("config/motd.txt") -/world/proc/load_admins() - if(config.admin_legacy_system) - //Legacy admin system uses admins.txt - It's not fucking legacy Erro. It's standard. I can assure you more people will be using 'legacy' than sql. SQL is lame. ~carnie - var/list/Lines = file2list("config/admins.txt") - for(var/line in Lines) - if(!line) continue - - if(copytext(line, 1, 2) == ";") - continue - - var/pos = findtext(line, " - ", 1, null) - if(pos) - var/m_key = copytext(line, 1, pos) - var/a_lev = copytext(line, pos + 3, length(line) + 1) - admin_datums[m_key] = new /datum/admins(a_lev) - diary << ("ADMIN: [m_key] = [a_lev]") - else - //The current admin system uses SQL - var/user = sqlfdbklogin - var/pass = sqlfdbkpass - var/db = sqlfdbkdb - var/address = sqladdress - var/port = sqlport - - var/DBConnection/dbcon = new() - - dbcon.Connect("dbi:mysql:[db]:[address]:[port]","[user]","[pass]") - if(!dbcon.IsConnected()) - diary << "Failed to connect to database in load_admins(). Reverting to legacy system." - config.admin_legacy_system = 1 - load_admins() - return - - var/DBQuery/query = dbcon.NewQuery("SELECT ckey, rank, level, flags FROM erro_admin") - query.Execute() - while(query.NextRow()) - var/adminckey = query.item[1] - var/adminrank = query.item[2] - var/adminlevel = query.item[3] - if(istext(adminlevel)) - adminlevel = text2num(adminlevel) - var/permissions = query.item[4] - if(istext(permissions)) - permissions = text2num(permissions) - - //This list of stuff translates the permission defines the database uses to the permission structure that the game uses. - var/permissions_actual = 0 - if(permissions & SQL_BUILDMODE) - permissions_actual |= BUILDMODE - if(permissions & SQL_ADMIN) - permissions_actual |= ADMIN - if(permissions & SQL_BAN) - permissions_actual |= BAN - if(permissions & SQL_FUN) - permissions_actual |= FUN - if(permissions & SQL_SERVER) - permissions_actual |= SERVER - if(permissions & SQL_DEBUG) - permissions_actual |= ADMDEBUG - if(permissions & SQL_POSSESS) - permissions_actual |= POSSESS - if(permissions & SQL_PERMISSIONS) - permissions_actual |= PERMISSIONS - - if(adminrank == "Removed") - return //This person was de-adminned. They are only in the admin list for archive purposes. - - var/datum/admins/AD = new /datum/admins(adminrank) - AD.level = adminlevel //Legacy support for old verbs - AD.sql_permissions = permissions_actual - admin_datums[adminckey] = AD - - if(!admin_datums) - diary << "The database query in load_admins() resulted in no admins being added to the list. Reverting to legacy system." - config.admin_legacy_system = 1 - load_admins() - return - /world/proc/load_configuration() config = new /datum/configuration() config.load("config/config.txt") diff --git a/config/admin_ranks.txt b/config/admin_ranks.txt new file mode 100644 index 00000000000..f938ddbf32e --- /dev/null +++ b/config/admin_ranks.txt @@ -0,0 +1,39 @@ +######################################################################################## +# ADMIN RANK DEFINES # +# The format of this is very simple. Rank name goes first. # +# Rank is CASE-SENSITIVE, all punctuation will be stripped so spaces don't matter. # +# Each rank is then followed by keywords with the prefix "+". # +# These keywords represent groups of verbs and abilities which are given to that rank. # +# +@ (or +prev) is a special shorthand which adds all the rights of the rank above it. # +# Ranks with no keywords will just be given the most basic verbs and abilities ~Carn # +######################################################################################## +# PLEASE NOTE: depending on config options, some abilities will be unavailable regardless if you have permission to use them! +# ALSO NOTE: this is a WorkInProgress at the moment. Most of this is just arbitrarily thrown in whatever group because LoadsaWork2Do+LittleTime. +# I'll be doing more moving around as feedback comes in. So be sure to check the notes after updates. + +# KEYWORDS: +# +ADMIN = general admin tools, verbs etc +# +FUN = mob-transformation, events, other event-orientated actions +# +BAN = the ability to ban, jobban and fullban +# +STEALTH = the ability to stealthmin (make yourself appear with a fake name to everyone but other admins +# +POSSESS = the ability to possess objects +# +REJUV (or +REJUVINATE) = the ability to heal, respawn, modify damage and use godmode +# +BUILD (or +BUILDMODE) = the ability to use buildmode +# +SERVER = higher-risk admin verbs and abilities, such as those which affect the server configuration. +# +DEBUG = debug tools used for diagnosing and fixing problems. It's useful to give this to coders so they can investigate problems on a live server +# +VAREDIT = everyone may view viewvars/debugvars/whatever you call it. This keyword allows you to actually EDIT those variables. +# +RIGHTS (or +PERMISSIONS) = allows you to promote and/or demote people. +# +SOUND (or +SOUNDS) = allows you to upload and play sounds +# +EVERYTHING (or +HOST or +ALL) = Simply gives you everything without having to type every flag + +Admin Observer +Moderator +ADMIN +Admin Candidate +@ +Trial Admin +@ +FUN +REJUV +VAREDIT +BAN +Badmin +@ +POSSESS +BUILDMODE +SERVER +Game Admin +@ +STEALTH +SOUNDS +DEBUG +Game Master +EVERYTHING + +Host +EVERYTHING + +Coder +DEBUG +VAREDIT +SERVER \ No newline at end of file diff --git a/config/admins.txt b/config/admins.txt index cd69e20db66..32aefc61e72 100644 --- a/config/admins.txt +++ b/config/admins.txt @@ -1,3 +1,10 @@ +###################################################################### +# Basically, ckey goes first. Rank goes after the "-" # +# Case is not important for ckey. # +# Case IS important for the rank. However punctuation/spaces are not # +# Ranks can be anything defined in admin_ranks.txt ~Carn # +###################################################################### + quarxink - Game Master tle - Game Master xsi - Game Master diff --git a/tgstation.dme b/tgstation.dme index cf1b4ab8e72..9a281262705 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -6,266 +6,6 @@ // BEGIN_FILE_DIR #define FILE_DIR . -#define FILE_DIR ".svn" -#define FILE_DIR ".svn/pristine" -#define FILE_DIR ".svn/pristine/00" -#define FILE_DIR ".svn/pristine/01" -#define FILE_DIR ".svn/pristine/02" -#define FILE_DIR ".svn/pristine/03" -#define FILE_DIR ".svn/pristine/04" -#define FILE_DIR ".svn/pristine/05" -#define FILE_DIR ".svn/pristine/06" -#define FILE_DIR ".svn/pristine/07" -#define FILE_DIR ".svn/pristine/08" -#define FILE_DIR ".svn/pristine/09" -#define FILE_DIR ".svn/pristine/0a" -#define FILE_DIR ".svn/pristine/0b" -#define FILE_DIR ".svn/pristine/0c" -#define FILE_DIR ".svn/pristine/0d" -#define FILE_DIR ".svn/pristine/0e" -#define FILE_DIR ".svn/pristine/0f" -#define FILE_DIR ".svn/pristine/10" -#define FILE_DIR ".svn/pristine/11" -#define FILE_DIR ".svn/pristine/12" -#define FILE_DIR ".svn/pristine/13" -#define FILE_DIR ".svn/pristine/14" -#define FILE_DIR ".svn/pristine/15" -#define FILE_DIR ".svn/pristine/16" -#define FILE_DIR ".svn/pristine/17" -#define FILE_DIR ".svn/pristine/18" -#define FILE_DIR ".svn/pristine/19" -#define FILE_DIR ".svn/pristine/1a" -#define FILE_DIR ".svn/pristine/1b" -#define FILE_DIR ".svn/pristine/1c" -#define FILE_DIR ".svn/pristine/1d" -#define FILE_DIR ".svn/pristine/1e" -#define FILE_DIR ".svn/pristine/1f" -#define FILE_DIR ".svn/pristine/20" -#define FILE_DIR ".svn/pristine/21" -#define FILE_DIR ".svn/pristine/22" -#define FILE_DIR ".svn/pristine/23" -#define FILE_DIR ".svn/pristine/24" -#define FILE_DIR ".svn/pristine/25" -#define FILE_DIR ".svn/pristine/26" -#define FILE_DIR ".svn/pristine/27" -#define FILE_DIR ".svn/pristine/28" -#define FILE_DIR ".svn/pristine/29" -#define FILE_DIR ".svn/pristine/2a" -#define FILE_DIR ".svn/pristine/2b" -#define FILE_DIR ".svn/pristine/2c" -#define FILE_DIR ".svn/pristine/2d" -#define FILE_DIR ".svn/pristine/2e" -#define FILE_DIR ".svn/pristine/2f" -#define FILE_DIR ".svn/pristine/30" -#define FILE_DIR ".svn/pristine/31" -#define FILE_DIR ".svn/pristine/32" -#define FILE_DIR ".svn/pristine/33" -#define FILE_DIR ".svn/pristine/34" -#define FILE_DIR ".svn/pristine/35" -#define FILE_DIR ".svn/pristine/36" -#define FILE_DIR ".svn/pristine/37" -#define FILE_DIR ".svn/pristine/38" -#define FILE_DIR ".svn/pristine/39" -#define FILE_DIR ".svn/pristine/3a" -#define FILE_DIR ".svn/pristine/3b" -#define FILE_DIR ".svn/pristine/3c" -#define FILE_DIR ".svn/pristine/3d" -#define FILE_DIR ".svn/pristine/3e" -#define FILE_DIR ".svn/pristine/3f" -#define FILE_DIR ".svn/pristine/40" -#define FILE_DIR ".svn/pristine/41" -#define FILE_DIR ".svn/pristine/42" -#define FILE_DIR ".svn/pristine/43" -#define FILE_DIR ".svn/pristine/44" -#define FILE_DIR ".svn/pristine/45" -#define FILE_DIR ".svn/pristine/46" -#define FILE_DIR ".svn/pristine/47" -#define FILE_DIR ".svn/pristine/48" -#define FILE_DIR ".svn/pristine/49" -#define FILE_DIR ".svn/pristine/4a" -#define FILE_DIR ".svn/pristine/4b" -#define FILE_DIR ".svn/pristine/4c" -#define FILE_DIR ".svn/pristine/4d" -#define FILE_DIR ".svn/pristine/4e" -#define FILE_DIR ".svn/pristine/4f" -#define FILE_DIR ".svn/pristine/50" -#define FILE_DIR ".svn/pristine/51" -#define FILE_DIR ".svn/pristine/52" -#define FILE_DIR ".svn/pristine/53" -#define FILE_DIR ".svn/pristine/54" -#define FILE_DIR ".svn/pristine/55" -#define FILE_DIR ".svn/pristine/56" -#define FILE_DIR ".svn/pristine/57" -#define FILE_DIR ".svn/pristine/58" -#define FILE_DIR ".svn/pristine/59" -#define FILE_DIR ".svn/pristine/5a" -#define FILE_DIR ".svn/pristine/5b" -#define FILE_DIR ".svn/pristine/5c" -#define FILE_DIR ".svn/pristine/5d" -#define FILE_DIR ".svn/pristine/5e" -#define FILE_DIR ".svn/pristine/5f" -#define FILE_DIR ".svn/pristine/60" -#define FILE_DIR ".svn/pristine/61" -#define FILE_DIR ".svn/pristine/62" -#define FILE_DIR ".svn/pristine/63" -#define FILE_DIR ".svn/pristine/64" -#define FILE_DIR ".svn/pristine/65" -#define FILE_DIR ".svn/pristine/66" -#define FILE_DIR ".svn/pristine/67" -#define FILE_DIR ".svn/pristine/68" -#define FILE_DIR ".svn/pristine/69" -#define FILE_DIR ".svn/pristine/6a" -#define FILE_DIR ".svn/pristine/6b" -#define FILE_DIR ".svn/pristine/6c" -#define FILE_DIR ".svn/pristine/6d" -#define FILE_DIR ".svn/pristine/6e" -#define FILE_DIR ".svn/pristine/6f" -#define FILE_DIR ".svn/pristine/70" -#define FILE_DIR ".svn/pristine/71" -#define FILE_DIR ".svn/pristine/72" -#define FILE_DIR ".svn/pristine/73" -#define FILE_DIR ".svn/pristine/74" -#define FILE_DIR ".svn/pristine/75" -#define FILE_DIR ".svn/pristine/76" -#define FILE_DIR ".svn/pristine/77" -#define FILE_DIR ".svn/pristine/78" -#define FILE_DIR ".svn/pristine/79" -#define FILE_DIR ".svn/pristine/7a" -#define FILE_DIR ".svn/pristine/7b" -#define FILE_DIR ".svn/pristine/7c" -#define FILE_DIR ".svn/pristine/7d" -#define FILE_DIR ".svn/pristine/7e" -#define FILE_DIR ".svn/pristine/7f" -#define FILE_DIR ".svn/pristine/80" -#define FILE_DIR ".svn/pristine/81" -#define FILE_DIR ".svn/pristine/82" -#define FILE_DIR ".svn/pristine/83" -#define FILE_DIR ".svn/pristine/84" -#define FILE_DIR ".svn/pristine/85" -#define FILE_DIR ".svn/pristine/86" -#define FILE_DIR ".svn/pristine/87" -#define FILE_DIR ".svn/pristine/88" -#define FILE_DIR ".svn/pristine/89" -#define FILE_DIR ".svn/pristine/8a" -#define FILE_DIR ".svn/pristine/8b" -#define FILE_DIR ".svn/pristine/8c" -#define FILE_DIR ".svn/pristine/8d" -#define FILE_DIR ".svn/pristine/8e" -#define FILE_DIR ".svn/pristine/8f" -#define FILE_DIR ".svn/pristine/90" -#define FILE_DIR ".svn/pristine/91" -#define FILE_DIR ".svn/pristine/92" -#define FILE_DIR ".svn/pristine/93" -#define FILE_DIR ".svn/pristine/94" -#define FILE_DIR ".svn/pristine/95" -#define FILE_DIR ".svn/pristine/96" -#define FILE_DIR ".svn/pristine/97" -#define FILE_DIR ".svn/pristine/98" -#define FILE_DIR ".svn/pristine/99" -#define FILE_DIR ".svn/pristine/9a" -#define FILE_DIR ".svn/pristine/9b" -#define FILE_DIR ".svn/pristine/9c" -#define FILE_DIR ".svn/pristine/9d" -#define FILE_DIR ".svn/pristine/9e" -#define FILE_DIR ".svn/pristine/9f" -#define FILE_DIR ".svn/pristine/a0" -#define FILE_DIR ".svn/pristine/a1" -#define FILE_DIR ".svn/pristine/a2" -#define FILE_DIR ".svn/pristine/a3" -#define FILE_DIR ".svn/pristine/a4" -#define FILE_DIR ".svn/pristine/a5" -#define FILE_DIR ".svn/pristine/a6" -#define FILE_DIR ".svn/pristine/a7" -#define FILE_DIR ".svn/pristine/a8" -#define FILE_DIR ".svn/pristine/a9" -#define FILE_DIR ".svn/pristine/aa" -#define FILE_DIR ".svn/pristine/ab" -#define FILE_DIR ".svn/pristine/ac" -#define FILE_DIR ".svn/pristine/ad" -#define FILE_DIR ".svn/pristine/ae" -#define FILE_DIR ".svn/pristine/af" -#define FILE_DIR ".svn/pristine/b0" -#define FILE_DIR ".svn/pristine/b1" -#define FILE_DIR ".svn/pristine/b2" -#define FILE_DIR ".svn/pristine/b3" -#define FILE_DIR ".svn/pristine/b4" -#define FILE_DIR ".svn/pristine/b5" -#define FILE_DIR ".svn/pristine/b6" -#define FILE_DIR ".svn/pristine/b7" -#define FILE_DIR ".svn/pristine/b8" -#define FILE_DIR ".svn/pristine/b9" -#define FILE_DIR ".svn/pristine/ba" -#define FILE_DIR ".svn/pristine/bb" -#define FILE_DIR ".svn/pristine/bc" -#define FILE_DIR ".svn/pristine/bd" -#define FILE_DIR ".svn/pristine/be" -#define FILE_DIR ".svn/pristine/bf" -#define FILE_DIR ".svn/pristine/c0" -#define FILE_DIR ".svn/pristine/c1" -#define FILE_DIR ".svn/pristine/c2" -#define FILE_DIR ".svn/pristine/c3" -#define FILE_DIR ".svn/pristine/c4" -#define FILE_DIR ".svn/pristine/c5" -#define FILE_DIR ".svn/pristine/c6" -#define FILE_DIR ".svn/pristine/c7" -#define FILE_DIR ".svn/pristine/c8" -#define FILE_DIR ".svn/pristine/c9" -#define FILE_DIR ".svn/pristine/ca" -#define FILE_DIR ".svn/pristine/cb" -#define FILE_DIR ".svn/pristine/cc" -#define FILE_DIR ".svn/pristine/cd" -#define FILE_DIR ".svn/pristine/ce" -#define FILE_DIR ".svn/pristine/cf" -#define FILE_DIR ".svn/pristine/d0" -#define FILE_DIR ".svn/pristine/d1" -#define FILE_DIR ".svn/pristine/d2" -#define FILE_DIR ".svn/pristine/d3" -#define FILE_DIR ".svn/pristine/d4" -#define FILE_DIR ".svn/pristine/d5" -#define FILE_DIR ".svn/pristine/d6" -#define FILE_DIR ".svn/pristine/d7" -#define FILE_DIR ".svn/pristine/d8" -#define FILE_DIR ".svn/pristine/d9" -#define FILE_DIR ".svn/pristine/da" -#define FILE_DIR ".svn/pristine/db" -#define FILE_DIR ".svn/pristine/dc" -#define FILE_DIR ".svn/pristine/dd" -#define FILE_DIR ".svn/pristine/de" -#define FILE_DIR ".svn/pristine/df" -#define FILE_DIR ".svn/pristine/e0" -#define FILE_DIR ".svn/pristine/e1" -#define FILE_DIR ".svn/pristine/e2" -#define FILE_DIR ".svn/pristine/e3" -#define FILE_DIR ".svn/pristine/e4" -#define FILE_DIR ".svn/pristine/e5" -#define FILE_DIR ".svn/pristine/e6" -#define FILE_DIR ".svn/pristine/e7" -#define FILE_DIR ".svn/pristine/e8" -#define FILE_DIR ".svn/pristine/e9" -#define FILE_DIR ".svn/pristine/ea" -#define FILE_DIR ".svn/pristine/eb" -#define FILE_DIR ".svn/pristine/ec" -#define FILE_DIR ".svn/pristine/ed" -#define FILE_DIR ".svn/pristine/ee" -#define FILE_DIR ".svn/pristine/ef" -#define FILE_DIR ".svn/pristine/f0" -#define FILE_DIR ".svn/pristine/f1" -#define FILE_DIR ".svn/pristine/f2" -#define FILE_DIR ".svn/pristine/f3" -#define FILE_DIR ".svn/pristine/f4" -#define FILE_DIR ".svn/pristine/f5" -#define FILE_DIR ".svn/pristine/f6" -#define FILE_DIR ".svn/pristine/f7" -#define FILE_DIR ".svn/pristine/f8" -#define FILE_DIR ".svn/pristine/f9" -#define FILE_DIR ".svn/pristine/fa" -#define FILE_DIR ".svn/pristine/fb" -#define FILE_DIR ".svn/pristine/fc" -#define FILE_DIR ".svn/pristine/fd" -#define FILE_DIR ".svn/pristine/fe" -#define FILE_DIR ".svn/pristine/ff" -#define FILE_DIR "bot" -#define FILE_DIR "bot/Marakov" #define FILE_DIR "code" #define FILE_DIR "code/__HELPERS" #define FILE_DIR "code/ATMOSPHERICS" @@ -450,15 +190,6 @@ #define FILE_DIR "code/WorkInProgress/mapload" #define FILE_DIR "code/WorkInProgress/organs" #define FILE_DIR "code/WorkInProgress/virus2" -#define FILE_DIR "config" -#define FILE_DIR "config/names" -#define FILE_DIR "data" -#define FILE_DIR "data/logs" -#define FILE_DIR "data/logs/2012" -#define FILE_DIR "data/logs/2012/10-October" -#define FILE_DIR "data/player_saves" -#define FILE_DIR "data/player_saves/g" -#define FILE_DIR "data/player_saves/g/giacomand" #define FILE_DIR "html" #define FILE_DIR "icons" #define FILE_DIR "icons/effects" @@ -473,7 +204,6 @@ #define FILE_DIR "icons/obj/machines" #define FILE_DIR "icons/obj/pipes" #define FILE_DIR "icons/pda_icons" -#define FILE_DIR "icons/PSD files" #define FILE_DIR "icons/spideros_icons" #define FILE_DIR "icons/Testing" #define FILE_DIR "icons/turf" @@ -482,7 +212,6 @@ #define FILE_DIR "interface" #define FILE_DIR "maps" #define FILE_DIR "maps/RandomZLevels" -#define FILE_DIR "music" #define FILE_DIR "sound" #define FILE_DIR "sound/AI" #define FILE_DIR "sound/ambience" @@ -496,18 +225,8 @@ #define FILE_DIR "sound/violin" #define FILE_DIR "sound/voice" #define FILE_DIR "sound/weapons" -#define FILE_DIR "SQL" #define FILE_DIR "tools" #define FILE_DIR "tools/Redirector" -#define FILE_DIR "tools/Runtime Condenser" -#define FILE_DIR "tools/UnstandardnessTestForDM" -#define FILE_DIR "tools/UnstandardnessTestForDM/UnstandardnessTestForDM" -#define FILE_DIR "tools/UnstandardnessTestForDM/UnstandardnessTestForDM/bin" -#define FILE_DIR "tools/UnstandardnessTestForDM/UnstandardnessTestForDM/bin/Debug" -#define FILE_DIR "tools/UnstandardnessTestForDM/UnstandardnessTestForDM/obj" -#define FILE_DIR "tools/UnstandardnessTestForDM/UnstandardnessTestForDM/obj/x86" -#define FILE_DIR "tools/UnstandardnessTestForDM/UnstandardnessTestForDM/obj/x86/Debug" -#define FILE_DIR "tools/UnstandardnessTestForDM/UnstandardnessTestForDM/Properties" // END_FILE_DIR // BEGIN_PREFERENCES @@ -1101,6 +820,7 @@ #include "code\modules\admin\admin.dm" #include "code\modules\admin\admin_investigate.dm" #include "code\modules\admin\admin_memo.dm" +#include "code\modules\admin\admin_ranks.dm" #include "code\modules\admin\admin_verbs.dm" #include "code\modules\admin\banjob.dm" #include "code\modules\admin\create_mob.dm" @@ -1112,10 +832,9 @@ #include "code\modules\admin\newbanjob.dm" #include "code\modules\admin\player_notes.dm" #include "code\modules\admin\player_panel.dm" +#include "code\modules\admin\topic.dm" #include "code\modules\admin\ToRban.dm" #include "code\modules\admin\DB ban\functions.dm" -#include "code\modules\admin\permissionverbs\assignment.dm" -#include "code\modules\admin\permissionverbs\permissionedit.dm" #include "code\modules\admin\verbs\adminhelp.dm" #include "code\modules\admin\verbs\adminjump.dm" #include "code\modules\admin\verbs\adminpm.dm"