mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-15 01:54:52 +01:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user