modular computer stuff

This commit is contained in:
Geeves
2020-01-25 23:08:37 +02:00
parent d56a4c2fe6
commit 658a9ceb83
20 changed files with 352 additions and 387 deletions
@@ -1,7 +1,7 @@
// Returns which access is relevant to passed network. Used by the program.
/proc/get_camera_access(var/network)
if(!network)
return 0
return FALSE
. = current_map.get_network_access(network)
if (.)
@@ -9,7 +9,7 @@
switch(network)
if(NETWORK_THUNDER)
return 0
return FALSE
if(NETWORK_ENGINE,NETWORK_ENGINEERING,NETWORK_ENGINEERING_OUTPOST,NETWORK_ALARM_ATMOS,NETWORK_ALARM_FIRE,NETWORK_ALARM_POWER)
return access_engine
if(NETWORK_MEDICAL)
@@ -32,8 +32,8 @@
program_icon_state = "cameras"
extended_desc = "This program allows remote access to station's camera system. Some camera networks may have additional access requirements."
size = 12
available_on_ntnet = 1
requires_ntnet = 1
available_on_ntnet = TRUE
requires_ntnet = TRUE
required_access_download = access_heads
color = LIGHT_COLOR_ORANGE
usage_flags = PROGRAM_ALL_REGULAR
@@ -82,13 +82,13 @@
/datum/nano_module/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)
return 1
return TRUE
return check_access(user, access_security) || check_access(user, network_access)
/datum/nano_module/camera_monitor/Topic(href, href_list)
if(..())
return 1
return TRUE
if(href_list["switch_camera"])
var/obj/machinery/camera/C = locate(href_list["switch_camera"]) in cameranet.cameras
@@ -98,7 +98,7 @@
return
switch_to_camera(usr, C)
return 1
return TRUE
else if(href_list["switch_network"])
// Either security access, or access to the specific camera network's department is required in order to access the network.
@@ -106,12 +106,12 @@
current_network = href_list["switch_network"]
else
to_chat(usr, "\The [ui_host()] shows an \"Network Access Denied\" error message.")
return 1
return TRUE
else if(href_list["reset"])
reset_current()
usr.reset_view(current_camera)
return 1
return TRUE
/datum/nano_module/camera_monitor/proc/switch_to_camera(var/mob/user, var/obj/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.
@@ -119,17 +119,17 @@
var/mob/living/silicon/ai/A = user
// Only allow non-carded AIs to view because the interaction with the eye gets all wonky otherwise.
if(!A.is_in_chassis())
return 0
return FALSE
A.eyeobj.setLoc(get_turf(C))
A.client.eye = A.eyeobj
return 1
return TRUE
set_current(C)
user.machine = ui_host()
user.reset_view(current_camera)
check_eye(user)
return 1
return TRUE
/datum/nano_module/camera_monitor/proc/set_current(var/obj/machinery/camera/C)
if(current_camera == C)
@@ -167,7 +167,7 @@
extended_desc = "This program allows remote access to station's camera system. Some camera networks may have additional access requirements. This version has an integrated database with additional encrypted keys."
size = 14
nanomodule_path = /datum/nano_module/camera_monitor/ert
available_on_ntnet = 0
available_on_ntnet = FALSE
/datum/nano_module/camera_monitor/ert
name = "Advanced Camera Monitoring Program"
@@ -5,8 +5,8 @@
program_icon_state = "security"
color = LIGHT_COLOR_ORANGE
size = 8
requires_ntnet = 1
available_on_ntnet = 1
requires_ntnet = TRUE
available_on_ntnet = TRUE
required_access_download = access_hos
required_access_run = access_security
nanomodule_path = /datum/nano_module/program/digitalwarrant/
@@ -44,13 +44,13 @@
/datum/nano_module/program/digitalwarrant/Topic(href, href_list)
if(..())
return 1
return TRUE
if(href_list["sw_menu"])
activewarrant = null
if(href_list["editwarrant"])
. = 1
. = TRUE
for(var/datum/record/warrant/W in SSrecords.warrants)
if(W.id == text2num(href_list["editwarrant"]))
activewarrant = W
@@ -68,7 +68,7 @@
return
if(href_list["addwarrant"])
. = 1
. = TRUE
var/datum/record/warrant/W = new()
var/temp = sanitize(input(usr, "Do you want to create a search-, or an arrest warrant?") as null|anything in list("search","arrest"))
if(CanInteract(user, default_state))
@@ -85,17 +85,17 @@
activewarrant = W
if(href_list["savewarrant"])
. = 1
. = TRUE
SSrecords.update_record(activewarrant)
activewarrant = null
if(href_list["deletewarrant"])
. = 1
. = TRUE
SSrecords.remove_record(activewarrant)
activewarrant = null
if(href_list["editwarrantname"])
. = 1
. = TRUE
var/namelist = list()
for(var/datum/record/general/t in SSrecords.records)
namelist += t.name
@@ -106,7 +106,7 @@
activewarrant.name = new_name
if(href_list["editwarrantnamecustom"])
. = 1
. = TRUE
var/new_name = sanitize(input("Please input name") as null|text)
if(CanInteract(user, default_state))
if (!new_name)
@@ -114,7 +114,7 @@
activewarrant.name = new_name
if(href_list["editwarrantcharges"])
. = 1
. = TRUE
var/new_charges = sanitize(input("Please input charges", "Charges", activewarrant.notes) as null|text)
if(CanInteract(user, default_state))
if (!new_charges)
@@ -122,10 +122,10 @@
activewarrant.notes = new_charges
if(href_list["editwarrantauth"])
. = 1
. = TRUE
activewarrant.authorization = "[I.registered_name] - [I.assignment ? I.assignment : "(Unknown)"]"
if(href_list["back"])
. = 1
. = TRUE
activewarrant = null