From 275266a73a7f2ba937244e0603424f383d51fc98 Mon Sep 17 00:00:00 2001 From: SteelSlayer Date: Mon, 9 Sep 2019 01:26:50 -0400 Subject: [PATCH 1/4] Admin verb mega update changes/removes all sorts of admin verbs, requested by Kyet --- code/__DEFINES/subsystems.dm | 1 - code/controllers/subsystem/tickets/tickets.dm | 13 +- code/modules/admin/admin.dm | 4 +- code/modules/admin/admin_verbs.dm | 14 +- code/modules/admin/stickyban.dm | 210 ------------------ .../admin/tickets/adminticketsverbs.dm | 4 +- .../admin/tickets/mentorticketsverbs.dm | 4 +- code/modules/admin/topic.dm | 3 - code/modules/admin/verbs/adminjump.dm | 2 +- code/modules/admin/verbs/freeze.dm | 4 +- code/modules/admin/verbs/randomverbs.dm | 37 ++- paradise.dme | 1 - 12 files changed, 40 insertions(+), 257 deletions(-) delete mode 100644 code/modules/admin/stickyban.dm diff --git a/code/__DEFINES/subsystems.dm b/code/__DEFINES/subsystems.dm index c55fec2cd87..4807da6ec42 100644 --- a/code/__DEFINES/subsystems.dm +++ b/code/__DEFINES/subsystems.dm @@ -71,7 +71,6 @@ #define INIT_ORDER_ICON_SMOOTHING -5 #define INIT_ORDER_OVERLAY -6 #define INIT_ORDER_XKEYSCORE -10 -#define INIT_ORDER_STICKY_BAN -10 #define INIT_ORDER_TICKETS -10 #define INIT_ORDER_LIGHTING -20 #define INIT_ORDER_SHUTTLE -21 diff --git a/code/controllers/subsystem/tickets/tickets.dm b/code/controllers/subsystem/tickets/tickets.dm index a5623775b5e..951a96558ca 100644 --- a/code/controllers/subsystem/tickets/tickets.dm +++ b/code/controllers/subsystem/tickets/tickets.dm @@ -263,7 +263,12 @@ UI STUFF else continue - dat += "" + dat += "" + dat += "

Resolve All

" + if(ticket_system_name == "Mentor Tickets") + dat += "Resolve All Open Mentor Tickets" + else + dat += "Resolve All Open Admin Tickets" return dat @@ -402,6 +407,12 @@ UI STUFF takeTicket(indexNum) showDetailUI(usr, indexNum) + if(href_list["resolveall"]) + if(ticket_system_name == "Mentor Tickets") + usr.client.resolveAllMentorTickets() + else + usr.client.resolveAllAdminTickets() + /datum/controller/subsystem/tickets/proc/takeTicket(var/index) if(assignStaffToTicket(usr.client, index)) if(span_class == "mentorhelp") diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm index d32a05eb312..60210f51903 100644 --- a/code/modules/admin/admin.dm +++ b/code/modules/admin/admin.dm @@ -54,7 +54,7 @@ var/global/nologevent = 0 ///////////////////////////////////////////////////////////////////////////////////////////////Panels /datum/admins/proc/show_player_panel(var/mob/M in GLOB.mob_list) - set category = "Admin" + set category = null set name = "Show Player Panel" set desc="Edit player (respawn, ban, heal, etc)" @@ -937,9 +937,9 @@ var/global/nologevent = 0 message_admins("[key_name_admin(usr)] checked the AI laws") /client/proc/update_mob_sprite(mob/living/carbon/human/H as mob) - set category = "Admin" set name = "Update Mob Sprite" set desc = "Should fix any mob sprite update errors." + set category = null if(!check_rights(R_ADMIN)) return diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index b66f83543dd..1c4d569507e 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -71,13 +71,12 @@ var/list/admin_verbs_admin = list( /client/proc/alt_check, /client/proc/secrets, /client/proc/change_human_appearance_admin, /* Allows an admin to change the basic appearance of human-based mobs */ - /client/proc/change_human_appearance_self, /* Allows the human-based mob itself change its basic appearance */ + /client/proc/change_human_appearance_self, /* Allows the human-based mob itself to change its basic appearance */ /client/proc/debug_variables, /client/proc/reset_all_tcs, /*resets all telecomms scripts*/ /client/proc/toggle_mentor_chat, /client/proc/toggle_advanced_interaction, /*toggle admin ability to interact with not only machines, but also atoms such as buttons and doors*/ - /client/proc/list_ssds, - /client/proc/list_afks, + /client/proc/list_ssds_afks, /client/proc/cmd_admin_headset_message, /client/proc/spawn_floor_cluwne, /client/proc/show_discord_duplicates, // This needs removing at some point, ingame discord linking got removed in #11359 @@ -85,8 +84,7 @@ var/list/admin_verbs_admin = list( ) var/list/admin_verbs_ban = list( /client/proc/unban_panel, - /client/proc/jobbans, - /client/proc/stickybanpanel + /client/proc/jobbans ) var/list/admin_verbs_sounds = list( /client/proc/play_local_sound, @@ -365,7 +363,7 @@ var/list/admin_verbs_ticket = list( /client/proc/player_panel() set name = "Player Panel" - set category = "Admin" + set category = null if(!check_rights(R_ADMIN)) return @@ -803,7 +801,7 @@ var/list/admin_verbs_ticket = list( /client/proc/change_human_appearance_admin(mob/living/carbon/human/H in GLOB.mob_list) set name = "C.M.A. - Admin" set desc = "Allows you to change the mob appearance" - set category = "Admin" + set category = null if(!check_rights(R_ADMIN)) return @@ -829,7 +827,7 @@ var/list/admin_verbs_ticket = list( /client/proc/change_human_appearance_self(mob/living/carbon/human/H in GLOB.mob_list) set name = "C.M.A. - Self" set desc = "Allows the mob to change its appearance" - set category = "Admin" + set category = null if(!check_rights(R_ADMIN)) return diff --git a/code/modules/admin/stickyban.dm b/code/modules/admin/stickyban.dm deleted file mode 100644 index 61759f2e36d..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(var/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(var/ban) - if(!ban) - return null - . = params2list(ban) - .["keys"] = splittext(.["keys"], ",") - .["type"] = splittext(.["type"], ",") - .["IP"] = splittext(.["IP"], ",") - .["computer_id"] = splittext(.["computer_id"], ",") - -/proc/list2stickyban(var/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/tickets/adminticketsverbs.dm b/code/modules/admin/tickets/adminticketsverbs.dm index 9ad1f722b08..406019745f8 100644 --- a/code/modules/admin/tickets/adminticketsverbs.dm +++ b/code/modules/admin/tickets/adminticketsverbs.dm @@ -12,12 +12,12 @@ /client/proc/resolveAllAdminTickets() set name = "Resolve All Open Admin Tickets" - set category = "Admin" + set category = null if(!holder || !check_rights(R_ADMIN)) return - if(alert("Are you sure you want to resolve ALL open tickets?","Resolve all open tickets?","Yes","No") != "Yes") + if(alert("Are you sure you want to resolve ALL open admin tickets?","Resolve all open admin tickets?","Yes","No") != "Yes") return SStickets.resolveAllOpenTickets() diff --git a/code/modules/admin/tickets/mentorticketsverbs.dm b/code/modules/admin/tickets/mentorticketsverbs.dm index 1122b770107..d65f4a30220 100644 --- a/code/modules/admin/tickets/mentorticketsverbs.dm +++ b/code/modules/admin/tickets/mentorticketsverbs.dm @@ -12,12 +12,12 @@ /client/proc/resolveAllMentorTickets() set name = "Resolve All Open Mentor Tickets" - set category = "Admin" + set category = null if(!holder || !check_rights(R_ADMIN)) return - if(alert("Are you sure you want to resolve ALL open tickets?","Resolve all open tickets?","Yes","No") != "Yes") + if(alert("Are you sure you want to resolve ALL open mentor tickets?","Resolve all open mentor tickets?","Yes","No") != "Yes") return SSmentor_tickets.resolveAllOpenTickets() diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index 21706aeabe3..3e4f5b374da 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -38,9 +38,6 @@ var/ticketID = text2num(href_list["openmentorticket"]) 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/admin/verbs/adminjump.dm b/code/modules/admin/verbs/adminjump.dm index a8053e1faed..16a1c14694f 100644 --- a/code/modules/admin/verbs/adminjump.dm +++ b/code/modules/admin/verbs/adminjump.dm @@ -30,7 +30,7 @@ /client/proc/jumptoturf(var/turf/T in world) set name = "Jump to Turf" - set category = "Admin" + set category = null if(!check_rights(R_ADMIN)) return diff --git a/code/modules/admin/verbs/freeze.dm b/code/modules/admin/verbs/freeze.dm index 209352993a0..bdef649468d 100644 --- a/code/modules/admin/verbs/freeze.dm +++ b/code/modules/admin/verbs/freeze.dm @@ -7,8 +7,8 @@ //////////////////////////////////////////////////////////////////////////////// var/global/list/frozen_mob_list = list() /client/proc/freeze(var/mob/living/M as mob in GLOB.mob_list) - set category = "Admin" set name = "Freeze" + set category = null if(!check_rights(R_ADMIN)) return @@ -87,8 +87,8 @@ var/global/list/frozen_mob_list = list() //////////////////////////Freeze Mech /client/proc/freezemecha(var/obj/mecha/O as obj in GLOB.mechas_list) - set category = "Admin" set name = "Freeze Mech" + set category = null if(!check_rights(R_ADMIN)) return diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index 2c7c6181b1d..46dc9ec5b6a 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -776,8 +776,8 @@ Traitors and the like can also be revived with the previous role mostly intact. feedback_add_details("admin_verb","GIBS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! /client/proc/cmd_admin_check_contents(mob/living/M as mob in GLOB.mob_list) - set category = "Admin" set name = "Check Contents" + set category = null if(!check_rights(R_ADMIN)) return @@ -957,21 +957,24 @@ Traitors and the like can also be revived with the previous role mostly intact. message_admins("[key_name_admin(usr)] reset NTTC scripts.") feedback_add_details("admin_verb","RAT2") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! -/client/proc/list_ssds() +/client/proc/list_ssds_afks() set category = "Admin" - set name = "List SSDs" - set desc = "Lists SSD players" + set name = "List SSDs and AFKs" + set desc = "Lists SSD and AFK players" if(!check_rights(R_ADMIN)) return - var/msg = "SSD Report" + /* ======== SSD Section ========= */ + var/msg = "SSD & AFK Report" msg += "SSD Players:
" msg += "" var/mins_ssd var/job_string var/key_string var/role_string + var/obj_count = 0 + var/obj_string = "" for(var/mob/living/carbon/human/H in GLOB.living_mob_list) if(!isLivingSSD(H)) continue @@ -984,8 +987,6 @@ Traitors and the like can also be revived with the previous role mostly intact. if(job_string in command_positions) job_string = "" + job_string + "" role_string = "-" - var/obj_count = 0 - var/obj_string = "" if(H.mind) if(H.mind.special_role) role_string = "[H.mind.special_role]" @@ -1003,24 +1004,12 @@ Traitors and the like can also be revived with the previous role mostly intact. else msg += "" msg += "" - msg += "
KeyReal NameJobMins SSDSpecial RoleAreaPPNCryo
Cryo
" - src << browse(msg, "window=Player_ssd_check") + msg += "
" -/client/proc/list_afks() - set category = "Admin" - set name = "List AFKs" - set desc = "Lists AFK players" - - if(!check_rights(R_ADMIN)) - return - - var/msg = "AFK Report" + /* ======== AFK Section ========= */ msg += "AFK Players:
" msg += "" var/mins_afk - var/job_string - var/key_string - var/role_string for(var/mob/living/carbon/human/H in GLOB.living_mob_list) if(H.client == null || H.stat == DEAD) // No clientless or dead continue @@ -1035,8 +1024,8 @@ Traitors and the like can also be revived with the previous role mostly intact. if(job_string in command_positions) job_string = "" + job_string + "" role_string = "-" - var/obj_count = 0 - var/obj_string = "" + obj_count = 0 + obj_string = "" if(H.mind) if(H.mind.special_role) role_string = "[H.mind.special_role]" @@ -1055,7 +1044,7 @@ Traitors and the like can also be revived with the previous role mostly intact. msg += "" msg += "" msg += "
KeyReal NameJobMins AFKSpecial RoleAreaPPNCryo
Cryo
" - src << browse(msg, "window=Player_afk_check") + src << browse(msg, "window=Player_ssd_afk_check") /client/proc/toggle_ert_calling() set category = "Event" diff --git a/paradise.dme b/paradise.dme index cda0cebff3e..a5b66b166cd 100644 --- a/paradise.dme +++ b/paradise.dme @@ -1175,7 +1175,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\ToRban.dm" #include "code\modules\admin\watchlist.dm" From 8fc8063c7432df6468808b8529224cec34355894 Mon Sep 17 00:00:00 2001 From: SteelSlayer Date: Mon, 9 Sep 2019 02:00:31 -0400 Subject: [PATCH 2/4] taking player_panel out to the woodshed --- code/modules/admin/admin_verbs.dm | 12 ------ code/modules/admin/player_panel.dm | 59 ------------------------------ 2 files changed, 71 deletions(-) diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 1c4d569507e..82c5d937cda 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -10,7 +10,6 @@ var/list/admin_verbs_default = list( var/list/admin_verbs_admin = list( /client/proc/check_antagonists, /*shows all antags*/ /datum/admins/proc/show_player_panel, - /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/toggleenter, /*toggles whether people can join the current game*/ @@ -361,17 +360,6 @@ var/list/admin_verbs_ticket = list( to_chat(mob, "Invisimin on. You are now as invisible as a ghost.") mob.remove_from_all_data_huds() -/client/proc/player_panel() - set name = "Player Panel" - set category = null - - if(!check_rights(R_ADMIN)) - return - - holder.player_panel_old() - feedback_add_details("admin_verb","PP") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! - return - /client/proc/player_panel_new() set name = "Player Panel New" set category = "Admin" diff --git a/code/modules/admin/player_panel.dm b/code/modules/admin/player_panel.dm index 9203477c7f9..51a7f442fbc 100644 --- a/code/modules/admin/player_panel.dm +++ b/code/modules/admin/player_panel.dm @@ -328,65 +328,6 @@ usr << browse(dat, "window=players;size=600x480") -//The old one -/datum/admins/proc/player_panel_old() - if(!usr.client.holder) - return - var/dat = "Player Menu" - dat += "" - //add to this if wanting to add back in IP checking - //add if you want to know their ip to the lists below - var/list/mobs = sortmobs() - - for(var/mob/M in mobs) - if(!M.ckey) continue - - dat += "" - if(isAI(M)) - dat += "" - else if(isrobot(M)) - dat += "" - else if(issmall(M)) - dat += "" - else if(ishuman(M)) - dat += "" - else if(istype(M, /mob/living/silicon/pai)) - dat += "" - else if(istype(M, /mob/new_player)) - dat += "" - else if(isobserver(M)) - dat += "" - else if(isalien(M)) - dat += "" - else - dat += "" - - - if(istype(M,/mob/living/carbon/human)) - var/mob/living/carbon/human/H = M - if(H.mind && H.mind.assigned_role) - dat += "" - else - dat += "" - - - dat += {" - - - "} - switch(is_special_character(M)) - if(0) - dat += {""} - if(1) - dat += {""} - if(2) - dat += {""} - - dat += "
NameReal NameAssigned JobKeyOptionsPMTraitor?
IP:(IP: [M.lastKnownIP])
[M.name]AICyborgMonkey[M.real_name]pAINew PlayerGhostAlienUnknown[H.mind.assigned_role]NA[(M.client ? "[M.client]" : "No client")]XPMTraitor?Traitor?Traitor?
" - - usr << browse(dat, "window=players;size=640x480") - - /datum/admins/proc/check_antagonists_line(mob/M, caption = "", close = 1) var/logout_status From 46ad75ec14e5c07155a63ebfa3bc3ebb8fe0f44a Mon Sep 17 00:00:00 2001 From: SteelSlayer Date: Mon, 9 Sep 2019 08:46:43 -0400 Subject: [PATCH 3/4] Revert "taking player_panel out to the woodshed" This reverts commit 8fc8063c7432df6468808b8529224cec34355894. --- code/modules/admin/admin_verbs.dm | 12 ++++++ code/modules/admin/player_panel.dm | 59 ++++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+) diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 82c5d937cda..1c4d569507e 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -10,6 +10,7 @@ var/list/admin_verbs_default = list( var/list/admin_verbs_admin = list( /client/proc/check_antagonists, /*shows all antags*/ /datum/admins/proc/show_player_panel, + /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/toggleenter, /*toggles whether people can join the current game*/ @@ -360,6 +361,17 @@ var/list/admin_verbs_ticket = list( to_chat(mob, "Invisimin on. You are now as invisible as a ghost.") mob.remove_from_all_data_huds() +/client/proc/player_panel() + set name = "Player Panel" + set category = null + + if(!check_rights(R_ADMIN)) + return + + holder.player_panel_old() + feedback_add_details("admin_verb","PP") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! + return + /client/proc/player_panel_new() set name = "Player Panel New" set category = "Admin" diff --git a/code/modules/admin/player_panel.dm b/code/modules/admin/player_panel.dm index 51a7f442fbc..9203477c7f9 100644 --- a/code/modules/admin/player_panel.dm +++ b/code/modules/admin/player_panel.dm @@ -328,6 +328,65 @@ usr << browse(dat, "window=players;size=600x480") +//The old one +/datum/admins/proc/player_panel_old() + if(!usr.client.holder) + return + var/dat = "Player Menu" + dat += "" + //add to this if wanting to add back in IP checking + //add if you want to know their ip to the lists below + var/list/mobs = sortmobs() + + for(var/mob/M in mobs) + if(!M.ckey) continue + + dat += "" + if(isAI(M)) + dat += "" + else if(isrobot(M)) + dat += "" + else if(issmall(M)) + dat += "" + else if(ishuman(M)) + dat += "" + else if(istype(M, /mob/living/silicon/pai)) + dat += "" + else if(istype(M, /mob/new_player)) + dat += "" + else if(isobserver(M)) + dat += "" + else if(isalien(M)) + dat += "" + else + dat += "" + + + if(istype(M,/mob/living/carbon/human)) + var/mob/living/carbon/human/H = M + if(H.mind && H.mind.assigned_role) + dat += "" + else + dat += "" + + + dat += {" + + + "} + switch(is_special_character(M)) + if(0) + dat += {""} + if(1) + dat += {""} + if(2) + dat += {""} + + dat += "
NameReal NameAssigned JobKeyOptionsPMTraitor?
IP:(IP: [M.lastKnownIP])
[M.name]AICyborgMonkey[M.real_name]pAINew PlayerGhostAlienUnknown[H.mind.assigned_role]NA[(M.client ? "[M.client]" : "No client")]XPMTraitor?Traitor?Traitor?
" + + usr << browse(dat, "window=players;size=640x480") + + /datum/admins/proc/check_antagonists_line(mob/M, caption = "", close = 1) var/logout_status From 4fb7d835954a710e1d3ef3f5660f69718895bfa4 Mon Sep 17 00:00:00 2001 From: SteelSlayer Date: Mon, 9 Sep 2019 10:12:58 -0400 Subject: [PATCH 4/4] re-add sticky ban, player_panel, increase width of ssd/afk window a bit --- code/__DEFINES/subsystems.dm | 1 + code/modules/admin/admin_verbs.dm | 5 +- code/modules/admin/stickyban.dm | 210 ++++++++++++++++++++++++ code/modules/admin/topic.dm | 3 + code/modules/admin/verbs/randomverbs.dm | 2 +- paradise.dme | 1 + 6 files changed, 219 insertions(+), 3 deletions(-) create mode 100644 code/modules/admin/stickyban.dm diff --git a/code/__DEFINES/subsystems.dm b/code/__DEFINES/subsystems.dm index 4807da6ec42..c55fec2cd87 100644 --- a/code/__DEFINES/subsystems.dm +++ b/code/__DEFINES/subsystems.dm @@ -71,6 +71,7 @@ #define INIT_ORDER_ICON_SMOOTHING -5 #define INIT_ORDER_OVERLAY -6 #define INIT_ORDER_XKEYSCORE -10 +#define INIT_ORDER_STICKY_BAN -10 #define INIT_ORDER_TICKETS -10 #define INIT_ORDER_LIGHTING -20 #define INIT_ORDER_SHUTTLE -21 diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 1c4d569507e..199d4cf276a 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -84,7 +84,8 @@ var/list/admin_verbs_admin = list( ) var/list/admin_verbs_ban = list( /client/proc/unban_panel, - /client/proc/jobbans + /client/proc/jobbans, + /client/proc/stickybanpanel ) var/list/admin_verbs_sounds = list( /client/proc/play_local_sound, @@ -363,7 +364,7 @@ var/list/admin_verbs_ticket = list( /client/proc/player_panel() set name = "Player Panel" - set category = null + set category = "Admin" if(!check_rights(R_ADMIN)) return diff --git a/code/modules/admin/stickyban.dm b/code/modules/admin/stickyban.dm new file mode 100644 index 00000000000..61759f2e36d --- /dev/null +++ b/code/modules/admin/stickyban.dm @@ -0,0 +1,210 @@ +/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(var/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(var/ban) + if(!ban) + return null + . = params2list(ban) + .["keys"] = splittext(.["keys"], ",") + .["type"] = splittext(.["type"], ",") + .["IP"] = splittext(.["IP"], ",") + .["computer_id"] = splittext(.["computer_id"], ",") + +/proc/list2stickyban(var/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 3e4f5b374da..9aaef943421 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -37,6 +37,9 @@ return var/ticketID = text2num(href_list["openmentorticket"]) SSmentor_tickets.showDetailUI(usr, ticketID) + + if(href_list["stickyban"]) + stickyban(href_list["stickyban"],href_list) if(href_list["makeAntag"]) switch(href_list["makeAntag"]) diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index 46dc9ec5b6a..aa22dfe944c 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -1044,7 +1044,7 @@ Traitors and the like can also be revived with the previous role mostly intact. msg += "Cryo" msg += "" msg += "" - src << browse(msg, "window=Player_ssd_afk_check") + src << browse(msg, "window=Player_ssd_afk_check;size=600x300") /client/proc/toggle_ert_calling() set category = "Event" diff --git a/paradise.dme b/paradise.dme index a5b66b166cd..cda0cebff3e 100644 --- a/paradise.dme +++ b/paradise.dme @@ -1175,6 +1175,7 @@ #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\ToRban.dm" #include "code\modules\admin\watchlist.dm"