class_name MapServer extends Server signal logged_in(packet: MapServerLoginSuccessPacket) @warning_ignore("shadowed_variable") func _init(host: String, port: int = 5121) -> void: super._init(host, port) func login(account_id: int, character_id: int, login_id1: int, gender: Constants.Gender): var map_server_login_packet = MapServerLoginPacket.new() map_server_login_packet.account_id = account_id map_server_login_packet.character_id = character_id map_server_login_packet.login_id1 = login_id1 map_server_login_packet.gender = gender peer.put_data(map_server_login_packet.to_bytes()) peer.get_data(6) # in-between packet peer.get_data(4) # in-between packet var packet = await received_packet if packet is MapServerLoginSuccessPacket: print(inst_to_dict(packet)) logged_in.emit(packet)