From 81ad8e322577880fdda8d7cfe2f114f3bfa69bec Mon Sep 17 00:00:00 2001 From: sasha80 Date: Wed, 27 Aug 2025 08:34:32 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A0=D0=B5=D1=84=D0=B0=D0=BA=D1=82=D0=BE?= =?UTF-8?q?=D1=80.=20=D0=A1=D0=B5=D1=82=D0=B5=D0=B2=D0=BE=D0=B9=20=D0=BC?= =?UTF-8?q?=D0=BE=D0=B4=D1=83=D0=BB=D1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/network.gd | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/scripts/network.gd b/scripts/network.gd index b060e89c..4699c4f6 100644 --- a/scripts/network.gd +++ b/scripts/network.gd @@ -1,7 +1,7 @@ class_name Network extends Node - -const UDP_PROTO: = {'yau07tx': yau07.YaU07, 'json-capsrpb': capsrpb.CapsRpb} +const UDPTX_PROTO: = {'yau07tx': yau07.YaU07} +const UDPJSON_PROTO: = {'json-capsrpb': capsrpb.CapsRpb} const TCP_PROTO: = {'5p28': tcp5p28.TCP5P28} const SERIAL_PROTO: = {'uart': spt25.SPT25} const MODBUS_PROTO: = {'mbcs': sch3.Sch3} @@ -162,11 +162,18 @@ func _ready() -> void: units_udprx[unit_name] = new_unit dst_ports[unit_name] = st[2][0] - if proto in UDP_PROTO: - var new_unit = UDP_PROTO[proto].new(unit_name) + if proto in UDPTX_PROTO: + var new_unit = UDPTX_PROTO[proto].new(unit_name) units[unit_name] = new_unit units_udp[unit_name] = new_unit - dst_ports[unit_name] = st[2][1] if len(st[2]) > 1 else st[2][0] + dst_ports[unit_name] = st[2][0] + dst_addrs[unit_name] = st[1] + + if proto in UDPJSON_PROTO: + var new_unit = UDPJSON_PROTO[proto].new(unit_name) + units[unit_name] = new_unit + units_udp[unit_name] = new_unit + dst_ports[unit_name] = st[2][1] dst_addrs[unit_name] = st[1] if proto in TCP_PROTO: