mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
Huge fukken commit. Very game-changing new feature has been added but it isn't actually available to players yet.
Spess Networking Technology:
▪ The machines are located in Centcom near the cargo shuttle.
▪ A new admin debug verb "Change Radio Type". Using this will toggle between old (current) radio code and the new radio code. ADMINS: I recommend only doing this if Doohl (me) is around to take note of anything that happens.
▪ The whole thing works, in theory, but hasn't been stress-tested with the usual 60+ players. I will write up a Tgstation Wiki article and/or explain what some of the stuff does in IRC or ingame.
One last thing to point out: this is a PROTOTYPE. I have tested it myself and optimized the code very well. In theory, this new radio system is significantly less laggy AND has many more features. However, because of it's a prototype, it can at any time destroy the server. The reason I am committing this and not updating the changelog is because it's not an actual feature YET. I want to stress test this on the servers to see how it fairs, then add some more stuff to it like the ability to link machines and repair networks.
git-svn-id: http://tgstation13.googlecode.com/svn/trunk@2807 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
157
code/game/machinery/telecomms/telemonitor.dm
Normal file
157
code/game/machinery/telecomms/telemonitor.dm
Normal file
@@ -0,0 +1,157 @@
|
||||
|
||||
/*
|
||||
Telecomms monitor tracks the overall trafficing of a telecommunications network
|
||||
and displays a heirarchy of linked machines.
|
||||
*/
|
||||
|
||||
|
||||
/obj/machinery/computer/telecomms/monitor
|
||||
name = "Telecommunications Monitor"
|
||||
icon_state = "comm_monitor"
|
||||
|
||||
var
|
||||
screen = 0 // the screen number:
|
||||
list/machines = list() // the machines located by the computer
|
||||
var/obj/machinery/telecomms/SelectedMachine
|
||||
|
||||
network = "NULL" // the network to probe
|
||||
|
||||
temp = "" // temporary feedback messages
|
||||
|
||||
req_access = list(access_engine)
|
||||
|
||||
attack_hand(mob/user as mob)
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
return
|
||||
user.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];input=network'>[network]</a><br>"
|
||||
if(machines.len)
|
||||
dat += "<br>Detected Network Entities:<ul>"
|
||||
for(var/obj/machinery/telecomms/T in machines)
|
||||
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)
|
||||
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
|
||||
|
||||
|
||||
Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
|
||||
|
||||
add_fingerprint(usr)
|
||||
usr.machine = src
|
||||
if(!src.allowed(usr) && !emagged)
|
||||
usr << "\red ACCESS DENIED."
|
||||
return
|
||||
|
||||
if(href_list["viewmachine"])
|
||||
screen = 1
|
||||
for(var/obj/machinery/telecomms/T in machines)
|
||||
if(T.id == href_list["viewmachine"])
|
||||
SelectedMachine = T
|
||||
break
|
||||
|
||||
if(href_list["operation"])
|
||||
switch(href_list["operation"])
|
||||
|
||||
if("release")
|
||||
machines = list()
|
||||
screen = 0
|
||||
|
||||
if("mainmenu")
|
||||
screen = 0
|
||||
|
||||
if("probe")
|
||||
if(machines.len > 0)
|
||||
temp = "- FAILED: CANNOT PROBE WHEN BUFFER FULL -"
|
||||
|
||||
else
|
||||
for(var/obj/machinery/telecomms/T in range(25, src))
|
||||
if(T.network == network)
|
||||
machines.Add(T)
|
||||
|
||||
if(!machines.len)
|
||||
temp = "- FAILED: UNABLE TO LOCATE NETWORK ENTITIES IN \[[network]\] -"
|
||||
else
|
||||
temp = "- [machines.len] ENTITIES LOCATED & BUFFERED -"
|
||||
|
||||
screen = 0
|
||||
|
||||
|
||||
if(href_list["input"])
|
||||
|
||||
var/newnet = input(usr, "Which network do you want to view?", "Comm Monitor", network) as null|text
|
||||
if(newnet && usr in range(1, src))
|
||||
network = newnet
|
||||
screen = 0
|
||||
machines = list()
|
||||
temp = "- NEW NETWORK TAG SET IN ADDRESS \[[network]\] -"
|
||||
|
||||
updateUsrDialog()
|
||||
return
|
||||
|
||||
attackby(var/obj/item/weapon/D as obj, var/mob/user as mob)
|
||||
if(istype(D, /obj/item/weapon/screwdriver))
|
||||
playsound(src.loc, 'Screwdriver.ogg', 50, 1)
|
||||
if(do_after(user, 20))
|
||||
if (src.stat & BROKEN)
|
||||
user << "\blue The broken glass falls out."
|
||||
var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc )
|
||||
new /obj/item/weapon/shard( src.loc )
|
||||
var/obj/item/weapon/circuitboard/comm_monitor/M = new /obj/item/weapon/circuitboard/comm_monitor( A )
|
||||
for (var/obj/C in src)
|
||||
C.loc = src.loc
|
||||
A.circuit = M
|
||||
A.state = 3
|
||||
A.icon_state = "3"
|
||||
A.anchored = 1
|
||||
del(src)
|
||||
else
|
||||
user << "\blue You disconnect the monitor."
|
||||
var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc )
|
||||
var/obj/item/weapon/circuitboard/comm_monitor/M = new /obj/item/weapon/circuitboard/comm_monitor( A )
|
||||
for (var/obj/C in src)
|
||||
C.loc = src.loc
|
||||
A.circuit = M
|
||||
A.state = 4
|
||||
A.icon_state = "4"
|
||||
A.anchored = 1
|
||||
del(src)
|
||||
else if(istype(D, /obj/item/weapon/card/emag) && !emagged)
|
||||
playsound(src.loc, 'sparks4.ogg', 75, 1)
|
||||
emagged = 1
|
||||
user << "\blue You you disable the security protocols"
|
||||
src.updateUsrDialog()
|
||||
return
|
||||
Reference in New Issue
Block a user