From edabc4dd191071b5e5d0bf24c116e9c5effa56a2 Mon Sep 17 00:00:00 2001 From: FalloutFalcon <86381784+FalloutFalcon@users.noreply.github.com> Date: Fri, 25 Oct 2024 08:18:11 -0500 Subject: [PATCH] Tweaks and improvments to SSblackbox logging (#3561) ## About The Pull Request updates a few of the logs to be more useful and ands a few new ones ## Why It's Good For The Game ## Changelog :cl: add: Faction statistics are now logged to the blackbox del: Removes some cruft, red and blue team radios, out date/useless database logging station trash cleaned /:cl: --------- Co-authored-by: Sun-Soaked <45698967+Sun-Soaked@users.noreply.github.com> --- code/__DEFINES/radio.dm | 10 +---- code/controllers/subsystem/blackbox.dm | 4 -- code/game/communications.dm | 12 ++---- code/game/machinery/autolathe.dm | 11 ++--- code/game/machinery/teambuilder.dm | 2 - code/game/objects/effects/decals/cleanable.dm | 7 +-- .../game/objects/items/devices/radio/radio.dm | 2 +- .../game/objects/items/stacks/sheets/glass.dm | 9 ++-- code/game/objects/items/trash.dm | 7 +-- code/game/say.dm | 6 +-- code/game/turfs/closed/minerals.dm | 3 +- code/modules/awaymissions/capture_the_flag.dm | 2 - code/modules/faction/faction_datum.dm | 43 +++++++++++++------ .../mining/equipment/kinetic_crusher.dm | 1 + .../modules/mob/dead/new_player/new_player.dm | 1 + .../mob/dead/new_player/ship_select.dm | 3 +- code/modules/mob/living/brain/brain_item.dm | 3 +- .../projectiles/ammunition/_ammo_casing.dm | 3 -- 18 files changed, 58 insertions(+), 71 deletions(-) diff --git a/code/__DEFINES/radio.dm b/code/__DEFINES/radio.dm index 96e7ab6e0578..f6686232993d 100644 --- a/code/__DEFINES/radio.dm +++ b/code/__DEFINES/radio.dm @@ -22,7 +22,6 @@ #define RADIO_KEY_CENTCOM "e" #define RADIO_TOKEN_CENTCOM ":e" -//WS Begin - SGR, Overmaps #define RADIO_CHANNEL_SOLGOV "SolGov" #define RADIO_KEY_SOLGOV "s" #define RADIO_TOKEN_SOLGOV ":s" @@ -48,18 +47,11 @@ #define RADIO_TOKEN_PIRATE ":y" #define RADIO_CHANNEL_WIDEBAND "Wideband" -//WS End - -#define RADIO_CHANNEL_CTF_RED "Red Team" -#define RADIO_CHANNEL_CTF_BLUE "Blue Team" - #define MIN_FREE_FREQ 1201 // ------------------------------------------------- // Frequencies are always odd numbers and range from 1201 to 1599. #define FREQ_SYNDICATE 1213 // Nuke op comms frequency, dark brown -#define FREQ_CTF_RED 1215 // CTF red team comms frequency, red -#define FREQ_CTF_BLUE 1217 // CTF blue team comms frequency, blue #define FREQ_CENTCOM 1337 // CentCom comms frequency, gray #define FREQ_SOLGOV 1345 // SolGov comms frequency, dark blue WS ADDITION #define FREQ_INTEQ 1347 // Inteq comms frequency, light brown @@ -91,7 +83,7 @@ #define MAX_FREQ 1489 // ------------------------------------------------------ -#define FREQ_WIDEBAND 1501 // Subspace/shuttle comms frequency, dark blue WS ADDITION +#define FREQ_WIDEBAND 1501 // sector wide communication #define MAX_FREE_FREQ 1599 // ------------------------------------------------- diff --git a/code/controllers/subsystem/blackbox.dm b/code/controllers/subsystem/blackbox.dm index 2ac0b06b74d6..ab325d49ebe7 100644 --- a/code/controllers/subsystem/blackbox.dm +++ b/code/controllers/subsystem/blackbox.dm @@ -150,10 +150,6 @@ SUBSYSTEM_DEF(blackbox) record_feedback("tally", "radio_usage", 1, "solgov") //WS Edit - SolGov Rep if(FREQ_AI_PRIVATE) record_feedback("tally", "radio_usage", 1, "ai private") - if(FREQ_CTF_RED) - record_feedback("tally", "radio_usage", 1, "CTF red team") - if(FREQ_CTF_BLUE) - record_feedback("tally", "radio_usage", 1, "CTF blue team") else record_feedback("tally", "radio_usage", 1, "other") diff --git a/code/game/communications.dm b/code/game/communications.dm index 94afdbf364f5..2ee368eaa891 100644 --- a/code/game/communications.dm +++ b/code/game/communications.dm @@ -94,8 +94,8 @@ GLOBAL_LIST_INIT(radiochannels, list( RADIO_CHANNEL_COMMON = FREQ_COMMON, RADIO_CHANNEL_COMMAND = FREQ_COMMAND, RADIO_CHANNEL_CENTCOM = FREQ_CENTCOM, - RADIO_CHANNEL_SOLGOV = FREQ_SOLGOV, //WS Edit - SolGov Rep - RADIO_CHANNEL_WIDEBAND = FREQ_WIDEBAND, //WS Edit - Overmap + RADIO_CHANNEL_SOLGOV = FREQ_SOLGOV, + RADIO_CHANNEL_WIDEBAND = FREQ_WIDEBAND, RADIO_CHANNEL_SYNDICATE = FREQ_SYNDICATE, RADIO_CHANNEL_NANOTRASEN = FREQ_NANOTRASEN, RADIO_CHANNEL_MINUTEMEN = FREQ_MINUTEMEN, @@ -103,16 +103,14 @@ GLOBAL_LIST_INIT(radiochannels, list( RADIO_CHANNEL_INTEQ = FREQ_INTEQ, RADIO_CHANNEL_PIRATE = FREQ_PIRATE, RADIO_CHANNEL_AI_PRIVATE = FREQ_AI_PRIVATE, - RADIO_CHANNEL_CTF_RED = FREQ_CTF_RED, - RADIO_CHANNEL_CTF_BLUE = FREQ_CTF_BLUE )) GLOBAL_LIST_INIT(reverseradiochannels, list( "[FREQ_COMMON]" = RADIO_CHANNEL_COMMON, "[FREQ_COMMAND]" = RADIO_CHANNEL_COMMAND, "[FREQ_CENTCOM]" = RADIO_CHANNEL_CENTCOM, - "[FREQ_SOLGOV]" = RADIO_CHANNEL_SOLGOV, //WS Edit - SolGov Rep - "[FREQ_WIDEBAND]" = RADIO_CHANNEL_WIDEBAND, //WS Edit - SolGov Rep + "[FREQ_SOLGOV]" = RADIO_CHANNEL_SOLGOV, + "[FREQ_WIDEBAND]" = RADIO_CHANNEL_WIDEBAND, "[FREQ_SYNDICATE]" = RADIO_CHANNEL_SYNDICATE, "[FREQ_NANOTRASEN]" = RADIO_CHANNEL_NANOTRASEN, "[FREQ_MINUTEMEN]" = RADIO_CHANNEL_MINUTEMEN, @@ -120,8 +118,6 @@ GLOBAL_LIST_INIT(reverseradiochannels, list( "[FREQ_INTEQ]" = RADIO_CHANNEL_INTEQ, "[FREQ_PIRATE]" = RADIO_CHANNEL_PIRATE, "[FREQ_AI_PRIVATE]" = RADIO_CHANNEL_AI_PRIVATE, - "[FREQ_CTF_RED]" = RADIO_CHANNEL_CTF_RED, - "[FREQ_CTF_BLUE]" = RADIO_CHANNEL_CTF_BLUE )) /datum/radio_frequency diff --git a/code/game/machinery/autolathe.dm b/code/game/machinery/autolathe.dm index e63b3f75fb2b..452cd39b5d58 100644 --- a/code/game/machinery/autolathe.dm +++ b/code/game/machinery/autolathe.dm @@ -339,14 +339,15 @@ materials.use_materials(materials_used) if(is_stack) - var/obj/item/stack/N = new being_built.build_path(A, multiplier, FALSE) - N.update_appearance() - N.autolathe_crafted(src) + var/obj/item/stack/new_item = new being_built.build_path(A, multiplier, FALSE) + new_item.update_appearance() + new_item.autolathe_crafted(src) + SSblackbox.record_feedback("nested tally", "item_printed", 1, list("[type]", "[new_item.type]")) else for(var/i=1, i<=multiplier, i++) var/obj/item/new_item = new being_built.build_path(A) new_item.autolathe_crafted(src) - + SSblackbox.record_feedback("nested tally", "item_printed", 1, list("[type]", "[new_item.type]")) if(length(picked_materials)) new_item.set_custom_materials(picked_materials, 1 / multiplier) //Ensure we get the non multiplied amount for(var/x in picked_materials) @@ -446,5 +447,5 @@ //Called when the object is constructed by an autolathe //Has a reference to the autolathe so you can do !!FUN!! things with hacked lathes -/obj/item/proc/autolathe_crafted(obj/machinery/autolathe/A) +/obj/item/proc/autolathe_crafted(obj/machinery/autolathe/lathe) return diff --git a/code/game/machinery/teambuilder.dm b/code/game/machinery/teambuilder.dm index 153035a39374..402ea5aa5c6b 100644 --- a/code/game/machinery/teambuilder.dm +++ b/code/game/machinery/teambuilder.dm @@ -43,11 +43,9 @@ desc = "A machine that, when passed, colors you based on the color of your team. Go red team!" color = "#ff0000" team_color = "#ff0000" - team_radio = FREQ_CTF_RED /obj/machinery/teambuilder/blue name = "Teambuilding Machine (Blue)" desc = "A machine that, when passed, colors you based on the color of your team. Go blue team!" color = "#0000ff" team_color = "#0000ff" - team_radio = FREQ_CTF_BLUE diff --git a/code/game/objects/effects/decals/cleanable.dm b/code/game/objects/effects/decals/cleanable.dm index 3ec6f58aa7b1..0be76dd1fac6 100644 --- a/code/game/objects/effects/decals/cleanable.dm +++ b/code/game/objects/effects/decals/cleanable.dm @@ -32,11 +32,8 @@ AddElement(/datum/element/connect_loc, loc_connections) AddElement(/datum/element/beauty, beauty) - SSblackbox.record_feedback("tally", "station_mess_created", 1, name) - -/obj/effect/decal/cleanable/Destroy() - SSblackbox.record_feedback("tally", "station_mess_destroyed", 1, name) - return ..() + if(!mapload) + SSblackbox.record_feedback("tally", "station_mess_created", 1, name) /obj/effect/decal/cleanable/proc/replace_decal(obj/effect/decal/cleanable/C) // Returns true if we should give up in favor of the pre-existing decal if(mergeable_decal) diff --git a/code/game/objects/items/devices/radio/radio.dm b/code/game/objects/items/devices/radio/radio.dm index cc528f103fe2..1caf2861a448 100644 --- a/code/game/objects/items/devices/radio/radio.dm +++ b/code/game/objects/items/devices/radio/radio.dm @@ -254,7 +254,7 @@ var/datum/signal/subspace/vocal/signal = new(src, freq, speaker, language, message, spans, message_mods) // Independent radios, on the CentCom frequency, reach all independent radios - if (independent && (freq == FREQ_CENTCOM || freq == FREQ_WIDEBAND || freq == FREQ_CTF_RED || freq == FREQ_CTF_BLUE)) //WS Edit - SolGov Rep + if (independent && (freq == FREQ_CENTCOM || freq == FREQ_WIDEBAND)) //WS Edit - SolGov Rep signal.data["compression"] = 0 signal.transmission_method = TRANSMISSION_SUPERSPACE signal.map_zones = list(0) // reaches all Z-levels diff --git a/code/game/objects/items/stacks/sheets/glass.dm b/code/game/objects/items/stacks/sheets/glass.dm index 40de06d6f9cb..666e927eaf3e 100644 --- a/code/game/objects/items/stacks/sheets/glass.dm +++ b/code/game/objects/items/stacks/sheets/glass.dm @@ -282,7 +282,7 @@ GLOBAL_LIST_INIT(plastitaniumglass_recipes, list( var/obj/item/stack/sheet/weld_material = /obj/item/stack/sheet/glass embedding = list("embed_chance" = 65) -/obj/item/shard/Initialize() +/obj/item/shard/Initialize(mapload) . = ..() AddComponent(/datum/component/caltrop, force) AddComponent(/datum/component/butchering, 150, 65) @@ -300,17 +300,14 @@ GLOBAL_LIST_INIT(plastitaniumglass_recipes, list( if (icon_prefix) icon_state = "[icon_prefix][icon_state]" - SSblackbox.record_feedback("tally", "station_mess_created", 1, name) + if(!mapload) + SSblackbox.record_feedback("tally", "station_mess_created", 1, name) var/static/list/loc_connections = list( COMSIG_ATOM_ENTERED = PROC_REF(on_entered), ) AddElement(/datum/element/connect_loc, loc_connections) -/obj/item/shard/Destroy() - . = ..() - SSblackbox.record_feedback("tally", "station_mess_destroyed", 1, name) - /obj/item/shard/afterattack(atom/A as mob|obj, mob/user, proximity) . = ..() if(!proximity || !(src in user)) diff --git a/code/game/objects/items/trash.dm b/code/game/objects/items/trash.dm index bdcb89796bc4..cc67c6795783 100644 --- a/code/game/objects/items/trash.dm +++ b/code/game/objects/items/trash.dm @@ -8,11 +8,8 @@ resistance_flags = FLAMMABLE /obj/item/trash/Initialize(mapload) - SSblackbox.record_feedback("tally", "station_mess_created", 1, name) - return ..() - -/obj/item/trash/Destroy() - SSblackbox.record_feedback("tally", "station_mess_destroyed", 1, name) + if(!mapload) + SSblackbox.record_feedback("tally", "station_mess_created", 1, name) return ..() /obj/item/trash/raisins diff --git a/code/game/say.dm b/code/game/say.dm index cac8bafe5365..c92b984dbb77 100644 --- a/code/game/say.dm +++ b/code/game/say.dm @@ -13,10 +13,8 @@ GLOBAL_LIST_INIT(freqtospan, list( "[FREQ_AI_PRIVATE]" = "aiprivradio", "[FREQ_SYNDICATE]" = "syndradio", "[FREQ_CENTCOM]" = "centcomradio", - "[FREQ_SOLGOV]" = "solgovradio", //WS Edit - SolGov Rep - "[FREQ_WIDEBAND]" = "widebandradio", //WS Edit - Overmaps - "[FREQ_CTF_RED]" = "redteamradio", - "[FREQ_CTF_BLUE]" = "blueteamradio" + "[FREQ_SOLGOV]" = "solgovradio", + "[FREQ_WIDEBAND]" = "widebandradio", )) GLOBAL_LIST_INIT(freqcolor, list()) diff --git a/code/game/turfs/closed/minerals.dm b/code/game/turfs/closed/minerals.dm index d3d2cc076ef2..7b8d68b7b2f9 100644 --- a/code/game/turfs/closed/minerals.dm +++ b/code/game/turfs/closed/minerals.dm @@ -113,7 +113,8 @@ visible_message(span_warning("The ore was completely ruined!")) else new mineralType(src, mineralAmt) - SSblackbox.record_feedback("tally", "ore_mined", mineralAmt, mineralType) + if(ishuman(user)) + SSblackbox.record_feedback("tally", "ore_mined", mineralAmt, mineralType) if(ishuman(user)) var/mob/living/carbon/human/H = user if(give_exp) diff --git a/code/modules/awaymissions/capture_the_flag.dm b/code/modules/awaymissions/capture_the_flag.dm index cde1ad6a4de1..037ae0add3e6 100644 --- a/code/modules/awaymissions/capture_the_flag.dm +++ b/code/modules/awaymissions/capture_the_flag.dm @@ -590,7 +590,6 @@ /datum/outfit/ctf/red/post_equip(mob/living/carbon/human/H) ..() var/obj/item/radio/R = H.ears - R.set_frequency(FREQ_CTF_RED) R.freqlock = TRUE R.independent = TRUE H.dna.species.stunmod = 0 @@ -598,7 +597,6 @@ /datum/outfit/ctf/blue/post_equip(mob/living/carbon/human/H) ..() var/obj/item/radio/R = H.ears - R.set_frequency(FREQ_CTF_BLUE) R.freqlock = TRUE R.independent = TRUE H.dna.species.stunmod = 0 diff --git a/code/modules/faction/faction_datum.dm b/code/modules/faction/faction_datum.dm index 450ee9688953..017c324f5011 100644 --- a/code/modules/faction/faction_datum.dm +++ b/code/modules/faction/faction_datum.dm @@ -1,62 +1,77 @@ /datum/faction var/name + /// Primarly to be used for backend stuff. + var/short_name var/parent_faction + /// List of prefixes that ships of this faction uses var/list/prefixes +/datum/faction/New() + if(!short_name) + short_name = name + /datum/faction/syndicate name = FACTION_SYNDICATE parent_faction = /datum/faction/syndicate - prefixes = list("SEV", "SSV") + prefixes = PREFIX_SYNDICATE /datum/faction/syndicate/ngr name = FACTION_NGR - prefixes = list("NGRV") + short_name = "NGR" + prefixes = PREFIX_NGR /datum/faction/syndicate/cybersun name = FACTION_CYBERSUN - prefixes = list("CSSV") + prefixes = PREFIX_CYBERSUN /datum/faction/syndicate/suns name = FACTION_SUNS - prefixes = list("SUNS") + short_name = "SUNS" + prefixes = PREFIX_SUNS /datum/faction/solgov name = FACTION_SOLGOV - prefixes = list("SCSV") + prefixes = PREFIX_SOLGOV /datum/faction/srm name = FACTION_SRM - prefixes = list("SRSV") + short_name = "SRM" + prefixes = PREFIX_SRM /datum/faction/inteq name = FACTION_INTEQ - prefixes = list("IRMV") + short_name = "INTEQ" + prefixes = PREFIX_INTEQ /datum/faction/clip name = FACTION_CLIP - prefixes = list("CMSV", "CMGSV") + short_name = "CLIP" + prefixes = PREFIX_CLIP /datum/faction/nt name = FACTION_NT + short_name = "NT" parent_faction = /datum/faction/nt - prefixes = list("NTSV") + prefixes = PREFIX_NT /datum/faction/nt/ns_logi name = FACTION_NS_LOGI - prefixes = list("NSSV") + prefixes = PREFIX_NS_LOGI /datum/faction/nt/vigilitas name = FACTION_VIGILITAS - prefixes = list("VISV") + prefixes = PREFIX_VIGILITAS /datum/faction/frontier name = FACTION_FRONTIER - prefixes = list("FFV") + prefixes = PREFIX_FRONTIER /datum/faction/pgf name = FACTION_PGF - prefixes = list("PGF", "PGFMC", "PGFN") + short_name = "PGF" + prefixes = PREFIX_PGF /datum/faction/independent name = FACTION_INDEPENDENT - prefixes = list("SV", "IMV", "ISV") + short_name = "Indie" + prefixes = PREFIX_INDEPENDENT diff --git a/code/modules/mining/equipment/kinetic_crusher.dm b/code/modules/mining/equipment/kinetic_crusher.dm index 05e81421ac4f..d110fe901082 100644 --- a/code/modules/mining/equipment/kinetic_crusher.dm +++ b/code/modules/mining/equipment/kinetic_crusher.dm @@ -138,6 +138,7 @@ L.apply_status_effect(STATUS_EFFECT_CRUSHERMARK, hammer_synced) var/target_turf = get_turf(target) if(ismineralturf(target_turf)) + SSblackbox.record_feedback("tally", "pick_used_mining", 1, src.type) var/turf/closed/mineral/M = target_turf new /obj/effect/temp_visual/kinetic_blast(M) ..() diff --git a/code/modules/mob/dead/new_player/new_player.dm b/code/modules/mob/dead/new_player/new_player.dm index 2dbbd9d4b65b..3ff72083450a 100644 --- a/code/modules/mob/dead/new_player/new_player.dm +++ b/code/modules/mob/dead/new_player/new_player.dm @@ -345,6 +345,7 @@ log_manifest(character.mind.key, character.mind, character, TRUE) + SSblackbox.record_feedback("tally", "player_joined_faction", 1, ship.get_faction()) if(length(ship.job_slots) > 1 && ship.job_slots[1] == job) // if it's the "captain" equivalent job of the ship. checks to make sure it's not a one-job ship minor_announce("[job.name] [character.real_name] on deck!", zlevel = ship.shuttle_port.virtual_z()) return TRUE diff --git a/code/modules/mob/dead/new_player/ship_select.dm b/code/modules/mob/dead/new_player/ship_select.dm index e130f6e404ce..dd60c13ce2cd 100644 --- a/code/modules/mob/dead/new_player/ship_select.dm +++ b/code/modules/mob/dead/new_player/ship_select.dm @@ -100,7 +100,8 @@ to_chat(spawnee, "There was an error loading the ship. Please contact admins!") spawnee.new_player_panel() return - SSblackbox.record_feedback("tally", "ship_purchased", 1, template.name) //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! + SSblackbox.record_feedback("tally", "ship_purchased", 1, template.name) + SSblackbox.record_feedback("tally", "faction_ship_purchased", 1, template.faction_datum.name) // Try to spawn as the first listed job in the job slots (usually captain) // Playtime checks are overridden, to ensure the player gets to join the ship they spawned. if(!spawnee.AttemptLateSpawn(target.job_slots[1], target, FALSE)) diff --git a/code/modules/mob/living/brain/brain_item.dm b/code/modules/mob/living/brain/brain_item.dm index 8629d01650d4..5fe96021461b 100644 --- a/code/modules/mob/living/brain/brain_item.dm +++ b/code/modules/mob/living/brain/brain_item.dm @@ -381,7 +381,8 @@ if(resilience) actual_trauma.resilience = resilience . = actual_trauma - SSblackbox.record_feedback("tally", "traumas", 1, actual_trauma.type) + if(owner?.client) + SSblackbox.record_feedback("tally", "traumas", 1, actual_trauma.type) //Add a random trauma of a certain subtype /obj/item/organ/brain/proc/gain_trauma_type(brain_trauma_type = /datum/brain_trauma, resilience, natural_gain = FALSE) diff --git a/code/modules/projectiles/ammunition/_ammo_casing.dm b/code/modules/projectiles/ammunition/_ammo_casing.dm index 580410f6683f..1c259d622931 100644 --- a/code/modules/projectiles/ammunition/_ammo_casing.dm +++ b/code/modules/projectiles/ammunition/_ammo_casing.dm @@ -171,11 +171,8 @@ /obj/item/ammo_casing/Destroy() . = ..() - if(BB) QDEL_NULL(BB) - else - SSblackbox.record_feedback("tally", "station_mess_destroyed", 1, name) /obj/item/ammo_casing/update_icon_state() icon_state = "[initial(icon_state)][BB ? (bullet_skin ? "-[bullet_skin]" : "") : "-empty"]"