From 08f36a9521fe7ebb2c2d1a5bfbe5acfee47df7fb Mon Sep 17 00:00:00 2001 From: S34N <12197162+S34NW@users.noreply.github.com> Date: Fri, 2 Sep 2022 23:51:00 +0100 Subject: [PATCH] Admin QoL: Deletes stickybans, tidies mob VV menu (#18943) * 1 * 2 * removes these too --- code/datums/datumvars.dm | 114 ---------- code/modules/admin/IsBanned.dm | 10 +- code/modules/admin/admin_verbs.dm | 1 - code/modules/admin/stickyban.dm | 210 ------------------ code/modules/admin/topic.dm | 3 - code/modules/mob/living/carbon/human/human.dm | 14 -- paradise.dme | 1 - 7 files changed, 5 insertions(+), 348 deletions(-) delete mode 100644 code/modules/admin/stickyban.dm diff --git a/code/datums/datumvars.dm b/code/datums/datumvars.dm index a06f28c0db3..ed4507a67ee 100644 --- a/code/datums/datumvars.dm +++ b/code/datums/datumvars.dm @@ -1004,113 +1004,6 @@ log_admin("[key_name(usr)] has rotated \the [A]") href_list["datumrefresh"] = href_list["rotatedatum"] - else if(href_list["makemonkey"]) - if(!check_rights(R_SPAWN)) return - - var/mob/living/carbon/human/H = locateUID(href_list["makemonkey"]) - if(!istype(H)) - to_chat(usr, "This can only be done to instances of type /mob/living/carbon/human") - return - - if(alert("Confirm mob type change?",,"Transform","Cancel") != "Transform") return - if(!H) - to_chat(usr, "Mob doesn't exist anymore") - return - holder.Topic(href, list("monkeyone"=href_list["makemonkey"])) - - else if(href_list["makerobot"]) - if(!check_rights(R_SPAWN)) return - - var/mob/living/carbon/human/H = locateUID(href_list["makerobot"]) - if(!istype(H)) - to_chat(usr, "This can only be done to instances of type /mob/living/carbon/human") - return - - if(alert("Confirm mob type change?",,"Transform","Cancel") != "Transform") return - if(!H) - to_chat(usr, "Mob doesn't exist anymore") - return - holder.Topic(href, list("makerobot"=href_list["makerobot"])) - - else if(href_list["makealien"]) - if(!check_rights(R_SPAWN)) return - - var/mob/living/carbon/human/H = locateUID(href_list["makealien"]) - if(!istype(H)) - to_chat(usr, "This can only be done to instances of type /mob/living/carbon/human") - return - - if(alert("Confirm mob type change?",,"Transform","Cancel") != "Transform") return - if(!H) - to_chat(usr, "Mob doesn't exist anymore") - return - holder.Topic(href, list("makealien"=href_list["makealien"])) - - else if(href_list["makeslime"]) - if(!check_rights(R_SPAWN)) return - - var/mob/living/carbon/human/H = locateUID(href_list["makeslime"]) - if(!istype(H)) - to_chat(usr, "This can only be done to instances of type /mob/living/carbon/human") - return - - if(alert("Confirm mob type change?",,"Transform","Cancel") != "Transform") return - if(!H) - to_chat(usr, "Mob doesn't exist anymore") - return - holder.Topic(href, list("makeslime"=href_list["makeslime"])) - - else if(href_list["makesuper"]) - if(!check_rights(R_SPAWN)) return - - var/mob/living/carbon/human/H = locateUID(href_list["makesuper"]) - if(!istype(H)) - to_chat(usr, "This can only be done to instances of type /mob/living/carbon/human") - return - - if(alert("Confirm mob type change?",,"Transform","Cancel") != "Transform") return - if(!H) - to_chat(usr, "Mob doesn't exist anymore") - return - holder.Topic(href, list("makesuper"=href_list["makesuper"])) - - else if(href_list["makeai"]) - if(!check_rights(R_SPAWN)) return - - var/mob/living/carbon/human/H = locateUID(href_list["makeai"]) - if(!istype(H)) - to_chat(usr, "This can only be done to instances of type /mob/living/carbon/human") - return - - if(alert("Confirm mob type change?",,"Transform","Cancel") != "Transform") return - if(!H) - to_chat(usr, "Mob doesn't exist anymore") - return - holder.Topic(href, list("makeai"=href_list["makeai"])) - - else if(href_list["setspecies"]) - if(!check_rights(R_SPAWN)) return - - var/mob/living/carbon/human/H = locateUID(href_list["setspecies"]) - if(!istype(H)) - to_chat(usr, "This can only be done to instances of type /mob/living/carbon/human") - return - - var/new_species = input("Please choose a new species.","Species",null) as null|anything in GLOB.all_species - - if(!H) - to_chat(usr, "Mob doesn't exist anymore") - return - - var/datum/species/S = GLOB.all_species[new_species] - if(H.set_species(S.type)) - to_chat(usr, "Set species of [H] to [H.dna.species].") - H.regenerate_icons() - message_admins("[key_name_admin(usr)] has changed the species of [key_name_admin(H)] to [new_species]") - log_admin("[key_name(usr)] has changed the species of [key_name(H)] to [new_species]") - else - to_chat(usr, "Failed! Something went wrong.") - else if(href_list["addlanguage"]) if(!check_rights(R_SPAWN)) return @@ -1330,13 +1223,6 @@ return src.debug_variables(DAT) - if(href_list["copyoutfit"]) - if(!check_rights(R_EVENT)) - return - var/mob/living/carbon/human/H = locateUID(href_list["copyoutfit"]) - if(istype(H)) - H.copy_outfit() - if(href_list["manipcolours"]) if(!check_rights(R_DEBUG)) return diff --git a/code/modules/admin/IsBanned.dm b/code/modules/admin/IsBanned.dm index 6f8357b5692..3c28939ec5e 100644 --- a/code/modules/admin/IsBanned.dm +++ b/code/modules/admin/IsBanned.dm @@ -11,7 +11,7 @@ if(type == "world") return ..() //shunt world topic banchecks to purely to byond's internal ban system - if(text2num(computer_id) == 2147483647) //this cid causes stickybans to go haywire + if(text2num(computer_id) == 2147483647) //this cid causes bans to go haywire log_adminwarn("Failed Login (invalid cid): [key] [address]-[computer_id]") if(log_info) INVOKE_ASYNC(GLOBAL_PROC, .proc/log_connection, ckey(key), address, computer_id, CONNECTION_TYPE_DROPPED_INVALID) @@ -212,11 +212,11 @@ if(.) //byond will not trigger isbanned() for "global" host bans, //ie, ones where the "apply to this game only" checkbox is not checked (defaults to not checked) - //So it's safe to let admins walk thru host/sticky bans here + //So it's safe to let admins walk thru bans here if(admin) - log_admin("The admin [key] has been allowed to bypass a matching host/sticky ban") - message_admins("The admin [key] has been allowed to bypass a matching host/sticky ban") - addclientmessage(ckey,"You have been allowed to bypass a matching host/sticky ban.") + log_admin("The admin [key] has been allowed to bypass a matching ban") + message_admins("The admin [key] has been allowed to bypass a matching ban") + addclientmessage(ckey,"You have been allowed to bypass a matching ban.") return null else log_adminwarn("Failed Login: [key] [computer_id] [address] - Banned [.["message"]]") diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index b4729ae0b47..9380bd9310c 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -72,7 +72,6 @@ GLOBAL_LIST_INIT(admin_verbs_admin, list( )) GLOBAL_LIST_INIT(admin_verbs_ban, list( /client/proc/ban_panel, - /client/proc/stickybanpanel, /datum/admins/proc/vpn_whitelist )) GLOBAL_LIST_INIT(admin_verbs_sounds, list( diff --git a/code/modules/admin/stickyban.dm b/code/modules/admin/stickyban.dm deleted file mode 100644 index 0c2af216d2e..00000000000 --- a/code/modules/admin/stickyban.dm +++ /dev/null @@ -1,210 +0,0 @@ -/datum/admins/proc/stickyban(action,data) - if(!check_rights(R_BAN)) - return - - switch(action) - if("show") - stickyban_show() - return - if("add") - var/list/ban = list() - var/ckey - ban["admin"] = usr.key - ban["type"] = list("sticky") - ban["reason"] = "(InGameBan)([usr.key])" //this will be displayed in dd only - - if(data["ckey"]) - ckey = ckey(data["ckey"]) - else - ckey = clean_input("Ckey","Ckey","") - if(!ckey) - return - ckey = ckey(ckey) - if(get_stickyban_from_ckey(ckey)) - to_chat(usr, "Error: Can not add a stickyban: User already has a current sticky ban") - - if(data["reason"]) - ban["message"] = data["reason"] - else - var/reason = clean_input("Reason","Reason","Ban Evasion") - if(!reason) - return - ban["message"] = "[reason]" - - world.SetConfig("ban", ckey, list2stickyban(ban)) - - log_admin("[key_name(usr)] has stickybanned [ckey].\nReason: [ban["message"]]") - message_admins("[key_name_admin(usr)] has stickybanned [ckey].\nReason: [ban["message"]]") - - if("remove") - if(!data["ckey"]) - return - var/ckey = data["ckey"] - - var/ban = get_stickyban_from_ckey(ckey) - if(!ban) - to_chat(usr, "Error: No sticky ban for [ckey] found!") - return - if(alert("Are you sure you want to remove the sticky ban on [ckey]?","Are you sure","Yes","No") == "No") - return - if(!get_stickyban_from_ckey(ckey)) - to_chat(usr, "Error: The ban disappeared.") - return - world.SetConfig("ban", ckey, null) - - log_admin("[key_name(usr)] removed [ckey]'s stickyban") - message_admins("[key_name_admin(usr)] removed [ckey]'s stickyban") - - if("remove_alt") - if(!data["ckey"]) - return - var/ckey = data["ckey"] - if(!data["alt"]) - return - var/alt = ckey(data["alt"]) - var/ban = get_stickyban_from_ckey(ckey) - if(!ban) - to_chat(usr, "Error: No sticky ban for [ckey] found!") - return - - var/found = 0 - //we have to do it this way because byond keeps the case in its sticky ban matches WHY!!! - for(var/key in ban["keys"]) - if(ckey(key) == alt) - found = 1 - break - - if(!found) - to_chat(usr, "Error: [alt] is not linked to [ckey]'s sticky ban!") - return - - if(alert("Are you sure you want to disassociate [alt] from [ckey]'s sticky ban? \nNote: Nothing stops byond from re-linking them","Are you sure","Yes","No") == "No") - return - - //we have to do this again incase something changes - ban = get_stickyban_from_ckey(ckey) - if(!ban) - to_chat(usr, "Error: The ban disappeared.") - return - - found = 0 - for(var/key in ban["keys"]) - if(ckey(key) == alt) - ban["keys"] -= key - found = 1 - break - - if(!found) - to_chat(usr, "Error: [alt] link to [ckey]'s sticky ban disappeared.") - return - - world.SetConfig("ban",ckey,list2stickyban(ban)) - - log_admin("[key_name(usr)] has disassociated [alt] from [ckey]'s sticky ban") - message_admins("[key_name_admin(usr)] has disassociated [alt] from [ckey]'s sticky ban") - - if("edit") - if(!data["ckey"]) - return - var/ckey = data["ckey"] - var/ban = get_stickyban_from_ckey(ckey) - if(!ban) - to_chat(usr, "Error: No sticky ban for [ckey] found!") - return - var/oldreason = ban["message"] - var/reason = clean_input("Reason","Reason","[ban["message"]]") - if(!reason || reason == oldreason) - return - //we have to do this again incase something changed while we waited for input - ban = get_stickyban_from_ckey(ckey) - if(!ban) - to_chat(usr, "Error: The ban disappeared.") - return - ban["message"] = "[reason]" - - world.SetConfig("ban",ckey,list2stickyban(ban)) - - log_admin("[key_name(usr)] has edited [ckey]'s sticky ban reason from [oldreason] to [reason]") - message_admins("[key_name_admin(usr)] has edited [ckey]'s sticky ban reason from [oldreason] to [reason]") - - spawn(10) - stickyban_show() - -/datum/admins/proc/stickyban_gethtml(ckey, ban) - . = "\[-\][ckey]
" - . += "[ban["message"]] \[Edit\]
" - if(ban["admin"]) - . += "[ban["admin"]]
" - else - . += "LEGACY
" - . += "Caught keys
\n
    " - for(var/key in ban["keys"]) - if(ckey(key) == ckey) - continue - . += "
  1. \[-\][key]
  2. " - . += "
\n" - -/datum/admins/proc/stickyban_show() - if(!check_rights(R_BAN)) - return - - var/list/bans = sortList(world.GetConfig("ban")) - var/banhtml = "" - for(var/key in bans) - var/ckey = ckey(key) - var/ban = stickyban2list(world.GetConfig("ban",key)) - banhtml += "

\n" - banhtml += stickyban_gethtml(ckey,ban) - - var/html = {" - - Sticky Bans - - -

All Sticky Bans:

\[+\]
- [banhtml] - - "} - usr << browse(html,"window=stickybans;size=700x400") - -/proc/get_stickyban_from_ckey(ckey) - if(!ckey) - return null - ckey = ckey(ckey) - . = null - for(var/key in world.GetConfig("ban")) - if(ckey(key) == ckey) - . = stickyban2list(world.GetConfig("ban",key)) - break - -/proc/stickyban2list(ban) - if(!ban) - return null - . = params2list(ban) - .["keys"] = splittext(.["keys"], ",") - .["type"] = splittext(.["type"], ",") - .["IP"] = splittext(.["IP"], ",") - .["computer_id"] = splittext(.["computer_id"], ",") - -/proc/list2stickyban(list/ban) - if(!ban || !islist(ban)) - return null - . = ban.Copy() - if(.["keys"]) - .["keys"] = jointext(.["keys"], ",") - if(.["type"]) - .["type"] = jointext(.["type"], ",") - if(.["IP"]) - .["IP"] = jointext(.["IP"], ",") - if(.["computer_id"]) - .["computer_id"] = jointext(.["computer_id"], ",") - . = list2params(.) - -/client/proc/stickybanpanel() - set name = "Sticky Ban Panel" - set category = "Admin" - - if(!check_rights(R_BAN)) - return - - holder.stickyban_show() diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index 0edc3c3aba5..5bfa5217dec 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -37,9 +37,6 @@ return SSmentor_tickets.showDetailUI(usr, ticketID) - if(href_list["stickyban"]) - stickyban(href_list["stickyban"],href_list) - if(href_list["makeAntag"]) switch(href_list["makeAntag"]) if("1") diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 3ccd1cc9130..e56d64ca3e3 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -1915,20 +1915,6 @@ Eyes need to have significantly high darksight to shine unless the mob has the X ..() - -/mob/living/carbon/human/vv_get_dropdown() - . = ..() - . += "---" - .["Set Species"] = "?_src_=vars;setspecies=[UID()]" - .["Copy Outfit"] = "?_src_=vars;copyoutfit=[UID()]" - .["Make AI"] = "?_src_=vars;makeai=[UID()]" - .["Make cyborg"] = "?_src_=vars;makerobot=[UID()]" - .["Make monkey"] = "?_src_=vars;makemonkey=[UID()]" - .["Make alien"] = "?_src_=vars;makealien=[UID()]" - .["Make slime"] = "?_src_=vars;makeslime=[UID()]" - .["Make superhero"] = "?_src_=vars;makesuper=[UID()]" - . += "---" - /mob/living/carbon/human/adjust_nutrition(change) if(HAS_TRAIT(src, TRAIT_NOHUNGER)) return FALSE diff --git a/paradise.dme b/paradise.dme index 866ef2ebb79..185880f9f6d 100644 --- a/paradise.dme +++ b/paradise.dme @@ -1209,7 +1209,6 @@ #include "code\modules\admin\player_panel.dm" #include "code\modules\admin\secrets.dm" #include "code\modules\admin\sql_notes.dm" -#include "code\modules\admin\stickyban.dm" #include "code\modules\admin\topic.dm" #include "code\modules\admin\watchlist.dm" #include "code\modules\admin\db_ban\functions.dm"