class_name LoginServer var host: String var port: int = 6900 var stream: PacketPeerStream = PacketPeerStream.new() var peer: StreamPeerTCP = StreamPeerTCP.new() @warning_ignore("shadowed_variable") func _init(host: String, port: int = 6900) -> void: self.host = host self.port = port stream.stream_peer = peer peer.connect_to_host(host, port) peer.poll() func login(username: String, password: String) -> LoginServerLoginSuccessPacket: var login_server_login_packet = LoginServerLoginPacket.new() login_server_login_packet.username = username login_server_login_packet.password = password peer.put_data(login_server_login_packet.to_bytes()) var success = LoginServerLoginSuccessPacket.from_bytes_via_peer(peer) var character_server_information: CharacterServerInformation = success.character_server_information[0] print(inst_to_dict(success), inst_to_dict(character_server_information)) return success