mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-25 21:19:00 +01:00
More work done on Telecomms:
▫ Signals can now be rejected by Subspace broadcasters through a specific data[] parameter. ▫ Improved the log browser. ▫ Log browsers and telecommunication monitors no longer require access to use. You do need access to delete logs, however. ▫ Intercoms need power to work. They don't drain power, they just need a constant flow of equipment power. As such, that offline intercom sprite's now finally being put to use. Scripting language: ▫ Sorry about all the files; they're all necessary! It's important to notice that the basic structure of the scripting language code is not mine; I cannibalized the base structure from some obscure BYOND project. It's pretty well documented, and I'd say easier to browse through than atmos. Here's the basic deal: A compiler datum manages the relationships between the three main subsystems of a scripting language: the Scanner, the Parser, and the Interpreter. The Scanner splits raw text into token datums that the Parser can read. The Parser transforms the otherwise random bits and strings into ordered AST Trees and nodes for the Interpreter to read. The interpreter actually executes the code and handles scope/functions/code blocks. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@3193 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -25,9 +25,13 @@ var
|
||||
|
||||
receive_information(datum/signal/signal, obj/machinery/telecomms/machine_from)
|
||||
|
||||
// Don't broadcast rejected signals
|
||||
if(signal.data["reject"])
|
||||
return
|
||||
|
||||
if(signal.data["message"])
|
||||
|
||||
// Kind of lame way to prevent MASSIVE RADIO SPAM but it works
|
||||
// Prevents massive radio spam
|
||||
if("[signal.data["message"]]:[signal.data["realname"]]" in recentmessages)
|
||||
return
|
||||
recentmessages.Add( "[signal.data["message"]]:[signal.data["realname"]]" )
|
||||
@@ -43,19 +47,48 @@ var
|
||||
if(signal.data["slow"] > 0)
|
||||
sleep(signal.data["slow"]) // simulate the network lag if necessary
|
||||
|
||||
/* ###### Broadcast a message using signal.data ###### */
|
||||
Broadcast_Message(signal.data["connection"], signal.data["mob"],
|
||||
signal.data["vmask"], signal.data["vmessage"],
|
||||
signal.data["radio"], signal.data["message"],
|
||||
signal.data["name"], signal.data["job"],
|
||||
signal.data["realname"], signal.data["vname"],, signal.data["compression"])
|
||||
|
||||
/* --- Do a snazzy animation! --- */
|
||||
flick("broadcaster_send", src)
|
||||
/** #### - Normal Broadcast - #### **/
|
||||
|
||||
if(signal.data["type"] == 0)
|
||||
|
||||
/* ###### Broadcast a message using signal.data ###### */
|
||||
Broadcast_Message(signal.data["connection"], signal.data["mob"],
|
||||
signal.data["vmask"], signal.data["vmessage"],
|
||||
signal.data["radio"], signal.data["message"],
|
||||
signal.data["name"], signal.data["job"],
|
||||
signal.data["realname"], signal.data["vname"],, signal.data["compression"])
|
||||
|
||||
|
||||
/** #### - Simple Broadcast - #### **/
|
||||
|
||||
if(signal.data["type"] == 1)
|
||||
|
||||
/* ###### Broadcast a message using signal.data ###### */
|
||||
Broadcast_SimpleMessage(signal.data["source"], signal.data["frequency"],
|
||||
signal.data["message"],null, null,
|
||||
signal.data["compression"])
|
||||
|
||||
|
||||
/** #### - Artificial Broadcast - #### **/
|
||||
// (Imitates a mob)
|
||||
|
||||
if(signal.data["type"] == 2)
|
||||
|
||||
/* ###### Broadcast a message using signal.data ###### */
|
||||
// Parameter "data" as 4: AI can't track this person/mob
|
||||
|
||||
Broadcast_Message(signal.data["connection"], signal.data["mob"],
|
||||
signal.data["vmask"], signal.data["vmessage"],
|
||||
signal.data["radio"], signal.data["message"],
|
||||
signal.data["name"], signal.data["job"],
|
||||
signal.data["realname"], signal.data["vname"], 4, signal.data["compression"])
|
||||
|
||||
spawn(1)
|
||||
recentmessages = list()
|
||||
|
||||
/* --- Do a snazzy animation! --- */
|
||||
flick("broadcaster_send", src)
|
||||
|
||||
/*
|
||||
Basically just an empty shell for receiving and broadcasting radio messages. Not
|
||||
@@ -105,7 +138,7 @@ var
|
||||
signal.data["realname"], signal.data["vname"],, signal.data["compression"])
|
||||
else
|
||||
if(intercept)
|
||||
Broadcast_Message(signal.data["connection"], signal.data["mob"],
|
||||
Broadcast_Message(signal.data["source"], signal.frequency,
|
||||
signal.data["vmask"], signal.data["vmessage"],
|
||||
signal.data["radio"], signal.data["message"],
|
||||
signal.data["name"], signal.data["job"],
|
||||
@@ -156,6 +189,7 @@ var
|
||||
1 -- Will only broadcast to intercoms
|
||||
2 -- Will only broadcast to intercoms and station-bounced radios
|
||||
3 -- Broadcast to syndicate frequency
|
||||
4 -- AI can't track down this person. Useful for imitation broadcasts where you can't find the actual mob
|
||||
|
||||
@param compression:
|
||||
If 0, the signal is audible
|
||||
@@ -348,6 +382,8 @@ var
|
||||
|
||||
//End of research and feedback code.
|
||||
|
||||
var/aitrack = ""
|
||||
|
||||
/* ###### Send the message ###### */
|
||||
|
||||
|
||||
@@ -358,19 +394,27 @@ var
|
||||
var/J = job
|
||||
var/rendered = "[part_a][N][part_b][quotedmsg][part_c]"
|
||||
for (var/mob/R in heard_masked)
|
||||
aitrack = "<a href='byond://?src=\ref[radio];track2=\ref[R];track=\ref[M]'>"
|
||||
if(data == 4)
|
||||
aitrack = "<a href='byond://?src=\ref[radio];track2=\ref[R];faketrack=\ref[M]'>"
|
||||
|
||||
if(istype(R, /mob/living/silicon/ai))
|
||||
R.show_message("[part_a]<a href='byond://?src=\ref[radio];track2=\ref[R];track=\ref[M]'>[N] ([J]) </a>[part_b][quotedmsg][part_c]", 2)
|
||||
R.show_message("[part_a][aitrack][N] ([J]) </a>[part_b][quotedmsg][part_c]", 2)
|
||||
else
|
||||
R.show_message(rendered, 2)
|
||||
|
||||
/* --- Process all the mobs that heard the voice normally (understood) --- */
|
||||
|
||||
if (length(heard_normal))
|
||||
var/rendered = "[part_a][M.real_name][part_b][quotedmsg][part_c]"
|
||||
var/rendered = "[part_a][realname][part_b][quotedmsg][part_c]"
|
||||
|
||||
for (var/mob/R in heard_normal)
|
||||
aitrack = "<a href='byond://?src=\ref[radio];track2=\ref[R];track=\ref[M]'>"
|
||||
if(data == 4)
|
||||
aitrack = "<a href='byond://?src=\ref[radio];track2=\ref[R];faketrack=\ref[M]'>"
|
||||
|
||||
if(istype(R, /mob/living/silicon/ai))
|
||||
R.show_message("[part_a]<a href='byond://?src=\ref[radio];track2=\ref[R];track=\ref[M]'>[realname] ([job]) </a>[part_b][quotedmsg][part_c]", 2)
|
||||
R.show_message("[part_a][aitrack][realname] ([job]) </a>[part_b][quotedmsg][part_c]", 2)
|
||||
else
|
||||
R.show_message(rendered, 2)
|
||||
|
||||
@@ -381,8 +425,13 @@ var
|
||||
var/rendered = "[part_a][vname][part_b][M.voice_message][part_c]"
|
||||
|
||||
for (var/mob/R in heard_voice)
|
||||
aitrack = "<a href='byond://?src=\ref[radio];track2=\ref[R];track=\ref[M]'>"
|
||||
if(data == 4)
|
||||
aitrack = "<a href='byond://?src=\ref[radio];track2=\ref[R];faketrack=\ref[M]'>"
|
||||
|
||||
|
||||
if(istype(R, /mob/living/silicon/ai))
|
||||
R.show_message("[part_a]<a href='byond://?src=\ref[radio];track2=\ref[R];track=\ref[M]'>[vname] ([job]) </a>[part_b][vmessage]][part_c]", 2)
|
||||
R.show_message("[part_a][aitrack][vname] ([job]) </a>[part_b][vmessage]][part_c]", 2)
|
||||
else
|
||||
R.show_message(rendered, 2)
|
||||
|
||||
@@ -394,8 +443,13 @@ var
|
||||
var/rendered = "[part_a][vname][part_b][quotedmsg][part_c]"
|
||||
|
||||
for (var/mob/R in heard_garbled)
|
||||
aitrack = "<a href='byond://?src=\ref[radio];track2=\ref[R];track=\ref[M]'>"
|
||||
if(data == 4)
|
||||
aitrack = "<a href='byond://?src=\ref[radio];track2=\ref[R];faketrack=\ref[M]'>"
|
||||
|
||||
|
||||
if(istype(R, /mob/living/silicon/ai))
|
||||
R.show_message("[part_a]<a href='byond://?src=\ref[radio];track2=\ref[R];track=\ref[M]'>[vname]</a>[part_b][quotedmsg][part_c]", 2)
|
||||
R.show_message("[part_a][aitrack][vname]</a>[part_b][quotedmsg][part_c]", 2)
|
||||
else
|
||||
R.show_message(rendered, 2)
|
||||
|
||||
@@ -407,10 +461,223 @@ var
|
||||
var/rendered = "[part_a][Gibberish(M.real_name, compression + 50)][part_b][quotedmsg][part_c]"
|
||||
|
||||
for (var/mob/R in heard_gibberish)
|
||||
aitrack = "<a href='byond://?src=\ref[radio];track2=\ref[R];track=\ref[M]'>"
|
||||
if(data == 4)
|
||||
aitrack = "<a href='byond://?src=\ref[radio];track2=\ref[R];faketrack=\ref[M]'>"
|
||||
|
||||
|
||||
if(istype(R, /mob/living/silicon/ai))
|
||||
R.show_message("[part_a]<a href='byond://?src=\ref[radio];track2=\ref[R];track=\ref[M]'>[Gibberish(realname, compression + 50)] ([Gibberish(job, compression + 50)]) </a>[part_b][quotedmsg][part_c]", 2)
|
||||
R.show_message("[part_a][aitrack][Gibberish(realname, compression + 50)] ([Gibberish(job, compression + 50)]) </a>[part_b][quotedmsg][part_c]", 2)
|
||||
else
|
||||
R.show_message(rendered, 2)
|
||||
|
||||
|
||||
|
||||
/proc/Broadcast_SimpleMessage(var/source, var/frequency, var/text, var/data, var/mob/M, var/compression)
|
||||
|
||||
|
||||
/* ###### Prepare the radio connection ###### */
|
||||
|
||||
if(!M)
|
||||
var/mob/living/carbon/human/H = new
|
||||
M = H
|
||||
|
||||
var/datum/radio_frequency/connection = radio_controller.return_frequency(frequency)
|
||||
|
||||
var/display_freq = connection.frequency
|
||||
|
||||
var/list/receive = list()
|
||||
|
||||
|
||||
// --- Broadcast only to intercom devices ---
|
||||
|
||||
if(data == 1)
|
||||
for (var/obj/item/device/radio/intercom/R in connection.devices["[RADIO_CHAT]"])
|
||||
|
||||
receive |= R.send_hear(display_freq)
|
||||
|
||||
|
||||
// --- Broadcast only to intercoms and station-bounced radios ---
|
||||
|
||||
else if(data == 2)
|
||||
for (var/obj/item/device/radio/R in connection.devices["[RADIO_CHAT]"])
|
||||
|
||||
if(istype(R, /obj/item/device/radio/headset))
|
||||
continue
|
||||
|
||||
receive |= R.send_hear(display_freq)
|
||||
|
||||
|
||||
// --- Broadcast to syndicate radio! ---
|
||||
|
||||
else if(data == 3)
|
||||
var/datum/radio_frequency/syndicateconnection = radio_controller.return_frequency(SYND_FREQ)
|
||||
|
||||
for (var/obj/item/device/radio/R in syndicateconnection.devices["[RADIO_CHAT]"])
|
||||
|
||||
receive |= R.send_hear(SYND_FREQ)
|
||||
|
||||
|
||||
// --- Broadcast to ALL radio devices ---
|
||||
|
||||
else
|
||||
for (var/obj/item/device/radio/R in connection.devices["[RADIO_CHAT]"])
|
||||
|
||||
receive |= R.send_hear(display_freq)
|
||||
|
||||
|
||||
/* ###### Organize the receivers into categories for displaying the message ###### */
|
||||
|
||||
// Understood the message:
|
||||
var/list/heard_normal = list() // normal message
|
||||
|
||||
// Did not understand the message:
|
||||
var/list/heard_garbled = list() // garbled message (ie "f*c* **u, **i*er!")
|
||||
var/list/heard_gibberish= list() // completely screwed over message (ie "F%! (O*# *#!<>&**%!")
|
||||
|
||||
for (var/mob/R in receive)
|
||||
|
||||
/* --- Loop through the receivers and categorize them --- */
|
||||
|
||||
if (R.client && R.client.STFU_radio) //Adminning with 80 people on can be fun when you're trying to talk and all you can hear is radios.
|
||||
continue
|
||||
|
||||
|
||||
// --- Check for compression ---
|
||||
if(compression > 0)
|
||||
|
||||
heard_gibberish += R
|
||||
continue
|
||||
|
||||
// --- Can understand the speech ---
|
||||
|
||||
if (R.say_understands(M))
|
||||
|
||||
heard_normal += R
|
||||
|
||||
// --- Can't understand the speech ---
|
||||
|
||||
else
|
||||
// - Just display a garbled message -
|
||||
|
||||
heard_garbled += R
|
||||
|
||||
|
||||
/* ###### Begin formatting and sending the message ###### */
|
||||
if (length(heard_normal) || length(heard_garbled) || length(heard_gibberish))
|
||||
|
||||
/* --- Some miscellaneous variables to format the string output --- */
|
||||
var/part_a = "<span class='radio'><span class='name'>" // goes in the actual output
|
||||
var/freq_text // the name of the channel
|
||||
|
||||
// --- Set the name of the channel ---
|
||||
switch(display_freq)
|
||||
|
||||
if(SYND_FREQ)
|
||||
freq_text = "#unkn"
|
||||
if(COMM_FREQ)
|
||||
freq_text = "Command"
|
||||
if(1351)
|
||||
freq_text = "Science"
|
||||
if(1355)
|
||||
freq_text = "Medical"
|
||||
if(1357)
|
||||
freq_text = "Engineering"
|
||||
if(1359)
|
||||
freq_text = "Security"
|
||||
if(1349)
|
||||
freq_text = "Mining"
|
||||
if(1347)
|
||||
freq_text = "Cargo"
|
||||
//There's probably a way to use the list var of channels in code\game\communications.dm to make the dept channels non-hardcoded, but I wasn't in an experimentive mood. --NEO
|
||||
|
||||
|
||||
// --- If the frequency has not been assigned a name, just use the frequency as the name ---
|
||||
|
||||
if(!freq_text)
|
||||
freq_text = format_frequency(display_freq)
|
||||
|
||||
// --- Some more pre-message formatting ---
|
||||
|
||||
var/part_b_extra = ""
|
||||
if(data == 3) // intercepted radio message
|
||||
part_b_extra = " <i>(Intercepted)</i>"
|
||||
|
||||
// Create a radio headset for the sole purpose of using its icon
|
||||
var/obj/item/device/radio/headset/radio = new
|
||||
|
||||
var/part_b = "</span><b> \icon[radio]\[[freq_text]\][part_b_extra]</b> <span class='message'>" // Tweaked for security headsets -- TLE
|
||||
var/part_c = "</span></span>"
|
||||
|
||||
if (display_freq==SYND_FREQ)
|
||||
part_a = "<span class='syndradio'><span class='name'>"
|
||||
else if (display_freq==COMM_FREQ)
|
||||
part_a = "<span class='comradio'><span class='name'>"
|
||||
else if (display_freq in DEPT_FREQS)
|
||||
part_a = "<span class='deptradio'><span class='name'>"
|
||||
|
||||
// --- This following recording is intended for research and feedback in the use of department radio channels ---
|
||||
|
||||
var/part_blackbox_b = "</span><b> \[[freq_text]\]</b> <span class='message'>" // Tweaked for security headsets -- TLE
|
||||
var/blackbox_msg = "[part_a][source][part_blackbox_b]\"[text]\"[part_c]"
|
||||
//var/blackbox_admin_msg = "[part_a][M.name] (Real name: [M.real_name])[part_blackbox_b][quotedmsg][part_c]"
|
||||
for (var/obj/machinery/blackbox_recorder/BR in world)
|
||||
//BR.messages_admin += blackbox_admin_msg
|
||||
switch(display_freq)
|
||||
if(1459)
|
||||
BR.msg_common += blackbox_msg
|
||||
if(1351)
|
||||
BR.msg_science += blackbox_msg
|
||||
if(1353)
|
||||
BR.msg_command += blackbox_msg
|
||||
if(1355)
|
||||
BR.msg_medical += blackbox_msg
|
||||
if(1357)
|
||||
BR.msg_engineering += blackbox_msg
|
||||
if(1359)
|
||||
BR.msg_security += blackbox_msg
|
||||
if(1441)
|
||||
BR.msg_deathsquad += blackbox_msg
|
||||
if(1213)
|
||||
BR.msg_syndicate += blackbox_msg
|
||||
if(1349)
|
||||
BR.msg_mining += blackbox_msg
|
||||
if(1347)
|
||||
BR.msg_cargo += blackbox_msg
|
||||
else
|
||||
BR.messages += blackbox_msg
|
||||
|
||||
//End of research and feedback code.
|
||||
|
||||
/* ###### Send the message ###### */
|
||||
|
||||
/* --- Process all the mobs that heard the voice normally (understood) --- */
|
||||
|
||||
if (length(heard_normal))
|
||||
var/rendered = "[part_a][source][part_b]\"[text]\"[part_c]"
|
||||
|
||||
for (var/mob/R in heard_normal)
|
||||
R.show_message(rendered, 2)
|
||||
|
||||
/* --- Process all the mobs that heard a garbled voice (did not understand) --- */
|
||||
// Displays garbled message (ie "f*c* **u, **i*er!")
|
||||
|
||||
if (length(heard_garbled))
|
||||
var/quotedmsg = "\"[stars(text)]\""
|
||||
var/rendered = "[part_a][source][part_b][quotedmsg][part_c]"
|
||||
|
||||
for (var/mob/R in heard_garbled)
|
||||
R.show_message(rendered, 2)
|
||||
|
||||
|
||||
/* --- Complete gibberish. Usually happens when there's a compressed message --- */
|
||||
|
||||
if (length(heard_gibberish))
|
||||
var/quotedmsg = "\"[Gibberish(text, compression + 50)]\""
|
||||
var/rendered = "[part_a][Gibberish(source, compression + 50)][part_b][quotedmsg][part_c]"
|
||||
|
||||
for (var/mob/R in heard_gibberish)
|
||||
R.show_message(rendered, 2)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
if(0)
|
||||
dat += "<br>[temp]<br>"
|
||||
dat += "<br>Current Network: <a href='?src=\ref[src];input=network'>[network]</a><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)
|
||||
@@ -60,56 +60,64 @@
|
||||
|
||||
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 --
|
||||
// If the log is a speech file
|
||||
if(C.input_type == "Speech File")
|
||||
// -- 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
|
||||
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))
|
||||
race = "Human"
|
||||
if(ishuman(M) || isbrain(M))
|
||||
race = "Human"
|
||||
|
||||
else if(ismonkey(M))
|
||||
race = "Monkey"
|
||||
language = race
|
||||
else if(ismonkey(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(issilicon(M) || C.parameters["job"] == "AI") // sometimes M gets deleted prematurely for AIs... just check the job
|
||||
race = "Artificial Life"
|
||||
|
||||
else if(ismetroid(M)) // NT knows a lot about metroids, but not aliens. Can identify metroids
|
||||
race = "Metroid"
|
||||
language = race
|
||||
else if(ismetroid(M)) // NT knows a lot about metroids, but not aliens. Can identify metroids
|
||||
race = "Metroid"
|
||||
language = race
|
||||
|
||||
else if(isanimal(M))
|
||||
race = "Domestic Animal"
|
||||
language = race
|
||||
else if(isanimal(M))
|
||||
race = "Domestic Animal"
|
||||
language = race
|
||||
|
||||
else
|
||||
race = "<i>Unidentifiable</i>"
|
||||
language = race
|
||||
else
|
||||
race = "<i>Unidentifiable</i>"
|
||||
language = race
|
||||
|
||||
del(M)
|
||||
del(M)
|
||||
|
||||
// -- If the orator is a human, or universal translate is active, OR mob has universal speech on --
|
||||
// -- 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"])
|
||||
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 += "<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>Source</font color></u>: Internal server code<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>"
|
||||
|
||||
dat += "</ol>"
|
||||
|
||||
|
||||
@@ -128,9 +136,6 @@
|
||||
|
||||
add_fingerprint(usr)
|
||||
usr.machine = src
|
||||
if(!src.allowed(usr) && !emagged)
|
||||
usr << "\red ACCESS DENIED."
|
||||
return
|
||||
|
||||
if(href_list["viewserver"])
|
||||
screen = 1
|
||||
@@ -166,6 +171,11 @@
|
||||
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"])]
|
||||
@@ -178,11 +188,11 @@
|
||||
else
|
||||
temp = "<font color = #D70B00>- FAILED: NO SELECTED MACHINE -</font color>"
|
||||
|
||||
if(href_list["input"])
|
||||
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) && newnet != network)
|
||||
if(newnet && usr in range(1, src))
|
||||
if(length(newnet) > 15)
|
||||
temp = "<font color = #D70B00>- FAILED: NETWORK TAG STRING TOO LENGHTLY -</font color>"
|
||||
|
||||
|
||||
@@ -139,13 +139,13 @@
|
||||
dat += "<br> <a href='?src=\ref[src];input=freq'>\[Add Filter\]</a>"
|
||||
dat += "<hr>"
|
||||
if(P.buffer)
|
||||
dat += "<br><br>MULTITOOL BUFFER: \ref[P.buffer] [P.buffer] <a href='?src=\ref[src];link=1'>\[Link\]</a> <a href='?src=\ref[src];flush=1'>\[Flush\]"
|
||||
dat += "<br><br>MULTITOOL BUFFER: [P.buffer] ([P.buffer.id]) <a href='?src=\ref[src];link=1'>\[Link\]</a> <a href='?src=\ref[src];flush=1'>\[Flush\]"
|
||||
else
|
||||
dat += "<br><br>MULTITOOL BUFFER: <a href='?src=\ref[src];buffer=1'>\[Add Machine\]</a>"
|
||||
|
||||
dat += "</font>"
|
||||
temp = ""
|
||||
user << browse(dat, "window=[src.name];size=520x500;can_resize=0")
|
||||
user << browse(dat, "window=tcommachine;size=520x500;can_resize=0")
|
||||
onclose(user, "dormitory")
|
||||
|
||||
Topic(href, href_list)
|
||||
|
||||
@@ -83,7 +83,10 @@
|
||||
"connection" = signal.data["connection"],
|
||||
"radio" = signal.data["radio"],
|
||||
"slow" = signal.data["slow"],
|
||||
"traffic" = signal.data["traffic"]
|
||||
"traffic" = signal.data["traffic"],
|
||||
"type" = signal.data["type"],
|
||||
"server" = signal.data["server"],
|
||||
"reject" = signal.data["reject"]
|
||||
)
|
||||
|
||||
// Keep the "original" signal constant
|
||||
@@ -137,6 +140,11 @@
|
||||
if(!(T in links) && machinetype != T.machinetype)
|
||||
links.Add(T)
|
||||
|
||||
if(istype(src, /obj/machinery/telecomms/server))
|
||||
var/obj/machinery/telecomms/server/S = src
|
||||
S.Compiler = new()
|
||||
S.Compiler.Holder = src
|
||||
|
||||
|
||||
update_icon()
|
||||
if(on)
|
||||
@@ -355,8 +363,21 @@
|
||||
circuitboard = "/obj/item/weapon/circuitboard/telecomms/server"
|
||||
var
|
||||
list/log_entries = list()
|
||||
list/stored_names = list()
|
||||
list/TrafficActions = list()
|
||||
logs = 0 // number of logs
|
||||
totaltraffic = 0 // gigabytes (if > 1024, divide by 1024 -> terrabytes)
|
||||
|
||||
list/memory = list() // stored memory
|
||||
rawcode = "" // the code to compile (raw text)
|
||||
datum/TCS_Compiler/Compiler // the compiler that compiles and runs the code
|
||||
autoruncode = 0 // 1 if the code is set to run every time a signal is picked up
|
||||
|
||||
encryption = "null" // encryption key: ie "password"
|
||||
salt = "null" // encryption salt: ie "123comsat"
|
||||
// would add up to md5("password123comsat")
|
||||
language = "human"
|
||||
|
||||
receive_information(datum/signal/signal, obj/machinery/telecomms/machine_from)
|
||||
|
||||
if(signal.data["message"])
|
||||
@@ -393,25 +414,50 @@
|
||||
log.parameters["vname"] = Gibberish(signal.data["vname"], signal.data["compression"] + 50)
|
||||
log.input_type = "Corrupt File"
|
||||
|
||||
// Log and store everything that needs to be logged
|
||||
log_entries.Add(log)
|
||||
if(!(signal.data["name"] in stored_names))
|
||||
stored_names.Add(signal.data["name"])
|
||||
logs++
|
||||
signal.data["server"] = src
|
||||
|
||||
// Give the log a name
|
||||
var/identifier = num2text( rand(-1000,1000) + world.time )
|
||||
log.name = "data packet ([md5(identifier)])"
|
||||
|
||||
relay_information(signal, "/obj/machinery/telecomms/broadcaster") // send to all broadcasters
|
||||
if(Compiler && autoruncode)
|
||||
Compiler.Run(signal) // execute the code
|
||||
|
||||
relay_information(signal, "/obj/machinery/telecomms/broadcaster")
|
||||
|
||||
|
||||
proc/setcode(var/t)
|
||||
if(t)
|
||||
if(istext(t))
|
||||
rawcode = t
|
||||
|
||||
proc/compile()
|
||||
if(Compiler)
|
||||
return Compiler.Compile(rawcode)
|
||||
|
||||
proc/update_logs()
|
||||
// deletes all logs when there are 100
|
||||
if(log_entries.len >= 100)
|
||||
var/list/restore = list()
|
||||
for(var/datum/comm_log_entry/log in log_entries)
|
||||
if(log.garbage_collector) // if garbage collector is set to 1, delete
|
||||
del(log)
|
||||
else
|
||||
restore.Add(log)
|
||||
// start deleting the very first log entry
|
||||
if(logs >= 400)
|
||||
for(var/i = 1, i <= logs, i++) // locate the first garbage collectable log entry and remove it
|
||||
var/datum/comm_log_entry/L = log_entries[i]
|
||||
if(L.garbage_collector)
|
||||
log_entries.Remove(L)
|
||||
logs--
|
||||
break
|
||||
|
||||
proc/add_entry(var/content, var/input)
|
||||
var/datum/comm_log_entry/log = new
|
||||
var/identifier = num2text( rand(-1000,1000) + world.time )
|
||||
log.name = "data packet ([md5(identifier)])"
|
||||
log.input_type = input
|
||||
log.parameters["message"] = content
|
||||
|
||||
|
||||
log_entries.len = 0
|
||||
log_entries.Add(restore)
|
||||
|
||||
// Simple log entry datum
|
||||
|
||||
@@ -490,42 +536,42 @@
|
||||
network = "tcommsat"
|
||||
|
||||
science
|
||||
id = "science server"
|
||||
id = "Science Server"
|
||||
freq_listening = list(1351)
|
||||
autolinkers = list("science", "broadcasterA")
|
||||
|
||||
medical
|
||||
id = "medical server"
|
||||
id = "Medical Server"
|
||||
freq_listening = list(1355)
|
||||
autolinkers = list("medical", "broadcasterA")
|
||||
|
||||
cargo
|
||||
id = "cargo server"
|
||||
id = "Cargo Server"
|
||||
freq_listening = list(1347)
|
||||
autolinkers = list("cargo", "broadcasterA")
|
||||
|
||||
mining
|
||||
id = "mining server"
|
||||
id = "Mining Server"
|
||||
freq_listening = list(1349)
|
||||
autolinkers = list("mining", "broadcasterA")
|
||||
|
||||
common
|
||||
id = "common server"
|
||||
id = "Common Server"
|
||||
freq_listening = list(1459)
|
||||
autolinkers = list("common", "broadcasterB")
|
||||
|
||||
command
|
||||
id = "command server"
|
||||
id = "Command Server"
|
||||
freq_listening = list(1353)
|
||||
autolinkers = list("command", "broadcasterB")
|
||||
|
||||
engineering
|
||||
id = "engineering server"
|
||||
id = "Engineering Server"
|
||||
freq_listening = list(1357)
|
||||
autolinkers = list("engineering", "broadcasterB")
|
||||
|
||||
security
|
||||
id = "security server"
|
||||
id = "Security Server"
|
||||
freq_listening = list(1359)
|
||||
autolinkers = list("security", "broadcasterB")
|
||||
|
||||
|
||||
@@ -18,8 +18,6 @@
|
||||
|
||||
temp = "" // temporary feedback messages
|
||||
|
||||
req_access = list(access_tcomsat)
|
||||
|
||||
attack_hand(mob/user as mob)
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
return
|
||||
@@ -33,7 +31,7 @@
|
||||
|
||||
if(0)
|
||||
dat += "<br>[temp]<br><br>"
|
||||
dat += "<br>Current Network: <a href='?src=\ref[src];input=network'>[network]</a><br>"
|
||||
dat += "<br>Current Network: <a href='?src=\ref[src];network=1'>[network]</a><br>"
|
||||
if(machines.len)
|
||||
dat += "<br>Detected Network Entities:<ul>"
|
||||
for(var/obj/machinery/telecomms/T in machines)
|
||||
@@ -72,9 +70,6 @@
|
||||
|
||||
add_fingerprint(usr)
|
||||
usr.machine = src
|
||||
if(!src.allowed(usr) && !emagged)
|
||||
usr << "\red ACCESS DENIED."
|
||||
return
|
||||
|
||||
if(href_list["viewmachine"])
|
||||
screen = 1
|
||||
@@ -110,10 +105,10 @@
|
||||
screen = 0
|
||||
|
||||
|
||||
if(href_list["input"])
|
||||
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) && newnet != network)
|
||||
if(newnet && usr in range(1, src))
|
||||
if(length(newnet) > 15)
|
||||
temp = "<font color = #D70B00>- FAILED: NETWORK TAG STRING TOO LENGHTLY -</font color>"
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
desc = "Dance my monkeys! DANCE!!!"
|
||||
icon_state = "electropack0"
|
||||
var/code = 2
|
||||
var/on = 0
|
||||
var/e_pads = 0.0
|
||||
g_amt = 2500
|
||||
m_amt = 10000
|
||||
|
||||
@@ -10,6 +10,7 @@ var/GLOBAL_RADIO_TYPE = 1 // radio type to use
|
||||
icon_state = "walkietalkie"
|
||||
item_state = "walkietalkie"
|
||||
var
|
||||
on = 1 // 0 for off
|
||||
last_transmission
|
||||
frequency = 1459 //common chat
|
||||
traitor_frequency = 0 //tune to frequency to unlock traitor supplies
|
||||
@@ -55,6 +56,11 @@ var/GLOBAL_RADIO_TYPE = 1 // radio type to use
|
||||
if(radio_controller)
|
||||
initialize()
|
||||
|
||||
// If intercom: do a local power check loop
|
||||
if(istype(src, /obj/item/device/radio/intercom))
|
||||
spawn(5)
|
||||
checkpower()
|
||||
|
||||
/obj/item/device/radio/initialize()
|
||||
if(freerange)
|
||||
if(frequency < 1200 || frequency > 1600)
|
||||
@@ -74,6 +80,9 @@ var/GLOBAL_RADIO_TYPE = 1 // radio type to use
|
||||
interact(user)
|
||||
|
||||
/obj/item/device/radio/proc/interact(mob/user as mob)
|
||||
if(!on)
|
||||
return
|
||||
|
||||
var/dat = {"
|
||||
<html><head><title>[src]</title></head><body><TT>
|
||||
Microphone: [broadcasting ? "<A href='byond://?src=\ref[src];talk=0'>Engaged</A>" : "<A href='byond://?src=\ref[src];talk=1'>Disengaged</A>"]<BR>
|
||||
@@ -111,10 +120,31 @@ var/GLOBAL_RADIO_TYPE = 1 // radio type to use
|
||||
Speaker: <A href='byond://?src=\ref[src];ch_name=[chan_name];listen=[!list]'>[list ? "Engaged" : "Disengaged"]</A><BR>
|
||||
"}
|
||||
|
||||
/obj/item/device/radio/proc/checkpower()
|
||||
|
||||
// Simple loop, checks for power. Strictly for intercoms
|
||||
while(src)
|
||||
|
||||
if(!src.loc)
|
||||
on = 0
|
||||
var/area/A = src.loc.loc
|
||||
if(!A || !isarea(A) || !A.master)
|
||||
on = 0
|
||||
else
|
||||
on = A.master.powered(EQUIP) // set "on" to the power status
|
||||
|
||||
if(!on)
|
||||
icon_state = "intercom-p"
|
||||
else
|
||||
icon_state = "intercom"
|
||||
|
||||
sleep(30)
|
||||
|
||||
/obj/item/device/radio/Topic(href, href_list)
|
||||
//..()
|
||||
if (usr.stat)
|
||||
if (usr.stat || !on)
|
||||
return
|
||||
|
||||
if (!(issilicon(usr) || (usr.contents.Find(src) || ( in_range(src, usr) && istype(loc, /turf) ))))
|
||||
usr << browse(null, "window=radio")
|
||||
return
|
||||
@@ -125,6 +155,24 @@ var/GLOBAL_RADIO_TYPE = 1 // radio type to use
|
||||
if(A && target)
|
||||
A.ai_actual_track(target)
|
||||
return
|
||||
|
||||
else if (href_list["faketrack"])
|
||||
var/mob/target = locate(href_list["track"])
|
||||
var/mob/living/silicon/ai/A = locate(href_list["track2"])
|
||||
if(A && target)
|
||||
|
||||
A:cameraFollow = target
|
||||
A << text("Now tracking [] on camera.", target.name)
|
||||
if (usr.machine == null)
|
||||
usr.machine = usr
|
||||
|
||||
while (usr:cameraFollow == target)
|
||||
usr << "Target is not on or near any active cameras on the station. We'll check again in 5 seconds (unless you use the cancel-camera verb)."
|
||||
sleep(40)
|
||||
continue
|
||||
|
||||
return
|
||||
|
||||
else if (href_list["freq"])
|
||||
var/new_frequency = (frequency + text2num(href_list["freq"]))
|
||||
if (!freerange || (frequency < 1200 || frequency > 1600))
|
||||
@@ -185,6 +233,9 @@ var/GLOBAL_RADIO_TYPE = 1 // radio type to use
|
||||
|
||||
/obj/item/device/radio/talk_into(mob/M as mob, message, channel)
|
||||
|
||||
if(!on) return // the device has to be on
|
||||
|
||||
|
||||
if(GLOBAL_RADIO_TYPE == 1) // NEW RADIO SYSTEMS: By Doohl
|
||||
|
||||
/* Quick introduction:
|
||||
@@ -292,7 +343,10 @@ var/GLOBAL_RADIO_TYPE = 1 // radio type to use
|
||||
"connection" = connection, // the radio connection to use
|
||||
"radio" = src, // stores the radio used for transmission
|
||||
"slow" = 0, // how much to sleep() before broadcasting - simulates net lag
|
||||
"traffic" = 0 // dictates the total traffic sum that the signal went through
|
||||
"traffic" = 0, // dictates the total traffic sum that the signal went through
|
||||
"type" = 0, // determines what type of radio input it is: normal broadcast
|
||||
"server" = null, // the last server to log this signal
|
||||
"reject" = 0 // if nonzero, the signal will not be accepted by any broadcasting machinery
|
||||
)
|
||||
signal.frequency = connection.frequency // Quick frequency set
|
||||
|
||||
@@ -340,7 +394,10 @@ var/GLOBAL_RADIO_TYPE = 1 // radio type to use
|
||||
"connection" = connection, // the radio connection to use
|
||||
"radio" = src, // stores the radio used for transmission
|
||||
"slow" = 0,
|
||||
"traffic" = 0
|
||||
"traffic" = 0,
|
||||
"type" = 0,
|
||||
"server" = null,
|
||||
"reject" = 0
|
||||
)
|
||||
signal.frequency = connection.frequency // Quick frequency set
|
||||
|
||||
@@ -351,7 +408,7 @@ var/GLOBAL_RADIO_TYPE = 1 // radio type to use
|
||||
sleep(rand(10,25)) // wait a little...
|
||||
|
||||
if(signal.data["done"])
|
||||
del(signal) // delete the signal - we're done here.
|
||||
// we're done here.
|
||||
return
|
||||
|
||||
// Oh my god; the comms are down or something because the signal hasn't been broadcasted yet.
|
||||
@@ -566,6 +623,8 @@ var/GLOBAL_RADIO_TYPE = 1 // radio type to use
|
||||
*/
|
||||
if (!(wires & WIRE_RECEIVE))
|
||||
return
|
||||
if (!on)
|
||||
return
|
||||
if (!freq) //recieved on main frequency
|
||||
if (!listening)
|
||||
return
|
||||
@@ -599,7 +658,7 @@ var/GLOBAL_RADIO_TYPE = 1 // radio type to use
|
||||
/* Instead, let's individually search potential containers for mobs! More verbose but a LOT more efficient and less laggy */
|
||||
// Check gamehelpers.dm for the proc definition:
|
||||
|
||||
return get_mobs_in_view(1, src)
|
||||
return get_mobs_in_view(3, src)
|
||||
|
||||
/obj/item/device/radio/examine()
|
||||
set src in view()
|
||||
|
||||
Reference in New Issue
Block a user