Skip to content

Commit

Permalink
Merge branch 'project/ares/logging_changes' into project/ares/tm_holder
Browse files Browse the repository at this point in the history
  • Loading branch information
realforest2001 committed Aug 21, 2023
2 parents 0d8c2c3 + d193222 commit 097b3d6
Show file tree
Hide file tree
Showing 10 changed files with 92 additions and 57 deletions.
2 changes: 1 addition & 1 deletion code/game/machinery/ARES/ARES.dm
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@
var/list/records_talking = list()
/// Holds all (/datum/ares_record/requisition_log)s
var/list/records_asrs = list()
/// Holds all (/datum/ares_record/security)s and (/datum/ares_record/antiair)s
/// Holds all (/datum/ares_record/security)s (including AA)
var/list/records_security = list()
/// Holds all (/datum/ares_record/flight)s
var/list/records_flight = list()
Expand Down
50 changes: 25 additions & 25 deletions code/game/machinery/ARES/ARES_procs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -67,20 +67,23 @@ GLOBAL_LIST_INIT(maintenance_categories, list(
/datum/ares_link/proc/log_ares_bioscan(title, input)
interface.records_bioscan.Add(new /datum/ares_record/bioscan(title, input))

/datum/ares_link/proc/log_ares_bombardment(mob/living/user, ob_name, coordinates)
interface.records_bombardment.Add(new /datum/ares_record/bombardment(ob_name, "Bombardment fired at [coordinates].", user))
/datum/ares_link/proc/log_ares_bombardment(mob/user, ob_name, coordinates)
interface.records_bombardment.Add(new /datum/ares_record/bombardment(ob_name, "Bombardment fired at [coordinates].", user.name))

/datum/ares_link/proc/log_ares_announcement(title, message)
interface.records_announcement.Add(new /datum/ares_record/announcement(title, message))

/datum/ares_link/proc/log_ares_antiair(mob/living/user, details)
interface.records_security.Add(new /datum/ares_record/antiair(details, user))

/datum/ares_link/proc/log_ares_requisition(source, details, mob/living/user)
interface.records_asrs.Add(new /datum/ares_record/requisition_log(source, details, user))
/datum/ares_link/proc/log_ares_requisition(source, details, mob/user)
interface.records_asrs.Add(new /datum/ares_record/requisition_log(source, details, user.name))

/datum/ares_link/proc/log_ares_security(title, details)
interface.records_security.Add(new /datum/ares_record/security(title, details))

/datum/ares_link/proc/log_ares_antiair(details)
interface.records_security.Add(new /datum/ares_record/security/antiair(details))

/datum/ares_link/proc/log_ares_flight(mob/user, details)
interface.records_flight.Add(new /datum/ares_record/flight(details, user.name))
// ------ End ARES Logging Procs ------ //

/proc/ares_apollo_talk(broadcast_message)
Expand Down Expand Up @@ -245,8 +248,6 @@ GLOBAL_LIST_INIT(maintenance_categories, list(

var/list/logged_alerts = list()
for(var/datum/ares_record/security/security_alert as anything in records_security)
if(!istype(security_alert))
continue
var/list/current_alert = list()
current_alert["time"] = security_alert.time
current_alert["title"] = security_alert.title
Expand All @@ -255,6 +256,17 @@ GLOBAL_LIST_INIT(maintenance_categories, list(
logged_alerts += list(current_alert)
data["records_security"] = logged_alerts

var/list/logged_flights = list()
for(var/datum/ares_record/flight/flight_log as anything in records_flight)
var/list/current_flight = list()
current_flight["time"] = flight_log.time
current_flight["title"] = flight_log.title
current_flight["details"] = flight_log.details
current_flight["user"] = flight_log.user
current_flight["ref"] = "\ref[flight_log]"
logged_flights += list(current_flight)
data["records_flight"] = logged_flights

var/list/logged_bioscans = list()
for(var/datum/ares_record/bioscan/scan as anything in records_bioscan)
var/list/current_scan = list()
Expand Down Expand Up @@ -300,18 +312,6 @@ GLOBAL_LIST_INIT(maintenance_categories, list(
logged_discussions += list(deleted_disc)
data["deleted_discussions"] = logged_discussions

var/list/logged_adjustments = list()
for(var/datum/ares_record/antiair/aa_adjustment as anything in records_security)
if(!istype(aa_adjustment))
continue
var/list/current_adjustment = list()
current_adjustment["time"] = aa_adjustment.time
current_adjustment["details"] = aa_adjustment.details
current_adjustment["user"] = aa_adjustment.user
current_adjustment["ref"] = "\ref[aa_adjustment]"
logged_adjustments += list(current_adjustment)
data["aa_adjustments"] = logged_adjustments

var/list/logged_orders = list()
for(var/datum/ares_record/requisition_log/req_order as anything in records_asrs)
if(!istype(req_order))
Expand Down Expand Up @@ -450,12 +450,12 @@ GLOBAL_LIST_INIT(maintenance_categories, list(
if("page_security")
last_menu = current_menu
current_menu = "security"
if("page_flight")
last_menu = current_menu
current_menu = "flight_log"
if("page_requisitions")
last_menu = current_menu
current_menu = "requisitions"
if("page_antiair")
last_menu = current_menu
current_menu = "antiair"
if("page_emergency")
last_menu = current_menu
current_menu = "emergency"
Expand All @@ -479,7 +479,7 @@ GLOBAL_LIST_INIT(maintenance_categories, list(
new_title = "[record.title] at [record.time]"
new_details = record.details
records_announcement -= record
if(ARES_RECORD_SECURITY)
if(ARES_RECORD_SECURITY, ARES_RECORD_ANTIAIR)
new_title = "[record.title] at [record.time]"
new_details = record.details
records_security -= record
Expand Down
12 changes: 10 additions & 2 deletions code/game/machinery/ARES/ARES_records.dm
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,21 @@
/datum/ares_record/security
record_name = ARES_RECORD_SECURITY

/datum/ares_record/antiair
/datum/ares_record/security/antiair
record_name = ARES_RECORD_ANTIAIR

/datum/ares_record/antiair/New(details, user)
/datum/ares_record/security/antiair/New(details)
time = worldtime2text()
src.title = "AntiAir Adjustment"
src.details = details

/datum/ares_record/flight
record_name = ARES_RECORD_FLIGHT

/datum/ares_record/flight/New(details, user)
time = worldtime2text()
src.title = "Flight Log"
src.details = details
src.user = user

/datum/ares_record/flight
Expand Down
8 changes: 4 additions & 4 deletions code/game/machinery/computer/almayer_control.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
/// requesting a distress beacon
COOLDOWN_DECLARE(cooldown_request)
/// requesting evac
COOLDOWN_DECLARE(cooldown_destruct)
COOLDOWN_DECLARE(cooldown_destruct)
/// messaging HC (admins)
COOLDOWN_DECLARE(cooldown_central)
/// making a ship announcement
COOLDOWN_DECLARE(cooldown_message)
COOLDOWN_DECLARE(cooldown_message)

var/list/messagetitle = list()
var/list/messagetext = list()
Expand Down Expand Up @@ -164,11 +164,11 @@
if(!level_selected)
return

set_security_level(seclevel2num(level_selected))
set_security_level(seclevel2num(level_selected), log = ARES_LOG_NONE)
log_game("[key_name(usr)] has changed the security level to [get_security_level()].")
message_admins("[key_name_admin(usr)] has changed the security level to [get_security_level()].")
var/datum/ares_link/link = GLOB.ares_link
link.log_ares_security("Security Level Update", "[usr] has changed the security level to [get_security_level()].")
link.log_ares_security("Manual Security Update", "[usr] has changed the security level to [get_security_level()].")
. = TRUE

if("messageUSCM")
Expand Down
4 changes: 2 additions & 2 deletions code/modules/cm_marines/anti_air.dm
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,12 @@ var/obj/structure/anti_air_cannon/almayer_aa_cannon
almayer_aa_cannon.protecting_section = ""
return
message_admins("[key_name(usr)] has set the AA to [html_encode(almayer_aa_cannon.protecting_section)].")
link.log_ares_antiair(usr, "Set AA to cover [html_encode(almayer_aa_cannon.protecting_section)].")
link.log_ares_antiair("[usr] Set AA to cover [html_encode(almayer_aa_cannon.protecting_section)].")
. = TRUE
if("deactivate")
almayer_aa_cannon.protecting_section = ""
message_admins("[key_name(usr)] has deactivated the AA cannon.")
link.log_ares_antiair(usr, "Deactivated Anti Air systems.")
link.log_ares_antiair("[usr] Deactivated Anti Air systems.")
. = TRUE

add_fingerprint(usr)
Expand Down
14 changes: 7 additions & 7 deletions code/modules/security_levels/security_levels.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//config.alert_desc_blue_downto


/proc/set_security_level(level, no_sound=0, announce=1)
/proc/set_security_level(level, no_sound = FALSE, announce = TRUE, log = ARES_LOG_SECURITY)
if(level != security_level)
SEND_GLOBAL_SIGNAL(COMSIG_GLOB_SECURITY_LEVEL_CHANGED, level)

Expand All @@ -16,32 +16,32 @@
switch(level)
if(SEC_LEVEL_GREEN)
if(announce)
ai_announcement("Attention: Security level lowered to GREEN - all clear.", no_sound ? null : 'sound/AI/code_green.ogg', ARES_LOG_SECURITY)
ai_announcement("Attention: Security level lowered to GREEN - all clear.", no_sound ? null : 'sound/AI/code_green.ogg', log)
security_level = SEC_LEVEL_GREEN

if(SEC_LEVEL_BLUE)
if(security_level < SEC_LEVEL_BLUE)
if(announce)
ai_announcement("Attention: Security level elevated to BLUE - potentially hostile activity on board.", no_sound ? null : 'sound/AI/code_blue_elevated.ogg', ARES_LOG_SECURITY)
ai_announcement("Attention: Security level elevated to BLUE - potentially hostile activity on board.", no_sound ? null : 'sound/AI/code_blue_elevated.ogg', log)
else
if(announce)
ai_announcement("Attention: Security level lowered to BLUE - potentially hostile activity on board.", no_sound ? null : 'sound/AI/code_blue_lowered.ogg', ARES_LOG_SECURITY)
ai_announcement("Attention: Security level lowered to BLUE - potentially hostile activity on board.", no_sound ? null : 'sound/AI/code_blue_lowered.ogg', log)
security_level = SEC_LEVEL_BLUE

if(SEC_LEVEL_RED)
if(security_level < SEC_LEVEL_RED)
if(announce)
ai_announcement("Attention: Security level elevated to RED - there is an immediate threat to the ship.", no_sound ? null : 'sound/AI/code_red_elevated.ogg', ARES_LOG_SECURITY)
ai_announcement("Attention: Security level elevated to RED - there is an immediate threat to the ship.", no_sound ? null : 'sound/AI/code_red_elevated.ogg', log)
else
if(announce)
ai_announcement("Attention: Security level lowered to RED - there is an immediate threat to the ship.", no_sound ? null : 'sound/AI/code_red_lowered.ogg', ARES_LOG_SECURITY)
ai_announcement("Attention: Security level lowered to RED - there is an immediate threat to the ship.", no_sound ? null : 'sound/AI/code_red_lowered.ogg', log)
security_level = SEC_LEVEL_RED

if(SEC_LEVEL_DELTA)
if(announce)
var/name = "SELF-DESTRUCT SYSTEMS ACTIVE"
var/input = "DANGER, THE EMERGENCY DESTRUCT SYSTEM IS NOW ACTIVATED. PROCEED TO THE SELF-DESTRUCT CHAMBER FOR CONTROL ROD INSERTION."
marine_announcement(input, name, 'sound/AI/selfdestruct_short.ogg', logging = ARES_LOG_SECURITY)
marine_announcement(input, name, 'sound/AI/selfdestruct_short.ogg', logging = log)
security_level = SEC_LEVEL_DELTA
EvacuationAuthority.enable_self_destruct()

Expand Down
9 changes: 9 additions & 0 deletions code/modules/shuttle/computers/dropship_computer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,8 @@
GLOB.alt_ctrl_disabled = TRUE

marine_announcement("Unscheduled dropship departure detected from operational area. Hijack likely. Shutting down autopilot.", "Dropship Alert", 'sound/AI/hijack.ogg', logging = ARES_LOG_SECURITY)
var/datum/ares_link/link = GLOB.ares_link
link.log_ares_flight("Unknown", "Unscheduled dropship departure detected from operational area. Hijack likely. Shutting down autopilot.")

var/mob/living/carbon/xenomorph/xeno = user
var/hivenumber = XENO_HIVE_NORMAL
Expand Down Expand Up @@ -346,6 +348,7 @@
to_chat(user, SPAN_WARNING("The dropship isn't responding to controls."))
return

var/datum/ares_link/link = GLOB.ares_link
switch(action)
if("move")
if(shuttle.mode != SHUTTLE_IDLE && (shuttle.mode != SHUTTLE_CALL && !shuttle.destination))
Expand All @@ -362,6 +365,7 @@
update_equipment(is_optimised)
if(is_set_flyby)
to_chat(user, SPAN_NOTICE("You begin the launch sequence for a flyby."))
link.log_ares_flight(user, "Launched Dropship [shuttle.name] on a flyby.")
var/log = "[key_name(user)] launched the dropship [src.shuttleId] on flyby."
msg_admin_niche(log)
log_interact(user, msg = "[log]")
Expand Down Expand Up @@ -390,6 +394,7 @@
return TRUE
SSshuttle.moveShuttle(shuttle.id, dock.id, TRUE)
to_chat(user, SPAN_NOTICE("You begin the launch sequence to [dock]."))
link.log_ares_flight(user, "Launched Dropship [shuttle.name] on a flight to [dock].")
var/log = "[key_name(user)] launched the dropship [src.shuttleId] on transport."
msg_admin_niche(log)
log_interact(user, msg = "[log]")
Expand All @@ -409,11 +414,13 @@
to_chat(user, SPAN_WARNING("Door controls have been overridden. Please call technical support."))
if("set-ferry")
is_set_flyby = FALSE
link.log_ares_flight(user, "Set Dropship [shuttle.name] to transport runs.")
var/log = "[key_name(user)] set the dropship [src.shuttleId] into transport"
msg_admin_niche(log)
log_interact(user, msg = "[log]")
if("set-flyby")
is_set_flyby = TRUE
link.log_ares_flight(user, "Set Dropship [shuttle.name] to flyby runs.")
var/log = "[key_name(user)] set the dropship [src.shuttleId] into flyby."
msg_admin_niche(log)
log_interact(user, msg = "[log]")
Expand All @@ -436,6 +443,7 @@
shuttle.automated_lz_id = ground_lz
shuttle.automated_delay = delay
playsound(loc, get_sfx("terminal_button"), KEYBOARD_SOUND_VOLUME, 1)
link.log_ares_flight(user, "Enabled autopilot for Dropship [shuttle.name].")
var/log = "[key_name(user)] has enabled auto pilot on '[shuttle.name]'"
message_admins(log)
log_interact(user, msg = "[log]")
Expand All @@ -452,6 +460,7 @@
shuttle.automated_lz_id = null
shuttle.automated_delay = null
playsound(loc, get_sfx("terminal_button"), KEYBOARD_SOUND_VOLUME, 1)
link.log_ares_flight(user, "Disabled autopilot for Dropship [shuttle.name].")
var/log = "[key_name(user)] has disabled auto pilot on '[shuttle.name]'"
message_admins(log)
log_interact(user, msg = "[log]")
Expand Down
2 changes: 2 additions & 0 deletions code/modules/shuttles/marine_ferry.dm
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@
automated_launch = FALSE
automated_launch_timer = TIMER_ID_NULL
ai_silent_announcement("Dropship '[name]' departing.")
var/datum/ares_link/link = GLOB.ares_link
link.log_ares_flight("Automated", "Dropship [name] launched on an automatic flight.")


/*
Expand Down
2 changes: 2 additions & 0 deletions code/modules/shuttles/shuttle_console.dm
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,8 @@ GLOBAL_LIST_EMPTY(shuttle_controls)

marine_announcement("Unscheduled dropship departure detected from operational area. Hijack likely. Shutting down autopilot.", "Dropship Alert", 'sound/AI/hijack.ogg', logging = ARES_LOG_SECURITY)
shuttle.alerts_allowed--
var/datum/ares_link/link = GLOB.ares_link
link.log_ares_flight("Unknown", "Unscheduled dropship departure detected from operational area. Hijack likely. Shutting down autopilot.")

to_chat(Q, SPAN_DANGER("A loud alarm erupts from [src]! The fleshy hosts must know that you can access it!"))
xeno_message(SPAN_XENOANNOUNCE("The Queen has commanded the metal bird to depart for the metal hive in the sky! Rejoice!"),3,Q.hivenumber)
Expand Down
Loading

0 comments on commit 097b3d6

Please sign in to comment.