Removes unused radio code, world print in forcesay

This commit is contained in:
mwerezak
2014-10-01 21:41:09 -04:00
parent b88666895b
commit 3209f19304
3 changed files with 120 additions and 285 deletions

View File

@@ -1,6 +1,3 @@
var/GLOBAL_RADIO_TYPE = 1 // radio type to use
// 0 = old radios
// 1 = new radios (subspace technology)
/obj/item/device/radio /obj/item/device/radio
@@ -248,146 +245,85 @@ var/GLOBAL_RADIO_TYPE = 1 // radio type to use
M.last_target_click = world.time M.last_target_click = world.time
if(GLOBAL_RADIO_TYPE == 1) // NEW RADIO SYSTEMS: By Doohl /* Quick introduction:
This new radio system uses a very robust FTL signaling technology unoriginally
dubbed "subspace" which is somewhat similar to 'blue-space' but can't
actually transmit large mass. Headsets are the only radio devices capable
of sending subspace transmissions to the Communications Satellite.
/* Quick introduction: A headset sends a signal to a subspace listener/reciever elsewhere in space,
This new radio system uses a very robust FTL signaling technology unoriginally the signal gets processed and logged, and an audible transmission gets sent
dubbed "subspace" which is somewhat similar to 'blue-space' but can't to each individual headset.
actually transmit large mass. Headsets are the only radio devices capable */
of sending subspace transmissions to the Communications Satellite.
A headset sends a signal to a subspace listener/reciever elsewhere in space, //#### Grab the connection datum ####//
the signal gets processed and logged, and an audible transmission gets sent var/datum/radio_frequency/connection = handle_message_mode(M, message, channel)
to each individual headset. if (!istype(connection))
*/ return
if (!connection)
return
//#### Grab the connection datum ####// var/turf/position = get_turf(src)
var/datum/radio_frequency/connection = handle_message_mode(M, message, channel)
if (!istype(connection))
return
if (!connection)
return
var/turf/position = get_turf(src) //#### Tagging the signal with all appropriate identity values ####//
//#### Tagging the signal with all appropriate identity values ####// // ||-- The mob's name identity --||
var/displayname = M.name // grab the display name (name you get when you hover over someone's icon)
// ||-- The mob's name identity --|| var/real_name = M.real_name // mob's real name
var/displayname = M.name // grab the display name (name you get when you hover over someone's icon) var/mobkey = "none" // player key associated with mob
var/real_name = M.real_name // mob's real name var/voicemask = 0 // the speaker is wearing a voice mask
var/mobkey = "none" // player key associated with mob if(M.client)
var/voicemask = 0 // the speaker is wearing a voice mask mobkey = M.key // assign the mob's key
if(M.client)
mobkey = M.key // assign the mob's key
var/jobname // the mob's "job" var/jobname // the mob's "job"
// --- Human: use their actual job --- // --- Human: use their actual job ---
if (ishuman(M)) if (ishuman(M))
jobname = M:get_assignment() jobname = M:get_assignment()
// --- Carbon Nonhuman --- // --- Carbon Nonhuman ---
else if (iscarbon(M)) // Nonhuman carbon mob else if (iscarbon(M)) // Nonhuman carbon mob
jobname = "No id" jobname = "No id"
// --- AI --- // --- AI ---
else if (isAI(M)) else if (isAI(M))
jobname = "AI" jobname = "AI"
// --- Cyborg --- // --- Cyborg ---
else if (isrobot(M)) else if (isrobot(M))
jobname = "Cyborg" jobname = "Cyborg"
// --- Personal AI (pAI) --- // --- Personal AI (pAI) ---
else if (istype(M, /mob/living/silicon/pai)) else if (istype(M, /mob/living/silicon/pai))
jobname = "Personal AI" jobname = "Personal AI"
// --- Unidentifiable mob --- // --- Unidentifiable mob ---
else else
jobname = "Unknown" jobname = "Unknown"
// --- Modifications to the mob's identity --- // --- Modifications to the mob's identity ---
// The mob is disguising their identity: // The mob is disguising their identity:
if (ishuman(M) && M.GetVoice() != real_name) if (ishuman(M) && M.GetVoice() != real_name)
displayname = M.GetVoice() displayname = M.GetVoice()
jobname = "Unknown" jobname = "Unknown"
voicemask = 1 voicemask = 1
/* ###### Radio headsets can only broadcast through subspace ###### */ /* ###### Radio headsets can only broadcast through subspace ###### */
if(subspace_transmission)
// First, we want to generate a new radio signal
var/datum/signal/signal = new
signal.transmission_method = 2 // 2 would be a subspace transmission.
// transmission_method could probably be enumerated through #define. Would be neater.
// --- Finally, tag the actual signal with the appropriate values ---
signal.data = list(
// Identity-associated tags:
"mob" = M, // store a reference to the mob
"mobtype" = M.type, // the mob's type
"realname" = real_name, // the mob's real name
"name" = displayname, // the mob's display name
"job" = jobname, // the mob's job
"key" = mobkey, // the mob's key
"vmessage" = pick(M.speak_emote), // the message to display if the voice wasn't understood
"vname" = M.voice_name, // the name to display if the voice wasn't understood
"vmask" = voicemask, // 1 if the mob is using a voice gas mask
// We store things that would otherwise be kept in the actual mob
// so that they can be logged even AFTER the mob is deleted or something
// Other tags:
"compression" = rand(45,50), // compressed radio signal
"message" = message, // the actual sent message
"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
"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
"level" = position.z, // The source's z level
"language" = speaking,
"verb" = verb
)
signal.frequency = connection.frequency // Quick frequency set
//#### Sending the signal to all subspace receivers ####//
for(var/obj/machinery/telecomms/receiver/R in telecomms_list)
R.receive_signal(signal)
// Allinone can act as receivers.
for(var/obj/machinery/telecomms/allinone/R in telecomms_list)
R.receive_signal(signal)
// Receiving code can be located in Telecommunications.dm
return
/* ###### Intercoms and station-bounced radios ###### */
var/filter_type = 2
/* --- Intercoms can only broadcast to other intercoms, but bounced radios can broadcast to bounced radios and intercoms --- */
if(istype(src, /obj/item/device/radio/intercom))
filter_type = 1
if(subspace_transmission)
// First, we want to generate a new radio signal
var/datum/signal/signal = new var/datum/signal/signal = new
signal.transmission_method = 2 signal.transmission_method = 2 // 2 would be a subspace transmission.
// transmission_method could probably be enumerated through #define. Would be neater.
/* --- Try to send a normal subspace broadcast first */
// --- Finally, tag the actual signal with the appropriate values ---
signal.data = list( signal.data = list(
// Identity-associated tags:
"mob" = M, // store a reference to the mob "mob" = M, // store a reference to the mob
"mobtype" = M.type, // the mob's type "mobtype" = M.type, // the mob's type
"realname" = real_name, // the mob's real name "realname" = real_name, // the mob's real name
@@ -396,192 +332,102 @@ var/GLOBAL_RADIO_TYPE = 1 // radio type to use
"key" = mobkey, // the mob's key "key" = mobkey, // the mob's key
"vmessage" = pick(M.speak_emote), // the message to display if the voice wasn't understood "vmessage" = pick(M.speak_emote), // the message to display if the voice wasn't understood
"vname" = M.voice_name, // the name to display if the voice wasn't understood "vname" = M.voice_name, // the name to display if the voice wasn't understood
"vmask" = voicemask, // 1 if the mob is using a voice gas mas "vmask" = voicemask, // 1 if the mob is using a voice gas mask
"compression" = 0, // uncompressed radio signal // We store things that would otherwise be kept in the actual mob
// so that they can be logged even AFTER the mob is deleted or something
// Other tags:
"compression" = rand(45,50), // compressed radio signal
"message" = message, // the actual sent message "message" = message, // the actual sent message
"connection" = connection, // the radio connection to use "connection" = connection, // the radio connection to use
"radio" = src, // stores the radio used for transmission "radio" = src, // stores the radio used for transmission
"slow" = 0, "slow" = 0, // how much to sleep() before broadcasting - simulates net lag
"traffic" = 0, "traffic" = 0, // dictates the total traffic sum that the signal went through
"type" = 0, "type" = 0, // determines what type of radio input it is: normal broadcast
"server" = null, "server" = null, // the last server to log this signal
"reject" = 0, "reject" = 0, // if nonzero, the signal will not be accepted by any broadcasting machinery
"level" = position.z, "level" = position.z, // The source's z level
"language" = speaking, "language" = speaking,
"verb" = verb "verb" = verb
) )
signal.frequency = connection.frequency // Quick frequency set signal.frequency = connection.frequency // Quick frequency set
//#### Sending the signal to all subspace receivers ####//
for(var/obj/machinery/telecomms/receiver/R in telecomms_list) for(var/obj/machinery/telecomms/receiver/R in telecomms_list)
R.receive_signal(signal) R.receive_signal(signal)
// Allinone can act as receivers.
for(var/obj/machinery/telecomms/allinone/R in telecomms_list)
R.receive_signal(signal)
sleep(rand(10,25)) // wait a little... // Receiving code can be located in Telecommunications.dm
return
if(signal.data["done"] && position.z in signal.data["level"])
// we're done here.
return
// Oh my god; the comms are down or something because the signal hasn't been broadcasted yet in our level.
// Send a mundane broadcast with limited targets:
//THIS IS TEMPORARY. YEAH RIGHT
if(!connection) return //~Carn
Broadcast_Message(connection, M, voicemask, pick(M.speak_emote),
src, message, displayname, jobname, real_name, M.voice_name,
filter_type, signal.data["compression"], list(position.z), connection.frequency,verb,speaking)
/* ###### Intercoms and station-bounced radios ###### */
else // OLD RADIO SYSTEMS: By Goons? var/filter_type = 2
var/datum/radio_frequency/connection = null /* --- Intercoms can only broadcast to other intercoms, but bounced radios can broadcast to bounced radios and intercoms --- */
if(channel && channels && channels.len > 0) if(istype(src, /obj/item/device/radio/intercom))
if (channel == "department") filter_type = 1
//world << "DEBUG: channel=\"[channel]\" switching to \"[channels[1]]\""
channel = channels[1]
connection = secure_radio_connections[channel]
else
connection = radio_connection
channel = null
if (!istype(connection))
return
var/display_freq = connection.frequency
//world << "DEBUG: used channel=\"[channel]\" frequency= \"[display_freq]\" connection.devices.len = [connection.devices.len]"
var/eqjobname var/datum/signal/signal = new
signal.transmission_method = 2
if (ishuman(M))
eqjobname = M:get_assignment()
else if (iscarbon(M))
eqjobname = "No id" //only humans can wear ID
else if (isAI(M))
eqjobname = "AI"
else if (isrobot(M))
eqjobname = "Cyborg"//Androids don't really describe these too well, in my opinion.
else if (istype(M, /mob/living/silicon/pai))
eqjobname = "Personal AI"
else
eqjobname = "Unknown"
if (!(wires & WIRE_TRANSMIT)) /* --- Try to send a normal subspace broadcast first */
return
var/list/receive = list() signal.data = list(
//for (var/obj/item/device/radio/R in radio_connection.devices) "mob" = M, // store a reference to the mob
for (var/obj/item/device/radio/R in connection.devices["[RADIO_CHAT]"]) // Modified for security headset code -- TLE "mobtype" = M.type, // the mob's type
//if(R.accept_rad(src, message)) "realname" = real_name, // the mob's real name
receive |= R.send_hear(display_freq, 0) "name" = displayname, // the mob's display name
"job" = jobname, // the mob's job
"key" = mobkey, // the mob's key
"vmessage" = pick(M.speak_emote), // the message to display if the voice wasn't understood
"vname" = M.voice_name, // the name to display if the voice wasn't understood
"vmask" = voicemask, // 1 if the mob is using a voice gas mas
//world << "DEBUG: receive.len=[receive.len]" "compression" = 0, // uncompressed radio signal
var/list/heard_masked = list() // masked name or no real name "message" = message, // the actual sent message
var/list/heard_normal = list() // normal message "connection" = connection, // the radio connection to use
var/list/heard_voice = list() // voice message "radio" = src, // stores the radio used for transmission
var/list/heard_garbled = list() // garbled message "slow" = 0,
"traffic" = 0,
"type" = 0,
"server" = null,
"reject" = 0,
"level" = position.z,
"language" = speaking,
"verb" = verb
)
signal.frequency = connection.frequency // Quick frequency set
for (var/mob/R in receive) for(var/obj/machinery/telecomms/receiver/R in telecomms_list)
if (R.client && !(R.client.prefs.toggles & CHAT_RADIO)) //Adminning with 80 people on can be fun when you're trying to talk and all you can hear is radios. R.receive_signal(signal)
continue
if (R.say_understands(M))
if (ishuman(M) && M.GetVoice() != M.real_name)
heard_masked += R
else
heard_normal += R
else
heard_voice += R
if (length(heard_masked) || length(heard_normal) || length(heard_voice) || length(heard_garbled))
var/part_a = "<span class='radio'><span class='name'>"
//var/part_b = "</span><b> \icon[src]\[[format_frequency(frequency)]\]</b> <span class='message'>"
var/freq_text= get_frequency_name(display_freq)
var/part_b = "</span><b> \icon[src]\[[freq_text]\]</b> <span class='message'>" // Tweaked for security headsets -- TLE sleep(rand(10,25)) // wait a little...
var/part_c = "</span></span>"
if (display_freq in ANTAG_FREQS) if(signal.data["done"] && position.z in signal.data["level"])
part_a = "<span class='syndradio'><span class='name'>" // we're done here.
else if (display_freq==COMM_FREQ) return
part_a = "<span class='comradio'><span class='name'>"
else if (display_freq in DEPT_FREQS)
part_a = "<span class='deptradio'><span class='name'>"
var/quotedmsg = M.say_quote(message) // Oh my god; the comms are down or something because the signal hasn't been broadcasted yet in our level.
// Send a mundane broadcast with limited targets:
//This following recording is intended for research and feedback in the use of department radio channels. //THIS IS TEMPORARY. YEAH RIGHT
if(!connection) return //~Carn
var/part_blackbox_b = "</span><b> \[[freq_text]\]</b> <span class='message'>" // Tweaked for security headsets -- TLE Broadcast_Message(connection, M, voicemask, pick(M.speak_emote),
var/blackbox_msg = "[part_a][M.name][part_blackbox_b][quotedmsg][part_c]" src, message, displayname, jobname, real_name, M.voice_name,
//var/blackbox_admin_msg = "[part_a][M.name] (Real name: [M.real_name])[part_blackbox_b][quotedmsg][part_c]" filter_type, signal.data["compression"], list(position.z), connection.frequency,verb,speaking)
if(istype(blackbox))
//BR.messages_admin += blackbox_admin_msg
switch(display_freq)
if(PUB_FREQ)
blackbox.msg_common += blackbox_msg
if(SCI_FREQ)
blackbox.msg_science += blackbox_msg
if(COMM_FREQ)
blackbox.msg_command += blackbox_msg
if(MED_FREQ)
blackbox.msg_medical += blackbox_msg
if(ENG_FREQ)
blackbox.msg_engineering += blackbox_msg
if(SEC_FREQ)
blackbox.msg_security += blackbox_msg
if(DTH_FREQ)
blackbox.msg_deathsquad += blackbox_msg
if(SYND_FREQ)
blackbox.msg_syndicate += blackbox_msg
if(SUP_FREQ)
blackbox.msg_cargo += blackbox_msg
else
blackbox.messages += blackbox_msg
//End of research and feedback code.
if (length(heard_masked))
var/N = M.name
var/J = eqjobname
if(ishuman(M) && M.GetVoice() != M.real_name)
N = M.GetVoice()
J = "Unknown"
var/rendered = "[part_a][N][part_b][quotedmsg][part_c]"
for (var/mob/R in heard_masked)
if(istype(R, /mob/living/silicon/ai))
R.show_message("[part_a]<a href='byond://?src=\ref[src];track2=\ref[R];track=\ref[M]'>[N] ([J]) </a>[part_b][quotedmsg][part_c]", 2)
else
R.show_message(rendered, 2)
if (length(heard_normal))
var/rendered = "[part_a][M.real_name][part_b][quotedmsg][part_c]"
for (var/mob/R in heard_normal)
if(istype(R, /mob/living/silicon/ai))
R.show_message("[part_a]<a href='byond://?src=\ref[src];track2=\ref[R];track=\ref[M]'>[M.real_name] ([eqjobname]) </a>[part_b][quotedmsg][part_c]", 2)
else
R.show_message(rendered, 2)
if (length(heard_voice))
var/rendered = "[part_a][M.voice_name][part_b][pick(M.speak_emote)][part_c]"
for (var/mob/R in heard_voice)
if(istype(R, /mob/living/silicon/ai))
R.show_message("[part_a]<a href='byond://?src=\ref[src];track2=\ref[R];track=\ref[M]'>[M.voice_name] ([eqjobname]) </a>[part_b][pick(M.speak_emote)][part_c]", 2)
else
R.show_message(rendered, 2)
if (length(heard_garbled))
quotedmsg = M.say_quote(stars(message))
var/rendered = "[part_a][M.voice_name][part_b][quotedmsg][part_c]"
for (var/mob/R in heard_voice)
if(istype(R, /mob/living/silicon/ai))
R.show_message("[part_a]<a href='byond://?src=\ref[src];track2=\ref[R];track=\ref[M]'>[M.voice_name]</a>[part_b][quotedmsg][part_c]", 2)
else
R.show_message(rendered, 2)
/obj/item/device/radio/hear_talk(mob/M as mob, msg, var/verb = "says", var/datum/language/speaking = null) /obj/item/device/radio/hear_talk(mob/M as mob, msg, var/verb = "says", var/datum/language/speaking = null)

View File

@@ -426,15 +426,6 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
/client/proc/cmd_switch_radio()
set category = "Debug"
set name = "Switch Radio Mode"
set desc = "Toggle between normal radios and experimental radios. Have a coder present if you do this."
GLOBAL_RADIO_TYPE = !GLOBAL_RADIO_TYPE // toggle
log_admin("[key_name(src)] has turned the experimental radio system [GLOBAL_RADIO_TYPE ? "on" : "off"].")
message_admins("[key_name_admin(src)] has turned the experimental radio system [GLOBAL_RADIO_TYPE ? "on" : "off"].", 0)
feedback_add_details("admin_verb","SRM") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/proc/cmd_admin_areatest() /client/proc/cmd_admin_areatest()
set category = "Mapping" set category = "Mapping"

View File

@@ -162,9 +162,7 @@
if(findtext(temp, "*", 1, 2)) //emotes if(findtext(temp, "*", 1, 2)) //emotes
return return
world << "Text after stuff is [temp]"
temp = copytext(trim_left(temp), 1, rand(5,8)) temp = copytext(trim_left(temp), 1, rand(5,8))
world << "Text after trimming is [temp]"
var/trimmed = trim_left(temp) var/trimmed = trim_left(temp)
if(length(trimmed)) if(length(trimmed))