From b64cb2a1c6e8ec555eab340808560bfbdd45b767 Mon Sep 17 00:00:00 2001 From: Batrachophreno Date: Fri, 30 Jan 2026 14:27:26 -0500 Subject: [PATCH] Fixes Camera Monitoring Console UI restricted network access (#21758) Fixes https://github.com/Aurorastation/Aurora.3/issues/21757. Changes made in https://github.com/Aurorastation/Aurora.3/pull/21734 allowed for camera monitoring consoles to launch their own headless versions of the Camera Monitoring app, but the Horizon's mapped consoles, unlike Runtime's, have some dedicated network restrictions. This PR adds a var to the camera_monitor program that can hold the src of the UI, which in the case of camera monitoring consoles, will restrict the available networks displayed to those set on the console obj itself. changes: - bugfix: "Dedicated camera monitoring console UIs now display only that console's predefined networks, not all networks to which the user has access (as is the case with regular use of the camera monitoring app.)" - bugfix: "Removes an unnecessary process() func from camera monitoring consoles." --- code/game/machinery/computer/camera.dm | 14 +++-- .../file_system/programs/security/camera.dm | 15 ++++- html/changelogs/Bat-CameraConsoles.yml | 59 +++++++++++++++++++ 3 files changed, 81 insertions(+), 7 deletions(-) create mode 100644 html/changelogs/Bat-CameraConsoles.yml diff --git a/code/game/machinery/computer/camera.dm b/code/game/machinery/computer/camera.dm index b401d613658..fa78e6d0557 100644 --- a/code/game/machinery/computer/camera.dm +++ b/code/game/machinery/computer/camera.dm @@ -22,7 +22,16 @@ if(console_networks.len) current_network = console_networks[1] + // Create a new camera_monitor program that can run independently of a modular computer. camera_monitor_program = new("Compless") + // Make sure that camera_monitor knows its been generated from a dedicated console; this will define its network access. + camera_monitor_program.monitored_networks = console_networks + +/obj/machinery/computer/security/Destroy() + if(camera_monitor_program) + camera_monitor_program = null + + . = ..() /obj/machinery/computer/security/attack_ai(var/mob/user as mob) if(!ai_can_interact(user)) @@ -178,11 +187,6 @@ if(can_access_camera(jump_to)) switch_to_camera(user,jump_to) -/obj/machinery/computer/security/process() - if(cache_id != GLOB.camera_repository.camera_cache_id) - cache_id = GLOB.camera_repository.camera_cache_id - SSnanoui.update_uis(src) - /obj/machinery/computer/security/proc/can_access_camera(var/obj/machinery/camera/C) var/list/shared_networks = src.console_networks & C.network if(shared_networks.len) diff --git a/code/modules/modular_computers/file_system/programs/security/camera.dm b/code/modules/modular_computers/file_system/programs/security/camera.dm index f2d99ebb3ae..32bb7422785 100644 --- a/code/modules/modular_computers/file_system/programs/security/camera.dm +++ b/code/modules/modular_computers/file_system/programs/security/camera.dm @@ -44,6 +44,8 @@ tgui_id = "CameraMonitoring" var/obj/machinery/camera/current_camera var/current_network + /// Used for camera monitor consoles from which this interface can be launched. If it exists, only provide that console's "console_networks" networks. + var/list/monitored_networks = list() /datum/computer_file/program/camera_monitor/ui_data(mob/user) var/list/data = initial_data() @@ -52,7 +54,17 @@ data["current_network"] = current_network var/list/all_networks = list() - for(var/network in SSatlas.current_map.station_networks) + var/list/available_networks = list() + + // If this UI was generated from a camera monitoring console, then only that console's networks will be available... + if(monitored_networks && (length(monitored_networks) >= 1)) + available_networks = monitored_networks + + // ...otherwise (if it was launched from a standard modular computer), get all networks to which the user has access. + else + available_networks = SSatlas.current_map.station_networks + + for(var/network in available_networks) all_networks += list( list( "tag" = network, @@ -205,7 +217,6 @@ return FALSE return TRUE - // ERT Variant of the program /datum/computer_file/program/camera_monitor/ert filename = "ntcammon" diff --git a/html/changelogs/Bat-CameraConsoles.yml b/html/changelogs/Bat-CameraConsoles.yml new file mode 100644 index 00000000000..f4ab53268dc --- /dev/null +++ b/html/changelogs/Bat-CameraConsoles.yml @@ -0,0 +1,59 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# - (fixes bugs) +# wip +# - (work in progress) +# qol +# - (quality of life) +# soundadd +# - (adds a sound) +# sounddel +# - (removes a sound) +# rscadd +# - (adds a feature) +# rscdel +# - (removes a feature) +# imageadd +# - (adds an image or sprite) +# imagedel +# - (removes an image or sprite) +# spellcheck +# - (fixes spelling or grammar) +# experiment +# - (experimental change) +# balance +# - (balance changes) +# code_imp +# - (misc internal code change) +# refactor +# - (refactors code) +# config +# - (makes a change to the config files) +# admin +# - (makes changes to administrator tools) +# server +# - (miscellaneous changes to server) +################################# + +# Your name. +author: Batrachophrenoboocosmomachia + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, this gets changed to [] after reading. Just remove the brackets when you add new shit. +# Please surround your changes in double quotes ("). It works without them, but if you use certain characters it screws up compiling. The quotes will not show up in the changelog. +changes: + - bugfix: "Dedicated camera monitoring console UIs now display only that console's predefined networks, not all networks to which the user has access (as is the case with regular use of the camera monitoring app.)" + - bugfix: "Removes an unnecessary process() func from camera monitoring consoles."