From 0564d6609f011b2bed22d8ea013a1db95b25470a Mon Sep 17 00:00:00 2001 From: 81Denton <32391752+81Denton@users.noreply.github.com> Date: Mon, 30 Dec 2019 21:56:05 +0100 Subject: [PATCH] Moves shuttle related logs into a new log file (#48441) * Logs shuttle computer usage * Adds a separate shuttle log * Adds missing logs to INDIVIDUAL_SHOW_ALL_LOG * no message --- code/__DEFINES/logging.dm | 3 ++- code/__HELPERS/_logging.dm | 3 +++ code/_globalvars/logging.dm | 2 ++ code/controllers/configuration/entries/general.dm | 2 ++ code/controllers/subsystem/shuttle.dm | 12 ++++++------ code/game/atoms.dm | 2 ++ code/game/machinery/computer/communications.dm | 1 + code/game/world.dm | 4 +++- code/modules/mining/aux_base.dm | 6 ++++-- code/modules/shuttle/computer.dm | 1 + code/modules/shuttle/emergency.dm | 4 ++-- code/modules/shuttle/on_move.dm | 2 ++ config/config.txt | 3 +++ 13 files changed, 33 insertions(+), 12 deletions(-) diff --git a/code/__DEFINES/logging.dm b/code/__DEFINES/logging.dm index 4b1db3937c8..7decaa9df70 100644 --- a/code/__DEFINES/logging.dm +++ b/code/__DEFINES/logging.dm @@ -36,6 +36,7 @@ #define LOG_MECHA (1 << 15) #define LOG_VIRUS (1 << 16) #define LOG_CLONING (1 << 17) +#define LOG_SHUTTLE (1 << 18) //Individual logging panel pages #define INDIVIDUAL_ATTACK_LOG (LOG_ATTACK) @@ -44,7 +45,7 @@ #define INDIVIDUAL_COMMS_LOG (LOG_PDA | LOG_CHAT | LOG_COMMENT | LOG_TELECOMMS) #define INDIVIDUAL_OOC_LOG (LOG_OOC | LOG_ADMIN) #define INDIVIDUAL_OWNERSHIP_LOG (LOG_OWNERSHIP) -#define INDIVIDUAL_SHOW_ALL_LOG (LOG_ATTACK | LOG_SAY | LOG_WHISPER | LOG_EMOTE | LOG_DSAY | LOG_PDA | LOG_CHAT | LOG_COMMENT | LOG_TELECOMMS | LOG_OOC | LOG_ADMIN | LOG_OWNERSHIP | LOG_GAME) +#define INDIVIDUAL_SHOW_ALL_LOG (LOG_ATTACK | LOG_SAY | LOG_WHISPER | LOG_EMOTE | LOG_DSAY | LOG_PDA | LOG_CHAT | LOG_COMMENT | LOG_TELECOMMS | LOG_OOC | LOG_ADMIN | LOG_OWNERSHIP | LOG_GAME | LOG_ADMIN_PRIVATE | LOG_ASAY | LOG_MECHA | LOG_VIRUS | LOG_CLONING | LOG_SHUTTLE) #define LOGSRC_CLIENT "Client" #define LOGSRC_MOB "Mob" diff --git a/code/__HELPERS/_logging.dm b/code/__HELPERS/_logging.dm index 68f1d8dc605..363a36295a0 100644 --- a/code/__HELPERS/_logging.dm +++ b/code/__HELPERS/_logging.dm @@ -148,6 +148,9 @@ if (CONFIG_GET(flag/log_vote)) WRITE_LOG(GLOB.world_game_log, "VOTE: [text]") +/proc/log_shuttle(text) + if (CONFIG_GET(flag/log_shuttle)) + WRITE_LOG(GLOB.world_shuttle_log, "SHUTTLE: [text]") /proc/log_topic(text) WRITE_LOG(GLOB.world_game_log, "TOPIC: [text]") diff --git a/code/_globalvars/logging.dm b/code/_globalvars/logging.dm index 0693158a653..2e0a70dcdcf 100644 --- a/code/_globalvars/logging.dm +++ b/code/_globalvars/logging.dm @@ -40,6 +40,8 @@ GLOBAL_VAR(world_paper_log) GLOBAL_PROTECT(world_paper_log) GLOBAL_VAR(tgui_log) GLOBAL_PROTECT(tgui_log) +GLOBAL_VAR(world_shuttle_log) +GLOBAL_PROTECT(world_shuttle_log) GLOBAL_LIST_EMPTY(bombers) GLOBAL_PROTECT(bombers) diff --git a/code/controllers/configuration/entries/general.dm b/code/controllers/configuration/entries/general.dm index 999b5738b40..e8ff6697233 100644 --- a/code/controllers/configuration/entries/general.dm +++ b/code/controllers/configuration/entries/general.dm @@ -83,6 +83,8 @@ /datum/config_entry/flag/log_job_debug // log roundstart divide occupations debug information to a file +/datum/config_entry/flag/log_shuttle // log shuttle related actions, ie shuttle computers, shuttle manipulator, emergency console + /datum/config_entry/flag/allow_admin_ooccolor // Allows admins with relevant permissions to have their own ooc colour /datum/config_entry/flag/allow_admin_asaycolor //Allows admins with relevant permissions to have a personalized asay color diff --git a/code/controllers/subsystem/shuttle.dm b/code/controllers/subsystem/shuttle.dm index 3bee27b174a..c79ed8e5b46 100644 --- a/code/controllers/subsystem/shuttle.dm +++ b/code/controllers/subsystem/shuttle.dm @@ -144,9 +144,9 @@ SUBSYSTEM_DEF(shuttle) return //no players no autoevac if(alive / total <= threshold) - var/msg = "Automatically dispatching shuttle due to crew death." + var/msg = "Automatically dispatching emergency shuttle due to crew death." message_admins(msg) - log_game("[msg] Alive: [alive], Roundstart: [total], Threshold: [threshold]") + log_shuttle("[msg] Alive: [alive], Roundstart: [total], Threshold: [threshold]") emergencyNoRecall = TRUE priority_announce("Catastrophic casualties detected: crisis shuttle protocols activated - jamming recall signals across all frequencies.") if(emergency.timeLeft(1) > emergencyCallTime * 0.4) @@ -234,11 +234,11 @@ SUBSYSTEM_DEF(shuttle) var/area/A = get_area(user) - log_game("[key_name(user)] has called the shuttle.") + log_shuttle("[key_name(user)] has called the emergency shuttle.") deadchat_broadcast(" has called the shuttle at [A.name].", "[user.real_name]", user) if(call_reason) SSblackbox.record_feedback("text", "shuttle_reason", 1, "[call_reason]") - log_game("Shuttle call reason: [call_reason]") + log_shuttle("Shuttle call reason: [call_reason]") message_admins("[ADMIN_LOOKUPFLW(user)] has called the shuttle. (TRIGGER CENTCOM RECALL)") /datum/controller/subsystem/shuttle/proc/centcom_recall(old_timer, admiral_message) @@ -271,7 +271,7 @@ SUBSYSTEM_DEF(shuttle) /datum/controller/subsystem/shuttle/proc/cancelEvac(mob/user) if(canRecall()) emergency.cancel(get_area(user)) - log_game("[key_name(user)] has recalled the shuttle.") + log_shuttle("[key_name(user)] has recalled the shuttle.") message_admins("[ADMIN_LOOKUPFLW(user)] has recalled the shuttle.") deadchat_broadcast(" has recalled the shuttle from [get_area_name(user, TRUE)].", "[user.real_name]", user) return 1 @@ -318,7 +318,7 @@ SUBSYSTEM_DEF(shuttle) if(callShuttle) if(EMERGENCY_IDLE_OR_RECALLED) emergency.request(null, set_coefficient = 2.5) - log_game("There is no means of calling the shuttle anymore. Shuttle automatically called.") + log_shuttle("There is no means of calling the emergency shuttle anymore. Shuttle automatically called.") message_admins("All the communications consoles were destroyed and all AIs are inactive. Shuttle called.") /datum/controller/subsystem/shuttle/proc/registerHostileEnvironment(datum/bad) diff --git a/code/game/atoms.dm b/code/game/atoms.dm index f7ae0b7fc50..c355e700326 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -1103,6 +1103,8 @@ log_game(log_text) if(LOG_MECHA) log_mecha(log_text) + if(LOG_SHUTTLE) + log_shuttle(log_text) else stack_trace("Invalid individual logging type: [message_type]. Defaulting to [LOG_GAME] (LOG_GAME).") log_game(log_text) diff --git a/code/game/machinery/computer/communications.dm b/code/game/machinery/computer/communications.dm index 878ce5482dc..f2b760cafae 100755 --- a/code/game/machinery/computer/communications.dm +++ b/code/game/machinery/computer/communications.dm @@ -171,6 +171,7 @@ D.adjust_money(-S.credit_cost) minor_announce("[usr.real_name] has purchased [S.name] for [S.credit_cost] credits.[S.extra_desc ? " [S.extra_desc]" : ""]" , "Shuttle Purchase") message_admins("[ADMIN_LOOKUPFLW(usr)] purchased [S.name].") + log_shuttle("[key_name(usr)] has purchased [S.name].") SSblackbox.record_feedback("text", "shuttle_purchase", 1, "[S.name]") else to_chat(usr, "Insufficient credits.") diff --git a/code/game/world.dm b/code/game/world.dm index 8e70b4f7ec2..3746cad1d4a 100644 --- a/code/game/world.dm +++ b/code/game/world.dm @@ -25,7 +25,7 @@ GLOBAL_VAR(restart_counter) SetupExternalRSC() - GLOB.config_error_log = GLOB.world_manifest_log = GLOB.world_pda_log = GLOB.world_job_debug_log = GLOB.sql_error_log = GLOB.world_href_log = GLOB.world_runtime_log = GLOB.world_attack_log = GLOB.world_game_log = "data/logs/config_error.[GUID()].log" //temporary file used to record errors with loading config, moved to log directory once logging is set bl + GLOB.config_error_log = GLOB.world_manifest_log = GLOB.world_pda_log = GLOB.world_job_debug_log = GLOB.sql_error_log = GLOB.world_href_log = GLOB.world_runtime_log = GLOB.world_attack_log = GLOB.world_game_log = GLOB.world_shuttle_log = "data/logs/config_error.[GUID()].log" //temporary file used to record errors with loading config, moved to log directory once logging is set bl make_datum_references_lists() //initialises global lists for referencing frequently used datums (so that we only ever do it once) @@ -132,6 +132,7 @@ GLOBAL_VAR(restart_counter) GLOB.world_job_debug_log = "[GLOB.log_directory]/job_debug.log" GLOB.world_paper_log = "[GLOB.log_directory]/paper.log" GLOB.tgui_log = "[GLOB.log_directory]/tgui.log" + GLOB.world_shuttle_log = "[GLOB.log_directory]/shuttle.log" #ifdef UNIT_TESTS GLOB.test_log = file("[GLOB.log_directory]/tests.log") @@ -147,6 +148,7 @@ GLOBAL_VAR(restart_counter) start_log(GLOB.world_runtime_log) start_log(GLOB.world_job_debug_log) start_log(GLOB.tgui_log) + start_log(GLOB.world_shuttle_log) GLOB.changelog_hash = md5('html/changelog.html') //for telling if the changelog has changed recently if(fexists(GLOB.config_error_log)) diff --git a/code/modules/mining/aux_base.dm b/code/modules/mining/aux_base.dm index 2fac34cebe4..ecb9e24cb76 100644 --- a/code/modules/mining/aux_base.dm +++ b/code/modules/mining/aux_base.dm @@ -90,6 +90,7 @@ interface with the mining shuttle at the landing site if a mobile beacon is also say("Launch sequence activated! Prepare for drop!!") playsound(loc, 'sound/machines/warning-buzzer.ogg', 70, FALSE) launch_warning = FALSE + log_shuttle("[key_name(usr)] has launched the auxillary base.") else if(!shuttle_error) say("Shuttle request uploaded. Please stand away from the doors.") else @@ -342,7 +343,7 @@ interface with the mining shuttle at the landing site if a mobile beacon is also for(var/i in 1 to landing_turfs.len) //You land NEAR the base, not IN it. var/turf/L = landing_turfs[i] if(!L) //This happens at map edges - to_chat(user, "Unable to secure a valid docking zone. Please try again in an open area near, but not within the aux. mining base.") + to_chat(user, "Unable to secure a valid docking zone. Please try again in an open area near, but not within the auxillary mining base.") SSshuttle.stationary.Remove(Mport) qdel(Mport) return @@ -353,7 +354,7 @@ interface with the mining shuttle at the landing site if a mobile beacon is also return if(mining_shuttle.canDock(Mport) != SHUTTLE_CAN_DOCK) - to_chat(user, "Unable to secure a valid docking zone. Please try again in an open area near, but not within the aux. mining base.") + to_chat(user, "Unable to secure a valid docking zone. Please try again in an open area near, but not within the auxillary mining base.") SSshuttle.stationary.Remove(Mport) qdel(Mport) return @@ -362,6 +363,7 @@ interface with the mining shuttle at the landing site if a mobile beacon is also to_chat(user, "Mining shuttle calibration successful! Shuttle interface available at base console.") anchored = TRUE //Locks in place to mark the landing zone. playsound(loc, 'sound/machines/ping.ogg', 50, FALSE) + log_shuttle("[key_name(usr)] has registered the mining shuttle beacon at [COORD(landing_spot)].") /obj/structure/mining_shuttle_beacon/proc/clear_cooldown() anti_spam_cd = 0 diff --git a/code/modules/shuttle/computer.dm b/code/modules/shuttle/computer.dm index cb12072eb5d..cc8ee2c1967 100644 --- a/code/modules/shuttle/computer.dm +++ b/code/modules/shuttle/computer.dm @@ -64,6 +64,7 @@ switch(SSshuttle.moveShuttle(shuttleId, href_list["move"], 1)) if(0) say("Shuttle departing. Please stand away from the doors.") + log_shuttle("[key_name(usr)] has sent shuttle \"[M]\" towards \"[href_list["move"]]\", using [src].") if(1) to_chat(usr, "Invalid shuttle requested.") else diff --git a/code/modules/shuttle/emergency.dm b/code/modules/shuttle/emergency.dm index cde49bc8906..fbb75b5bd08 100644 --- a/code/modules/shuttle/emergency.dm +++ b/code/modules/shuttle/emergency.dm @@ -107,7 +107,7 @@ authorized += ID message_admins("[ADMIN_LOOKUPFLW(user)] has authorized early shuttle launch") - log_game("[key_name(user)] has authorized early shuttle launch in [COORD(src)]") + log_shuttle("[key_name(user)] has authorized early shuttle launch in [COORD(src)]") // Now check if we're on our way . = TRUE process() @@ -146,7 +146,7 @@ var/time = TIME_LEFT message_admins("[ADMIN_LOOKUPFLW(user)] has emagged the emergency shuttle [time] seconds before launch.") - log_game("[key_name(user)] has emagged the emergency shuttle in [COORD(src)] [time] seconds before launch.") + log_shuttle("[key_name(user)] has emagged the emergency shuttle in [COORD(src)] [time] seconds before launch.") ENABLE_BITFIELD(obj_flags, EMAGGED) SSshuttle.emergency.movement_force = list("KNOCKDOWN" = 60, "THROW" = 20)//YOUR PUNY SEATBELTS can SAVE YOU NOW, MORTAL diff --git a/code/modules/shuttle/on_move.dm b/code/modules/shuttle/on_move.dm index b33537057b3..7b304832b37 100644 --- a/code/modules/shuttle/on_move.dm +++ b/code/modules/shuttle/on_move.dm @@ -33,8 +33,10 @@ All ShuttleMove procs go here M.stop_pulling() M.visible_message("[shuttle] slams into [M]!") SSblackbox.record_feedback("tally", "shuttle_gib", 1, M.type) + log_attack("[key_name(M)] was shuttle gibbed by [shuttle].") M.gib() + else //non-living mobs shouldn't be affected by shuttles, which is why this is an else if(istype(thing, /obj/singularity) && !istype(thing, /obj/singularity/narsie)) //it's a singularity but not a god, ignore it. continue diff --git a/config/config.txt b/config/config.txt index 5b985085f9d..58058c2c58d 100644 --- a/config/config.txt +++ b/config/config.txt @@ -140,6 +140,9 @@ LOG_VIRUS ## log cloning actions LOG_CLONING +# log shuttle actions +LOG_SHUTTLE + ##Log camera pictures - Must have picture logging enabled PICTURE_LOGGING_CAMERA