mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2025-12-27 18:51:53 +00:00
255 lines
7.8 KiB
Plaintext
255 lines
7.8 KiB
Plaintext
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31
|
|
/obj/machinery/computer/telecomms
|
|
|
|
light_color = LIGHT_COLOR_DARKGREEN
|
|
|
|
/obj/machinery/computer/telecomms/server
|
|
name = "Telecommunications Server Monitor"
|
|
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"
|
|
|
|
attack_hand(mob/user as mob)
|
|
if(stat & (BROKEN|NOPOWER))
|
|
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/mob/M = new mobtype
|
|
|
|
if(ishuman(M) || isbrain(M))
|
|
var/mob/living/carbon/human/H = M
|
|
race = "[H.species.name]"
|
|
|
|
|
|
else if(issmall(M))
|
|
race = "Monkey"
|
|
language = race
|
|
|
|
else if(issilicon(M) || C.parameters["job"] == "AI") // sometimes M gets deleted prematurely for AIs... just check the job
|
|
race = "Artificial Life"
|
|
|
|
else if(isslime(M)) // NT knows a lot about slimes, but not aliens. Can identify slimes
|
|
race = "slime"
|
|
language = race
|
|
|
|
else if(isanimal(M))
|
|
race = "Domestic Animal"
|
|
language = race
|
|
|
|
else
|
|
race = "<i>Unidentifiable</i>"
|
|
language = race
|
|
|
|
qdel(M)
|
|
|
|
// -- 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
|
|
|
|
|
|
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 << "\red ACCESS DENIED."
|
|
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)
|
|
qdel(D)
|
|
|
|
else
|
|
temp = "<font color = #D70B00>- FAILED: NO SELECTED MACHINE -</font color>"
|
|
|
|
if(href_list["network"])
|
|
|
|
var/newnet = input(usr, "Which network do you want to view?", "Comm Monitor", network) as null|text
|
|
|
|
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
|
|
|
|
attackby(var/obj/item/weapon/D as obj, var/mob/user as mob, params)
|
|
if(istype(D, /obj/item/weapon/screwdriver))
|
|
playsound(src.loc, 'sound/items/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 )
|
|
PoolOrNew(/obj/item/weapon/shard, loc)
|
|
var/obj/item/weapon/circuitboard/comm_server/M = new /obj/item/weapon/circuitboard/comm_server( A )
|
|
for (var/obj/C in src)
|
|
C.loc = src.loc
|
|
A.circuit = M
|
|
A.state = 3
|
|
A.icon_state = "3"
|
|
A.anchored = 1
|
|
qdel(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_server/M = new /obj/item/weapon/circuitboard/comm_server( A )
|
|
for (var/obj/C in src)
|
|
C.loc = src.loc
|
|
A.circuit = M
|
|
A.state = 4
|
|
A.icon_state = "4"
|
|
A.anchored = 1
|
|
qdel(src)
|
|
src.updateUsrDialog()
|
|
return
|
|
|
|
emag_act(user as mob)
|
|
if(!emagged)
|
|
playsound(src.loc, 'sound/effects/sparks4.ogg', 75, 1)
|
|
emagged = 1
|
|
user << "\blue You you disable the security protocols"
|