mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-24 04:27:35 +01:00
All radios now only work in their Z level. This means that the CommSat has a few more additions to work with this change. There is now a new Telecomms Machine called the Relay which allows information to travel across Z levels. It it then linked to a new machine called the Hub, which will receive information from the Relays and send it to the buses. Because every Z level needs these relays, which are linked up with Receivers/Broadcasters, every Z level will get one. There is one in the station, in the RD's office, one in Telecomms as always, one in the Ruskie station which is turned off and hidden from the HUB's linked list. The last one is in Mining but the location for it has not been decided yet.</li>
PDAs now need to be in a Z level with a functioning Relay/Comms Network in order to send messages. It will also send uncompressed (scrambled) messages like you would with the ordinary voice messages. I've gotten rid of the "in world" check for blackboxes, when there can only be one. You can now easily send test signals to see if Telecomms is functioning for an atom. test_telecomms() git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4222 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -701,36 +701,6 @@ var/global/list/obj/item/device/pda/PDAs = list()
|
||||
id.loc = get_turf(src)
|
||||
id = null
|
||||
|
||||
/obj/item/device/pda/proc/telecomms_process(var/receipent, var/originator, var/data)
|
||||
var/telecomms_intact = 0
|
||||
/* Make sure telecomms is intact */
|
||||
for (var/obj/machinery/telecomms/receiver/R in world)
|
||||
|
||||
if((1459 in R.freq_listening) && R.on)
|
||||
|
||||
for (var/obj/machinery/telecomms/bus/B in R.links)
|
||||
|
||||
if((1459 in B.freq_listening) && B.on)
|
||||
|
||||
for(var/obj/machinery/telecomms/server/S in B.links)
|
||||
|
||||
if((1459 in S.freq_listening) && S.on)
|
||||
// Add a log
|
||||
S.add_entry("[originator] sent to [receipent]: \"[data]\"", "PDA log")
|
||||
|
||||
for(var/obj/machinery/telecomms/broadcaster/C in S.links)
|
||||
|
||||
if(((1459 in C.freq_listening || C.freq_listening.len == 0)) && C.on)
|
||||
|
||||
telecomms_intact = 1
|
||||
break
|
||||
|
||||
break
|
||||
break
|
||||
break
|
||||
|
||||
return telecomms_intact
|
||||
|
||||
/obj/item/device/pda/proc/create_message(var/mob/living/U = usr, var/obj/item/device/pda/P)
|
||||
|
||||
var/t = input(U, "Please enter message", name, null) as text
|
||||
@@ -756,7 +726,23 @@ var/global/list/obj/item/device/pda/PDAs = list()
|
||||
if(MS.active)
|
||||
useMS = MS
|
||||
break
|
||||
if(useMS) // only send the message if it's stable
|
||||
|
||||
var/datum/signal/signal = telecomms_process()
|
||||
|
||||
var/useTC = 0
|
||||
if(signal)
|
||||
if(signal.data["done"])
|
||||
useTC = 1
|
||||
if(P.loc.z in signal.data["level"])
|
||||
useTC = 2
|
||||
//Let's make this barely readable
|
||||
if(signal.data["compression"] > 0)
|
||||
t = Gibberish(t, signal.data["compression"] + 50)
|
||||
|
||||
if(useMS && useTC) // only send the message if it's stable
|
||||
if(useTC != 2) // Does our recepient have a broadcaster on their level?
|
||||
U << "ERROR: Cannot reach recepient."
|
||||
return
|
||||
useMS.send_pda_message("[P.owner]","[owner]","[t]")
|
||||
|
||||
tnote += "<i><b>→ To [P.owner]:</b></i><br>[t]<br>"
|
||||
|
||||
@@ -32,9 +32,15 @@
|
||||
if(range > 0)
|
||||
return get_mobs_in_view(canhear_range, src)
|
||||
|
||||
receive_range(freq)
|
||||
receive_range(freq, level)
|
||||
if (!on)
|
||||
return 0
|
||||
if (!(src.wires & WIRE_RECEIVE))
|
||||
return 0
|
||||
if(!src.loc)
|
||||
return 0
|
||||
if(src.loc.z != level)
|
||||
return 0
|
||||
if (!src.listening)
|
||||
return 0
|
||||
if(freq == SYND_FREQ)
|
||||
|
||||
@@ -359,11 +359,13 @@ var/GLOBAL_RADIO_TYPE = 1 // radio type to use
|
||||
|
||||
//#### Sending the signal to all subspace receivers ####//
|
||||
for(var/obj/machinery/telecomms/receiver/R in world)
|
||||
R.receive_signal(signal)
|
||||
if(src.loc.z == R.loc.z)
|
||||
R.receive_signal(signal)
|
||||
|
||||
// Allinone can act as receivers.
|
||||
for(var/obj/machinery/telecomms/allinone/R in world)
|
||||
R.receive_signal(signal)
|
||||
if(src.loc.z == R.loc.z)
|
||||
R.receive_signal(signal)
|
||||
|
||||
// Receiving code can be located in Telecommunications.dm
|
||||
return
|
||||
@@ -409,7 +411,8 @@ var/GLOBAL_RADIO_TYPE = 1 // radio type to use
|
||||
signal.frequency = connection.frequency // Quick frequency set
|
||||
|
||||
for(var/obj/machinery/telecomms/receiver/R in world)
|
||||
R.receive_signal(signal)
|
||||
if(src.loc.z == R.loc.z)
|
||||
R.receive_signal(signal)
|
||||
|
||||
|
||||
sleep(rand(10,25)) // wait a little...
|
||||
@@ -426,7 +429,7 @@ var/GLOBAL_RADIO_TYPE = 1 // radio type to use
|
||||
|
||||
Broadcast_Message(connection, M, voicemask, M.voice_message,
|
||||
src, message, displayname, jobname, real_name, M.voice_name,
|
||||
filter_type, signal.data["compression"])
|
||||
filter_type, signal.data["compression"], src.loc.z)
|
||||
|
||||
|
||||
|
||||
@@ -535,31 +538,31 @@ var/GLOBAL_RADIO_TYPE = 1 // radio type to use
|
||||
var/part_blackbox_b = "</span><b> \[[freq_text]\]</b> <span class='message'>" // Tweaked for security headsets -- TLE
|
||||
var/blackbox_msg = "[part_a][M.name][part_blackbox_b][quotedmsg][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)
|
||||
if(istype(blackbox))
|
||||
//BR.messages_admin += blackbox_admin_msg
|
||||
switch(display_freq)
|
||||
if(1459)
|
||||
BR.msg_common += blackbox_msg
|
||||
blackbox.msg_common += blackbox_msg
|
||||
if(1351)
|
||||
BR.msg_science += blackbox_msg
|
||||
blackbox.msg_science += blackbox_msg
|
||||
if(1353)
|
||||
BR.msg_command += blackbox_msg
|
||||
blackbox.msg_command += blackbox_msg
|
||||
if(1355)
|
||||
BR.msg_medical += blackbox_msg
|
||||
blackbox.msg_medical += blackbox_msg
|
||||
if(1357)
|
||||
BR.msg_engineering += blackbox_msg
|
||||
blackbox.msg_engineering += blackbox_msg
|
||||
if(1359)
|
||||
BR.msg_security += blackbox_msg
|
||||
blackbox.msg_security += blackbox_msg
|
||||
if(1441)
|
||||
BR.msg_deathsquad += blackbox_msg
|
||||
blackbox.msg_deathsquad += blackbox_msg
|
||||
if(1213)
|
||||
BR.msg_syndicate += blackbox_msg
|
||||
blackbox.msg_syndicate += blackbox_msg
|
||||
if(1349)
|
||||
BR.msg_mining += blackbox_msg
|
||||
blackbox.msg_mining += blackbox_msg
|
||||
if(1347)
|
||||
BR.msg_cargo += blackbox_msg
|
||||
blackbox.msg_cargo += blackbox_msg
|
||||
else
|
||||
BR.messages += blackbox_msg
|
||||
blackbox.messages += blackbox_msg
|
||||
|
||||
//End of research and feedback code.
|
||||
|
||||
@@ -623,13 +626,15 @@ var/GLOBAL_RADIO_TYPE = 1 // radio type to use
|
||||
*/
|
||||
|
||||
|
||||
/obj/item/device/radio/proc/receive_range(freq)
|
||||
/obj/item/device/radio/proc/receive_range(freq, level)
|
||||
// check if this radio can receive on the given frequency, and if so,
|
||||
// what the range is in which mobs will hear the radio
|
||||
// returns: 0 if can't receive, range otherwise
|
||||
|
||||
if (!(wires & WIRE_RECEIVE))
|
||||
return 0
|
||||
if(isnull(src.loc) || src.loc.z != level)
|
||||
return 0
|
||||
if(freq == SYND_FREQ)
|
||||
if(!(src.syndie))//Checks to see if it's allowed on that frequency, based on the encryption keys
|
||||
return 0
|
||||
|
||||
Reference in New Issue
Block a user