From 2d5cc1d9bea9c3971c4991b77e645aa7125fc1df Mon Sep 17 00:00:00 2001 From: forest2001 Date: Wed, 22 Nov 2023 16:54:05 +0000 Subject: [PATCH 01/11] tech logging and core sec --- code/__DEFINES/ARES.dm | 1 + code/game/machinery/ARES/ARES_interface.dm | 16 +++ code/game/machinery/ARES/ARES_procs.dm | 10 ++ code/game/machinery/ARES/ARES_records.dm | 12 ++ code/game/machinery/camera/presets.dm | 2 +- code/modules/cm_tech/tech.dm | 12 +- .../cm_tech/techs/abstract/transitory.dm | 7 +- .../cm_tech/techs/marine/tier1/points.dm | 1 - .../techs/marine/tier2/orbital_ammo.dm | 2 - .../cm_tech/techs/marine/tier3/cryo_spec.dm | 1 - .../cm_tech/techs/marine/tier3/cryorine.dm | 1 - code/modules/cm_tech/trees/marine.dm | 2 +- maps/map_files/USS_Almayer/USS_Almayer.dmm | 76 +++++++---- .../packages/tgui/interfaces/AresInterface.js | 127 +++++++++++++++++- 14 files changed, 230 insertions(+), 40 deletions(-) diff --git a/code/__DEFINES/ARES.dm b/code/__DEFINES/ARES.dm index a1b82af25821..9cd1384f5310 100644 --- a/code/__DEFINES/ARES.dm +++ b/code/__DEFINES/ARES.dm @@ -27,6 +27,7 @@ #define ARES_RECORD_MAINTENANCE "Maintenance Ticket" #define ARES_RECORD_ACCESS "Access Ticket" #define ARES_RECORD_FLIGHT "Flight Record" +#define ARES_RECORD_TECH "Tech Control Record" /// Not by ARES logged through marine_announcement() #define ARES_LOG_NONE 0 diff --git a/code/game/machinery/ARES/ARES_interface.dm b/code/game/machinery/ARES/ARES_interface.dm index 0e45d5ee171b..857294c5fbb7 100644 --- a/code/game/machinery/ARES/ARES_interface.dm +++ b/code/game/machinery/ARES/ARES_interface.dm @@ -183,6 +183,19 @@ logged_orders += list(current_order) data["records_requisition"] = logged_orders + var/list/logged_techs = list() + for(var/datum/ares_record/tech/tech_unlock as anything in datacore.records_tech) + if(!istype(tech_unlock)) + continue + var/list/current_tech = list() + current_tech["time"] = tech_unlock.time + current_tech["details"] = tech_unlock.details + current_tech["user"] = tech_unlock.user + current_tech["tier_changer"] = tech_unlock.is_tier + current_tech["ref"] = "\ref[tech_unlock]" + logged_techs += list(current_tech) + data["records_tech"] = logged_techs + var/list/logged_convos = list() var/list/active_convo = list() var/active_ref @@ -315,6 +328,9 @@ if("page_deleted_1to1") last_menu = current_menu current_menu = "deleted_talks" + if("page_tech") + last_menu = current_menu + current_menu = "tech_log" // -- Delete Button -- // if("delete_record") diff --git a/code/game/machinery/ARES/ARES_procs.dm b/code/game/machinery/ARES/ARES_procs.dm index 831f76e48930..02e591c3b2ea 100644 --- a/code/game/machinery/ARES/ARES_procs.dm +++ b/code/game/machinery/ARES/ARES_procs.dm @@ -58,6 +58,8 @@ GLOBAL_LIST_INIT(maintenance_categories, list( var/list/records_security = list() /// Holds all (/datum/ares_record/flight)s var/list/records_flight = list() + /// Holds all (/datum/ares_record/tech)s + var/list/records_tech = list() /// Is nuke request usable or not? var/nuke_available = TRUE @@ -155,6 +157,14 @@ GLOBAL_LIST_INIT(maintenance_categories, list( return FALSE var/datum/ares_datacore/datacore = GLOB.ares_datacore datacore.records_flight.Add(new /datum/ares_record/flight(details, user_name)) + +/proc/log_ares_tech(user_name, tier_tech = FALSE, announce_name, announce_message, cost) + if(!ares_can_log()) + return FALSE + var/new_details = "[announce_name] - [announce_message] - [cost] INT" + var/datum/ares_datacore/datacore = GLOB.ares_datacore + datacore.records_tech.Add(new /datum/ares_record/tech(announce_name, new_details, user_name, tier_tech)) + // ------ End ARES Logging Procs ------ // // ------ ARES Interface Procs ------ // diff --git a/code/game/machinery/ARES/ARES_records.dm b/code/game/machinery/ARES/ARES_records.dm index f89b2c120e05..2104942ffa9e 100644 --- a/code/game/machinery/ARES/ARES_records.dm +++ b/code/game/machinery/ARES/ARES_records.dm @@ -58,6 +58,18 @@ src.details = details src.user = user +/datum/ares_record/tech + record_name = ARES_RECORD_TECH + /// If this tech unlock changed the tier. + var/is_tier = FALSE + +/datum/ares_record/tech/New(title, details, user, tier_tech) + time = worldtime2text() + src.title = title + src.details = details + src.user = user + is_tier = tier_tech + /datum/ares_record/deletion record_name = ARES_RECORD_DELETED diff --git a/code/game/machinery/camera/presets.dm b/code/game/machinery/camera/presets.dm index e5ab520cbee8..17215fa5ae86 100644 --- a/code/game/machinery/camera/presets.dm +++ b/code/game/machinery/camera/presets.dm @@ -111,7 +111,7 @@ /obj/structure/machinery/camera/autoname/almayer/containment/ares name = "ares core camera" - network = list(CAMERA_NET_ALMAYER, CAMERA_NET_ARES) + network = list(CAMERA_NET_ARES) //used by the landing camera dropship equipment. Do not place them right under where the dropship lands. //Should place them near each corner of your LZs. diff --git a/code/modules/cm_tech/tech.dm b/code/modules/cm_tech/tech.dm index dea505f3237a..03a790d7d4b3 100644 --- a/code/modules/cm_tech/tech.dm +++ b/code/modules/cm_tech/tech.dm @@ -21,7 +21,7 @@ var/background_icon = "background" var/background_icon_locked = "marine" - var/announce_name + var/announce_name = "ALMAYER SPECIAL ASSETS AUTHORIZED" var/announce_message /datum/tech/proc/can_unlock(mob/M) @@ -58,6 +58,9 @@ return TRUE +/datum/tech/proc/is_tier_tech() + return FALSE + /** Called when a tech is unlocked. Usually, benefits can be applied here * however, the purchase can still be cancelled by returning FALSE * @@ -69,11 +72,16 @@ unlocked = TRUE to_chat(user, SPAN_HELPFUL("You have purchased the '[name]' tech node.")) log_admin("[key_name_admin(user)] has bought '[name]' via tech points.") + if(!is_tier_tech()) + var/log_details = announce_message + if(!log_details) + log_details = name + log_ares_tech(user.real_name, is_tier_tech(), announce_name, log_details, required_points) holder.spend_points(required_points) update_icon(node) if(!(tech_flags & TECH_FLAG_NO_ANNOUNCE) && announce_message && announce_name) - marine_announcement(announce_message, announce_name, 'sound/misc/notice2.ogg') + marine_announcement(announce_message, announce_name, 'sound/misc/notice2.ogg', logging = ARES_LOG_NONE) return TRUE diff --git a/code/modules/cm_tech/techs/abstract/transitory.dm b/code/modules/cm_tech/techs/abstract/transitory.dm index 7798b6053d0e..59280d152c68 100644 --- a/code/modules/cm_tech/techs/abstract/transitory.dm +++ b/code/modules/cm_tech/techs/abstract/transitory.dm @@ -22,7 +22,10 @@ return TRUE -/datum/tech/transitory/on_unlock() +/datum/tech/transitory/is_tier_tech() + return TRUE + +/datum/tech/transitory/on_unlock(mob/user) . = ..() if(!next) return @@ -31,6 +34,8 @@ if(next_tier) holder.tier = next_tier holder.on_tier_change(previous_tier) + if(flags & TREE_FLAG_MARINE) + log_ares_tech(user.real_name, is_tier_tech(), "ALMAYER DEFCON LEVEL INCREASED", "THREAT ASSESSMENT LEVEL INCREASED TO LEVEL [next_tier.tier].\n\nLEVEL [next_tier.tier] assets have been authorised to handle the situation.", required_points) /datum/tech/transitory/get_tier_overlay() if(!next) diff --git a/code/modules/cm_tech/techs/marine/tier1/points.dm b/code/modules/cm_tech/techs/marine/tier1/points.dm index 739b82fa1504..decece73c543 100644 --- a/code/modules/cm_tech/techs/marine/tier1/points.dm +++ b/code/modules/cm_tech/techs/marine/tier1/points.dm @@ -31,7 +31,6 @@ icon_state = "budget_ds" desc = "Distributes resources to the dropship fabricator." - announce_name = "ALMAYER SPECIAL ASSETS AUTHORIZED" announce_message = "Additional dropship part fabricator points have been authorised for this operation." required_points = 12 diff --git a/code/modules/cm_tech/techs/marine/tier2/orbital_ammo.dm b/code/modules/cm_tech/techs/marine/tier2/orbital_ammo.dm index 2ab2c2541e68..dc57356de2e7 100644 --- a/code/modules/cm_tech/techs/marine/tier2/orbital_ammo.dm +++ b/code/modules/cm_tech/techs/marine/tier2/orbital_ammo.dm @@ -7,8 +7,6 @@ tier = /datum/tier/two - announce_name = "ALMAYER SPECIAL ASSETS AUTHORIZED" - var/type_to_give /datum/tech/repeatable/ob/on_unlock() diff --git a/code/modules/cm_tech/techs/marine/tier3/cryo_spec.dm b/code/modules/cm_tech/techs/marine/tier3/cryo_spec.dm index 16f0f26576a3..93f893f24dba 100644 --- a/code/modules/cm_tech/techs/marine/tier3/cryo_spec.dm +++ b/code/modules/cm_tech/techs/marine/tier3/cryo_spec.dm @@ -3,7 +3,6 @@ desc = "Wakes up an additional specialist to fight against any threats." icon_state = "overshield" - announce_name = "ALMAYER SPECIAL ASSETS AUTHORIZED" announce_message = "An additional specialist is being taken out of cryo." required_points = 8 diff --git a/code/modules/cm_tech/techs/marine/tier3/cryorine.dm b/code/modules/cm_tech/techs/marine/tier3/cryorine.dm index 49b4eea8f525..32f0e9f800b7 100644 --- a/code/modules/cm_tech/techs/marine/tier3/cryorine.dm +++ b/code/modules/cm_tech/techs/marine/tier3/cryorine.dm @@ -4,7 +4,6 @@ desc = "Wakes up additional troops to fight against any threats." icon_state = "cryotroops" - announce_name = "ALMAYER SPECIAL ASSETS AUTHORIZED" announce_message = "Additional troops are being taken out of cryo." required_points = 6 diff --git a/code/modules/cm_tech/trees/marine.dm b/code/modules/cm_tech/trees/marine.dm index 8a805647e060..0a2467e3f101 100644 --- a/code/modules/cm_tech/trees/marine.dm +++ b/code/modules/cm_tech/trees/marine.dm @@ -174,4 +174,4 @@ GLOBAL_LIST_EMPTY(tech_controls_marine) return //No need to announce tier updates for tier 1 var/name = "ALMAYER DEFCON LEVEL INCREASED" var/input = "THREAT ASSESSMENT LEVEL INCREASED TO LEVEL [tier.tier].\n\nLEVEL [tier.tier] assets have been authorised to handle the situation." - marine_announcement(input, name, 'sound/AI/commandreport.ogg') + marine_announcement(input, name, 'sound/AI/commandreport.ogg', logging = ARES_LOG_NONE) diff --git a/maps/map_files/USS_Almayer/USS_Almayer.dmm b/maps/map_files/USS_Almayer/USS_Almayer.dmm index f3074bd4d7d0..cda24f75eb45 100644 --- a/maps/map_files/USS_Almayer/USS_Almayer.dmm +++ b/maps/map_files/USS_Almayer/USS_Almayer.dmm @@ -6732,10 +6732,10 @@ }, /area/almayer/command/airoom) "avM" = ( -/obj/structure/machinery/computer/cameras/almayer/ares{ +/obj/structure/machinery/computer/cameras/almayer{ dir = 8; pixel_x = 17; - pixel_y = 6 + pixel_y = 8 }, /obj/structure/surface/table/reinforced/almayer_B{ climbable = 0; @@ -6747,6 +6747,11 @@ pixel_y = 6 }, /obj/item/tool/pen, +/obj/structure/machinery/computer/cameras/almayer/ares{ + dir = 8; + pixel_x = 17; + pixel_y = -6 + }, /turf/open/floor/almayer/no_build{ icon_state = "ai_floors" }, @@ -7494,7 +7499,13 @@ /obj/item/storage/belt/medical/full, /obj/structure/machinery/computer/working_joe{ dir = 8; - pixel_x = 17 + pixel_x = 17; + pixel_y = 8 + }, +/obj/structure/machinery/computer/cameras/almayer/ares{ + dir = 8; + pixel_x = 17; + pixel_y = -6 }, /turf/open/floor/almayer{ icon_state = "plate" @@ -41726,9 +41737,6 @@ "ikM" = ( /obj/structure/surface/table/almayer, /obj/structure/machinery/computer/cameras/almayer_network, -/obj/structure/machinery/computer/secure_data{ - pixel_x = 17 - }, /obj/structure/machinery/computer/card{ pixel_x = -16 }, @@ -41739,6 +41747,9 @@ pixel_x = 8; pixel_y = 32 }, +/obj/structure/machinery/computer/secure_data{ + pixel_x = 17 + }, /turf/open/floor/almayer{ icon_state = "plate" }, @@ -50041,6 +50052,9 @@ pixel_y = 3; layer = 3.05 }, +/obj/structure/machinery/computer/cameras/almayer/ares{ + pixel_y = 16 + }, /turf/open/floor/wood/ship, /area/almayer/living/commandbunks) "lDJ" = ( @@ -58779,13 +58793,11 @@ /turf/open/floor/plating/plating_catwalk, /area/almayer/hull/upper_hull/u_f_s) "pmV" = ( -/obj/structure/prop/server_equipment/yutani_server/broken{ - density = 0; - desc = "A powerful server tower housing various AI functions."; - name = "server tower"; - pixel_y = 16 - }, /obj/structure/pipes/standard/simple/hidden/supply/no_boom, +/obj/structure/machinery/computer/tech_control{ + pixel_y = 16; + density = 0 + }, /turf/open/floor/almayer/no_build{ icon_state = "ai_floors" }, @@ -63686,8 +63698,14 @@ /turf/open/floor/plating/plating_catwalk, /area/almayer/hull/lower_hull/l_m_s) "rna" = ( -/turf/closed/wall/almayer/white, -/area/almayer/command/airoom) +/obj/structure/surface/table/almayer, +/obj/structure/machinery/computer/cameras/almayer/ares{ + pixel_x = 1 + }, +/turf/open/floor/almayer{ + icon_state = "plate" + }, +/area/almayer/shipboard/brig/main_office) "rne" = ( /turf/open/floor/carpet, /area/almayer/command/corporateliason) @@ -92069,7 +92087,7 @@ ahE hUg wcn vBm -gqW +rna buX mLJ eRL @@ -138018,7 +138036,7 @@ fEN cqm gTH qit -rna +ebN qQS gwn pfT @@ -138622,12 +138640,12 @@ daz daz kfU daz -rna -rna +ebN +ebN lnS uVv yit -rna +ebN cxc kBy kBy @@ -138826,13 +138844,13 @@ daz daz daz sGZ -rna -rna -roH ebN ebN +roH ebN daz +daz +daz wnh wnh daz @@ -139638,13 +139656,13 @@ daz daz daz tHu -rna -rna -gXs ebN ebN +gXs ebN daz +daz +daz wnh wnh daz @@ -139840,12 +139858,12 @@ daz daz sTV daz -rna -rna +ebN +ebN gbg uVv erN -rna +ebN qQS kBy kBy @@ -140454,7 +140472,7 @@ rCi gba mUz our -rna +ebN cxc kBy kBy diff --git a/tgui/packages/tgui/interfaces/AresInterface.js b/tgui/packages/tgui/interfaces/AresInterface.js index aae115d150b0..c2b9615490d7 100644 --- a/tgui/packages/tgui/interfaces/AresInterface.js +++ b/tgui/packages/tgui/interfaces/AresInterface.js @@ -18,6 +18,7 @@ const PAGES = { 'security': () => Security, 'requisitions': () => Requisitions, 'emergency': () => Emergency, + 'tech_log': () => TechLogs, }; export const AresInterface = (props, context) => { @@ -252,7 +253,7 @@ const MainMenu = (props, context) => {