From 950d18c8db011d369b6c0ab89b9671a6fe86f74c Mon Sep 17 00:00:00 2001 From: oranges Date: Tue, 20 Feb 2018 09:36:24 +1300 Subject: [PATCH 1/2] Merge pull request #35507 from arsserpentarium/ntnetfix [READY]NTnet circuit fix --- .../integrated_electronics/subtypes/input.dm | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/code/modules/integrated_electronics/subtypes/input.dm b/code/modules/integrated_electronics/subtypes/input.dm index c22e38d56a..571c22d4e9 100644 --- a/code/modules/integrated_electronics/subtypes/input.dm +++ b/code/modules/integrated_electronics/subtypes/input.dm @@ -591,11 +591,12 @@ desc = "Enables the sending and receiving of messages on NTNet via packet data protocol." extended_desc = "Data can be send or received using the second pin on each side, \ with additonal data reserved for the third pin. When a message is received, the second activation pin \ - will pulse whatever's connected to it. Pulsing the first activation pin will send a message." + will pulse whatever's connected to it. Pulsing the first activation pin will send a message. Message \ + can be send to multiple recepients. Addresses must be separated with ; symbol." icon_state = "signal" complexity = 4 inputs = list( - "target NTNet address" = IC_PINTYPE_STRING, + "target NTNet addresses"= IC_PINTYPE_STRING, "data to send" = IC_PINTYPE_STRING, "secondary text" = IC_PINTYPE_STRING, "passkey" = IC_PINTYPE_STRING, //No this isn't a real passkey encryption scheme but that's why you keep your nodes secure so no one can find it out! @@ -604,17 +605,19 @@ "address received" = IC_PINTYPE_STRING, "data received" = IC_PINTYPE_STRING, "secondary text received" = IC_PINTYPE_STRING, - "passkey" = IC_PINTYPE_STRING + "passkey" = IC_PINTYPE_STRING ) activators = list("send data" = IC_PINTYPE_PULSE_IN, "on data received" = IC_PINTYPE_PULSE_OUT) spawn_flags = IC_SPAWN_DEFAULT|IC_SPAWN_RESEARCH power_draw_per_use = 50 var/datum/ntnet_connection/exonet = null + var/address /obj/item/integrated_circuit/input/ntnet_packet/Initialize() . = ..() var/datum/component/ntnet_interface/net = LoadComponent(/datum/component/ntnet_interface) - desc += "
This circuit's NTNet hardware address is: [net.hardware_id]" + address = net.hardware_id + desc += "
This circuit's NTNet hardware address is: [address]" /obj/item/integrated_circuit/input/ntnet_packet/do_work() var/target_address = get_pin_data(IC_INPUT, 1) @@ -623,14 +626,15 @@ var/key = get_pin_data(IC_INPUT, 4) var/datum/netdata/data = new - data.recipient_ids += target_address + data.recipient_ids = splittext(target_address, ";") + data.sender_id = address data.plaintext_data = message data.plaintext_data_secondary = text data.plaintext_passkey = key ntnet_send(data) /obj/item/integrated_circuit/input/ntnet_recieve(datum/netdata/data) - set_pin_data(IC_OUTPUT, 1, length(data.recipient_ids) >= 1? data.recipient_ids[1] : null) + set_pin_data(IC_OUTPUT, 1, data.sender_id) set_pin_data(IC_OUTPUT, 2, data.plaintext_data) set_pin_data(IC_OUTPUT, 3, data.plaintext_data_secondary) set_pin_data(IC_OUTPUT, 4, data.plaintext_passkey)