From b8d812fb476254b805bf9913d78c02113e5ff16b Mon Sep 17 00:00:00 2001
From: Letter N <24603524+LetterN@users.noreply.github.com>
Date: Sun, 23 Aug 2020 17:18:32 +0800
Subject: [PATCH] "what if adminbus stops leaking confidential adminchat" and
also updates admin things. you can now do `obj/structure/singulo:50`
---
code/modules/admin/admin.dm | 229 ++++++++++--------
code/modules/admin/admin_investigate.dm | 42 +++-
code/modules/admin/verbs/playsound.dm | 26 +-
.../view_variables/mass_edit_variables.dm | 36 +--
.../admin/view_variables/modify_variables.dm | 36 +--
code/modules/admin/view_variables/topic.dm | 19 +-
.../admin/view_variables/topic_basic.dm | 32 +--
.../admin/view_variables/view_variables.dm | 15 +-
.../research/designs/computer_part_designs.dm | 13 +-
.../techweb/nodes/computer_hud_nodes.dm | 4 +-
tgui/packages/tgui-panel/index.js | 17 +-
.../packages/tgui/public/tgui-panel.bundle.js | 2 +-
12 files changed, 282 insertions(+), 189 deletions(-)
diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm
index 5779a21667..8421d9955d 100644
--- a/code/modules/admin/admin.dm
+++ b/code/modules/admin/admin.dm
@@ -2,11 +2,11 @@
////////////////////////////////
/proc/message_admins(msg)
msg = "ADMIN LOG:[msg]"
- to_chat(GLOB.admins, msg)
+ to_chat(GLOB.admins, msg, confidential = TRUE)
/proc/relay_msg_admins(msg)
msg = "RELAY:[msg]"
- to_chat(GLOB.admins, msg)
+ to_chat(GLOB.admins, msg, confidential = TRUE)
///////////////////////////////////////////////////////////////////////////////////////////////Panels
@@ -22,7 +22,7 @@
log_admin("[key_name(usr)] checked the individual player panel for [key_name(M)][isobserver(usr)?"":" while in game"].")
if(!M)
- to_chat(usr, "You seem to be selecting a mob that doesn't exist anymore.")
+ to_chat(usr, "You seem to be selecting a mob that doesn't exist anymore.", confidential = TRUE)
return
var/body = "
Options for [M.key]"
@@ -65,6 +65,7 @@
body += "VV - "
if(M.mind)
body += "TP - "
+ // body += "SKILLS - "
else
body += "Init Mind - "
if (iscyborg(M))
@@ -122,6 +123,7 @@
body += "Traitor panel | "
body += "Narrate to | "
body += "Subtle message | "
+ // body += "Play sound to | "
body += "Language Menu"
if (M.client)
@@ -216,7 +218,7 @@
if (!istype(src, /datum/admins))
src = usr.client.holder
if (!istype(src, /datum/admins))
- to_chat(usr, "Error: you are not an admin!")
+ to_chat(usr, "Error: you are not an admin!", confidential = TRUE)
return
var/dat
dat = text("Admin Newscaster
Admin Newscaster Unit
")
@@ -242,7 +244,7 @@
dat+=" The newscaster recognises you as: [src.admin_signature]"
if(1)
dat+= "Station Feed Channels"
- if( isemptylist(GLOB.news_network.network_channels) )
+ if( !length(GLOB.news_network.network_channels) )
dat+="No active channels found..."
else
for(var/datum/news/feed_channel/CHANNEL in GLOB.news_network.network_channels)
@@ -295,7 +297,7 @@
dat+="ATTENTION: This channel has been deemed as threatening to the welfare of the station, and marked with a Nanotrasen D-Notice. "
dat+="No further feed story additions are allowed while the D-Notice is in effect.
"
else
- if( isemptylist(src.admincaster_feed_channel.messages) )
+ if( !length(src.admincaster_feed_channel.messages) )
dat+="No feed messages found in channel... "
else
var/i = 0
@@ -317,7 +319,7 @@
dat+="NOTE: Due to the nature of news Feeds, total deletion of a Feed Story is not possible. "
dat+="Keep in mind that users attempting to view a censored feed will instead see the \[REDACTED\] tag above it."
dat+="Select Feed channel to get Stories from: "
- if(isemptylist(GLOB.news_network.network_channels))
+ if(!length(GLOB.news_network.network_channels))
dat+="No feed channels found active... "
else
for(var/datum/news/feed_channel/CHANNEL in GLOB.news_network.network_channels)
@@ -328,7 +330,7 @@
dat+="A D-Notice is to be bestowed upon the channel if the handling Authority deems it as harmful for the station's"
dat+="morale, integrity or disciplinary behaviour. A D-Notice will render a channel unable to be updated by anyone, without deleting any feed"
dat+="stories it might contain at the time. You can lift a D-Notice if you have the required access at any time."
- if(isemptylist(GLOB.news_network.network_channels))
+ if(!length(GLOB.news_network.network_channels))
dat+="No feed channels found active... "
else
for(var/datum/news/feed_channel/CHANNEL in GLOB.news_network.network_channels)
@@ -339,7 +341,7 @@
dat+="[src.admincaster_feed_channel.channel_name]: \[ created by: [src.admincaster_feed_channel.returnAuthor(-1)] \] "
dat+="[(src.admincaster_feed_channel.authorCensor) ? ("Undo Author censorship") : ("Censor channel Author")]"
- if( isemptylist(src.admincaster_feed_channel.messages) )
+ if( !length(src.admincaster_feed_channel.messages) )
dat+="No feed messages found in channel... "
else
for(var/datum/news/feed_message/MESSAGE in src.admincaster_feed_channel.messages)
@@ -356,7 +358,7 @@
dat+="ATTENTION: This channel has been deemed as threatening to the welfare of the station, and marked with a Nanotrasen D-Notice. "
dat+="No further feed story additions are allowed while the D-Notice is in effect.
"
else
- if( isemptylist(src.admincaster_feed_channel.messages) )
+ if( !length(src.admincaster_feed_channel.messages) )
dat+="No feed messages found in channel... "
else
for(var/datum/news/feed_message/MESSAGE in src.admincaster_feed_channel.messages)
@@ -426,7 +428,6 @@
"}
if(GLOB.master_mode == "secret")
dat += "(Force Secret Mode) "
-
if(GLOB.master_mode == "dynamic")
if(SSticker.current_state <= GAME_STATE_PREGAME)
dat += "(Force Roundstart Rulesets) "
@@ -449,7 +450,6 @@
dat += ""
if(SSticker.IsRoundInProgress())
dat += "(Game Mode Panel) "
-
dat += {"
Create Object
@@ -461,7 +461,7 @@
if(marked_datum && istype(marked_datum, /atom))
dat += "Duplicate Marked Datum "
- usr << browse(dat, "window=admin2;size=210x200")
+ usr << browse(dat, "window=admin2;size=240x280")
return
/////////////////////////////////////////////////////////////////////////////////////////////////admins2.dm merge
@@ -475,33 +475,42 @@
if (!usr.client.holder)
return
- var/list/options = list("Regular Restart", "Hard Restart (No Delay/Feeback Reason)", "Hardest Restart (No actions, just reboot)")
+ var/localhost_addresses = list("127.0.0.1", "::1")
+ var/list/options = list("Regular Restart", "Regular Restart (with delay)", "Hard Restart (No Delay/Feeback Reason)", "Hardest Restart (No actions, just reboot)")
if(world.TgsAvailable())
options += "Server Restart (Kill and restart DD)";
- var/rebootconfirm
if(SSticker.admin_delay_notice)
- if(alert(usr, "Are you sure? An admin has already delayed the round end for the following reason: [SSticker.admin_delay_notice]", "Confirmation", "Yes", "No") == "Yes")
- rebootconfirm = TRUE
- else
- rebootconfirm = TRUE
- if(rebootconfirm)
- var/result = input(usr, "Select reboot method", "World Reboot", options[1]) as null|anything in options
- if(result)
- SSblackbox.record_feedback("tally", "admin_verb", 1, "Reboot World") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
- var/init_by = "Initiated by [usr.client.holder.fakekey ? "Admin" : usr.key]."
- switch(result)
- if("Regular Restart")
- SSticker.Reboot(init_by, "admin reboot - by [usr.key] [usr.client.holder.fakekey ? "(stealth)" : ""]", 10)
- if("Hard Restart (No Delay, No Feeback Reason)")
- to_chat(world, "World reboot - [init_by]")
- world.Reboot()
- if("Hardest Restart (No actions, just reboot)")
- to_chat(world, "Hard world reboot - [init_by]")
- world.Reboot(fast_track = TRUE)
- if("Server Restart (Kill and restart DD)")
- to_chat(world, "Server restart - [init_by]")
- world.TgsEndProcess()
+ if(alert(usr, "Are you sure? An admin has already delayed the round end for the following reason: [SSticker.admin_delay_notice]", "Confirmation", "Yes", "No") != "Yes")
+ return FALSE
+
+ var/result = input(usr, "Select reboot method", "World Reboot", options[1]) as null|anything in options
+ if(result)
+ SSblackbox.record_feedback("tally", "admin_verb", 1, "Reboot World") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
+ var/init_by = "Initiated by [usr.client.holder.fakekey ? "Admin" : usr.key]."
+ switch(result)
+ if("Regular Restart")
+ if(!(isnull(usr.client.address) || (usr.client.address in localhost_addresses)))
+ if(alert("Are you sure you want to restart the server?","This server is live","Restart","Cancel") != "Restart")
+ return FALSE
+ SSticker.Reboot(init_by, "admin reboot - by [usr.key] [usr.client.holder.fakekey ? "(stealth)" : ""]", 10)
+ if("Regular Restart (with delay)")
+ var/delay = input("What delay should the restart have (in seconds)?", "Restart Delay", 5) as num|null
+ if(!delay)
+ return FALSE
+ if(!(isnull(usr.client.address) || (usr.client.address in localhost_addresses)))
+ if(alert("Are you sure you want to restart the server?","This server is live","Restart","Cancel") != "Restart")
+ return FALSE
+ SSticker.Reboot(init_by, "admin reboot - by [usr.key] [usr.client.holder.fakekey ? "(stealth)" : ""]", delay * 10)
+ if("Hard Restart (No Delay, No Feeback Reason)")
+ to_chat(world, "World reboot - [init_by]")
+ world.Reboot()
+ if("Hardest Restart (No actions, just reboot)")
+ to_chat(world, "Hard world reboot - [init_by]")
+ world.Reboot(fast_track = TRUE)
+ if("Server Restart (Kill and restart DD)")
+ to_chat(world, "Server restart - [init_by]")
+ world.TgsEndProcess()
/datum/admins/proc/end_round()
set category = "Server"
@@ -529,7 +538,7 @@
if(message)
if(!check_rights(R_SERVER,0))
message = adminscrub(message,500)
- to_chat(world, "[usr.client.holder.fakekey ? "Administrator" : usr.key] Announces:\n \t [message]")
+ to_chat(world, "[usr.client.holder.fakekey ? "Administrator" : usr.key] Announces:\n \t [message]", confidential = TRUE)
log_admin("Announce: [key_name(usr)] : [message]")
SSblackbox.record_feedback("tally", "admin_verb", 1, "Announce") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
@@ -551,7 +560,7 @@
else
message_admins("[key_name(usr)] set the admin notice.")
log_admin("[key_name(usr)] set the admin notice:\n[new_admin_notice]")
- to_chat(world, "Admin Notice:\n \t [new_admin_notice]")
+ to_chat(world, "Admin Notice:\n \t [new_admin_notice]", confidential = TRUE)
SSblackbox.record_feedback("tally", "admin_verb", 1, "Set Admin Notice") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
GLOB.admin_notice = new_admin_notice
return
@@ -598,20 +607,29 @@
set desc="Start the round RIGHT NOW"
set name="Start Now"
if(SSticker.current_state == GAME_STATE_PREGAME || SSticker.current_state == GAME_STATE_STARTUP)
- SSticker.start_immediately = TRUE
- log_admin("[usr.key] has started the game.")
- var/msg = ""
- if(SSticker.current_state == GAME_STATE_STARTUP)
- msg = " (The server is still setting up, but the round will be \
- started as soon as possible.)"
- message_admins("\
- [usr.key] has started the game.[msg]")
- SSblackbox.record_feedback("tally", "admin_verb", 1, "Start Now") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
- return 1
+ if(!SSticker.start_immediately)
+ var/localhost_addresses = list("127.0.0.1", "::1")
+ if(!(isnull(usr.client.address) || (usr.client.address in localhost_addresses)))
+ if(alert("Are you sure you want to start the round?","Start Now","Start Now","Cancel") != "Start Now")
+ return FALSE
+ SSticker.start_immediately = TRUE
+ log_admin("[usr.key] has started the game.")
+ var/msg = ""
+ if(SSticker.current_state == GAME_STATE_STARTUP)
+ msg = " (The server is still setting up, but the round will be \
+ started as soon as possible.)"
+ message_admins("[usr.key] has started the game.[msg]")
+ SSblackbox.record_feedback("tally", "admin_verb", 1, "Start Now") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
+ return TRUE
+ SSticker.start_immediately = FALSE
+ SSticker.SetTimeLeft(1800)
+ to_chat(world, "The game will start in 180 seconds.")
+ SEND_SOUND(world, sound(get_announcer_sound("attention")))
+ message_admins("[usr.key] has cancelled immediate game start. Game will start in 180 seconds.")
+ log_admin("[usr.key] has cancelled immediate game start.")
else
to_chat(usr, "Error: Start Now: Game has already started.")
-
- return 0
+ return FALSE
/datum/admins/proc/toggleenter()
set category = "Server"
@@ -619,9 +637,9 @@
set name="Toggle Entering"
GLOB.enter_allowed = !( GLOB.enter_allowed )
if (!( GLOB.enter_allowed ))
- to_chat(world, "New players may no longer enter the game.")
+ to_chat(world, "New players may no longer enter the game.", confidential = TRUE)
else
- to_chat(world, "New players may now enter the game.")
+ to_chat(world, "New players may now enter the game.", confidential = TRUE)
log_admin("[key_name(usr)] toggled new player game entering.")
message_admins("[key_name_admin(usr)] toggled new player game entering.")
world.update_status()
@@ -634,9 +652,9 @@
var/alai = CONFIG_GET(flag/allow_ai)
CONFIG_SET(flag/allow_ai, !alai)
if (alai)
- to_chat(world, "The AI job is no longer chooseable.")
+ to_chat(world, "The AI job is no longer chooseable.", confidential = TRUE)
else
- to_chat(world, "The AI job is chooseable now.")
+ to_chat(world, "The AI job is chooseable now.", confidential = TRUE)
log_admin("[key_name(usr)] toggled AI allowed.")
world.update_status()
SSblackbox.record_feedback("nested tally", "admin_toggle", 1, list("Toggle AI", "[!alai ? "Disabled" : "Enabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
@@ -654,7 +672,7 @@
aiPlayer.end_multicam()
log_admin("[key_name(usr)] toggled AI multicam.")
world.update_status()
- to_chat(GLOB.ai_list | GLOB.admins, "The AI [almcam ? "no longer" : "now"] has multicam.")
+ to_chat(GLOB.ai_list | GLOB.admins, "The AI [almcam ? "no longer" : "now"] has multicam.", confidential = TRUE)
SSblackbox.record_feedback("nested tally", "admin_toggle", 1, list("Toggle Multicam", "[!almcam ? "Disabled" : "Enabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/datum/admins/proc/toggleaban()
@@ -664,9 +682,9 @@
var/new_nores = !CONFIG_GET(flag/norespawn)
CONFIG_SET(flag/norespawn, new_nores)
if (!new_nores)
- to_chat(world, "You may now respawn.")
+ to_chat(world, "You may now respawn.", confidential = TRUE)
else
- to_chat(world, "You may no longer respawn :(")
+ to_chat(world, "You may no longer respawn :(", confidential = TRUE)
message_admins("[key_name_admin(usr)] toggled respawn to [!new_nores ? "On" : "Off"].")
log_admin("[key_name(usr)] toggled respawn to [!new_nores ? "On" : "Off"].")
world.update_status()
@@ -675,7 +693,7 @@
/datum/admins/proc/delay()
set category = "Server"
set desc="Delay the game start"
- set name="Delay pre-game"
+ set name="Delay Pre-Game"
var/newtime = input("Set a new time in seconds. Set -1 for indefinite delay.","Set Delay",round(SSticker.GetTimeLeft()/10)) as num|null
if(SSticker.current_state > GAME_STATE_PREGAME)
@@ -683,11 +701,12 @@
if(newtime)
newtime = newtime*10
SSticker.SetTimeLeft(newtime)
+ SSticker.start_immediately = FALSE
if(newtime < 0)
- to_chat(world, "The game start has been delayed.")
+ to_chat(world, "The game start has been delayed.", confidential = TRUE)
log_admin("[key_name(usr)] delayed the round start.")
else
- to_chat(world, "The game will start in [DisplayTimeText(newtime)].")
+ to_chat(world, "The game will start in [DisplayTimeText(newtime)].", confidential = TRUE)
SEND_SOUND(world, sound(get_announcer_sound("attention")))
log_admin("[key_name(usr)] set the pre-game delay to [DisplayTimeText(newtime)].")
SSblackbox.record_feedback("tally", "admin_verb", 1, "Delay Game Start") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
@@ -724,20 +743,28 @@
set desc = "(atom path) Spawn an atom"
set name = "Spawn"
- if(!check_rights(R_SPAWN))
+ if(!check_rights(R_SPAWN) || !object)
+ return
+
+ var/list/preparsed = splittext(object,":")
+ var/path = preparsed[1]
+ var/amount = 1
+ if(preparsed.len > 1)
+ amount = clamp(text2num(preparsed[2]),1, 50) //50 at a time!
+
+ var/chosen = pick_closest_path(path)
+ if(!chosen)
return
var/turf/T = get_turf(usr)
- var/chosen = pick_closest_path(object)
- if(!chosen)
- return
if(ispath(chosen, /turf))
T.ChangeTurf(chosen)
else
- var/atom/A = new chosen(T)
- A.flags_1 |= ADMIN_SPAWNED_1
+ for(var/i in 1 to amount)
+ var/atom/A = new chosen(T)
+ A.flags_1 |= ADMIN_SPAWNED_1
- log_admin("[key_name(usr)] spawned [chosen] at [AREACOORD(usr)]")
+ log_admin("[key_name(usr)] spawned [amount] x [chosen] at [AREACOORD(usr)]")
SSblackbox.record_feedback("tally", "admin_verb", 1, "Spawn Atom") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/datum/admins/proc/podspawn_atom(object as text)
@@ -782,20 +809,18 @@
log_admin("[key_name(usr)] spawned cargo pack [chosen] at [AREACOORD(usr)]")
SSblackbox.record_feedback("tally", "admin_verb", 1, "Spawn Cargo") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
-
-/datum/admins/proc/show_traitor_panel(mob/M in GLOB.mob_list)
+/datum/admins/proc/show_traitor_panel(mob/target_mob in GLOB.mob_list)
set category = "Admin"
set desc = "Edit mobs's memory and role"
set name = "Show Traitor Panel"
-
- if(!istype(M))
- to_chat(usr, "This can only be used on instances of type /mob")
+ var/datum/mind/target_mind = target_mob.mind
+ if(!target_mind)
+ to_chat(usr, "This mob has no mind!", confidential = TRUE)
return
- if(!M.mind)
- to_chat(usr, "This mob has no mind!")
+ if(!istype(target_mob) && !istype(target_mind))
+ to_chat(usr, "This can only be used on instances of type /mob and /mind", confidential = TRUE)
return
-
- M.mind.traitor_panel()
+ target_mind.traitor_panel()
SSblackbox.record_feedback("tally", "admin_verb", 1, "Traitor Panel") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
@@ -805,9 +830,9 @@
set name="Toggle tinted welding helmes"
GLOB.tinted_weldhelh = !( GLOB.tinted_weldhelh )
if (GLOB.tinted_weldhelh)
- to_chat(world, "The tinted_weldhelh has been enabled!")
+ to_chat(world, "The tinted_weldhelh has been enabled!", confidential = TRUE)
else
- to_chat(world, "The tinted_weldhelh has been disabled!")
+ to_chat(world, "The tinted_weldhelh has been disabled!", confidential = TRUE)
log_admin("[key_name(usr)] toggled tinted_weldhelh.")
message_admins("[key_name_admin(usr)] toggled tinted_weldhelh.")
SSblackbox.record_feedback("nested tally", "admin_toggle", 1, list("Toggle Tinted Welding Helmets", "[GLOB.tinted_weldhelh ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
@@ -819,9 +844,9 @@
var/new_guest_ban = !CONFIG_GET(flag/guest_ban)
CONFIG_SET(flag/guest_ban, new_guest_ban)
if (new_guest_ban)
- to_chat(world, "Guests may no longer enter the game.")
+ to_chat(world, "Guests may no longer enter the game.", confidential = TRUE)
else
- to_chat(world, "Guests may now enter the game.")
+ to_chat(world, "Guests may now enter the game.", confidential = TRUE)
log_admin("[key_name(usr)] toggled guests game entering [!new_guest_ban ? "" : "dis"]allowed.")
message_admins("[key_name_admin(usr)] toggled guests game entering [!new_guest_ban ? "" : "dis"]allowed.")
SSblackbox.record_feedback("nested tally", "admin_toggle", 1, list("Toggle Guests", "[!new_guest_ban ? "Enabled" : "Disabled"]")) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
@@ -832,37 +857,37 @@
var/mob/living/silicon/S = i
ai_number++
if(isAI(S))
- to_chat(usr, "AI [key_name(S, usr)]'s laws:")
+ to_chat(usr, "AI [key_name(S, usr)]'s laws:", confidential = TRUE)
else if(iscyborg(S))
var/mob/living/silicon/robot/R = S
- to_chat(usr, "CYBORG [key_name(S, usr)] [R.connected_ai?"(Slaved to: [key_name(R.connected_ai)])":"(Independent)"]: laws:")
+ to_chat(usr, "CYBORG [key_name(S, usr)] [R.connected_ai?"(Slaved to: [key_name(R.connected_ai)])":"(Independent)"]: laws:", confidential = TRUE)
else if (ispAI(S))
- to_chat(usr, "pAI [key_name(S, usr)]'s laws:")
+ to_chat(usr, "pAI [key_name(S, usr)]'s laws:", confidential = TRUE)
else
- to_chat(usr, "SOMETHING SILICON [key_name(S, usr)]'s laws:")
+ to_chat(usr, "SOMETHING SILICON [key_name(S, usr)]'s laws:", confidential = TRUE)
if (S.laws == null)
- to_chat(usr, "[key_name(S, usr)]'s laws are null?? Contact a coder.")
+ to_chat(usr, "[key_name(S, usr)]'s laws are null?? Contact a coder.", confidential = TRUE)
else
S.laws.show_laws(usr)
if(!ai_number)
- to_chat(usr, "No AIs located" )
+ to_chat(usr, "No AIs located" , confidential = TRUE)
/datum/admins/proc/output_all_devil_info()
var/devil_number = 0
for(var/datum/mind/D in SSticker.mode.devils)
devil_number++
var/datum/antagonist/devil/devil = D.has_antag_datum(/datum/antagonist/devil)
- to_chat(usr, "Devil #[devil_number]: