mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-15 18:14:22 +01:00
fec9a5d725
## About The Pull Request TODO: - [x] Main circuit code - [x] BCI compatibility - [x] Limiting range in some way(not intended as a private cross map coms system) This adds a new NFC component, its similair to NTNet component with the distinction it will only be received by the shell's circuit you target. Allowing more targeted networking for things like remotes I'd love suggestions for a max range, if any. Because im not really sure. Maby circuit has to be in vision for it to work? gif is too big so here is direct link to discord embedded gif showing it off https://cdn.discordapp.com/attachments/326831214667235328/1296810437295341649/example.gif?ex=6713a455&is=671252d5&hm=f87b282ac71c318eac03b4a53e03ebcfd91e5a0b0a1e9165beb3f87318b96809& <img src="https://cdn.discordapp.com/attachments/326831214667235328/1296810437295341649/example.gif?ex=6713a455&is=671252d5&hm=f87b282ac71c318eac03b4a53e03ebcfd91e5a0b0a1e9165beb3f87318b96809&"> ## Why It's Good For The Game NTNet is powerfull for making networked circuits, but I lack a good way to create a direct "remote" with complex data. I want to make a circuit that makes it easier to controll other circuits in a less strictly coupeld way and this seems like a clean way to make those ## Changelog 🆑 add: A new cirucit component allows NFC communications /🆑 --------- Co-authored-by: Ben10Omintrix <138636438+Ben10Omintrix@users.noreply.github.com>
37 lines
1.3 KiB
Plaintext
37 lines
1.3 KiB
Plaintext
/**
|
|
* # NFC Transmitter List Literal Component
|
|
*
|
|
* Create a list literal and send a data package through NFC
|
|
*
|
|
* This file is based off of nfc_sendl.dm
|
|
* Any changes made to those files should be copied over with discretion
|
|
*/
|
|
/obj/item/circuit_component/list_literal/nfc_send
|
|
display_name = "NFC Transmitter List Literal"
|
|
desc = "Creates a list literal data package and sends it through NFC. If Encryption Key is set then transmitted data will be only picked up by receivers with the same Encryption Key."
|
|
category = "Utility"
|
|
|
|
/// Encryption key
|
|
var/datum/port/input/enc_key
|
|
|
|
/// The targeted circuit
|
|
var/datum/port/input/target
|
|
|
|
/obj/item/circuit_component/list_literal/nfc_send/populate_ports()
|
|
. = ..()
|
|
enc_key = add_input_port("Encryption Key", PORT_TYPE_STRING)
|
|
target = add_input_port("Target", PORT_TYPE_ATOM)
|
|
|
|
/obj/item/circuit_component/list_literal/nfc_send/should_receive_input(datum/port/input/port)
|
|
. = ..()
|
|
if(!.)
|
|
return FALSE
|
|
/// If the server is down, don't use power or attempt to send data
|
|
return find_functional_ntnet_relay()
|
|
|
|
/obj/item/circuit_component/list_literal/nfc_send/input_received(datum/port/input/port)
|
|
. = ..()
|
|
if(isatom(target.value))
|
|
var/atom/target_enty = target.value
|
|
SEND_SIGNAL(target_enty, COMSIG_CIRCUIT_NFC_DATA_SENT, list("data" = list_output.value, "enc_key" = enc_key.value, "port" = WEAKREF(list_output)))
|