mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-26 14:31:59 +01:00
NTNet Extensibility (#22908)
Fixes https://github.com/Aurorastation/Aurora.3/issues/21944 Spiritual successor of https://github.com/Aurorastation/Aurora.3/pull/22352 Cherrypicked changes from the C3 Crew Management branch, this PR contains all NTNet extensibility features, including Field Relay construction, off-site camera usage (contingent on standing up remote hardware and being out of jamming), etc. This also fixes a handful of outstanding telecomms and view/mobeye-related bugs adjacent to where I was working. changes: - rscadd: "Adds NTNet extensibility, requires new machinery constructed on away-site z-levels." - rscadd: "Breaks NTNet Relay machinery into Quantum Relay ('core' obj on Horizon) and Field Relay (deployable off-site constructions)." - qol: "Embedded cameras (basically every video camera EXCEPT those which are installed on walls) can now be viewed from NTNet-connected z-level, not just connected ones." - rscadd: "Adds several public camera monitor consoles to the Horizon (near where public sensor grid feed consoles already exist)." - rscadd: "Adds some spare camera console boards to Horizon technical storage." - qol: "Adds action button for 'cancel-camera-view' verb while viewing cameras or looking up/down z-level." - bugfix: "Fixes Jockey comms (frequency was missing from ANTAG_FREQS)." - bugfix: "Fixes look-up/look-down actions intermittently failing without first using cancel-camera-view."
This commit is contained in:
@@ -26,7 +26,7 @@
|
||||
data["isAI"] = isAI(user)
|
||||
data["crewmembers"] = list()
|
||||
if(SSradio.telecomms_ping(computer))
|
||||
for(var/z_level in SSatlas.current_map.map_levels)
|
||||
for(var/z_level in GLOB.ntnet_global.get_reachable_z_levels(computer.network_card))
|
||||
data["crewmembers"] += GLOB.crew_repository.health_data(z_level)
|
||||
|
||||
data["security_level"] = seclevel2num(get_security_level())
|
||||
|
||||
@@ -21,6 +21,16 @@
|
||||
|
||||
data["ntnetstatus"] = GLOB.ntnet_global.check_function()
|
||||
data["ntnetrelays"] = GLOB.ntnet_global.relays.len
|
||||
data["ntnetcores"] = 0
|
||||
data["ntnetfieldrelays"] = 0
|
||||
data["ntnetroutedrelays"] = 0
|
||||
for(var/obj/structure/machinery/ntnet_relay/R in GLOB.ntnet_global.relays)
|
||||
if(R.core_service)
|
||||
data["ntnetcores"]++
|
||||
else
|
||||
data["ntnetfieldrelays"]++
|
||||
if(R.can_route_to_core())
|
||||
data["ntnetroutedrelays"]++
|
||||
data["idsstatus"] = GLOB.ntnet_global.intrusion_detection_enabled
|
||||
data["idsalarm"] = GLOB.ntnet_global.intrusion_detection_alarm
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
return
|
||||
|
||||
switch(network)
|
||||
if(NETWORK_THUNDER, NETWORK_NEWS)
|
||||
if(NETWORK_THUNDER, NETWORK_NEWS, NETWORK_EXPEDITION)
|
||||
return FALSE
|
||||
if(NETWORK_REACTOR,NETWORK_ENGINEERING,NETWORK_ENGINEERING_OUTPOST,NETWORK_ALARM_ATMOS,NETWORK_ALARM_FIRE,NETWORK_ALARM_POWER)
|
||||
return ACCESS_ENGINE
|
||||
@@ -46,6 +46,15 @@
|
||||
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()
|
||||
/// Used by non-modular camera consoles that run this program - abstracts as modular comp w/ network card.
|
||||
var/atom/ntnet_endpoint
|
||||
var/ntnet_endpoint_ethernet = FALSE
|
||||
var/ntnet_endpoint_long_range = FALSE
|
||||
|
||||
/datum/computer_file/program/camera_monitor/ui_host()
|
||||
if(ntnet_endpoint)
|
||||
return ntnet_endpoint
|
||||
return ..()
|
||||
|
||||
/datum/computer_file/program/camera_monitor/ui_data(mob/user)
|
||||
var/list/data = initial_data()
|
||||
@@ -108,6 +117,7 @@
|
||||
|
||||
return 0
|
||||
|
||||
/// If no network_access is passed, or if 0 is returned, we treat this as no camera access required. Allowed it.
|
||||
/datum/computer_file/program/camera_monitor/proc/can_access_network(var/mob/user, var/network_access)
|
||||
// No access passed, or 0 which is considered no access requirement. Allow it.
|
||||
if(!network_access)
|
||||
@@ -115,6 +125,19 @@
|
||||
|
||||
return (check_network_access(user, ACCESS_SECURITY) && GLOB.security_level >= SEC_LEVEL_BLUE) || check_network_access(user, network_access)
|
||||
|
||||
/datum/computer_file/program/camera_monitor/proc/can_reach_camera(var/obj/structure/machinery/camera/C)
|
||||
if(!C?.can_use())
|
||||
return FALSE
|
||||
|
||||
var/turf/camera_turf = get_turf(C)
|
||||
if(!camera_turf || !GLOB.ntnet_global)
|
||||
return FALSE
|
||||
|
||||
if(computer?.network_card)
|
||||
return (camera_turf.z in GLOB.ntnet_global.get_reachable_z_levels(computer.network_card, requires_ntnet_feature))
|
||||
|
||||
return (camera_turf.z in GLOB.ntnet_global.get_reachable_z_levels_for_endpoint(ntnet_endpoint, requires_ntnet_feature, ntnet_endpoint_ethernet, ntnet_endpoint_long_range))
|
||||
|
||||
/datum/computer_file/program/camera_monitor/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state)
|
||||
. = ..()
|
||||
if(.)
|
||||
@@ -152,6 +175,10 @@
|
||||
usr.reset_view(current_camera)
|
||||
return TRUE
|
||||
|
||||
/datum/computer_file/program/camera_monitor/kill_program(forced)
|
||||
reset_current()
|
||||
return ..()
|
||||
|
||||
/datum/computer_file/program/camera_monitor/proc/switch_to_camera(var/mob/user, var/obj/structure/machinery/camera/C)
|
||||
//don't need to check if the camera works for AI because the AI jumps to the camera location and doesn't actually look through cameras.
|
||||
if(isAI(user))
|
||||
@@ -164,7 +191,7 @@
|
||||
A.client.eye = A.eyeobj
|
||||
return TRUE
|
||||
|
||||
if(!is_contact_area(get_area(C)))
|
||||
if(!can_reach_camera(C))
|
||||
to_chat(user, SPAN_NOTICE("This camera is too far away to connect to!"))
|
||||
return FALSE
|
||||
|
||||
@@ -186,6 +213,10 @@
|
||||
if(!current_camera)
|
||||
return 0
|
||||
|
||||
if(!can_reach_camera(current_camera))
|
||||
reset_current()
|
||||
return -1
|
||||
|
||||
var/viewflag = current_camera.check_eye(user)
|
||||
if(viewflag < 0)
|
||||
reset_current()
|
||||
@@ -194,6 +225,8 @@
|
||||
/datum/computer_file/program/camera_monitor/grants_equipment_vision(mob/user)
|
||||
if(user.stat || user.blinded || !current_camera)
|
||||
return FALSE
|
||||
if(!can_reach_camera(current_camera))
|
||||
return FALSE
|
||||
return current_camera.grants_equipment_vision(user)
|
||||
|
||||
/datum/computer_file/program/camera_monitor/proc/set_current(var/obj/structure/machinery/camera/C)
|
||||
@@ -233,8 +266,8 @@
|
||||
|
||||
/datum/computer_file/program/camera_monitor/news
|
||||
filename = "idcammon"
|
||||
filedesc = "Journalism Camera Monitoring"
|
||||
extended_desc = "This program allows remote access to station's camera system. Some camera networks may have additional access requirements. This version has has a connection to news networks."
|
||||
filedesc = "Public Camera Monitoring"
|
||||
extended_desc = "This program allows remote access to station's camera system. Some camera networks may have additional access requirements. This version has has a connection to news and expeditionary networks."
|
||||
size = 2
|
||||
required_access_download = null
|
||||
usage_flags = PROGRAM_ALL
|
||||
@@ -242,5 +275,5 @@
|
||||
/datum/computer_file/program/camera_monitor/news/modify_networks_list(var/list/networks)
|
||||
networks = list()
|
||||
networks.Add(list(list("tag" = NETWORK_NEWS, "has_access" = 1)))
|
||||
networks.Add(list(list("tag" = NETWORK_THUNDER, "has_access" = 1)))
|
||||
networks.Add(list(list("tag" = NETWORK_EXPEDITION, "has_access" = 1)))
|
||||
return networks
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
var/turf/mech_turf = get_turf(M)
|
||||
mechData["location"] = "[mech_turf.x], [mech_turf.y], [mech_turf.z]"
|
||||
|
||||
mechData["camera_status"] = M.camera.status
|
||||
mechData["camera_status"] = M.camera.can_use()
|
||||
mechData["lockdown"] = M.lockdown
|
||||
mechs += list(mechData)
|
||||
|
||||
@@ -121,7 +121,7 @@
|
||||
A.client.eye = A.eyeobj
|
||||
return TRUE
|
||||
|
||||
if(!is_contact_area(get_area(C)))
|
||||
if(!can_reach_camera(C))
|
||||
to_chat(user, SPAN_NOTICE("This camera is too far away to connect to!"))
|
||||
return FALSE
|
||||
|
||||
@@ -130,6 +130,16 @@
|
||||
user.reset_view(current_camera)
|
||||
return TRUE
|
||||
|
||||
/datum/computer_file/program/penal_mechs/proc/can_reach_camera(var/obj/structure/machinery/camera/C)
|
||||
if(!C?.can_use())
|
||||
return FALSE
|
||||
|
||||
var/turf/camera_turf = get_turf(C)
|
||||
if(!camera_turf || !computer?.network_card || !GLOB.ntnet_global)
|
||||
return FALSE
|
||||
|
||||
return (camera_turf.z in GLOB.ntnet_global.get_reachable_z_levels(computer.network_card, requires_ntnet_feature))
|
||||
|
||||
/datum/computer_file/program/penal_mechs/proc/set_current(var/obj/structure/machinery/camera/C)
|
||||
if(current_camera == C)
|
||||
return
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
/datum/computer_file/program/clientmanager/ui_data(mob/user)
|
||||
var/list/data = list()
|
||||
data["ntnet_status"] = GLOB.ntnet_global.check_function(NTNET_SOFTWAREDOWNLOAD)
|
||||
data["ntnet_status"] = computer.get_ntnet_status(NTNET_SOFTWAREDOWNLOAD)
|
||||
return data
|
||||
|
||||
/datum/computer_file/program/clientmanager/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state)
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
if(action == "enroll")
|
||||
. = TRUE
|
||||
if(!GLOB.ntnet_global.check_function(NTNET_SOFTWAREDOWNLOAD))
|
||||
if(!computer.get_ntnet_status(NTNET_SOFTWAREDOWNLOAD))
|
||||
to_chat(ui.user, SPAN_WARNING("Cannot connect to NTNet download servers. Please try again later."))
|
||||
return
|
||||
if(params["enroll_type"] & DEVICE_COMPANY)
|
||||
|
||||
Reference in New Issue
Block a user