Adds Radio Circuit Component Signaler to list-signalers (#76613)

## About The Pull Request

Fixes #76503

Probably important for this stuff to be logged.
## Why It's Good For The Game

Helps admins figure out the signallers that are signalling, and who
triggered the signaller.
## Changelog
🆑
admin: If a circuit component outputs a radio signal, it should now be
logged in list-signalers.
/🆑
This commit is contained in:
san7890
2023-07-10 11:19:32 -06:00
committed by GitHub
parent e87648b80e
commit de3fb72973
@@ -22,8 +22,23 @@
/// Current frequency value
var/current_freq = DEFAULT_SIGNALER_CODE
/// Holds a reference to the shell.
var/atom/movable/parent_shell = null
/// The ckey of the user who used the shell we were placed in, important for signalling logs.
var/owner_ckey = null
var/datum/radio_frequency/radio_connection
/obj/item/circuit_component/radio/register_shell(atom/movable/shell)
parent_shell = shell
var/potential_fingerprints = shell.fingerprintslast
if(!isnull(potential_fingerprints))
owner_ckey = potential_fingerprints
/obj/item/circuit_component/radio/unregister_shell(atom/movable/shell)
parent_shell = null
/obj/item/circuit_component/radio/populate_options()
var/static/component_options = list(
COMP_RADIO_PUBLIC,
@@ -58,7 +73,20 @@
current_freq = frequency
if(COMPONENT_TRIGGERED_BY(trigger_input, port))
var/datum/signal/signal = new(list("code" = round(code.value) || 0, "key" = parent?.owner_id))
var/signal_code = round(code.value) || 0
var/turf/location = get_turf(src)
var/time = time2text(world.realtime,"hh:mm:ss")
var/list/loggable_strings = list("[time] <B>:</B> The [QDELETED(parent_shell) ? "null circuit shell(?)" : parent_shell] @ location ([location.x],[location.y],[location.z]) transmitted the following signal <B>:</B> [format_frequency(current_freq)]/[signal_code] via the radio circuit component.")
if(!isnull(owner_ckey))
loggable_strings += "<B>:</B> The person who inserted the signalling circuit component was very likely [owner_ckey]."
if(!QDELETED(parent_shell))
loggable_strings += "<B>:</B> The last fingerprints on the containing shell was [parent_shell.fingerprintslast]."
var/loggable_string = loggable_strings.Join(" ")
GLOB.lastsignalers.Add(loggable_string)
var/datum/signal/signal = new(list("code" = signal_code, "key" = parent?.owner_id), logging_data = loggable_string)
radio_connection.post_signal(src, signal)
/obj/item/circuit_component/radio/receive_signal(datum/signal/signal)