[MIRROR] JSON Logging Refactor (#11623)

Co-authored-by: Selis <12716288+ItsSelis@users.noreply.github.com>
Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
CHOMPStation2StaffMirrorBot
2025-09-14 20:05:26 +02:00
committed by GitHub
co-authored by Selis Kashargul
parent 272afa33c8
commit 5a62077f2c
425 changed files with 4081 additions and 2568 deletions
+1 -1
View File
@@ -31,4 +31,4 @@
var/F = file("broken_icons.txt")
fdel(F)
F << text
to_world(span_filter_system("Completeled successfully and written to [F]"))
to_chat(world, span_filter_system("Completeled successfully and written to [F]"))
+3 -3
View File
@@ -3,7 +3,7 @@ ADMIN_VERB(cmd_admin_say, R_ADMIN, "ASay", "Send a message to other admins", "Ad
if(!msg)
return
log_adminsay(msg, user)
user.mob.log_talk(message, LOG_ASAY)
for(var/client/C in GLOB.admins)
if(check_rights_for(C, R_ADMIN))
@@ -13,7 +13,7 @@ ADMIN_VERB(cmd_admin_say, R_ADMIN, "ASay", "Send a message to other admins", "Ad
ADMIN_VERB(cmd_mod_say, (R_ADMIN|R_MOD|R_SERVER), "Msay", "Send a message to other mod", "Admin.Chat", message as text)
var/msg = sanitize(message)
log_modsay(msg, user)
log_modsay(msg, list("speaker" = user))
if (!msg)
return
@@ -29,7 +29,7 @@ ADMIN_VERB(cmd_mod_say, (R_ADMIN|R_MOD|R_SERVER), "Msay", "Send a message to oth
ADMIN_VERB(cmd_event_say, (R_ADMIN|R_MOD|R_EVENT|R_SERVER), "Esay", "Send a message to other event manager", "Admin.Chat", message as text)
var/msg = sanitize(message)
log_eventsay(msg, user)
log_eventsay(msg, list("speaker" = user))
if (!msg)
return
+1 -1
View File
@@ -39,4 +39,4 @@
if((M.mind && M.mind.special_role && A && A.can_hear_aooc) || isobserver(M)) // Antags must have their type be allowed to AOOC to see AOOC. This prevents, say, ERT from seeing AOOC.
to_chat(M, span_ooc(span_aooc("[create_text_tag("aooc", "Antag-OOC:", M.client)] <EM>[player_display]:</EM> " + span_message("[msg]"))))
log_aooc(msg,src)
src.mob.log_talk("(AOOC) [msg]", LOG_OOC)
+1 -1
View File
@@ -1,4 +1,4 @@
ADMIN_VERB(cinematic, R_FUN, "Cinematic", "Show a cinematic to all players.", ADMIN_CATEGORY_FUN)
ADMIN_VERB(cinematic, R_FUN, "Cinematic", "Show a cinematic to all players.", "Fun.Do Not")
var/datum/cinematic/choice = tgui_input_list(
user,
"Chose a cinematic to play to everyone in the server.",
+4 -4
View File
@@ -19,10 +19,10 @@
GLOB.custom_event_msg = input
to_world(span_filter_system("<h1>[span_alert("Custom Event")]</h1>"))
to_world(span_filter_system("<h2>[span_alert("A custom event is starting. OOC Info:")]</h2>"))
to_world(span_filter_system(span_alert("[GLOB.custom_event_msg]")))
to_world(span_filter_system("<br>"))
to_chat(world, span_filter_system("<h1>[span_alert("Custom Event")]</h1>"))
to_chat(world, span_filter_system("<h2>[span_alert("A custom event is starting. OOC Info:")]</h2>"))
to_chat(world, span_filter_system(span_alert("[GLOB.custom_event_msg]")))
to_chat(world, span_filter_system("<br>"))
SSwebhooks.send(
WEBHOOK_CUSTOM_EVENT,
+24 -22
View File
@@ -393,33 +393,33 @@ ADMIN_VERB(cmd_assume_direct_control, (R_DEBUG|R_ADMIN|R_EVENT), "Assume Direct
var/list/areas_without_intercom = areas_all - areas_with_intercom
var/list/areas_without_camera = areas_all - areas_with_camera
to_world(span_bold("AREAS WITHOUT AN APC:"))
to_chat(world, span_bold("AREAS WITHOUT AN APC:"))
for(var/areatype in areas_without_APC)
to_world("* [areatype]")
to_chat(world, "* [areatype]")
to_world(span_bold("AREAS WITHOUT AN AIR ALARM:"))
to_chat(world, span_bold("AREAS WITHOUT AN AIR ALARM:"))
for(var/areatype in areas_without_air_alarm)
to_world("* [areatype]")
to_chat(world, "* [areatype]")
to_world(span_bold("AREAS WITHOUT A REQUEST CONSOLE:"))
to_chat(world, span_bold("AREAS WITHOUT A REQUEST CONSOLE:"))
for(var/areatype in areas_without_RC)
to_world("* [areatype]")
to_chat(world, "* [areatype]")
to_world(span_bold("AREAS WITHOUT ANY LIGHTS:"))
to_chat(world, span_bold("AREAS WITHOUT ANY LIGHTS:"))
for(var/areatype in areas_without_light)
to_world("* [areatype]")
to_chat(world, "* [areatype]")
to_world(span_bold("AREAS WITHOUT A LIGHT SWITCH:"))
to_chat(world, span_bold("AREAS WITHOUT A LIGHT SWITCH:"))
for(var/areatype in areas_without_LS)
to_world("* [areatype]")
to_chat(world, "* [areatype]")
to_world(span_bold("AREAS WITHOUT ANY INTERCOMS:"))
to_chat(world, span_bold("AREAS WITHOUT ANY INTERCOMS:"))
for(var/areatype in areas_without_intercom)
to_world("* [areatype]")
to_chat(world, "* [areatype]")
to_world(span_bold("AREAS WITHOUT ANY CAMERAS:"))
to_chat(world, span_bold("AREAS WITHOUT ANY CAMERAS:"))
for(var/areatype in areas_without_camera)
to_world("* [areatype]")
to_chat(world, "* [areatype]")
/datum/admins/proc/cmd_admin_dress(input in getmobs())
set category = "Fun.Event Kit"
@@ -624,15 +624,17 @@ ADMIN_VERB(cmd_assume_direct_control, (R_DEBUG|R_ADMIN|R_EVENT), "Assume Direct
else
tgui_alert_async(usr, "Invalid mob")
/datum/admins/proc/view_runtimes()
set category = "Debug.Investigate"
set name = "View Runtimes"
set desc = "Open the Runtime Viewer"
ADMIN_VERB(view_runtimes, R_DEBUG, "View Runtimes", "Opens the runtime viewer.", ADMIN_CATEGORY_DEBUG)
GLOB.error_cache.show_to(user)
if(!check_rights(R_DEBUG))
return
error_cache.showTo(usr)
// 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
if(GLOB.total_runtimes >= 50000) // arbitrary number, I don't know when exactly it happens
var/warning = "There are a lot of runtimes, clicking any button (especially \"linear\") can have the potential to lag or crash the server"
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
tgui_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")
/datum/admins/proc/change_weather()
set category = "Debug.Events"
+2 -2
View File
@@ -14,11 +14,11 @@
var/dice = num2text(sum) + "d" + num2text(side)
if(tgui_alert(usr, "Do you want to inform the world about your game?","Show world?",list("Yes", "No")) == "Yes")
to_world("<h2 style=\"color:#A50400\">The dice have been rolled by Gods!</h2>")
to_chat(world, "<h2 style=\"color:#A50400\">The dice have been rolled by Gods!</h2>")
var/result = roll(dice)
if(tgui_alert(usr, "Do you want to inform the world about the result?","Show world?",list("Yes", "No")) == "Yes")
to_world("<h2 style=\"color:#A50400\">Gods rolled [dice], result is [result]</h2>")
to_chat(world, "<h2 style=\"color:#A50400\">Gods rolled [dice], result is [result]</h2>")
message_admins("[key_name_admin(src)] rolled dice [dice], result is [result]", 1)
+2 -2
View File
@@ -5,7 +5,7 @@ ADMIN_VERB(fix_atmos, (R_ADMIN|R_DEBUG|R_EVENT), "Fix Atmospherics Grief", "View
feedback_add_details("admin_verb","FA")
log_and_message_admins("Full atmosphere reset initiated by [user].")
to_world(span_danger("Initiating restart of atmosphere. The server may lag a bit."))
to_chat(world, span_danger("Initiating restart of atmosphere. The server may lag a bit."))
sleep(10)
var/current_time = world.timeofday
@@ -43,4 +43,4 @@ ADMIN_VERB(fix_atmos, (R_ADMIN|R_DEBUG|R_EVENT), "Fix Atmospherics Grief", "View
SSair.RebootZAS()
to_chat(user, "\[5/5\] - ZAS Rebooted")
to_world(span_danger("Atmosphere restart completed in " + span_bold("[(world.timeofday - current_time)/10]") + " seconds."))
to_chat(world, span_danger("Atmosphere restart completed in " + span_bold("[(world.timeofday - current_time)/10]") + " seconds."))
+4 -4
View File
@@ -310,9 +310,9 @@ var/list/debug_verbs = list (
if(i*10+j <= atom_list.len)
temp_atom = atom_list[i*10+j]
line += " no.[i+10+j]@\[[temp_atom.x], [temp_atom.y], [temp_atom.z]\]; "
to_world(line)*/
to_chat(world, line)*/
to_world("There are [count] objects of type [type_path] on z-level [num_level]")
to_chat(world, "There are [count] objects of type [type_path] on z-level [num_level]")
feedback_add_details("admin_verb","mOBJZ") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/proc/count_objects_all()
@@ -337,7 +337,7 @@ var/list/debug_verbs = list (
if(i*10+j <= atom_list.len)
temp_atom = atom_list[i*10+j]
line += " no.[i+10+j]@\[[temp_atom.x], [temp_atom.y], [temp_atom.z]\]; "
to_world(line)*/
to_chat(world, line)*/
to_world("There are [count] objects of type [type_path] in the game world")
to_chat(world, "There are [count] objects of type [type_path] in the game world")
feedback_add_details("admin_verb","mOBJ") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
+1 -1
View File
@@ -103,7 +103,7 @@ var/list/sounds_cache = list()
if(!check_rights(R_SOUNDS))
return
var/list/sounds = file2list("sound/serversound_list.txt");
var/list/sounds = world.file2list("sound/serversound_list.txt");
sounds += "--CANCEL--"
sounds += sounds_cache
+1 -1
View File
@@ -24,7 +24,7 @@
to_chat(src, "Your prayers have been received by the gods.", confidential = TRUE)
feedback_add_details("admin_verb","PR") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
log_pray(raw_msg, src)
log_prayer("[src.key]/([src.name]): [raw_msg]")
/proc/CentCom_announce(var/msg, var/mob/Sender, var/iamessage)
msg = span_blue(span_bold(span_orange("[uppertext(using_map.boss_short)]M[iamessage ? " IA" : ""]:") + "[key_name(Sender, 1)] [ADMIN_PP(Sender)] [ADMIN_VV(Sender)] [ADMIN_SM(Sender)] ([admin_jump_link(Sender)]) [ADMIN_CA(Sender)] [ADMIN_BSA(Sender)] [ADMIN_CENTCOM_REPLY(Sender)]:") + " [msg]")
+3 -3
View File
@@ -124,7 +124,7 @@ ADMIN_VERB(drop_everything, R_ADMIN, "Drop Everything", ADMIN_VERB_NO_DESCRIPTIO
if (!msg) // We check both before and after, just in case sanitization ended us up with empty message.
return
to_world("[msg]")
to_chat(world, "[msg]")
log_admin("GlobalNarrate: [key_name(usr)] : [msg]")
message_admins(span_blue(span_bold(" GlobalNarrate: [key_name_admin(usr)] : [msg]<BR>")), 1)
feedback_add_details("admin_verb","GLN") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
@@ -710,7 +710,7 @@ ADMIN_VERB(respawn_character, (R_ADMIN|R_REJUVINATE), "Spawn Character", "(Re)Sp
if(confirm == "Yes")
command_announcement.Announce(input, customname, new_sound = 'sound/AI/commandreport.ogg', msg_sanitized = 1);
else
to_world(span_red("New [using_map.company_name] Update available at all communication consoles."))
to_chat(world, span_red("New [using_map.company_name] Update available at all communication consoles."))
world << sound('sound/AI/commandreport.ogg')
log_admin("[key_name(src)] has created a command report: [input]")
@@ -964,7 +964,7 @@ ADMIN_VERB(respawn_character, (R_ADMIN|R_REJUVINATE), "Spawn Character", "(Re)Sp
message_admins("Admin [key_name_admin(usr)] has forced the players to have random appearances.", 1)
if(notifyplayers == "Yes")
to_world(span_boldannounce(span_blue("Admin [usr.key] has forced the players to have completely random identities!")))
to_chat(world, span_boldannounce(span_blue("Admin [usr.key] has forced the players to have completely random identities!")))
to_chat(usr, "<i>Remember: you can always disable the randomness by using the verb again, assuming the round hasn't started yet</i>.")
+1 -1
View File
@@ -200,7 +200,7 @@ GLOBAL_VAR(ert_loaded)
GLOB.ert_loaded = TRUE
var/datum/map_template/MT = SSmapping.map_templates["Special Area - ERT"]
if(!istype(MT))
error("ERT Area is not a valid map template!")
log_mapping("ERT Area is not a valid map template!")
else
MT.load_new_z(centered = TRUE)
log_and_message_admins("Loaded the ERT shuttle just now.")
+1 -1
View File
@@ -75,7 +75,7 @@ GLOBAL_VAR(trader_loaded)
GLOB.trader_loaded = TRUE
var/datum/map_template/MT = SSmapping.map_templates["Special Area - Salamander Trader"] //was: "Special Area - Trader"
if(!istype(MT))
error("Trader is not a valid map template!")
log_mapping("Trader is not a valid map template!")
else
MT.load_new_z(centered = TRUE)
log_and_message_admins("Loaded the trade shuttle just now.")