extends Node var net = NetworkedMultiplayerENet.new() var api = MultiplayerAPI.new() var port = 1909 var ip = '127.0.0.1' var polling = false # Called when the node enters the scene tree for the first time. func _connect(): polling = true print('Login connecting to port: ' + str(port)) print('at ip: '+ip) net.create_client(ip,port) # net.set_dtls_enabled(true) # net.set_dtls_verify_enabled(false) self.set_custom_multiplayer(api) custom_multiplayer.set_root_node(self) custom_multiplayer.set_network_peer(net) net.connect("connection_failed", self, "_On_Connection_Failed") net.connect("connection_succeeded", self, "_On_Connection_Succeeded") pass # Replace with function body. func _process(_delta): if polling: custom_multiplayer.poll() func _On_Connection_Failed(): print("Failed to connect to game server") func _On_Connection_Succeeded(): print("Connected to game server") func Register(username, password, password2, email, salt): rpc_id(1,"RegisterPlayer", username, password, password2, email, salt, api.get_rpc_sender_id()) remote func update_status(message): get_parent().get_node('LoginUI/register/VBoxContainer/Label').text = message