mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-29 08:08:49 +01:00
eol conversion
This commit is contained in:
@@ -1,125 +1,125 @@
|
||||
/obj/machinery/computer/security
|
||||
name = "security camera console"
|
||||
desc = "Used to access the various cameras on the station."
|
||||
icon_screen = "cameras"
|
||||
icon_keyboard = "security_key"
|
||||
circuit = /obj/item/weapon/circuitboard/security
|
||||
var/obj/machinery/camera/current = null
|
||||
var/last_pic = 1.0
|
||||
var/list/network = list("SS13")
|
||||
var/mapping = 0//For the overview file, interesting bit of code.
|
||||
|
||||
/obj/machinery/computer/security/check_eye(var/mob/user as mob)
|
||||
if ((get_dist(user, src) > 1 || user.eye_blind || !( current ) || !( current.status )) && (!istype(user, /mob/living/silicon)))
|
||||
return null
|
||||
var/list/viewing = viewers(src)
|
||||
if((istype(user,/mob/living/silicon/robot)) && (!(viewing.Find(user))))
|
||||
return null
|
||||
user.reset_view(current)
|
||||
return 1
|
||||
|
||||
|
||||
/obj/machinery/computer/security/attack_hand(var/mob/user as mob)
|
||||
if(!stat)
|
||||
|
||||
if (!network)
|
||||
ERROR("A computer lacks a network at [x],[y],[z].")
|
||||
return
|
||||
if (!(istype(network,/list)))
|
||||
ERROR("The computer at [x],[y],[z] has a network that is not a list!")
|
||||
return
|
||||
|
||||
if(..())
|
||||
return
|
||||
|
||||
var/list/L = list()
|
||||
for (var/obj/machinery/camera/C in cameranet.cameras)
|
||||
if((z > ZLEVEL_SPACEMAX || C.z > ZLEVEL_SPACEMAX) && (C.z != z))//if on away mission, can only recieve feed from same z_level cameras
|
||||
continue
|
||||
L.Add(C)
|
||||
|
||||
camera_sort(L)
|
||||
|
||||
var/list/D = list()
|
||||
D["Cancel"] = "Cancel"
|
||||
for(var/obj/machinery/camera/C in L)
|
||||
if(!C.network)
|
||||
ERROR("[C.c_tag] has no camera network.")
|
||||
continue
|
||||
if(!(istype(C.network,/list)))
|
||||
ERROR("[C.c_tag]'s camera network is not a list!")
|
||||
continue
|
||||
var/list/tempnetwork = C.network&network
|
||||
if(tempnetwork.len)
|
||||
D[text("[][]", C.c_tag, (C.status ? null : " (Deactivated)"))] = C
|
||||
|
||||
var/t = input(user, "Which camera should you change to?") as null|anything in D
|
||||
if(!t)
|
||||
user.unset_machine()
|
||||
return 0
|
||||
|
||||
var/obj/machinery/camera/C = D[t]
|
||||
|
||||
if(t == "Cancel")
|
||||
user.unset_machine()
|
||||
return 0
|
||||
|
||||
if(C)
|
||||
if ((get_dist(user, src) > 1 || user.machine != src || user.eye_blind || !( C.can_use() )) && (!istype(user, /mob/living/silicon/ai)))
|
||||
if(!C.can_use() && !isAI(user))
|
||||
src.current = null
|
||||
return 0
|
||||
else
|
||||
if(isAI(user))
|
||||
var/mob/living/silicon/ai/A = user
|
||||
A.eyeobj.setLoc(get_turf(C))
|
||||
A.client.eye = A.eyeobj
|
||||
else
|
||||
src.current = C
|
||||
use_power(50)
|
||||
|
||||
spawn(5)
|
||||
attack_hand(user)
|
||||
return
|
||||
|
||||
|
||||
|
||||
/obj/machinery/computer/security/telescreen
|
||||
name = "\improper Telescreen"
|
||||
desc = "Used for watching an empty arena."
|
||||
icon = 'icons/obj/stationobjs.dmi'
|
||||
icon_state = "telescreen"
|
||||
network = list("thunder")
|
||||
density = 0
|
||||
circuit = null
|
||||
|
||||
/obj/machinery/computer/security/telescreen/update_icon()
|
||||
icon_state = initial(icon_state)
|
||||
if(stat & BROKEN)
|
||||
icon_state += "b"
|
||||
return
|
||||
|
||||
/obj/machinery/computer/security/telescreen/entertainment
|
||||
name = "entertainment monitor"
|
||||
desc = "Damn, they better have the /tg/ channel on these things."
|
||||
icon = 'icons/obj/status_display.dmi'
|
||||
icon_state = "entertainment"
|
||||
network = list("thunder")
|
||||
density = 0
|
||||
circuit = null
|
||||
|
||||
/obj/machinery/computer/security/wooden_tv
|
||||
name = "security camera monitor"
|
||||
desc = "An old TV hooked into the stations camera network."
|
||||
icon_state = "television"
|
||||
icon_keyboard = null
|
||||
icon_screen = "detective_tv"
|
||||
|
||||
|
||||
/obj/machinery/computer/security/mining
|
||||
name = "outpost camera console"
|
||||
desc = "Used to access the various cameras on the outpost."
|
||||
icon_screen = "mining"
|
||||
icon_keyboard = "mining_key"
|
||||
network = list("MINE")
|
||||
circuit = "/obj/item/weapon/circuitboard/mining"
|
||||
/obj/machinery/computer/security
|
||||
name = "security camera console"
|
||||
desc = "Used to access the various cameras on the station."
|
||||
icon_screen = "cameras"
|
||||
icon_keyboard = "security_key"
|
||||
circuit = /obj/item/weapon/circuitboard/security
|
||||
var/obj/machinery/camera/current = null
|
||||
var/last_pic = 1.0
|
||||
var/list/network = list("SS13")
|
||||
var/mapping = 0//For the overview file, interesting bit of code.
|
||||
|
||||
/obj/machinery/computer/security/check_eye(var/mob/user as mob)
|
||||
if ((get_dist(user, src) > 1 || user.eye_blind || !( current ) || !( current.status )) && (!istype(user, /mob/living/silicon)))
|
||||
return null
|
||||
var/list/viewing = viewers(src)
|
||||
if((istype(user,/mob/living/silicon/robot)) && (!(viewing.Find(user))))
|
||||
return null
|
||||
user.reset_view(current)
|
||||
return 1
|
||||
|
||||
|
||||
/obj/machinery/computer/security/attack_hand(var/mob/user as mob)
|
||||
if(!stat)
|
||||
|
||||
if (!network)
|
||||
ERROR("A computer lacks a network at [x],[y],[z].")
|
||||
return
|
||||
if (!(istype(network,/list)))
|
||||
ERROR("The computer at [x],[y],[z] has a network that is not a list!")
|
||||
return
|
||||
|
||||
if(..())
|
||||
return
|
||||
|
||||
var/list/L = list()
|
||||
for (var/obj/machinery/camera/C in cameranet.cameras)
|
||||
if((z > ZLEVEL_SPACEMAX || C.z > ZLEVEL_SPACEMAX) && (C.z != z))//if on away mission, can only recieve feed from same z_level cameras
|
||||
continue
|
||||
L.Add(C)
|
||||
|
||||
camera_sort(L)
|
||||
|
||||
var/list/D = list()
|
||||
D["Cancel"] = "Cancel"
|
||||
for(var/obj/machinery/camera/C in L)
|
||||
if(!C.network)
|
||||
ERROR("[C.c_tag] has no camera network.")
|
||||
continue
|
||||
if(!(istype(C.network,/list)))
|
||||
ERROR("[C.c_tag]'s camera network is not a list!")
|
||||
continue
|
||||
var/list/tempnetwork = C.network&network
|
||||
if(tempnetwork.len)
|
||||
D[text("[][]", C.c_tag, (C.status ? null : " (Deactivated)"))] = C
|
||||
|
||||
var/t = input(user, "Which camera should you change to?") as null|anything in D
|
||||
if(!t)
|
||||
user.unset_machine()
|
||||
return 0
|
||||
|
||||
var/obj/machinery/camera/C = D[t]
|
||||
|
||||
if(t == "Cancel")
|
||||
user.unset_machine()
|
||||
return 0
|
||||
|
||||
if(C)
|
||||
if ((get_dist(user, src) > 1 || user.machine != src || user.eye_blind || !( C.can_use() )) && (!istype(user, /mob/living/silicon/ai)))
|
||||
if(!C.can_use() && !isAI(user))
|
||||
src.current = null
|
||||
return 0
|
||||
else
|
||||
if(isAI(user))
|
||||
var/mob/living/silicon/ai/A = user
|
||||
A.eyeobj.setLoc(get_turf(C))
|
||||
A.client.eye = A.eyeobj
|
||||
else
|
||||
src.current = C
|
||||
use_power(50)
|
||||
|
||||
spawn(5)
|
||||
attack_hand(user)
|
||||
return
|
||||
|
||||
|
||||
|
||||
/obj/machinery/computer/security/telescreen
|
||||
name = "\improper Telescreen"
|
||||
desc = "Used for watching an empty arena."
|
||||
icon = 'icons/obj/stationobjs.dmi'
|
||||
icon_state = "telescreen"
|
||||
network = list("thunder")
|
||||
density = 0
|
||||
circuit = null
|
||||
|
||||
/obj/machinery/computer/security/telescreen/update_icon()
|
||||
icon_state = initial(icon_state)
|
||||
if(stat & BROKEN)
|
||||
icon_state += "b"
|
||||
return
|
||||
|
||||
/obj/machinery/computer/security/telescreen/entertainment
|
||||
name = "entertainment monitor"
|
||||
desc = "Damn, they better have the /tg/ channel on these things."
|
||||
icon = 'icons/obj/status_display.dmi'
|
||||
icon_state = "entertainment"
|
||||
network = list("thunder")
|
||||
density = 0
|
||||
circuit = null
|
||||
|
||||
/obj/machinery/computer/security/wooden_tv
|
||||
name = "security camera monitor"
|
||||
desc = "An old TV hooked into the stations camera network."
|
||||
icon_state = "television"
|
||||
icon_keyboard = null
|
||||
icon_screen = "detective_tv"
|
||||
|
||||
|
||||
/obj/machinery/computer/security/mining
|
||||
name = "outpost camera console"
|
||||
desc = "Used to access the various cameras on the outpost."
|
||||
icon_screen = "mining"
|
||||
icon_keyboard = "mining_key"
|
||||
network = list("MINE")
|
||||
circuit = "/obj/item/weapon/circuitboard/mining"
|
||||
|
||||
@@ -1,157 +1,157 @@
|
||||
/obj/machinery/computer/camera_advanced
|
||||
name = "advanced camera console"
|
||||
desc = "Used to access the various cameras on the station."
|
||||
icon_screen = "cameras"
|
||||
icon_keyboard = "security_key"
|
||||
var/mob/camera/aiEye/remote/eyeobj
|
||||
var/mob/living/carbon/human/current_user = null
|
||||
var/list/networks = list("SS13")
|
||||
var/datum/action/camera_off/off_action = new
|
||||
var/datum/action/camera_jump/jump_action = new
|
||||
|
||||
/obj/machinery/computer/camera_advanced/proc/CreateEye()
|
||||
eyeobj = new()
|
||||
eyeobj.origin = src
|
||||
|
||||
/obj/machinery/computer/camera_advanced/proc/GrantActions(var/mob/living/carbon/user)
|
||||
off_action.target = user
|
||||
off_action.Grant(user)
|
||||
jump_action.target = user
|
||||
jump_action.Grant(user)
|
||||
|
||||
/obj/machinery/computer/camera_advanced/check_eye(var/mob/user as mob)
|
||||
if (get_dist(user, src) > 1 || user.eye_blind)
|
||||
off_action.Activate()
|
||||
return 0
|
||||
return 1
|
||||
|
||||
/obj/machinery/computer/camera_advanced/attack_hand(var/mob/user as mob)
|
||||
if(..())
|
||||
return
|
||||
if(!iscarbon(user))
|
||||
return
|
||||
var/mob/living/carbon/L = user
|
||||
|
||||
if(!current_user)
|
||||
if(!eyeobj)
|
||||
CreateEye()
|
||||
GrantActions(user)
|
||||
current_user = user
|
||||
eyeobj.user = user
|
||||
eyeobj.name = "Camere Eye ([user.name])"
|
||||
L.remote_view = 1
|
||||
L.remote_control = eyeobj
|
||||
L.client.perspective = EYE_PERSPECTIVE
|
||||
if(!eyeobj.initialized)
|
||||
for(var/obj/machinery/camera/C in cameranet.cameras)
|
||||
if(!C.can_use())
|
||||
continue
|
||||
if(C.network&networks)
|
||||
eyeobj.setLoc(get_turf(C))
|
||||
break
|
||||
eyeobj.initialized = 1
|
||||
else
|
||||
eyeobj.setLoc(eyeobj.loc)
|
||||
else
|
||||
user << "The console is already in use!"
|
||||
|
||||
/mob/camera/aiEye/remote
|
||||
name = "Inactive Camera Eye"
|
||||
var/sprint = 10
|
||||
var/cooldown = 0
|
||||
var/acceleration = 1
|
||||
var/mob/living/carbon/human/user = null
|
||||
var/obj/machinery/computer/camera_advanced/origin
|
||||
var/initialized = 0
|
||||
var/visible_icon = 0
|
||||
var/image/user_image = null
|
||||
|
||||
/mob/camera/aiEye/remote/GetViewerClient()
|
||||
if(user)
|
||||
return user.client
|
||||
return null
|
||||
|
||||
/mob/camera/aiEye/remote/setLoc(var/T)
|
||||
if(user)
|
||||
if(!isturf(user.loc))
|
||||
return
|
||||
T = get_turf(T)
|
||||
loc = T
|
||||
cameranet.visibility(src)
|
||||
if(user.client)
|
||||
if(visible_icon)
|
||||
user.client.images -= user_image
|
||||
user_image = image(icon,loc,icon_state,FLY_LAYER)
|
||||
user.client.images += user_image
|
||||
user.client.eye = src
|
||||
|
||||
/mob/camera/aiEye/remote/relaymove(mob/user,direct)
|
||||
var/initial = initial(sprint)
|
||||
var/max_sprint = 50
|
||||
|
||||
if(cooldown && cooldown < world.timeofday) // 3 seconds
|
||||
sprint = initial
|
||||
|
||||
for(var/i = 0; i < max(sprint, initial); i += 20)
|
||||
var/turf/step = get_turf(get_step(src, direct))
|
||||
if(step)
|
||||
src.setLoc(step)
|
||||
|
||||
cooldown = world.timeofday + 5
|
||||
if(acceleration)
|
||||
sprint = min(sprint + 0.5, max_sprint)
|
||||
else
|
||||
sprint = initial
|
||||
|
||||
/datum/action/camera_off
|
||||
name = "End Camera View"
|
||||
action_type = AB_INNATE
|
||||
button_icon_state = "camera_off"
|
||||
|
||||
/datum/action/camera_off/Activate()
|
||||
if(!target || !iscarbon(target))
|
||||
return
|
||||
var/mob/living/carbon/C = target
|
||||
var/mob/camera/aiEye/remote/remote_eye = C.remote_control
|
||||
C.remote_view = 0
|
||||
remote_eye.origin.current_user = null
|
||||
remote_eye.origin.jump_action.Remove(C)
|
||||
if(C.client)
|
||||
C.client.perspective = MOB_PERSPECTIVE
|
||||
C.client.eye = src
|
||||
C.client.images -= remote_eye.user_image
|
||||
C.remote_control = null
|
||||
C.unset_machine()
|
||||
src.Remove(C)
|
||||
|
||||
/datum/action/camera_jump
|
||||
name = "Jump To Camera"
|
||||
action_type = AB_INNATE
|
||||
button_icon_state = "camera_jump"
|
||||
|
||||
/datum/action/camera_jump/Activate()
|
||||
if(!target || !iscarbon(target))
|
||||
return
|
||||
var/mob/living/carbon/C = target
|
||||
var/mob/camera/aiEye/remote/remote_eye = C.remote_control
|
||||
var/obj/machinery/computer/camera_advanced/origin = remote_eye.origin
|
||||
|
||||
var/list/L = list()
|
||||
|
||||
for (var/obj/machinery/camera/cam in cameranet.cameras)
|
||||
L.Add(cam)
|
||||
|
||||
camera_sort(L)
|
||||
|
||||
var/list/T = list()
|
||||
|
||||
for (var/obj/machinery/camera/netcam in L)
|
||||
var/list/tempnetwork = netcam.network&origin.networks
|
||||
if (tempnetwork.len)
|
||||
T[text("[][]", netcam.c_tag, (netcam.can_use() ? null : " (Deactivated)"))] = netcam
|
||||
|
||||
|
||||
var/camera = input("Choose which camera you want to view", "Cameras") as null|anything in T
|
||||
var/obj/machinery/camera/final = T[camera]
|
||||
if(final)
|
||||
/obj/machinery/computer/camera_advanced
|
||||
name = "advanced camera console"
|
||||
desc = "Used to access the various cameras on the station."
|
||||
icon_screen = "cameras"
|
||||
icon_keyboard = "security_key"
|
||||
var/mob/camera/aiEye/remote/eyeobj
|
||||
var/mob/living/carbon/human/current_user = null
|
||||
var/list/networks = list("SS13")
|
||||
var/datum/action/camera_off/off_action = new
|
||||
var/datum/action/camera_jump/jump_action = new
|
||||
|
||||
/obj/machinery/computer/camera_advanced/proc/CreateEye()
|
||||
eyeobj = new()
|
||||
eyeobj.origin = src
|
||||
|
||||
/obj/machinery/computer/camera_advanced/proc/GrantActions(var/mob/living/carbon/user)
|
||||
off_action.target = user
|
||||
off_action.Grant(user)
|
||||
jump_action.target = user
|
||||
jump_action.Grant(user)
|
||||
|
||||
/obj/machinery/computer/camera_advanced/check_eye(var/mob/user as mob)
|
||||
if (get_dist(user, src) > 1 || user.eye_blind)
|
||||
off_action.Activate()
|
||||
return 0
|
||||
return 1
|
||||
|
||||
/obj/machinery/computer/camera_advanced/attack_hand(var/mob/user as mob)
|
||||
if(..())
|
||||
return
|
||||
if(!iscarbon(user))
|
||||
return
|
||||
var/mob/living/carbon/L = user
|
||||
|
||||
if(!current_user)
|
||||
if(!eyeobj)
|
||||
CreateEye()
|
||||
GrantActions(user)
|
||||
current_user = user
|
||||
eyeobj.user = user
|
||||
eyeobj.name = "Camere Eye ([user.name])"
|
||||
L.remote_view = 1
|
||||
L.remote_control = eyeobj
|
||||
L.client.perspective = EYE_PERSPECTIVE
|
||||
if(!eyeobj.initialized)
|
||||
for(var/obj/machinery/camera/C in cameranet.cameras)
|
||||
if(!C.can_use())
|
||||
continue
|
||||
if(C.network&networks)
|
||||
eyeobj.setLoc(get_turf(C))
|
||||
break
|
||||
eyeobj.initialized = 1
|
||||
else
|
||||
eyeobj.setLoc(eyeobj.loc)
|
||||
else
|
||||
user << "The console is already in use!"
|
||||
|
||||
/mob/camera/aiEye/remote
|
||||
name = "Inactive Camera Eye"
|
||||
var/sprint = 10
|
||||
var/cooldown = 0
|
||||
var/acceleration = 1
|
||||
var/mob/living/carbon/human/user = null
|
||||
var/obj/machinery/computer/camera_advanced/origin
|
||||
var/initialized = 0
|
||||
var/visible_icon = 0
|
||||
var/image/user_image = null
|
||||
|
||||
/mob/camera/aiEye/remote/GetViewerClient()
|
||||
if(user)
|
||||
return user.client
|
||||
return null
|
||||
|
||||
/mob/camera/aiEye/remote/setLoc(var/T)
|
||||
if(user)
|
||||
if(!isturf(user.loc))
|
||||
return
|
||||
T = get_turf(T)
|
||||
loc = T
|
||||
cameranet.visibility(src)
|
||||
if(user.client)
|
||||
if(visible_icon)
|
||||
user.client.images -= user_image
|
||||
user_image = image(icon,loc,icon_state,FLY_LAYER)
|
||||
user.client.images += user_image
|
||||
user.client.eye = src
|
||||
|
||||
/mob/camera/aiEye/remote/relaymove(mob/user,direct)
|
||||
var/initial = initial(sprint)
|
||||
var/max_sprint = 50
|
||||
|
||||
if(cooldown && cooldown < world.timeofday) // 3 seconds
|
||||
sprint = initial
|
||||
|
||||
for(var/i = 0; i < max(sprint, initial); i += 20)
|
||||
var/turf/step = get_turf(get_step(src, direct))
|
||||
if(step)
|
||||
src.setLoc(step)
|
||||
|
||||
cooldown = world.timeofday + 5
|
||||
if(acceleration)
|
||||
sprint = min(sprint + 0.5, max_sprint)
|
||||
else
|
||||
sprint = initial
|
||||
|
||||
/datum/action/camera_off
|
||||
name = "End Camera View"
|
||||
action_type = AB_INNATE
|
||||
button_icon_state = "camera_off"
|
||||
|
||||
/datum/action/camera_off/Activate()
|
||||
if(!target || !iscarbon(target))
|
||||
return
|
||||
var/mob/living/carbon/C = target
|
||||
var/mob/camera/aiEye/remote/remote_eye = C.remote_control
|
||||
C.remote_view = 0
|
||||
remote_eye.origin.current_user = null
|
||||
remote_eye.origin.jump_action.Remove(C)
|
||||
if(C.client)
|
||||
C.client.perspective = MOB_PERSPECTIVE
|
||||
C.client.eye = src
|
||||
C.client.images -= remote_eye.user_image
|
||||
C.remote_control = null
|
||||
C.unset_machine()
|
||||
src.Remove(C)
|
||||
|
||||
/datum/action/camera_jump
|
||||
name = "Jump To Camera"
|
||||
action_type = AB_INNATE
|
||||
button_icon_state = "camera_jump"
|
||||
|
||||
/datum/action/camera_jump/Activate()
|
||||
if(!target || !iscarbon(target))
|
||||
return
|
||||
var/mob/living/carbon/C = target
|
||||
var/mob/camera/aiEye/remote/remote_eye = C.remote_control
|
||||
var/obj/machinery/computer/camera_advanced/origin = remote_eye.origin
|
||||
|
||||
var/list/L = list()
|
||||
|
||||
for (var/obj/machinery/camera/cam in cameranet.cameras)
|
||||
L.Add(cam)
|
||||
|
||||
camera_sort(L)
|
||||
|
||||
var/list/T = list()
|
||||
|
||||
for (var/obj/machinery/camera/netcam in L)
|
||||
var/list/tempnetwork = netcam.network&origin.networks
|
||||
if (tempnetwork.len)
|
||||
T[text("[][]", netcam.c_tag, (netcam.can_use() ? null : " (Deactivated)"))] = netcam
|
||||
|
||||
|
||||
var/camera = input("Choose which camera you want to view", "Cameras") as null|anything in T
|
||||
var/obj/machinery/camera/final = T[camera]
|
||||
if(final)
|
||||
remote_eye.setLoc(get_turf(final))
|
||||
@@ -1,232 +1,232 @@
|
||||
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31
|
||||
|
||||
/obj/machinery/computer/telecomms/server
|
||||
name = "telecommunications server monitoring console"
|
||||
icon_screen = "comm_logs"
|
||||
|
||||
var/screen = 0 // the screen number:
|
||||
var/list/servers = list() // the servers located by the computer
|
||||
var/obj/machinery/telecomms/server/SelectedServer
|
||||
|
||||
var/network = "NULL" // the network to probe
|
||||
var/temp = "" // temporary feedback messages
|
||||
|
||||
var/universal_translate = 0 // set to 1 if it can translate nonhuman speech
|
||||
|
||||
req_access = list(access_tcomsat)
|
||||
circuit = "/obj/item/weapon/circuitboard/comm_server"
|
||||
|
||||
/obj/machinery/computer/telecomms/server/attack_hand(mob/user as mob)
|
||||
if(..())
|
||||
return
|
||||
user.set_machine(src)
|
||||
var/dat = "<TITLE>Telecommunication Server Monitor</TITLE><center><b>Telecommunications Server Monitor</b></center>"
|
||||
|
||||
switch(screen)
|
||||
|
||||
|
||||
// --- Main Menu ---
|
||||
|
||||
if(0)
|
||||
dat += "<br>[temp]<br>"
|
||||
dat += "<br>Current Network: <a href='?src=\ref[src];network=1'>[network]</a><br>"
|
||||
if(servers.len)
|
||||
dat += "<br>Detected Telecommunication Servers:<ul>"
|
||||
for(var/obj/machinery/telecomms/T in servers)
|
||||
dat += "<li><a href='?src=\ref[src];viewserver=[T.id]'>\ref[T] [T.name]</a> ([T.id])</li>"
|
||||
dat += "</ul>"
|
||||
dat += "<br><a href='?src=\ref[src];operation=release'>\[Flush Buffer\]</a>"
|
||||
|
||||
else
|
||||
dat += "<br>No servers detected. Scan for servers: <a href='?src=\ref[src];operation=scan'>\[Scan\]</a>"
|
||||
|
||||
|
||||
// --- Viewing Server ---
|
||||
|
||||
if(1)
|
||||
dat += "<br>[temp]<br>"
|
||||
dat += "<center><a href='?src=\ref[src];operation=mainmenu'>\[Main Menu\]</a> <a href='?src=\ref[src];operation=refresh'>\[Refresh\]</a></center>"
|
||||
dat += "<br>Current Network: [network]"
|
||||
dat += "<br>Selected Server: [SelectedServer.id]"
|
||||
|
||||
if(SelectedServer.totaltraffic >= 1024)
|
||||
dat += "<br>Total recorded traffic: [round(SelectedServer.totaltraffic / 1024)] Terrabytes<br><br>"
|
||||
else
|
||||
dat += "<br>Total recorded traffic: [SelectedServer.totaltraffic] Gigabytes<br><br>"
|
||||
|
||||
dat += "Stored Logs: <ol>"
|
||||
|
||||
var/i = 0
|
||||
for(var/datum/comm_log_entry/C in SelectedServer.log_entries)
|
||||
i++
|
||||
|
||||
|
||||
// If the log is a speech file
|
||||
if(C.input_type == "Speech File")
|
||||
|
||||
dat += "<li><font color = #008F00>[C.name]</font color> <font color = #FF0000><a href='?src=\ref[src];delete=[i]'>\[X\]</a></font color><br>"
|
||||
|
||||
// -- Determine race of orator --
|
||||
|
||||
var/race // The actual race of the mob
|
||||
var/language = "Human" // MMIs, pAIs, Cyborgs and humans all speak Human
|
||||
var/mobtype = C.parameters["mobtype"]
|
||||
|
||||
var/list/humans = typesof(/mob/living/carbon/human, /mob/living/carbon/brain)
|
||||
var/list/monkeys = typesof(/mob/living/carbon/monkey)
|
||||
var/list/silicons = typesof(/mob/living/silicon)
|
||||
var/list/slimes = typesof(/mob/living/simple_animal/slime)
|
||||
var/list/animals = typesof(/mob/living/simple_animal)
|
||||
|
||||
if(mobtype in humans)
|
||||
race = "Human"
|
||||
language = race
|
||||
|
||||
else if(mobtype in slimes) // NT knows a lot about slimes, but not aliens. Can identify slimes
|
||||
race = "Slime"
|
||||
language = race
|
||||
|
||||
else if(mobtype in monkeys)
|
||||
race = "Monkey"
|
||||
language = race
|
||||
|
||||
else if(mobtype in silicons || C.parameters["job"] == "AI") // sometimes M gets deleted prematurely for AIs... just check the job
|
||||
race = "Artificial Life"
|
||||
language = race
|
||||
|
||||
else if(istype(mobtype, /obj))
|
||||
race = "Machinery"
|
||||
language = race
|
||||
|
||||
else if(mobtype in animals)
|
||||
race = "Domestic Animal"
|
||||
language = race
|
||||
|
||||
else
|
||||
race = "<i>Unidentifiable</i>"
|
||||
language = race
|
||||
|
||||
// -- If the orator is a human, or universal translate is active, OR mob has universal speech on --
|
||||
|
||||
if(language == "Human" || universal_translate || C.parameters["uspeech"])
|
||||
dat += "<u><font color = #18743E>Data type</font color></u>: [C.input_type]<br>"
|
||||
dat += "<u><font color = #18743E>Source</font color></u>: [C.parameters["name"]] (Job: [C.parameters["job"]])<br>"
|
||||
dat += "<u><font color = #18743E>Class</font color></u>: [race]<br>"
|
||||
dat += "<u><font color = #18743E>Contents</font color></u>: \"[C.parameters["message"]]\"<br>"
|
||||
|
||||
|
||||
// -- Orator is not human and universal translate not active --
|
||||
|
||||
else
|
||||
dat += "<u><font color = #18743E>Data type</font color></u>: Audio File<br>"
|
||||
dat += "<u><font color = #18743E>Source</font color></u>: <i>Unidentifiable</i><br>"
|
||||
dat += "<u><font color = #18743E>Class</font color></u>: [race]<br>"
|
||||
dat += "<u><font color = #18743E>Contents</font color></u>: <i>Unintelligble</i><br>"
|
||||
|
||||
dat += "</li><br>"
|
||||
|
||||
else if(C.input_type == "Execution Error")
|
||||
|
||||
dat += "<li><font color = #990000>[C.name]</font color> <font color = #FF0000><a href='?src=\ref[src];delete=[i]'>\[X\]</a></font color><br>"
|
||||
dat += "<u><font color = #787700>Output</font color></u>: \"[C.parameters["message"]]\"<br>"
|
||||
dat += "</li><br>"
|
||||
|
||||
|
||||
dat += "</ol>"
|
||||
|
||||
|
||||
|
||||
user << browse(dat, "window=comm_monitor;size=575x400")
|
||||
onclose(user, "server_control")
|
||||
|
||||
temp = ""
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/computer/telecomms/server/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
|
||||
|
||||
add_fingerprint(usr)
|
||||
usr.set_machine(src)
|
||||
|
||||
if(href_list["viewserver"])
|
||||
screen = 1
|
||||
for(var/obj/machinery/telecomms/T in servers)
|
||||
if(T.id == href_list["viewserver"])
|
||||
SelectedServer = T
|
||||
break
|
||||
|
||||
if(href_list["operation"])
|
||||
switch(href_list["operation"])
|
||||
|
||||
if("release")
|
||||
servers = list()
|
||||
screen = 0
|
||||
|
||||
if("mainmenu")
|
||||
screen = 0
|
||||
|
||||
if("scan")
|
||||
if(servers.len > 0)
|
||||
temp = "<font color = #D70B00>- FAILED: CANNOT PROBE WHEN BUFFER FULL -</font color>"
|
||||
|
||||
else
|
||||
for(var/obj/machinery/telecomms/server/T in range(25, src))
|
||||
if(T.network == network)
|
||||
servers.Add(T)
|
||||
|
||||
if(!servers.len)
|
||||
temp = "<font color = #D70B00>- FAILED: UNABLE TO LOCATE SERVERS IN \[[network]\] -</font color>"
|
||||
else
|
||||
temp = "<font color = #336699>- [servers.len] SERVERS PROBED & BUFFERED -</font color>"
|
||||
|
||||
screen = 0
|
||||
|
||||
if(href_list["delete"])
|
||||
|
||||
if(!src.allowed(usr) && !emagged)
|
||||
usr << "<span class='danger'>ACCESS DENIED.</span>"
|
||||
return
|
||||
|
||||
if(SelectedServer)
|
||||
|
||||
var/datum/comm_log_entry/D = SelectedServer.log_entries[text2num(href_list["delete"])]
|
||||
|
||||
temp = "<font color = #336699>- DELETED ENTRY: [D.name] -</font color>"
|
||||
|
||||
SelectedServer.log_entries.Remove(D)
|
||||
del(D)
|
||||
|
||||
else
|
||||
temp = "<font color = #D70B00>- FAILED: NO SELECTED MACHINE -</font color>"
|
||||
|
||||
if(href_list["network"])
|
||||
|
||||
var/newnet = stripped_input(usr, "Which network do you want to view?", "Comm Monitor", network)
|
||||
|
||||
if(newnet && ((usr in range(1, src) || issilicon(usr))))
|
||||
if(length(newnet) > 15)
|
||||
temp = "<font color = #D70B00>- FAILED: NETWORK TAG STRING TOO LENGHTLY -</font color>"
|
||||
|
||||
else
|
||||
|
||||
network = newnet
|
||||
screen = 0
|
||||
servers = list()
|
||||
temp = "<font color = #336699>- NEW NETWORK TAG SET IN ADDRESS \[[network]\] -</font color>"
|
||||
|
||||
updateUsrDialog()
|
||||
return
|
||||
|
||||
/obj/machinery/computer/telecomms/server/attackby()
|
||||
..()
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
/obj/machinery/computer/telecomms/server/emag_act(mob/user as mob)
|
||||
if(!emagged)
|
||||
playsound(src.loc, 'sound/effects/sparks4.ogg', 75, 1)
|
||||
emagged = 1
|
||||
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31
|
||||
|
||||
/obj/machinery/computer/telecomms/server
|
||||
name = "telecommunications server monitoring console"
|
||||
icon_screen = "comm_logs"
|
||||
|
||||
var/screen = 0 // the screen number:
|
||||
var/list/servers = list() // the servers located by the computer
|
||||
var/obj/machinery/telecomms/server/SelectedServer
|
||||
|
||||
var/network = "NULL" // the network to probe
|
||||
var/temp = "" // temporary feedback messages
|
||||
|
||||
var/universal_translate = 0 // set to 1 if it can translate nonhuman speech
|
||||
|
||||
req_access = list(access_tcomsat)
|
||||
circuit = "/obj/item/weapon/circuitboard/comm_server"
|
||||
|
||||
/obj/machinery/computer/telecomms/server/attack_hand(mob/user as mob)
|
||||
if(..())
|
||||
return
|
||||
user.set_machine(src)
|
||||
var/dat = "<TITLE>Telecommunication Server Monitor</TITLE><center><b>Telecommunications Server Monitor</b></center>"
|
||||
|
||||
switch(screen)
|
||||
|
||||
|
||||
// --- Main Menu ---
|
||||
|
||||
if(0)
|
||||
dat += "<br>[temp]<br>"
|
||||
dat += "<br>Current Network: <a href='?src=\ref[src];network=1'>[network]</a><br>"
|
||||
if(servers.len)
|
||||
dat += "<br>Detected Telecommunication Servers:<ul>"
|
||||
for(var/obj/machinery/telecomms/T in servers)
|
||||
dat += "<li><a href='?src=\ref[src];viewserver=[T.id]'>\ref[T] [T.name]</a> ([T.id])</li>"
|
||||
dat += "</ul>"
|
||||
dat += "<br><a href='?src=\ref[src];operation=release'>\[Flush Buffer\]</a>"
|
||||
|
||||
else
|
||||
dat += "<br>No servers detected. Scan for servers: <a href='?src=\ref[src];operation=scan'>\[Scan\]</a>"
|
||||
|
||||
|
||||
// --- Viewing Server ---
|
||||
|
||||
if(1)
|
||||
dat += "<br>[temp]<br>"
|
||||
dat += "<center><a href='?src=\ref[src];operation=mainmenu'>\[Main Menu\]</a> <a href='?src=\ref[src];operation=refresh'>\[Refresh\]</a></center>"
|
||||
dat += "<br>Current Network: [network]"
|
||||
dat += "<br>Selected Server: [SelectedServer.id]"
|
||||
|
||||
if(SelectedServer.totaltraffic >= 1024)
|
||||
dat += "<br>Total recorded traffic: [round(SelectedServer.totaltraffic / 1024)] Terrabytes<br><br>"
|
||||
else
|
||||
dat += "<br>Total recorded traffic: [SelectedServer.totaltraffic] Gigabytes<br><br>"
|
||||
|
||||
dat += "Stored Logs: <ol>"
|
||||
|
||||
var/i = 0
|
||||
for(var/datum/comm_log_entry/C in SelectedServer.log_entries)
|
||||
i++
|
||||
|
||||
|
||||
// If the log is a speech file
|
||||
if(C.input_type == "Speech File")
|
||||
|
||||
dat += "<li><font color = #008F00>[C.name]</font color> <font color = #FF0000><a href='?src=\ref[src];delete=[i]'>\[X\]</a></font color><br>"
|
||||
|
||||
// -- Determine race of orator --
|
||||
|
||||
var/race // The actual race of the mob
|
||||
var/language = "Human" // MMIs, pAIs, Cyborgs and humans all speak Human
|
||||
var/mobtype = C.parameters["mobtype"]
|
||||
|
||||
var/list/humans = typesof(/mob/living/carbon/human, /mob/living/carbon/brain)
|
||||
var/list/monkeys = typesof(/mob/living/carbon/monkey)
|
||||
var/list/silicons = typesof(/mob/living/silicon)
|
||||
var/list/slimes = typesof(/mob/living/simple_animal/slime)
|
||||
var/list/animals = typesof(/mob/living/simple_animal)
|
||||
|
||||
if(mobtype in humans)
|
||||
race = "Human"
|
||||
language = race
|
||||
|
||||
else if(mobtype in slimes) // NT knows a lot about slimes, but not aliens. Can identify slimes
|
||||
race = "Slime"
|
||||
language = race
|
||||
|
||||
else if(mobtype in monkeys)
|
||||
race = "Monkey"
|
||||
language = race
|
||||
|
||||
else if(mobtype in silicons || C.parameters["job"] == "AI") // sometimes M gets deleted prematurely for AIs... just check the job
|
||||
race = "Artificial Life"
|
||||
language = race
|
||||
|
||||
else if(istype(mobtype, /obj))
|
||||
race = "Machinery"
|
||||
language = race
|
||||
|
||||
else if(mobtype in animals)
|
||||
race = "Domestic Animal"
|
||||
language = race
|
||||
|
||||
else
|
||||
race = "<i>Unidentifiable</i>"
|
||||
language = race
|
||||
|
||||
// -- If the orator is a human, or universal translate is active, OR mob has universal speech on --
|
||||
|
||||
if(language == "Human" || universal_translate || C.parameters["uspeech"])
|
||||
dat += "<u><font color = #18743E>Data type</font color></u>: [C.input_type]<br>"
|
||||
dat += "<u><font color = #18743E>Source</font color></u>: [C.parameters["name"]] (Job: [C.parameters["job"]])<br>"
|
||||
dat += "<u><font color = #18743E>Class</font color></u>: [race]<br>"
|
||||
dat += "<u><font color = #18743E>Contents</font color></u>: \"[C.parameters["message"]]\"<br>"
|
||||
|
||||
|
||||
// -- Orator is not human and universal translate not active --
|
||||
|
||||
else
|
||||
dat += "<u><font color = #18743E>Data type</font color></u>: Audio File<br>"
|
||||
dat += "<u><font color = #18743E>Source</font color></u>: <i>Unidentifiable</i><br>"
|
||||
dat += "<u><font color = #18743E>Class</font color></u>: [race]<br>"
|
||||
dat += "<u><font color = #18743E>Contents</font color></u>: <i>Unintelligble</i><br>"
|
||||
|
||||
dat += "</li><br>"
|
||||
|
||||
else if(C.input_type == "Execution Error")
|
||||
|
||||
dat += "<li><font color = #990000>[C.name]</font color> <font color = #FF0000><a href='?src=\ref[src];delete=[i]'>\[X\]</a></font color><br>"
|
||||
dat += "<u><font color = #787700>Output</font color></u>: \"[C.parameters["message"]]\"<br>"
|
||||
dat += "</li><br>"
|
||||
|
||||
|
||||
dat += "</ol>"
|
||||
|
||||
|
||||
|
||||
user << browse(dat, "window=comm_monitor;size=575x400")
|
||||
onclose(user, "server_control")
|
||||
|
||||
temp = ""
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/computer/telecomms/server/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
|
||||
|
||||
add_fingerprint(usr)
|
||||
usr.set_machine(src)
|
||||
|
||||
if(href_list["viewserver"])
|
||||
screen = 1
|
||||
for(var/obj/machinery/telecomms/T in servers)
|
||||
if(T.id == href_list["viewserver"])
|
||||
SelectedServer = T
|
||||
break
|
||||
|
||||
if(href_list["operation"])
|
||||
switch(href_list["operation"])
|
||||
|
||||
if("release")
|
||||
servers = list()
|
||||
screen = 0
|
||||
|
||||
if("mainmenu")
|
||||
screen = 0
|
||||
|
||||
if("scan")
|
||||
if(servers.len > 0)
|
||||
temp = "<font color = #D70B00>- FAILED: CANNOT PROBE WHEN BUFFER FULL -</font color>"
|
||||
|
||||
else
|
||||
for(var/obj/machinery/telecomms/server/T in range(25, src))
|
||||
if(T.network == network)
|
||||
servers.Add(T)
|
||||
|
||||
if(!servers.len)
|
||||
temp = "<font color = #D70B00>- FAILED: UNABLE TO LOCATE SERVERS IN \[[network]\] -</font color>"
|
||||
else
|
||||
temp = "<font color = #336699>- [servers.len] SERVERS PROBED & BUFFERED -</font color>"
|
||||
|
||||
screen = 0
|
||||
|
||||
if(href_list["delete"])
|
||||
|
||||
if(!src.allowed(usr) && !emagged)
|
||||
usr << "<span class='danger'>ACCESS DENIED.</span>"
|
||||
return
|
||||
|
||||
if(SelectedServer)
|
||||
|
||||
var/datum/comm_log_entry/D = SelectedServer.log_entries[text2num(href_list["delete"])]
|
||||
|
||||
temp = "<font color = #336699>- DELETED ENTRY: [D.name] -</font color>"
|
||||
|
||||
SelectedServer.log_entries.Remove(D)
|
||||
del(D)
|
||||
|
||||
else
|
||||
temp = "<font color = #D70B00>- FAILED: NO SELECTED MACHINE -</font color>"
|
||||
|
||||
if(href_list["network"])
|
||||
|
||||
var/newnet = stripped_input(usr, "Which network do you want to view?", "Comm Monitor", network)
|
||||
|
||||
if(newnet && ((usr in range(1, src) || issilicon(usr))))
|
||||
if(length(newnet) > 15)
|
||||
temp = "<font color = #D70B00>- FAILED: NETWORK TAG STRING TOO LENGHTLY -</font color>"
|
||||
|
||||
else
|
||||
|
||||
network = newnet
|
||||
screen = 0
|
||||
servers = list()
|
||||
temp = "<font color = #336699>- NEW NETWORK TAG SET IN ADDRESS \[[network]\] -</font color>"
|
||||
|
||||
updateUsrDialog()
|
||||
return
|
||||
|
||||
/obj/machinery/computer/telecomms/server/attackby()
|
||||
..()
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
/obj/machinery/computer/telecomms/server/emag_act(mob/user as mob)
|
||||
if(!emagged)
|
||||
playsound(src.loc, 'sound/effects/sparks4.ogg', 75, 1)
|
||||
emagged = 1
|
||||
user << "<span class='notice'>You you disable the security protocols.</span>"
|
||||
@@ -1,134 +1,134 @@
|
||||
|
||||
/*
|
||||
Telecomms monitor tracks the overall trafficing of a telecommunications network
|
||||
and displays a heirarchy of linked machines.
|
||||
*/
|
||||
|
||||
|
||||
/obj/machinery/computer/telecomms/monitor
|
||||
name = "telecommunications monitoring console"
|
||||
icon_screen = "comm_monitor"
|
||||
|
||||
var/screen = 0 // the screen number:
|
||||
var/list/machinelist = list() // the machines located by the computer
|
||||
var/obj/machinery/telecomms/SelectedMachine
|
||||
|
||||
var/network = "NULL" // the network to probe
|
||||
|
||||
var/temp = "" // temporary feedback messages
|
||||
circuit = "/obj/item/weapon/circuitboard/comm_monitor"
|
||||
|
||||
/obj/machinery/computer/telecomms/monitor/attack_hand(mob/user as mob)
|
||||
if(..())
|
||||
return
|
||||
user.set_machine(src)
|
||||
var/dat = "<TITLE>Telecommunications Monitor</TITLE><center><b>Telecommunications Monitor</b></center>"
|
||||
|
||||
switch(screen)
|
||||
|
||||
|
||||
// --- Main Menu ---
|
||||
|
||||
if(0)
|
||||
dat += "<br>[temp]<br><br>"
|
||||
dat += "<br>Current Network: <a href='?src=\ref[src];network=1'>[network]</a><br>"
|
||||
if(machinelist.len)
|
||||
dat += "<br>Detected Network Entities:<ul>"
|
||||
for(var/obj/machinery/telecomms/T in machinelist)
|
||||
dat += "<li><a href='?src=\ref[src];viewmachine=[T.id]'>\ref[T] [T.name]</a> ([T.id])</li>"
|
||||
dat += "</ul>"
|
||||
dat += "<br><a href='?src=\ref[src];operation=release'>\[Flush Buffer\]</a>"
|
||||
else
|
||||
dat += "<a href='?src=\ref[src];operation=probe'>\[Probe Network\]</a>"
|
||||
|
||||
|
||||
// --- Viewing Machine ---
|
||||
|
||||
if(1)
|
||||
dat += "<br>[temp]<br>"
|
||||
dat += "<center><a href='?src=\ref[src];operation=mainmenu'>\[Main Menu\]</a></center>"
|
||||
dat += "<br>Current Network: [network]<br>"
|
||||
dat += "Selected Network Entity: [SelectedMachine.name] ([SelectedMachine.id])<br>"
|
||||
dat += "Linked Entities: <ol>"
|
||||
for(var/obj/machinery/telecomms/T in SelectedMachine.links)
|
||||
if(!T.hide)
|
||||
dat += "<li><a href='?src=\ref[src];viewmachine=[T.id]'>\ref[T.id] [T.name]</a> ([T.id])</li>"
|
||||
dat += "</ol>"
|
||||
|
||||
|
||||
|
||||
user << browse(dat, "window=comm_monitor;size=575x400")
|
||||
onclose(user, "server_control")
|
||||
|
||||
temp = ""
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/computer/telecomms/monitor/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
|
||||
|
||||
add_fingerprint(usr)
|
||||
usr.set_machine(src)
|
||||
|
||||
if(href_list["viewmachine"])
|
||||
screen = 1
|
||||
for(var/obj/machinery/telecomms/T in machinelist)
|
||||
if(T.id == href_list["viewmachine"])
|
||||
SelectedMachine = T
|
||||
break
|
||||
|
||||
if(href_list["operation"])
|
||||
switch(href_list["operation"])
|
||||
|
||||
if("release")
|
||||
machinelist = list()
|
||||
screen = 0
|
||||
|
||||
if("mainmenu")
|
||||
screen = 0
|
||||
|
||||
if("probe")
|
||||
if(machinelist.len > 0)
|
||||
temp = "<font color = #D70B00>- FAILED: CANNOT PROBE WHEN BUFFER FULL -</font color>"
|
||||
|
||||
else
|
||||
for(var/obj/machinery/telecomms/T in range(25, src))
|
||||
if(T.network == network)
|
||||
machinelist.Add(T)
|
||||
|
||||
if(!machinelist.len)
|
||||
temp = "<font color = #D70B00>- FAILED: UNABLE TO LOCATE NETWORK ENTITIES IN \[[network]\] -</font color>"
|
||||
else
|
||||
temp = "<font color = #336699>- [machinelist.len] ENTITIES LOCATED & BUFFERED -</font color>"
|
||||
|
||||
screen = 0
|
||||
|
||||
|
||||
if(href_list["network"])
|
||||
|
||||
var/newnet = stripped_input(usr, "Which network do you want to view?", "Comm Monitor", network)
|
||||
if(newnet && ((usr in range(1, src) || issilicon(usr))))
|
||||
if(length(newnet) > 15)
|
||||
temp = "<font color = #D70B00>- FAILED: NETWORK TAG STRING TOO LENGHTLY -</font color>"
|
||||
|
||||
else
|
||||
network = newnet
|
||||
screen = 0
|
||||
machinelist = list()
|
||||
temp = "<font color = #336699>- NEW NETWORK TAG SET IN ADDRESS \[[network]\] -</font color>"
|
||||
|
||||
updateUsrDialog()
|
||||
return
|
||||
|
||||
/obj/machinery/computer/telecomms/monitor/attackby()
|
||||
..()
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
/obj/machinery/computer/telecomms/monitor/emag_act(mob/user as mob)
|
||||
if(!emagged)
|
||||
playsound(src.loc, 'sound/effects/sparks4.ogg', 75, 1)
|
||||
emagged = 1
|
||||
|
||||
/*
|
||||
Telecomms monitor tracks the overall trafficing of a telecommunications network
|
||||
and displays a heirarchy of linked machines.
|
||||
*/
|
||||
|
||||
|
||||
/obj/machinery/computer/telecomms/monitor
|
||||
name = "telecommunications monitoring console"
|
||||
icon_screen = "comm_monitor"
|
||||
|
||||
var/screen = 0 // the screen number:
|
||||
var/list/machinelist = list() // the machines located by the computer
|
||||
var/obj/machinery/telecomms/SelectedMachine
|
||||
|
||||
var/network = "NULL" // the network to probe
|
||||
|
||||
var/temp = "" // temporary feedback messages
|
||||
circuit = "/obj/item/weapon/circuitboard/comm_monitor"
|
||||
|
||||
/obj/machinery/computer/telecomms/monitor/attack_hand(mob/user as mob)
|
||||
if(..())
|
||||
return
|
||||
user.set_machine(src)
|
||||
var/dat = "<TITLE>Telecommunications Monitor</TITLE><center><b>Telecommunications Monitor</b></center>"
|
||||
|
||||
switch(screen)
|
||||
|
||||
|
||||
// --- Main Menu ---
|
||||
|
||||
if(0)
|
||||
dat += "<br>[temp]<br><br>"
|
||||
dat += "<br>Current Network: <a href='?src=\ref[src];network=1'>[network]</a><br>"
|
||||
if(machinelist.len)
|
||||
dat += "<br>Detected Network Entities:<ul>"
|
||||
for(var/obj/machinery/telecomms/T in machinelist)
|
||||
dat += "<li><a href='?src=\ref[src];viewmachine=[T.id]'>\ref[T] [T.name]</a> ([T.id])</li>"
|
||||
dat += "</ul>"
|
||||
dat += "<br><a href='?src=\ref[src];operation=release'>\[Flush Buffer\]</a>"
|
||||
else
|
||||
dat += "<a href='?src=\ref[src];operation=probe'>\[Probe Network\]</a>"
|
||||
|
||||
|
||||
// --- Viewing Machine ---
|
||||
|
||||
if(1)
|
||||
dat += "<br>[temp]<br>"
|
||||
dat += "<center><a href='?src=\ref[src];operation=mainmenu'>\[Main Menu\]</a></center>"
|
||||
dat += "<br>Current Network: [network]<br>"
|
||||
dat += "Selected Network Entity: [SelectedMachine.name] ([SelectedMachine.id])<br>"
|
||||
dat += "Linked Entities: <ol>"
|
||||
for(var/obj/machinery/telecomms/T in SelectedMachine.links)
|
||||
if(!T.hide)
|
||||
dat += "<li><a href='?src=\ref[src];viewmachine=[T.id]'>\ref[T.id] [T.name]</a> ([T.id])</li>"
|
||||
dat += "</ol>"
|
||||
|
||||
|
||||
|
||||
user << browse(dat, "window=comm_monitor;size=575x400")
|
||||
onclose(user, "server_control")
|
||||
|
||||
temp = ""
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/computer/telecomms/monitor/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
|
||||
|
||||
add_fingerprint(usr)
|
||||
usr.set_machine(src)
|
||||
|
||||
if(href_list["viewmachine"])
|
||||
screen = 1
|
||||
for(var/obj/machinery/telecomms/T in machinelist)
|
||||
if(T.id == href_list["viewmachine"])
|
||||
SelectedMachine = T
|
||||
break
|
||||
|
||||
if(href_list["operation"])
|
||||
switch(href_list["operation"])
|
||||
|
||||
if("release")
|
||||
machinelist = list()
|
||||
screen = 0
|
||||
|
||||
if("mainmenu")
|
||||
screen = 0
|
||||
|
||||
if("probe")
|
||||
if(machinelist.len > 0)
|
||||
temp = "<font color = #D70B00>- FAILED: CANNOT PROBE WHEN BUFFER FULL -</font color>"
|
||||
|
||||
else
|
||||
for(var/obj/machinery/telecomms/T in range(25, src))
|
||||
if(T.network == network)
|
||||
machinelist.Add(T)
|
||||
|
||||
if(!machinelist.len)
|
||||
temp = "<font color = #D70B00>- FAILED: UNABLE TO LOCATE NETWORK ENTITIES IN \[[network]\] -</font color>"
|
||||
else
|
||||
temp = "<font color = #336699>- [machinelist.len] ENTITIES LOCATED & BUFFERED -</font color>"
|
||||
|
||||
screen = 0
|
||||
|
||||
|
||||
if(href_list["network"])
|
||||
|
||||
var/newnet = stripped_input(usr, "Which network do you want to view?", "Comm Monitor", network)
|
||||
if(newnet && ((usr in range(1, src) || issilicon(usr))))
|
||||
if(length(newnet) > 15)
|
||||
temp = "<font color = #D70B00>- FAILED: NETWORK TAG STRING TOO LENGHTLY -</font color>"
|
||||
|
||||
else
|
||||
network = newnet
|
||||
screen = 0
|
||||
machinelist = list()
|
||||
temp = "<font color = #336699>- NEW NETWORK TAG SET IN ADDRESS \[[network]\] -</font color>"
|
||||
|
||||
updateUsrDialog()
|
||||
return
|
||||
|
||||
/obj/machinery/computer/telecomms/monitor/attackby()
|
||||
..()
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
/obj/machinery/computer/telecomms/monitor/emag_act(mob/user as mob)
|
||||
if(!emagged)
|
||||
playsound(src.loc, 'sound/effects/sparks4.ogg', 75, 1)
|
||||
emagged = 1
|
||||
user << "<span class='notice'>You you disable the security protocols.</span>"
|
||||
@@ -1,285 +1,285 @@
|
||||
|
||||
|
||||
/obj/machinery/computer/telecomms/traffic
|
||||
name = "telecommunications traffic control console"
|
||||
|
||||
var/screen = 0 // the screen number:
|
||||
var/list/servers = list() // the servers located by the computer
|
||||
var/mob/editingcode
|
||||
var/mob/lasteditor
|
||||
var/list/viewingcode = list()
|
||||
var/obj/machinery/telecomms/server/SelectedServer
|
||||
|
||||
var/network = "NULL" // the network to probe
|
||||
var/temp = "" // temporary feedback messages
|
||||
|
||||
var/storedcode = "" // code stored
|
||||
var/obj/item/weapon/card/id/auth = null
|
||||
var/list/access_log = list()
|
||||
var/process = 0
|
||||
circuit = "/obj/item/weapon/circuitboard/comm_traffic"
|
||||
|
||||
req_access = list(access_tcomsat)
|
||||
|
||||
/obj/machinery/computer/telecomms/traffic/proc/stop_editing()
|
||||
if(editingcode)
|
||||
if(editingcode.client)
|
||||
winshow(editingcode, "Telecomms IDE", 0) // hide the window!
|
||||
editingcode.unset_machine()
|
||||
editingcode = null
|
||||
|
||||
/obj/machinery/computer/telecomms/traffic/process()
|
||||
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
stop_editing()
|
||||
return
|
||||
|
||||
if(editingcode && editingcode.machine != src)
|
||||
stop_editing()
|
||||
return
|
||||
|
||||
if(!editingcode)
|
||||
if(length(viewingcode) > 0)
|
||||
editingcode = pick(viewingcode)
|
||||
viewingcode.Remove(editingcode)
|
||||
return
|
||||
|
||||
process = !process
|
||||
if(!process)
|
||||
return
|
||||
|
||||
// loop if there's someone manning the keyboard
|
||||
if(!editingcode.client)
|
||||
stop_editing()
|
||||
return
|
||||
|
||||
// For the typer, the input is enabled. Buffer the typed text
|
||||
storedcode = "[winget(editingcode, "tcscode", "text")]"
|
||||
winset(editingcode, "tcscode", "is-disabled=false")
|
||||
|
||||
// If the player's not manning the keyboard anymore, adjust everything
|
||||
if(!in_range(editingcode, src) && !issilicon(editingcode) || editingcode.machine != src)
|
||||
winshow(editingcode, "Telecomms IDE", 0) // hide the window!
|
||||
editingcode = null
|
||||
return
|
||||
|
||||
// For other people viewing the typer type code, the input is disabled and they can only view the code
|
||||
// (this is put in place so that there's not any magical shenanigans with 50 people inputting different code all at once)
|
||||
|
||||
if(length(viewingcode))
|
||||
// This piece of code is very important - it escapes quotation marks so string aren't cut off by the input element
|
||||
var/showcode = replacetext(storedcode, "\\\"", "\\\\\"")
|
||||
showcode = replacetext(storedcode, "\"", "\\\"")
|
||||
|
||||
for(var/mob/M in viewingcode)
|
||||
|
||||
if( (M.machine == src && in_range(M, src) ) || issilicon(M))
|
||||
winset(M, "tcscode", "is-disabled=true")
|
||||
winset(M, "tcscode", "text=\"[showcode]\"")
|
||||
else
|
||||
viewingcode.Remove(M)
|
||||
winshow(M, "Telecomms IDE", 0) // hide the windows
|
||||
|
||||
|
||||
/obj/machinery/computer/telecomms/traffic/attack_hand(mob/user as mob)
|
||||
if(..())
|
||||
return
|
||||
user.set_machine(src)
|
||||
var/dat = "<TITLE>Telecommunication Traffic Control</TITLE><center><b>Telecommunications Traffic Control</b></center>"
|
||||
dat += "<br><b><font color='[(auth ? "green" : "red")]'>[(auth ? "AUTHED" : "NOT AUTHED")]:</font></b> <A href='?src=\ref[src];auth=1'>[(!auth ? "Insert ID" : auth)]</A><BR>"
|
||||
dat += "<A href='?src=\ref[src];print=1'>View System Log</A><HR>"
|
||||
|
||||
if(issilicon(user) || auth)
|
||||
|
||||
switch(screen)
|
||||
|
||||
|
||||
// --- Main Menu ---
|
||||
|
||||
if(0)
|
||||
dat += "<br>[temp]<br>"
|
||||
dat += "<br>Current Network: <a href='?src=\ref[src];network=1'>[network]</a><br>"
|
||||
if(servers.len)
|
||||
dat += "<br>Detected Telecommunication Servers:<ul>"
|
||||
for(var/obj/machinery/telecomms/T in servers)
|
||||
dat += "<li><a href='?src=\ref[src];viewserver=[T.id]'>\ref[T] [T.name]</a> ([T.id])</li>"
|
||||
dat += "</ul>"
|
||||
dat += "<br><a href='?src=\ref[src];operation=release'>\[Flush Buffer\]</a>"
|
||||
|
||||
else
|
||||
dat += "<br>No servers detected. Scan for servers: <a href='?src=\ref[src];operation=scan'>\[Scan\]</a>"
|
||||
|
||||
|
||||
// --- Viewing Server ---
|
||||
|
||||
if(1)
|
||||
if(SelectedServer)
|
||||
dat += "<br>[temp]<br>"
|
||||
dat += "<center><a href='?src=\ref[src];operation=mainmenu'>\[Main Menu\]</a> <a href='?src=\ref[src];operation=refresh'>\[Refresh\]</a></center>"
|
||||
dat += "<br>Current Network: [network]"
|
||||
dat += "<br>Selected Server: [SelectedServer.id]<br><br>"
|
||||
dat += "<br><a href='?src=\ref[src];operation=editcode'>\[Edit Code\]</a>"
|
||||
dat += "<br>Signal Execution: "
|
||||
if(SelectedServer.autoruncode)
|
||||
dat += "<a href='?src=\ref[src];operation=togglerun'>ALWAYS</a>"
|
||||
else
|
||||
dat += "<a href='?src=\ref[src];operation=togglerun'>NEVER</a>"
|
||||
else
|
||||
screen = 0
|
||||
return
|
||||
|
||||
|
||||
user << browse(dat, "window=traffic_control;size=575x400")
|
||||
onclose(user, "server_control")
|
||||
|
||||
temp = ""
|
||||
return
|
||||
|
||||
/obj/machinery/computer/telecomms/traffic/proc/create_log(var/entry, var/mob/user)
|
||||
var/id = null
|
||||
if(issilicon(user))
|
||||
id = "System Administrator"
|
||||
else
|
||||
if(auth)
|
||||
id = "[auth.registered_name] ([auth.assignment])"
|
||||
else
|
||||
ERROR("There is a null auth while the user isn't a silicon! ([user.name], [user.type])")
|
||||
return
|
||||
access_log += "\[[get_timestamp()]\] [id] [entry]"
|
||||
|
||||
/obj/machinery/computer/telecomms/traffic/proc/print_logs()
|
||||
. = "<center><h2>Traffic Control Telecomms System Log</h2></center><HR>"
|
||||
for(var/entry in access_log)
|
||||
. += entry + "<BR>"
|
||||
return .
|
||||
|
||||
/obj/machinery/computer/telecomms/traffic/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
|
||||
|
||||
add_fingerprint(usr)
|
||||
usr.set_machine(src)
|
||||
|
||||
if(href_list["auth"])
|
||||
if(iscarbon(usr))
|
||||
var/mob/living/carbon/C = usr
|
||||
if(!auth)
|
||||
var/obj/item/weapon/card/id/I = C.get_active_hand()
|
||||
if(istype(I))
|
||||
if(check_access(I))
|
||||
C.drop_item()
|
||||
I.loc = src
|
||||
auth = I
|
||||
create_log("has logged in.", usr)
|
||||
else
|
||||
create_log("has logged out.", usr)
|
||||
auth.loc = src.loc
|
||||
C.put_in_hands(auth)
|
||||
auth = null
|
||||
updateUsrDialog()
|
||||
return
|
||||
|
||||
if(href_list["print"])
|
||||
usr << browse(print_logs(), "window=traffic_logs")
|
||||
return
|
||||
|
||||
if(!auth && !issilicon(usr) && !emagged)
|
||||
usr << "<span class='danger'>ACCESS DENIED.</span>"
|
||||
return
|
||||
|
||||
if(href_list["viewserver"])
|
||||
screen = 1
|
||||
for(var/obj/machinery/telecomms/T in servers)
|
||||
if(T.id == href_list["viewserver"])
|
||||
SelectedServer = T
|
||||
create_log("selected server [T.name]", usr)
|
||||
break
|
||||
|
||||
|
||||
if(href_list["operation"])
|
||||
create_log("has performed action: [href_list["operation"]].", usr)
|
||||
switch(href_list["operation"])
|
||||
|
||||
if("release")
|
||||
servers = list()
|
||||
screen = 0
|
||||
|
||||
if("mainmenu")
|
||||
screen = 0
|
||||
|
||||
if("scan")
|
||||
if(servers.len > 0)
|
||||
temp = "<font color = #D70B00>- FAILED: CANNOT PROBE WHEN BUFFER FULL -</font color>"
|
||||
|
||||
else
|
||||
for(var/obj/machinery/telecomms/server/T in range(25, src))
|
||||
if(T.network == network)
|
||||
servers.Add(T)
|
||||
|
||||
if(!servers.len)
|
||||
temp = "<font color = #D70B00>- FAILED: UNABLE TO LOCATE SERVERS IN \[[network]\] -</font color>"
|
||||
else
|
||||
temp = "<font color = #336699>- [servers.len] SERVERS PROBED & BUFFERED -</font color>"
|
||||
|
||||
screen = 0
|
||||
|
||||
if("editcode")
|
||||
if(editingcode == usr) return
|
||||
if(usr in viewingcode) return
|
||||
|
||||
if(!editingcode)
|
||||
lasteditor = usr
|
||||
editingcode = usr
|
||||
winshow(editingcode, "Telecomms IDE", 1) // show the IDE
|
||||
winset(editingcode, "tcscode", "is-disabled=false")
|
||||
winset(editingcode, "tcscode", "text=\"\"")
|
||||
var/showcode = replacetext(storedcode, "\\\"", "\\\\\"")
|
||||
showcode = replacetext(storedcode, "\"", "\\\"")
|
||||
winset(editingcode, "tcscode", "text=\"[showcode]\"")
|
||||
|
||||
else
|
||||
viewingcode.Add(usr)
|
||||
winshow(usr, "Telecomms IDE", 1) // show the IDE
|
||||
winset(usr, "tcscode", "is-disabled=true")
|
||||
winset(editingcode, "tcscode", "text=\"\"")
|
||||
var/showcode = replacetext(storedcode, "\"", "\\\"")
|
||||
winset(usr, "tcscode", "text=\"[showcode]\"")
|
||||
|
||||
if("togglerun")
|
||||
SelectedServer.autoruncode = !(SelectedServer.autoruncode)
|
||||
|
||||
if(href_list["network"])
|
||||
|
||||
var/newnet = stripped_input(usr, "Which network do you want to view?", "Comm Monitor", network)
|
||||
|
||||
if(newnet && canAccess(usr))
|
||||
if(length(newnet) > 15)
|
||||
temp = "<font color = #D70B00>- FAILED: NETWORK TAG STRING TOO LENGHTLY -</font color>"
|
||||
|
||||
else
|
||||
|
||||
network = newnet
|
||||
screen = 0
|
||||
servers = list()
|
||||
temp = "<font color = #336699>- NEW NETWORK TAG SET IN ADDRESS \[[network]\] -</font color>"
|
||||
create_log("has set the network to [network].", usr)
|
||||
|
||||
updateUsrDialog()
|
||||
return
|
||||
|
||||
/obj/machinery/computer/telecomms/traffic/attackby()
|
||||
..()
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
/obj/machinery/computer/telecomms/traffic/emag_act(mob/user as mob)
|
||||
if(!emagged)
|
||||
playsound(src.loc, 'sound/effects/sparks4.ogg', 75, 1)
|
||||
emagged = 1
|
||||
user << "<span class='notice'>You you disable the security protocols.</span>"
|
||||
|
||||
/obj/machinery/computer/telecomms/traffic/proc/canAccess(var/mob/user)
|
||||
if(issilicon(user) || in_range(user, src))
|
||||
return 1
|
||||
|
||||
|
||||
/obj/machinery/computer/telecomms/traffic
|
||||
name = "telecommunications traffic control console"
|
||||
|
||||
var/screen = 0 // the screen number:
|
||||
var/list/servers = list() // the servers located by the computer
|
||||
var/mob/editingcode
|
||||
var/mob/lasteditor
|
||||
var/list/viewingcode = list()
|
||||
var/obj/machinery/telecomms/server/SelectedServer
|
||||
|
||||
var/network = "NULL" // the network to probe
|
||||
var/temp = "" // temporary feedback messages
|
||||
|
||||
var/storedcode = "" // code stored
|
||||
var/obj/item/weapon/card/id/auth = null
|
||||
var/list/access_log = list()
|
||||
var/process = 0
|
||||
circuit = "/obj/item/weapon/circuitboard/comm_traffic"
|
||||
|
||||
req_access = list(access_tcomsat)
|
||||
|
||||
/obj/machinery/computer/telecomms/traffic/proc/stop_editing()
|
||||
if(editingcode)
|
||||
if(editingcode.client)
|
||||
winshow(editingcode, "Telecomms IDE", 0) // hide the window!
|
||||
editingcode.unset_machine()
|
||||
editingcode = null
|
||||
|
||||
/obj/machinery/computer/telecomms/traffic/process()
|
||||
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
stop_editing()
|
||||
return
|
||||
|
||||
if(editingcode && editingcode.machine != src)
|
||||
stop_editing()
|
||||
return
|
||||
|
||||
if(!editingcode)
|
||||
if(length(viewingcode) > 0)
|
||||
editingcode = pick(viewingcode)
|
||||
viewingcode.Remove(editingcode)
|
||||
return
|
||||
|
||||
process = !process
|
||||
if(!process)
|
||||
return
|
||||
|
||||
// loop if there's someone manning the keyboard
|
||||
if(!editingcode.client)
|
||||
stop_editing()
|
||||
return
|
||||
|
||||
// For the typer, the input is enabled. Buffer the typed text
|
||||
storedcode = "[winget(editingcode, "tcscode", "text")]"
|
||||
winset(editingcode, "tcscode", "is-disabled=false")
|
||||
|
||||
// If the player's not manning the keyboard anymore, adjust everything
|
||||
if(!in_range(editingcode, src) && !issilicon(editingcode) || editingcode.machine != src)
|
||||
winshow(editingcode, "Telecomms IDE", 0) // hide the window!
|
||||
editingcode = null
|
||||
return
|
||||
|
||||
// For other people viewing the typer type code, the input is disabled and they can only view the code
|
||||
// (this is put in place so that there's not any magical shenanigans with 50 people inputting different code all at once)
|
||||
|
||||
if(length(viewingcode))
|
||||
// This piece of code is very important - it escapes quotation marks so string aren't cut off by the input element
|
||||
var/showcode = replacetext(storedcode, "\\\"", "\\\\\"")
|
||||
showcode = replacetext(storedcode, "\"", "\\\"")
|
||||
|
||||
for(var/mob/M in viewingcode)
|
||||
|
||||
if( (M.machine == src && in_range(M, src) ) || issilicon(M))
|
||||
winset(M, "tcscode", "is-disabled=true")
|
||||
winset(M, "tcscode", "text=\"[showcode]\"")
|
||||
else
|
||||
viewingcode.Remove(M)
|
||||
winshow(M, "Telecomms IDE", 0) // hide the windows
|
||||
|
||||
|
||||
/obj/machinery/computer/telecomms/traffic/attack_hand(mob/user as mob)
|
||||
if(..())
|
||||
return
|
||||
user.set_machine(src)
|
||||
var/dat = "<TITLE>Telecommunication Traffic Control</TITLE><center><b>Telecommunications Traffic Control</b></center>"
|
||||
dat += "<br><b><font color='[(auth ? "green" : "red")]'>[(auth ? "AUTHED" : "NOT AUTHED")]:</font></b> <A href='?src=\ref[src];auth=1'>[(!auth ? "Insert ID" : auth)]</A><BR>"
|
||||
dat += "<A href='?src=\ref[src];print=1'>View System Log</A><HR>"
|
||||
|
||||
if(issilicon(user) || auth)
|
||||
|
||||
switch(screen)
|
||||
|
||||
|
||||
// --- Main Menu ---
|
||||
|
||||
if(0)
|
||||
dat += "<br>[temp]<br>"
|
||||
dat += "<br>Current Network: <a href='?src=\ref[src];network=1'>[network]</a><br>"
|
||||
if(servers.len)
|
||||
dat += "<br>Detected Telecommunication Servers:<ul>"
|
||||
for(var/obj/machinery/telecomms/T in servers)
|
||||
dat += "<li><a href='?src=\ref[src];viewserver=[T.id]'>\ref[T] [T.name]</a> ([T.id])</li>"
|
||||
dat += "</ul>"
|
||||
dat += "<br><a href='?src=\ref[src];operation=release'>\[Flush Buffer\]</a>"
|
||||
|
||||
else
|
||||
dat += "<br>No servers detected. Scan for servers: <a href='?src=\ref[src];operation=scan'>\[Scan\]</a>"
|
||||
|
||||
|
||||
// --- Viewing Server ---
|
||||
|
||||
if(1)
|
||||
if(SelectedServer)
|
||||
dat += "<br>[temp]<br>"
|
||||
dat += "<center><a href='?src=\ref[src];operation=mainmenu'>\[Main Menu\]</a> <a href='?src=\ref[src];operation=refresh'>\[Refresh\]</a></center>"
|
||||
dat += "<br>Current Network: [network]"
|
||||
dat += "<br>Selected Server: [SelectedServer.id]<br><br>"
|
||||
dat += "<br><a href='?src=\ref[src];operation=editcode'>\[Edit Code\]</a>"
|
||||
dat += "<br>Signal Execution: "
|
||||
if(SelectedServer.autoruncode)
|
||||
dat += "<a href='?src=\ref[src];operation=togglerun'>ALWAYS</a>"
|
||||
else
|
||||
dat += "<a href='?src=\ref[src];operation=togglerun'>NEVER</a>"
|
||||
else
|
||||
screen = 0
|
||||
return
|
||||
|
||||
|
||||
user << browse(dat, "window=traffic_control;size=575x400")
|
||||
onclose(user, "server_control")
|
||||
|
||||
temp = ""
|
||||
return
|
||||
|
||||
/obj/machinery/computer/telecomms/traffic/proc/create_log(var/entry, var/mob/user)
|
||||
var/id = null
|
||||
if(issilicon(user))
|
||||
id = "System Administrator"
|
||||
else
|
||||
if(auth)
|
||||
id = "[auth.registered_name] ([auth.assignment])"
|
||||
else
|
||||
ERROR("There is a null auth while the user isn't a silicon! ([user.name], [user.type])")
|
||||
return
|
||||
access_log += "\[[get_timestamp()]\] [id] [entry]"
|
||||
|
||||
/obj/machinery/computer/telecomms/traffic/proc/print_logs()
|
||||
. = "<center><h2>Traffic Control Telecomms System Log</h2></center><HR>"
|
||||
for(var/entry in access_log)
|
||||
. += entry + "<BR>"
|
||||
return .
|
||||
|
||||
/obj/machinery/computer/telecomms/traffic/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
|
||||
|
||||
add_fingerprint(usr)
|
||||
usr.set_machine(src)
|
||||
|
||||
if(href_list["auth"])
|
||||
if(iscarbon(usr))
|
||||
var/mob/living/carbon/C = usr
|
||||
if(!auth)
|
||||
var/obj/item/weapon/card/id/I = C.get_active_hand()
|
||||
if(istype(I))
|
||||
if(check_access(I))
|
||||
C.drop_item()
|
||||
I.loc = src
|
||||
auth = I
|
||||
create_log("has logged in.", usr)
|
||||
else
|
||||
create_log("has logged out.", usr)
|
||||
auth.loc = src.loc
|
||||
C.put_in_hands(auth)
|
||||
auth = null
|
||||
updateUsrDialog()
|
||||
return
|
||||
|
||||
if(href_list["print"])
|
||||
usr << browse(print_logs(), "window=traffic_logs")
|
||||
return
|
||||
|
||||
if(!auth && !issilicon(usr) && !emagged)
|
||||
usr << "<span class='danger'>ACCESS DENIED.</span>"
|
||||
return
|
||||
|
||||
if(href_list["viewserver"])
|
||||
screen = 1
|
||||
for(var/obj/machinery/telecomms/T in servers)
|
||||
if(T.id == href_list["viewserver"])
|
||||
SelectedServer = T
|
||||
create_log("selected server [T.name]", usr)
|
||||
break
|
||||
|
||||
|
||||
if(href_list["operation"])
|
||||
create_log("has performed action: [href_list["operation"]].", usr)
|
||||
switch(href_list["operation"])
|
||||
|
||||
if("release")
|
||||
servers = list()
|
||||
screen = 0
|
||||
|
||||
if("mainmenu")
|
||||
screen = 0
|
||||
|
||||
if("scan")
|
||||
if(servers.len > 0)
|
||||
temp = "<font color = #D70B00>- FAILED: CANNOT PROBE WHEN BUFFER FULL -</font color>"
|
||||
|
||||
else
|
||||
for(var/obj/machinery/telecomms/server/T in range(25, src))
|
||||
if(T.network == network)
|
||||
servers.Add(T)
|
||||
|
||||
if(!servers.len)
|
||||
temp = "<font color = #D70B00>- FAILED: UNABLE TO LOCATE SERVERS IN \[[network]\] -</font color>"
|
||||
else
|
||||
temp = "<font color = #336699>- [servers.len] SERVERS PROBED & BUFFERED -</font color>"
|
||||
|
||||
screen = 0
|
||||
|
||||
if("editcode")
|
||||
if(editingcode == usr) return
|
||||
if(usr in viewingcode) return
|
||||
|
||||
if(!editingcode)
|
||||
lasteditor = usr
|
||||
editingcode = usr
|
||||
winshow(editingcode, "Telecomms IDE", 1) // show the IDE
|
||||
winset(editingcode, "tcscode", "is-disabled=false")
|
||||
winset(editingcode, "tcscode", "text=\"\"")
|
||||
var/showcode = replacetext(storedcode, "\\\"", "\\\\\"")
|
||||
showcode = replacetext(storedcode, "\"", "\\\"")
|
||||
winset(editingcode, "tcscode", "text=\"[showcode]\"")
|
||||
|
||||
else
|
||||
viewingcode.Add(usr)
|
||||
winshow(usr, "Telecomms IDE", 1) // show the IDE
|
||||
winset(usr, "tcscode", "is-disabled=true")
|
||||
winset(editingcode, "tcscode", "text=\"\"")
|
||||
var/showcode = replacetext(storedcode, "\"", "\\\"")
|
||||
winset(usr, "tcscode", "text=\"[showcode]\"")
|
||||
|
||||
if("togglerun")
|
||||
SelectedServer.autoruncode = !(SelectedServer.autoruncode)
|
||||
|
||||
if(href_list["network"])
|
||||
|
||||
var/newnet = stripped_input(usr, "Which network do you want to view?", "Comm Monitor", network)
|
||||
|
||||
if(newnet && canAccess(usr))
|
||||
if(length(newnet) > 15)
|
||||
temp = "<font color = #D70B00>- FAILED: NETWORK TAG STRING TOO LENGHTLY -</font color>"
|
||||
|
||||
else
|
||||
|
||||
network = newnet
|
||||
screen = 0
|
||||
servers = list()
|
||||
temp = "<font color = #336699>- NEW NETWORK TAG SET IN ADDRESS \[[network]\] -</font color>"
|
||||
create_log("has set the network to [network].", usr)
|
||||
|
||||
updateUsrDialog()
|
||||
return
|
||||
|
||||
/obj/machinery/computer/telecomms/traffic/attackby()
|
||||
..()
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
|
||||
/obj/machinery/computer/telecomms/traffic/emag_act(mob/user as mob)
|
||||
if(!emagged)
|
||||
playsound(src.loc, 'sound/effects/sparks4.ogg', 75, 1)
|
||||
emagged = 1
|
||||
user << "<span class='notice'>You you disable the security protocols.</span>"
|
||||
|
||||
/obj/machinery/computer/telecomms/traffic/proc/canAccess(var/mob/user)
|
||||
if(issilicon(user) || in_range(user, src))
|
||||
return 1
|
||||
return 0
|
||||
@@ -1,28 +1,28 @@
|
||||
/*Completely generic structures for use by mappers to create fake objects, i.e. display rooms*/
|
||||
/obj/structure/showcase
|
||||
name = "showcase"
|
||||
icon = 'icons/obj/stationobjs.dmi'
|
||||
icon_state = "showcase_1"
|
||||
desc = "A stand with the empty body of a cyborg bolted to it."
|
||||
density = 1
|
||||
anchored = 1
|
||||
|
||||
/obj/structure/showcase/fakeid
|
||||
name = "\improper Centcom identification console"
|
||||
desc = "You can use this to change ID's."
|
||||
icon = 'icons/obj/computer.dmi'
|
||||
icon_state = "computer"
|
||||
|
||||
/obj/structure/showcase/fakeid/New()
|
||||
overlays += "id"
|
||||
overlays += "id_key"
|
||||
|
||||
/obj/structure/showcase/fakesec
|
||||
name = "\improper Centcom security records"
|
||||
desc = "Used to view and edit personnel's security records"
|
||||
icon = 'icons/obj/computer.dmi'
|
||||
icon_state = "computer"
|
||||
|
||||
/obj/structure/showcase/fakesec/New()
|
||||
overlays += "security"
|
||||
/*Completely generic structures for use by mappers to create fake objects, i.e. display rooms*/
|
||||
/obj/structure/showcase
|
||||
name = "showcase"
|
||||
icon = 'icons/obj/stationobjs.dmi'
|
||||
icon_state = "showcase_1"
|
||||
desc = "A stand with the empty body of a cyborg bolted to it."
|
||||
density = 1
|
||||
anchored = 1
|
||||
|
||||
/obj/structure/showcase/fakeid
|
||||
name = "\improper Centcom identification console"
|
||||
desc = "You can use this to change ID's."
|
||||
icon = 'icons/obj/computer.dmi'
|
||||
icon_state = "computer"
|
||||
|
||||
/obj/structure/showcase/fakeid/New()
|
||||
overlays += "id"
|
||||
overlays += "id_key"
|
||||
|
||||
/obj/structure/showcase/fakesec
|
||||
name = "\improper Centcom security records"
|
||||
desc = "Used to view and edit personnel's security records"
|
||||
icon = 'icons/obj/computer.dmi'
|
||||
icon_state = "computer"
|
||||
|
||||
/obj/structure/showcase/fakesec/New()
|
||||
overlays += "security"
|
||||
overlays += "security_key"
|
||||
Reference in New Issue
Block a user