Admin Verb Datums MkIII | Now with functional command bar (#82511)

This commit is contained in:
Zephyr
2024-04-12 15:27:09 -04:00
committed by GitHub
parent e0d335b442
commit 7f8752be14
104 changed files with 1898 additions and 3287 deletions
+189 -351
View File
@@ -1,40 +1,27 @@
/client/proc/Debug2()
set category = "Debug"
set name = "Debug-Game"
if(!check_rights(R_DEBUG))
return
if(GLOB.Debug2)
GLOB.Debug2 = 0
message_admins("[key_name(src)] toggled debugging off.")
log_admin("[key_name(src)] toggled debugging off.")
else
GLOB.Debug2 = 1
message_admins("[key_name(src)] toggled debugging on.")
log_admin("[key_name(src)] toggled debugging on.")
ADMIN_VERB(toggle_game_debug, R_DEBUG, "Debug-Game", "Toggles game debugging.", ADMIN_CATEGORY_DEBUG)
GLOB.Debug2 = !GLOB.Debug2
var/message = "toggled debugging [(GLOB.Debug2 ? "ON" : "OFF")]"
message_admins("[key_name_admin(user)] [message].")
log_admin("[key_name(user)] [message].")
BLACKBOX_LOG_ADMIN_VERB("Toggle Debug Two")
/client/proc/Cell()
set category = "Debug"
set name = "Air Status in Location"
if(!mob)
ADMIN_VERB_VISIBILITY(air_status, ADMIN_VERB_VISIBLITY_FLAG_MAPPING_DEBUG)
ADMIN_VERB(air_status, R_DEBUG, "Air Status In Location", "Gets the air status for your current turf.", ADMIN_CATEGORY_DEBUG)
var/turf/user_turf = get_turf(user.mob)
if(!isturf(user_turf))
return
var/turf/T = get_turf(mob)
if(!isturf(T))
return
atmos_scan(user=usr, target=T, silent=TRUE)
atmos_scan(user.mob, user_turf, silent = TRUE)
BLACKBOX_LOG_ADMIN_VERB("Air Status In Location")
/client/proc/cmd_admin_robotize(mob/M in GLOB.mob_list)
set category = "Admin.Fun"
set name = "Make Cyborg"
ADMIN_VERB(cmd_admin_robotize, R_FUN, "Make Cyborg", ADMIN_VERB_NO_DESCRIPTION, ADMIN_CATEGORY_HIDDEN, mob/target)
if(!SSticker.HasRoundStarted())
tgui_alert(usr,"Wait until the game starts")
tgui_alert(user, "Wait until the game starts")
return
log_admin("[key_name(src)] has robotized [M.key].")
INVOKE_ASYNC(M, TYPE_PROC_REF(/mob, Robotize))
if(issilicon(target))
tgui_alert(user, "They are already a cyborg.")
return
log_admin("[key_name(user)] has robotized [target.key].")
INVOKE_ASYNC(target, TYPE_PROC_REF(/mob, Robotize))
/client/proc/poll_type_to_del(search_string)
var/list/types = get_fancy_list_of_atom_types()
@@ -50,13 +37,8 @@
return
return types[key]
//TODO: merge the vievars version into this or something maybe mayhaps
/client/proc/cmd_debug_del_all(object as text)
set category = "Debug"
set name = "Del-All"
var/type_to_del = poll_type_to_del(object)
ADMIN_VERB(cmd_del_all, R_DEBUG|R_SPAWN, "Del-All", "Delete all datums with the specified type.", ADMIN_CATEGORY_DEBUG, object as text)
var/type_to_del = user.poll_type_to_del(object)
if(!type_to_del)
return
@@ -66,16 +48,12 @@
counter++
qdel(O)
CHECK_TICK
log_admin("[key_name(src)] has deleted all ([counter]) instances of [type_to_del].")
message_admins("[key_name_admin(src)] has deleted all ([counter]) instances of [type_to_del].")
log_admin("[key_name(user)] has deleted all ([counter]) instances of [type_to_del].")
message_admins("[key_name_admin(user)] has deleted all ([counter]) instances of [type_to_del].")
BLACKBOX_LOG_ADMIN_VERB("Delete All")
/client/proc/cmd_debug_force_del_all(object as text)
set category = "Debug"
set name = "Force-Del-All"
var/type_to_del = poll_type_to_del(object)
ADMIN_VERB(cmd_del_all_force, R_DEBUG|R_SPAWN, "Force-Del-All", "Forcibly delete all datums with the specified type.", ADMIN_CATEGORY_DEBUG, object as text)
var/type_to_del = user.poll_type_to_del(object)
if(!type_to_del)
return
@@ -85,29 +63,25 @@
counter++
qdel(O, force = TRUE)
CHECK_TICK
log_admin("[key_name(src)] has force-deleted all ([counter]) instances of [type_to_del].")
message_admins("[key_name_admin(src)] has force-deleted all ([counter]) instances of [type_to_del].")
log_admin("[key_name(user)] has force-deleted all ([counter]) instances of [type_to_del].")
message_admins("[key_name_admin(user)] has force-deleted all ([counter]) instances of [type_to_del].")
BLACKBOX_LOG_ADMIN_VERB("Force-Delete All")
/client/proc/cmd_debug_hard_del_all(object as text)
set category = "Debug"
set name = "Hard-Del-All"
var/type_to_del = poll_type_to_del(object)
ADMIN_VERB(cmd_del_all_hard, R_DEBUG|R_SPAWN, "Hard-Del-All", "Hard delete all datums with the specified type.", ADMIN_CATEGORY_DEBUG, object as text)
var/type_to_del = user.poll_type_to_del(object)
if(!type_to_del)
return
var/choice = alert("ARE YOU SURE that you want to hard delete this type? It will cause MASSIVE lag.", "Hoooo lad what happen?", "Yes", "No")
var/choice = alert(user, "ARE YOU SURE that you want to hard delete this type? It will cause MASSIVE lag.", "Hoooo lad what happen?", "Yes", "No")
if(choice != "Yes")
return
choice = alert("Do you want to pre qdelete the atom? This will speed things up significantly, but may break depending on your level of fuckup.", "How do you even get it that bad", "Yes", "No")
choice = alert(user, "Do you want to pre qdelete the atom? This will speed things up significantly, but may break depending on your level of fuckup.", "How do you even get it that bad", "Yes", "No")
var/should_pre_qdel = TRUE
if(choice == "No")
should_pre_qdel = FALSE
choice = alert("Ok one last thing, do you want to yield to the game? or do it all at once. These are hard deletes remember.", "Jesus christ man", "Yield", "Ignore the server")
choice = alert(user, "Ok one last thing, do you want to yield to the game? or do it all at once. These are hard deletes remember.", "Jesus christ man", "Yield", "Ignore the server")
var/should_check_tick = TRUE
if(choice == "Ignore the server")
should_check_tick = FALSE
@@ -129,24 +103,20 @@
qdel(O)
del(O)
CHECK_TICK
log_admin("[key_name(src)] has hard deleted all ([counter]) instances of [type_to_del].")
message_admins("[key_name_admin(src)] has hard deleted all ([counter]) instances of [type_to_del].")
log_admin("[key_name(user)] has hard deleted all ([counter]) instances of [type_to_del].")
message_admins("[key_name_admin(user)] has hard deleted all ([counter]) instances of [type_to_del].")
BLACKBOX_LOG_ADMIN_VERB("Hard Delete All")
/client/proc/cmd_debug_make_powernets()
set category = "Debug"
set name = "Make Powernets"
ADMIN_VERB(cmd_debug_make_powernets, R_DEBUG|R_SERVER, "Make Powernets", "Regenerates all powernets for all cables.", ADMIN_CATEGORY_DEBUG)
SSmachines.makepowernets()
log_admin("[key_name(src)] has remade the powernet. makepowernets() called.")
message_admins("[key_name_admin(src)] has remade the powernets. makepowernets() called.")
log_admin("[key_name(user)] has remade the powernet. makepowernets() called.")
message_admins("[key_name_admin(user)] has remade the powernets. makepowernets() called.")
BLACKBOX_LOG_ADMIN_VERB("Make Powernets")
/client/proc/cmd_admin_grantfullaccess(mob/M in GLOB.mob_list)
set category = "Debug"
set name = "Grant Full Access"
ADMIN_VERB_VISIBILITY(cmd_admin_grantfullaccess, ADMIN_VERB_VISIBLITY_FLAG_MAPPING_DEBUG)
ADMIN_VERB(cmd_admin_grantfullaccess, R_DEBUG, "Grant Full Access", "Grant full access to a mob.", ADMIN_CATEGORY_DEBUG, mob/M in world)
if(!SSticker.HasRoundStarted())
tgui_alert(usr,"Wait until the game starts")
tgui_alert(user, "Wait until the game starts")
return
if(ishuman(M))
var/mob/living/carbon/human/H = M
@@ -180,51 +150,44 @@
H.equip_to_slot(id, ITEM_SLOT_ID)
else
tgui_alert(usr,"Invalid mob")
tgui_alert(user,"Invalid mob")
BLACKBOX_LOG_ADMIN_VERB("Grant Full Access")
log_admin("[key_name(src)] has granted [M.key] full access.")
message_admins(span_adminnotice("[key_name_admin(usr)] has granted [M.key] full access."))
/client/proc/cmd_assume_direct_control(mob/M in GLOB.mob_list)
set category = "Admin.Game"
set name = "Assume direct control"
set desc = "Direct intervention"
log_admin("[key_name(user)] has granted [M.key] full access.")
message_admins(span_adminnotice("[key_name_admin(user)] has granted [M.key] full access."))
ADMIN_VERB(cmd_assume_direct_control, R_ADMIN, "Assume Direct Control", "Assume direct control of a mob.", ADMIN_CATEGORY_DEBUG, mob/M)
if(M.ckey)
if(tgui_alert(usr,"This mob is being controlled by [M.key]. Are you sure you wish to assume control of it? [M.key] will be made a ghost.",,list("Yes","No")) != "Yes")
if(tgui_alert(user,"This mob is being controlled by [M.key]. Are you sure you wish to assume control of it? [M.key] will be made a ghost.",,list("Yes","No")) != "Yes")
return
if(!M || QDELETED(M))
to_chat(usr, span_warning("The target mob no longer exists."))
to_chat(user, span_warning("The target mob no longer exists."))
return
message_admins(span_adminnotice("[key_name_admin(usr)] assumed direct control of [M]."))
log_admin("[key_name(usr)] assumed direct control of [M].")
var/mob/adminmob = mob
message_admins(span_adminnotice("[key_name_admin(user)] assumed direct control of [M]."))
log_admin("[key_name(user)] assumed direct control of [M].")
var/mob/adminmob = user.mob
if(M.ckey)
M.ghostize(FALSE)
M.key = key
init_verbs()
M.key = user.key
user.init_verbs()
if(isobserver(adminmob))
qdel(adminmob)
BLACKBOX_LOG_ADMIN_VERB("Assume Direct Control")
/client/proc/cmd_give_direct_control(mob/M in GLOB.mob_list)
set category = "Admin.Game"
set name = "Give direct control"
ADMIN_VERB(cmd_give_direct_control, R_ADMIN, "Give Direct Control", "Give direct control of a mob to another player.", ADMIN_CATEGORY_GAME, mob/M)
if(!M)
return
if(M.ckey)
if(tgui_alert(usr,"This mob is being controlled by [M.key]. Are you sure you wish to give someone else control of it? [M.key] will be made a ghost.",,list("Yes","No")) != "Yes")
if(tgui_alert(user,"This mob is being controlled by [M.key]. Are you sure you wish to give someone else control of it? [M.key] will be made a ghost.",,list("Yes","No")) != "Yes")
return
var/client/newkey = input(src, "Pick the player to put in control.", "New player") as null|anything in sort_list(GLOB.clients)
var/client/newkey = input(user, "Pick the player to put in control.", "New player") as null|anything in sort_list(GLOB.clients)
if(isnull(newkey))
return
var/mob/oldmob = newkey.mob
var/delmob = FALSE
if((isobserver(oldmob) || tgui_alert(usr,"Do you want to delete [newkey]'s old mob?","Delete?",list("Yes","No")) != "No"))
if((isobserver(oldmob) || tgui_alert(user,"Do you want to delete [newkey]'s old mob?","Delete?",list("Yes","No")) != "No"))
delmob = TRUE
if(!M || QDELETED(M))
to_chat(usr, span_warning("The target mob no longer exists, aborting."))
to_chat(user, span_warning("The target mob no longer exists, aborting."))
return
if(M.ckey)
M.ghostize(FALSE)
@@ -232,14 +195,12 @@
M.client?.init_verbs()
if(delmob)
qdel(oldmob)
message_admins(span_adminnotice("[key_name_admin(usr)] gave away direct control of [M] to [newkey]."))
log_admin("[key_name(usr)] gave away direct control of [M] to [newkey].")
message_admins(span_adminnotice("[key_name_admin(user)] gave away direct control of [M] to [newkey]."))
log_admin("[key_name(user)] gave away direct control of [M] to [newkey].")
BLACKBOX_LOG_ADMIN_VERB("Give Direct Control")
/client/proc/cmd_admin_areatest(on_station, filter_maint)
set category = "Mapping"
set name = "Test Areas"
ADMIN_VERB_VISIBILITY(cmd_admin_areatest, ADMIN_VERB_VISIBLITY_FLAG_MAPPING_DEBUG)
ADMIN_VERB(cmd_admin_areatest, R_DEBUG, "Test Areas", "Tests the areas for various machinery.", ADMIN_CATEGORY_MAPPING, on_station as num, filter_maint as num)
var/list/dat = list()
var/list/areas_all = list()
var/list/areas_with_APC = list()
@@ -270,7 +231,7 @@
))
if(SSticker.current_state == GAME_STATE_STARTUP)
to_chat(usr, "Game still loading, please hold!", confidential = TRUE)
to_chat(user, "Game still loading, please hold!", confidential = TRUE)
return
var/log_message
@@ -283,8 +244,8 @@
dat += "<b>Maintenance Areas Filtered Out</b>"
log_message += ", with no maintenance areas"
message_admins(span_adminnotice("[key_name_admin(usr)] used the Test Areas debug command checking [log_message]."))
log_admin("[key_name(usr)] used the Test Areas debug command checking [log_message].")
message_admins(span_adminnotice("[key_name_admin(user)] used the Test Areas debug command checking [log_message]."))
log_admin("[key_name(user)] used the Test Areas debug command checking [log_message].")
for(var/area/A as anything in GLOB.areas)
if(on_station)
@@ -425,28 +386,23 @@
if(!(areas_with_APC.len || areas_with_multiple_APCs.len || areas_with_air_alarm.len || areas_with_RC.len || areas_with_light.len || areas_with_LS.len || areas_with_intercom.len || areas_with_camera.len))
dat += "<b>No problem areas!</b>"
var/datum/browser/popup = new(usr, "testareas", "Test Areas", 500, 750)
var/datum/browser/popup = new(user.mob, "testareas", "Test Areas", 500, 750)
popup.set_content(dat.Join())
popup.open()
ADMIN_VERB_VISIBILITY(cmd_admin_areatest_station, ADMIN_VERB_VISIBLITY_FLAG_MAPPING_DEBUG)
ADMIN_VERB(cmd_admin_areatest_station, R_DEBUG, "Test Areas (STATION ONLY)", "Tests the areas for various machinery on station z-levels.", ADMIN_CATEGORY_MAPPING)
SSadmin_verbs.dynamic_invoke_verb(user, /datum/admin_verb/cmd_admin_areatest, /* on_station = */ TRUE)
/client/proc/cmd_admin_areatest_station()
set category = "Mapping"
set name = "Test Areas (STATION ONLY)"
cmd_admin_areatest(TRUE)
ADMIN_VERB_VISIBILITY(cmd_admin_areatest_station_no_maintenance, ADMIN_VERB_VISIBLITY_FLAG_MAPPING_DEBUG)
ADMIN_VERB(cmd_admin_areatest_station_no_maintenance, R_DEBUG, "Test Areas (STATION - NO MAINT)", "Tests the areas for various machinery on station z-levels, excluding maintenance areas.", ADMIN_CATEGORY_MAPPING)
SSadmin_verbs.dynamic_invoke_verb(user, /datum/admin_verb/cmd_admin_areatest, /* on_station = */ TRUE, /* filter_maint = */ TRUE)
/client/proc/cmd_admin_areatest_station_no_maintenance()
set category = "Mapping"
set name = "Test Areas (STATION - NO MAINT)"
cmd_admin_areatest(on_station = TRUE, filter_maint = TRUE)
/client/proc/cmd_admin_areatest_all()
set category = "Mapping"
set name = "Test Areas (ALL)"
cmd_admin_areatest(FALSE)
ADMIN_VERB_VISIBILITY(cmd_admin_areatest_all, ADMIN_VERB_VISIBLITY_FLAG_MAPPING_DEBUG)
ADMIN_VERB(cmd_admin_areatest_all, R_DEBUG, "Test Areas (ALL)", "Tests the areas for various machinery on all z-levels.", ADMIN_CATEGORY_MAPPING)
SSadmin_verbs.dynamic_invoke_verb(user, /datum/admin_verb/cmd_admin_areatest)
/client/proc/robust_dress_shop()
var/list/baseoutfits = list("Naked","Custom","As Job...", "As Plasmaman...")
var/list/outfits = list()
var/list/paths = subtypesof(/datum/outfit) - typesof(/datum/outfit/job) - typesof(/datum/outfit/plasmaman)
@@ -497,52 +453,29 @@
return dresscode
/client/proc/cmd_admin_rejuvenate(mob/living/M in GLOB.mob_list)
set category = "Debug"
set name = "Rejuvenate"
if(!check_rights(R_ADMIN))
return
if(!mob)
return
ADMIN_VERB_ONLY_CONTEXT_MENU(cmd_admin_rejuvenate, R_ADMIN, "Rejuvenate", mob/living/M in world)
if(!istype(M))
tgui_alert(usr,"Cannot revive a ghost")
tgui_alert(user,"Cannot revive a ghost")
return
M.revive(ADMIN_HEAL_ALL)
log_admin("[key_name(usr)] healed / revived [key_name(M)]")
var/msg = span_danger("Admin [key_name_admin(usr)] healed / revived [ADMIN_LOOKUPFLW(M)]!")
log_admin("[key_name(user)] healed / revived [key_name(M)]")
var/msg = span_danger("Admin [key_name_admin(user)] healed / revived [ADMIN_LOOKUPFLW(M)]!")
message_admins(msg)
admin_ticket_log(M, msg)
BLACKBOX_LOG_ADMIN_VERB("Rejuvenate")
/client/proc/cmd_admin_delete(atom/A as obj|mob|turf in world)
set category = "Debug"
set name = "Delete"
ADMIN_VERB_AND_CONTEXT_MENU(cmd_admin_delete, R_DEBUG|R_SPAWN, "Delete", ADMIN_VERB_NO_DESCRIPTION, ADMIN_CATEGORY_HIDDEN, atom/target as obj|mob|turf in world)
user.admin_delete(target)
if(!check_rights(R_SPAWN|R_DEBUG))
return
admin_delete(A)
/client/proc/cmd_admin_check_contents(mob/living/M in GLOB.mob_list)
set category = "Debug"
set name = "Check Contents"
var/list/L = M.get_contents()
for(var/t in L)
to_chat(usr, "[t] [ADMIN_VV(t)] [ADMIN_TAG(t)]", confidential = TRUE)
ADMIN_VERB_AND_CONTEXT_MENU(cmd_check_contents, R_ADMIN, "Check Contents", ADMIN_VERB_NO_DESCRIPTION, ADMIN_CATEGORY_HIDDEN, mob/living/mob)
var/list/mob_contents = mob.get_contents()
for(var/content in mob_contents)
to_chat(user, "[content] [ADMIN_VV(content)] [ADMIN_TAG(content)]", confidential = TRUE)
BLACKBOX_LOG_ADMIN_VERB("Check Contents")
/client/proc/modify_goals()
set category = "Debug"
set name = "Modify goals"
if(!check_rights(R_ADMIN))
return
holder.modify_goals()
ADMIN_VERB(modify_goals, R_ADMIN, "Modify Goals", "Modify the station goals for the shift.", ADMIN_CATEGORY_DEBUG)
user.holder.modify_goals()
/datum/admins/proc/modify_goals()
var/dat = ""
@@ -551,34 +484,27 @@
dat += "<br><a href='?src=[REF(src)];[HrefToken()];add_station_goal=1'>Add New Goal</a>"
usr << browse(dat, "window=goals;size=400x400")
/client/proc/cmd_debug_mob_lists()
set category = "Debug"
set name = "Debug Mob Lists"
set desc = "For when you just gotta know"
var/chosen_list = tgui_input_list(usr, "Which list?", "Select List", list("Players","Admins","Mobs","Living Mobs","Dead Mobs","Clients","Joined Clients"))
ADMIN_VERB(debug_mob_lists, R_DEBUG, "Debug Mob Lists", "For when you just gotta know.", ADMIN_CATEGORY_DEBUG)
var/chosen_list = tgui_input_list(user, "Which list?", "Select List", list("Players","Admins","Mobs","Living Mobs","Dead Mobs","Clients","Joined Clients"))
if(isnull(chosen_list))
return
switch(chosen_list)
if("Players")
to_chat(usr, jointext(GLOB.player_list,","), confidential = TRUE)
to_chat(user, jointext(GLOB.player_list,","), confidential = TRUE)
if("Admins")
to_chat(usr, jointext(GLOB.admins,","), confidential = TRUE)
to_chat(user, jointext(GLOB.admins,","), confidential = TRUE)
if("Mobs")
to_chat(usr, jointext(GLOB.mob_list,","), confidential = TRUE)
to_chat(user, jointext(GLOB.mob_list,","), confidential = TRUE)
if("Living Mobs")
to_chat(usr, jointext(GLOB.alive_mob_list,","), confidential = TRUE)
to_chat(user, jointext(GLOB.alive_mob_list,","), confidential = TRUE)
if("Dead Mobs")
to_chat(usr, jointext(GLOB.dead_mob_list,","), confidential = TRUE)
to_chat(user, jointext(GLOB.dead_mob_list,","), confidential = TRUE)
if("Clients")
to_chat(usr, jointext(GLOB.clients,","), confidential = TRUE)
to_chat(user, jointext(GLOB.clients,","), confidential = TRUE)
if("Joined Clients")
to_chat(usr, jointext(GLOB.joined_player_list,","), confidential = TRUE)
/client/proc/cmd_display_del_log()
set category = "Debug"
set name = "Display del() Log"
set desc = "Display del's log of everything that's passed through it."
to_chat(user, jointext(GLOB.joined_player_list,","), confidential = TRUE)
ADMIN_VERB(del_log, R_DEBUG, "Display del() Log", "Display del's log of everything that's passed through it.", ADMIN_CATEGORY_DEBUG)
var/list/dellog = list("<B>List of things that have gone through qdel this round</B><BR><BR><ol>")
sortTim(SSgarbage.items, cmp=/proc/cmp_qdel_item_time, associative = TRUE)
for(var/path in SSgarbage.items)
@@ -609,37 +535,19 @@
dellog += "</ol>"
usr << browse(dellog.Join(), "window=dellog")
user << browse(dellog.Join(), "window=dellog")
/client/proc/cmd_display_overlay_log()
set category = "Debug"
set name = "Display overlay Log"
set desc = "Display SSoverlays log of everything that's passed through it."
ADMIN_VERB(display_overlay_log, R_DEBUG, "Display Overlay Log", "Display SSoverlays log of everything that's passed through it.", ADMIN_CATEGORY_DEBUG)
render_stats(SSoverlays.stats, user)
render_stats(SSoverlays.stats, src)
ADMIN_VERB(init_log, R_DEBUG, "Display Initialize() Log", "Displays a list of things that didn't handle Initialize() properly.", ADMIN_CATEGORY_DEBUG)
user << browse(replacetext(SSatoms.InitLog(), "\n", "<br>"), "window=initlog")
/client/proc/cmd_display_init_log()
set category = "Debug"
set name = "Display Initialize() Log"
set desc = "Displays a list of things that didn't handle Initialize() properly"
ADMIN_VERB(debug_color_test, R_DEBUG, "Colorblind Testing", "Change your view to a budget version of colorblindness to test for usability.", ADMIN_CATEGORY_DEBUG)
user.holder.color_test.ui_interact(user.mob)
usr << browse(replacetext(SSatoms.InitLog(), "\n", "<br>"), "window=initlog")
/client/proc/open_colorblind_test()
set category = "Debug"
set name = "Colorblind Testing"
set desc = "Change your view to a budget version of colorblindness to test for usability"
if(!holder)
return
holder.color_test.ui_interact(mob)
/client/proc/debug_plane_masters()
set category = "Debug"
set name = "Edit/Debug Planes"
set desc = "Edit and visualize plane masters and their connections (relays)"
edit_plane_masters()
ADMIN_VERB(debug_plane_masters, R_DEBUG, "Edit/Debug Planes", "Edit and visualize plane masters and their connections (relays).", ADMIN_CATEGORY_DEBUG)
user.edit_plane_masters()
/client/proc/edit_plane_masters(mob/debug_on)
if(!holder)
@@ -651,21 +559,10 @@
holder.plane_debug.set_mirroring(FALSE)
holder.plane_debug.ui_interact(mob)
/client/proc/debug_huds(i as num)
set category = "Debug"
set name = "Debug HUDs"
set desc = "Debug the data or antag HUDs"
ADMIN_VERB(debug_huds, R_DEBUG, "Debug HUDs", "Debug the data or antag HUDs.", ADMIN_CATEGORY_DEBUG, i as num)
SSadmin_verbs.dynamic_invoke_verb(user, /datum/admin_verb/debug_variables, GLOB.huds[i])
if(!holder)
return
debug_variables(GLOB.huds[i])
/client/proc/jump_to_ruin()
set category = "Debug"
set name = "Jump to Ruin"
set desc = "Displays a list of all placed ruins to teleport to."
if(!holder)
return
ADMIN_VERB(jump_to_ruin, R_DEBUG, "Jump to Ruin", "Displays a list of all placed ruins to teleport to.", ADMIN_CATEGORY_DEBUG)
var/list/names = list()
for(var/obj/effect/landmark/ruin/ruin_landmark as anything in GLOB.ruin_landmarks)
var/datum/map_template/ruin/template = ruin_landmark.ruin_template
@@ -680,23 +577,17 @@
names[name] = ruin_landmark
var/ruinname = tgui_input_list(usr, "Select ruin", "Jump to Ruin", sort_list(names))
var/ruinname = tgui_input_list(user, "Select ruin", "Jump to Ruin", sort_list(names))
var/obj/effect/landmark/ruin/landmark = names[ruinname]
if(istype(landmark))
var/datum/map_template/ruin/template = landmark.ruin_template
usr.forceMove(get_turf(landmark))
to_chat(usr, span_name("[template.name]"), confidential = TRUE)
to_chat(usr, "<span class='italics'>[template.description]</span>", confidential = TRUE)
/client/proc/place_ruin()
set category = "Debug"
set name = "Spawn Ruin"
set desc = "Attempt to randomly place a specific ruin."
if (!holder)
if(!istype(landmark))
return
var/datum/map_template/ruin/template = landmark.ruin_template
user.mob.forceMove(get_turf(landmark))
to_chat(user, span_name("[template.name]"), confidential = TRUE)
to_chat(user, "<span class='italics'>[template.description]</span>", confidential = TRUE)
ADMIN_VERB_VISIBILITY(place_ruin, ADMIN_VERB_VISIBLITY_FLAG_MAPPING_DEBUG)
ADMIN_VERB(place_ruin, R_DEBUG, "Spawn Ruin", "Attempt to randomly place a specific ruin.", ADMIN_CATEGORY_MAPPING)
var/list/exists = list()
for(var/landmark in GLOB.ruin_landmarks)
var/obj/effect/landmark/ruin/L = landmark
@@ -714,15 +605,15 @@
themed_names[name] = list(ruin, theme, list(ruin.default_area))
names += sort_list(themed_names)
var/ruinname = tgui_input_list(usr, "Select ruin", "Spawn Ruin", sort_list(names))
var/ruinname = tgui_input_list(user, "Select ruin", "Spawn Ruin", sort_list(names))
var/data = names[ruinname]
if (!data)
return
var/datum/map_template/ruin/template = data[1]
if (exists[template])
var/response = tgui_alert(usr,"There is already a [template] in existence.", "Spawn Ruin", list("Jump", "Place Another", "Cancel"))
var/response = tgui_alert(user,"There is already a [template] in existence.", "Spawn Ruin", list("Jump", "Place Another", "Cancel"))
if (response == "Jump")
usr.forceMove(get_turf(exists[template]))
user.mob.forceMove(get_turf(exists[template]))
return
else if (response == "Cancel")
return
@@ -731,25 +622,17 @@
seedRuins(SSmapping.levels_by_trait(data[2]), max(1, template.cost), data[3], list(ruinname = template))
if (GLOB.ruin_landmarks.len > len)
var/obj/effect/landmark/ruin/landmark = GLOB.ruin_landmarks[GLOB.ruin_landmarks.len]
log_admin("[key_name(src)] randomly spawned ruin [ruinname] at [COORD(landmark)].")
usr.forceMove(get_turf(landmark))
to_chat(src, span_name("[template.name]"), confidential = TRUE)
to_chat(src, "<span class='italics'>[template.description]</span>", confidential = TRUE)
log_admin("[key_name(user)] randomly spawned ruin [ruinname] at [COORD(landmark)].")
user.mob.forceMove(get_turf(landmark))
to_chat(user, span_name("[template.name]"), confidential = TRUE)
to_chat(user, "<span class='italics'>[template.description]</span>", confidential = TRUE)
else
to_chat(src, span_warning("Failed to place [template.name]."), confidential = TRUE)
to_chat(user, span_warning("Failed to place [template.name]."), confidential = TRUE)
/client/proc/unload_ctf()
set category = "Debug"
set name = "Unload CTF"
set desc = "Despawns the majority of CTF"
toggle_id_ctf(usr, CTF_GHOST_CTF_GAME_ID, unload=TRUE)
/client/proc/run_empty_query(val as num)
set category = "Debug"
set name = "Run empty query"
set desc = "Amount of queries to run"
ADMIN_VERB(unload_ctf, R_DEBUG, "Unload CTF", "Despawns the majority of CTF.", ADMIN_CATEGORY_DEBUG)
toggle_id_ctf(user, CTF_GHOST_CTF_GAME_ID, unload=TRUE)
ADMIN_VERB(run_empty_query, R_DEBUG, "Run Empty Query", "Runs a specified number of empty queries.", ADMIN_CATEGORY_DEBUG, val as num)
var/list/queries = list()
for(var/i in 1 to val)
var/datum/db_query/query = SSdbcore.NewQuery("NULL")
@@ -761,45 +644,31 @@
qdel(query)
queries.Cut()
message_admins("[key_name_admin(src)] ran [val] empty queries.")
message_admins("[key_name_admin(user)] ran [val] empty queries.")
/client/proc/clear_dynamic_transit()
set category = "Debug"
set name = "Clear Dynamic Turf Reservations"
set desc = "Deallocates all reserved space, restoring it to round start conditions."
if(!holder)
return
var/answer = tgui_alert(usr,"WARNING: THIS WILL WIPE ALL RESERVED SPACE TO A CLEAN SLATE! ANY MOVING SHUTTLES, ELEVATORS, OR IN-PROGRESS PHOTOGRAPHY WILL BE DELETED!", "Really wipe dynamic turfs?", list("YES", "NO"))
ADMIN_VERB(clear_turf_reservations, R_DEBUG, "Clear Dynamic Turf Reservations", "Deallocates all reserved space, restoring it to round start conditions.", ADMIN_CATEGORY_DEBUG)
var/answer = tgui_alert(
user,
"WARNING: THIS WILL WIPE ALL RESERVED SPACE TO A CLEAN SLATE! ANY MOVING SHUTTLES, ELEVATORS, OR IN-PROGRESS PHOTOGRAPHY WILL BE DELETED!",
"Really wipe dynamic turfs?",
list("YES", "NO"),
)
if(answer != "YES")
return
message_admins(span_adminnotice("[key_name_admin(src)] cleared dynamic transit space."))
BLACKBOX_LOG_ADMIN_VERB("Clear Dynamic Transit")
log_admin("[key_name(src)] cleared dynamic transit space.")
message_admins(span_adminnotice("[key_name_admin(user)] cleared dynamic transit space."))
BLACKBOX_LOG_ADMIN_VERB("Clear Dynamic Turf Reservations")
log_admin("[key_name(user)] cleared dynamic turf reservations.")
SSmapping.wipe_reservations() //this goes after it's logged, incase something horrible happens.
/client/proc/toggle_medal_disable()
set category = "Debug"
set name = "Toggle Medal Disable"
set desc = "Toggles the safety lock on trying to contact the medal hub."
if(!check_rights(R_DEBUG))
return
ADMIN_VERB(toggle_medal_disable, R_DEBUG, "Toggle Medal Disable", "Toggles the safety lock on trying to contact the medal hub.", ADMIN_CATEGORY_DEBUG)
SSachievements.achievements_enabled = !SSachievements.achievements_enabled
message_admins(span_adminnotice("[key_name_admin(src)] [SSachievements.achievements_enabled ? "disabled" : "enabled"] the medal hub lockout."))
message_admins(span_adminnotice("[key_name_admin(user)] [SSachievements.achievements_enabled ? "disabled" : "enabled"] the medal hub lockout."))
BLACKBOX_LOG_ADMIN_VERB("Toggle Medal Disable")
log_admin("[key_name(src)] [SSachievements.achievements_enabled ? "disabled" : "enabled"] the medal hub lockout.")
log_admin("[key_name(user)] [SSachievements.achievements_enabled ? "disabled" : "enabled"] the medal hub lockout.")
/client/proc/view_runtimes()
set category = "Debug"
set name = "View Runtimes"
set desc = "Open the runtime Viewer"
if(!holder)
return
GLOB.error_cache.show_to(src)
ADMIN_VERB(view_runtimes, R_DEBUG, "View Runtimes", "Opens the runtime viewer.", ADMIN_CATEGORY_DEBUG)
GLOB.error_cache.show_to(user)
// The runtime viewer has the potential to crash the server if there's a LOT of runtimes
// this has happened before, multiple times, so we'll just leave an alert on it
@@ -808,80 +677,54 @@
if(GLOB.total_runtimes >= 100000)
warning = "There are a TON of runtimes, clicking any button (especially \"linear\") WILL LIKELY crash the server"
// Not using TGUI alert, because it's view runtimes, stuff is probably broken
alert(usr, "[warning]. Proceed with caution. If you really need to see the runtimes, download the runtime log and view it in a text editor.", "HEED THIS WARNING CAREFULLY MORTAL")
/client/proc/pump_random_event()
set category = "Debug"
set name = "Pump Random Event"
set desc = "Schedules the event subsystem to fire a new random event immediately. Some events may fire without notification."
if(!holder)
return
alert(user, "[warning]. Proceed with caution. If you really need to see the runtimes, download the runtime log and view it in a text editor.", "HEED THIS WARNING CAREFULLY MORTAL")
ADMIN_VERB(pump_random_event, R_DEBUG, "Pump Random Event", "Schedules the event subsystem to fire a new random event immediately. Some events may fire without notification.", ADMIN_CATEGORY_DEBUG)
SSevents.scheduled = world.time
message_admins(span_adminnotice("[key_name_admin(src)] pumped a random event."))
message_admins(span_adminnotice("[key_name_admin(user)] pumped a random event."))
BLACKBOX_LOG_ADMIN_VERB("Pump Random Event")
log_admin("[key_name(src)] pumped a random event.")
/client/proc/start_line_profiling()
set category = "Profile"
set name = "Start Line Profiling"
set desc = "Starts tracking line by line profiling for code lines that support it"
log_admin("[key_name(user)] pumped a random event.")
ADMIN_VERB_VISIBILITY(start_line_profiling, ADMIN_VERB_VISIBLITY_FLAG_MAPPING_DEBUG)
ADMIN_VERB(start_line_profiling, R_DEBUG, "Start Line Profiling", "Starts tracking line by line profiling for code lines that support it.", ADMIN_CATEGORY_PROFILE)
LINE_PROFILE_START
message_admins(span_adminnotice("[key_name_admin(src)] started line by line profiling."))
message_admins(span_adminnotice("[key_name_admin(user)] started line by line profiling."))
BLACKBOX_LOG_ADMIN_VERB("Start Line Profiling")
log_admin("[key_name(src)] started line by line profiling.")
/client/proc/stop_line_profiling()
set category = "Profile"
set name = "Stops Line Profiling"
set desc = "Stops tracking line by line profiling for code lines that support it"
log_admin("[key_name(user)] started line by line profiling.")
ADMIN_VERB_VISIBILITY(stop_line_profiling, ADMIN_VERB_VISIBLITY_FLAG_MAPPING_DEBUG)
ADMIN_VERB(stop_line_profiling, R_DEBUG, "Stop Line Profiling", "Stops tracking line by line profiling for code lines that support it.", ADMIN_CATEGORY_PROFILE)
LINE_PROFILE_STOP
message_admins(span_adminnotice("[key_name_admin(src)] stopped line by line profiling."))
message_admins(span_adminnotice("[key_name_admin(user)] stopped line by line profiling."))
BLACKBOX_LOG_ADMIN_VERB("Stop Line Profiling")
log_admin("[key_name(src)] stopped line by line profiling.")
/client/proc/show_line_profiling()
set category = "Profile"
set name = "Show Line Profiling"
set desc = "Shows tracked profiling info from code lines that support it"
log_admin("[key_name(user)] stopped line by line profiling.")
ADMIN_VERB_VISIBILITY(show_line_profiling, ADMIN_VERB_VISIBLITY_FLAG_MAPPING_DEBUG)
ADMIN_VERB(show_line_profiling, R_DEBUG, "Show Line Profiling", "Shows tracked profiling info from code lines that support it.", ADMIN_CATEGORY_PROFILE)
var/sortlist = list(
"Avg time" = GLOBAL_PROC_REF(cmp_profile_avg_time_dsc),
"Total Time" = GLOBAL_PROC_REF(cmp_profile_time_dsc),
"Call Count" = GLOBAL_PROC_REF(cmp_profile_count_dsc)
)
var/sort = input(src, "Sort type?", "Sort Type", "Avg time") as null|anything in sortlist
var/sort = input(user, "Sort type?", "Sort Type", "Avg time") as null|anything in sortlist
if (!sort)
return
sort = sortlist[sort]
profile_show(src, sort)
profile_show(user, sort)
/client/proc/reload_configuration()
set category = "Debug"
set name = "Reload Configuration"
set desc = "Force config reload to world default"
if(!check_rights(R_DEBUG))
return
if(tgui_alert(usr, "Are you absolutely sure you want to reload the configuration from the default path on the disk, wiping any in-round modifications?", "Really reset?", list("No", "Yes")) == "Yes")
config.admin_reload()
/// A debug verb to check the sources of currently running timers
/client/proc/check_timer_sources()
set category = "Debug"
set name = "Check Timer Sources"
set desc = "Checks the sources of the running timers"
if (!check_rights(R_DEBUG))
ADMIN_VERB(reload_configuration, R_DEBUG, "Reload Configuration", "Reloads the configuration from the default path on the disk, wiping any in-round modifications.", ADMIN_CATEGORY_DEBUG)
if(!tgui_alert(user, "Are you absolutely sure you want to reload the configuration from the default path on the disk, wiping any in-round modifications?", "Really reset?", list("No", "Yes")) == "Yes")
return
config.admin_reload()
ADMIN_VERB(check_timer_sources, R_DEBUG, "Check Timer Sources", "Checks the sources of running timers.", ADMIN_CATEGORY_DEBUG)
var/bucket_list_output = generate_timer_source_output(SStimer.bucket_list)
var/second_queue = generate_timer_source_output(SStimer.second_queue)
usr << browse({"
user << browse({"
<h3>bucket_list</h3>
[bucket_list_output]
@@ -889,24 +732,16 @@
[second_queue]
"}, "window=check_timer_sources;size=700x700")
/// A debug verb to try and re-establish a connection with the TTS server and to refetch TTS voices.
/// Since voices are cached beforehand, this is unlikely to update preferences.
/client/proc/reestablish_tts_connection()
set category = "Debug"
set name = "Re-establish Connection To TTS"
set desc = "Re-establishes connection to the TTS server if possible"
if (!check_rights(R_DEBUG))
return
message_admins("[key_name_admin(usr)] attempted to re-establish connection to the TTS HTTP server.")
log_admin("[key_name(usr)] attempted to re-establish connection to the TTS HTTP server.")
ADMIN_VERB(reestablish_tts_connection, R_DEBUG, "Re-establish Connection To TTS", "Re-establishes connection to the TTS server if possible", ADMIN_CATEGORY_DEBUG)
message_admins("[key_name_admin(user)] attempted to re-establish connection to the TTS HTTP server.")
log_admin("[key_name(user)] attempted to re-establish connection to the TTS HTTP server.")
var/success = SStts.establish_connection_to_tts()
if(!success)
message_admins("[key_name_admin(usr)] failed to re-established the connection to the TTS HTTP server.")
log_admin("[key_name(usr)] failed to re-established the connection to the TTS HTTP server.")
message_admins("[key_name_admin(user)] failed to re-established the connection to the TTS HTTP server.")
log_admin("[key_name(user)] failed to re-established the connection to the TTS HTTP server.")
return
message_admins("[key_name_admin(usr)] successfully re-established the connection to the TTS HTTP server.")
log_admin("[key_name(usr)] successfully re-established the connection to the TTS HTTP server.")
message_admins("[key_name_admin(user)] successfully re-established the connection to the TTS HTTP server.")
log_admin("[key_name(user)] successfully re-established the connection to the TTS HTTP server.")
/proc/generate_timer_source_output(list/datum/timedevent/events)
var/list/per_source = list()
@@ -950,10 +785,14 @@
return b["count"] - a["count"]
#ifdef TESTING
/client/proc/check_missing_sprites()
set category = "Debug"
set name = "Debug Worn Item Sprites"
set desc = "We're cancelling the Spritemageddon. (This will create a LOT of runtimes! Don't use on a live server!)"
ADMIN_VERB_CUSTOM_EXIST_CHECK(check_missing_sprites)
return TRUE
#else
ADMIN_VERB_CUSTOM_EXIST_CHECK(check_missing_sprites)
return FALSE
#endif
ADMIN_VERB(check_missing_sprites, R_DEBUG, "Debug Worn Item Sprites", "We're cancelling the Spritemageddon. (This will create a LOT of runtimes! Don't use on a live server!)", ADMIN_CATEGORY_DEBUG)
var/actual_file_name
for(var/test_obj in subtypesof(/obj/item))
var/obj/item/sprite = new test_obj
@@ -962,55 +801,54 @@
//Is there an explicit worn_icon to pick against the worn_icon_state? Easy street expected behavior.
if(sprite.worn_icon)
if(!(sprite.icon_state in icon_states(sprite.worn_icon)))
to_chat(src, span_warning("ERROR sprites for [sprite.type]. Slot Flags are [sprite.slot_flags]."), confidential = TRUE)
to_chat(user, span_warning("ERROR sprites for [sprite.type]. Slot Flags are [sprite.slot_flags]."), confidential = TRUE)
else if(sprite.worn_icon_state)
if(sprite.slot_flags & ITEM_SLOT_MASK)
actual_file_name = 'icons/mob/clothing/mask.dmi'
if(!(sprite.worn_icon_state in icon_states(actual_file_name)))
to_chat(src, span_warning("ERROR sprites for [sprite.type]. Mask slot."), confidential = TRUE)
to_chat(user, span_warning("ERROR sprites for [sprite.type]. Mask slot."), confidential = TRUE)
if(sprite.slot_flags & ITEM_SLOT_NECK)
actual_file_name = 'icons/mob/clothing/neck.dmi'
if(!(sprite.worn_icon_state in icon_states(actual_file_name)))
to_chat(src, span_warning("ERROR sprites for [sprite.type]. Neck slot."), confidential = TRUE)
to_chat(user, span_warning("ERROR sprites for [sprite.type]. Neck slot."), confidential = TRUE)
if(sprite.slot_flags & ITEM_SLOT_BACK)
actual_file_name = 'icons/mob/clothing/back.dmi'
if(!(sprite.worn_icon_state in icon_states(actual_file_name)))
to_chat(src, span_warning("ERROR sprites for [sprite.type]. Back slot."), confidential = TRUE)
to_chat(user, span_warning("ERROR sprites for [sprite.type]. Back slot."), confidential = TRUE)
if(sprite.slot_flags & ITEM_SLOT_HEAD)
actual_file_name = 'icons/mob/clothing/head/default.dmi'
if(!(sprite.worn_icon_state in icon_states(actual_file_name)))
to_chat(src, span_warning("ERROR sprites for [sprite.type]. Head slot."), confidential = TRUE)
to_chat(user, span_warning("ERROR sprites for [sprite.type]. Head slot."), confidential = TRUE)
if(sprite.slot_flags & ITEM_SLOT_BELT)
actual_file_name = 'icons/mob/clothing/belt.dmi'
if(!(sprite.worn_icon_state in icon_states(actual_file_name)))
to_chat(src, span_warning("ERROR sprites for [sprite.type]. Belt slot."), confidential = TRUE)
to_chat(user, span_warning("ERROR sprites for [sprite.type]. Belt slot."), confidential = TRUE)
if(sprite.slot_flags & ITEM_SLOT_SUITSTORE)
actual_file_name = 'icons/mob/clothing/belt_mirror.dmi'
if(!(sprite.worn_icon_state in icon_states(actual_file_name)))
to_chat(src, span_warning("ERROR sprites for [sprite.type]. Suit Storage slot."), confidential = TRUE)
to_chat(user, span_warning("ERROR sprites for [sprite.type]. Suit Storage slot."), confidential = TRUE)
else if(sprite.icon_state)
if(sprite.slot_flags & ITEM_SLOT_MASK)
actual_file_name = 'icons/mob/clothing/mask.dmi'
if(!(sprite.icon_state in icon_states(actual_file_name)))
to_chat(src, span_warning("ERROR sprites for [sprite.type]. Mask slot."), confidential = TRUE)
to_chat(user, span_warning("ERROR sprites for [sprite.type]. Mask slot."), confidential = TRUE)
if(sprite.slot_flags & ITEM_SLOT_NECK)
actual_file_name = 'icons/mob/clothing/neck.dmi'
if(!(sprite.icon_state in icon_states(actual_file_name)))
to_chat(src, span_warning("ERROR sprites for [sprite.type]. Neck slot."), confidential = TRUE)
to_chat(user, span_warning("ERROR sprites for [sprite.type]. Neck slot."), confidential = TRUE)
if(sprite.slot_flags & ITEM_SLOT_BACK)
actual_file_name = 'icons/mob/clothing/back.dmi'
if(!(sprite.icon_state in icon_states(actual_file_name)))
to_chat(src, span_warning("ERROR sprites for [sprite.type]. Back slot."), confidential = TRUE)
to_chat(user, span_warning("ERROR sprites for [sprite.type]. Back slot."), confidential = TRUE)
if(sprite.slot_flags & ITEM_SLOT_HEAD)
actual_file_name = 'icons/mob/clothing/head/default.dmi'
if(!(sprite.icon_state in icon_states(actual_file_name)))
to_chat(src, span_warning("ERROR sprites for [sprite.type]. Head slot."), confidential = TRUE)
to_chat(user, span_warning("ERROR sprites for [sprite.type]. Head slot."), confidential = TRUE)
if(sprite.slot_flags & ITEM_SLOT_BELT)
actual_file_name = 'icons/mob/clothing/belt.dmi'
if(!(sprite.icon_state in icon_states(actual_file_name)))
to_chat(src, span_warning("ERROR sprites for [sprite.type]. Belt slot."), confidential = TRUE)
to_chat(user, span_warning("ERROR sprites for [sprite.type]. Belt slot."), confidential = TRUE)
if(sprite.slot_flags & ITEM_SLOT_SUITSTORE)
actual_file_name = 'icons/mob/clothing/belt_mirror.dmi'
if(!(sprite.icon_state in icon_states(actual_file_name)))
to_chat(src, span_warning("ERROR sprites for [sprite.type]. Suit Storage slot."), confidential = TRUE)
#endif
to_chat(user, span_warning("ERROR sprites for [sprite.type]. Suit Storage slot."), confidential = TRUE)