Improved UI
This commit is contained in:
@ -1,13 +1,18 @@
|
||||
extends NetworkNode
|
||||
|
||||
@export var ip := "127.0.0.1"
|
||||
@export var port := 4242
|
||||
@export var host: String
|
||||
@export var port: int
|
||||
|
||||
var socket := PacketPeerUDP.new()
|
||||
|
||||
func _init():
|
||||
super._init()
|
||||
socket.connect_to_host(ip, port)
|
||||
func _enter_tree():
|
||||
socket.connect_to_host(host, port)
|
||||
|
||||
for child in get_children():
|
||||
if !(child is PacketHandler):
|
||||
continue
|
||||
|
||||
set_handler(child.packet_type, child)
|
||||
|
||||
func _process(_delta):
|
||||
while socket.get_available_packet_count() > 0:
|
||||
|
Reference in New Issue
Block a user