From 313afffce7a823c30acf4853b083f9ca5132e879 Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Fri, 29 Nov 2024 21:54:32 +0100 Subject: next commit --- packets/character_server_login_success_packet.gd | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) (limited to 'packets/character_server_login_success_packet.gd') diff --git a/packets/character_server_login_success_packet.gd b/packets/character_server_login_success_packet.gd index 800e218..bfe6c45 100644 --- a/packets/character_server_login_success_packet.gd +++ b/packets/character_server_login_success_packet.gd @@ -2,6 +2,10 @@ class_name CharacterServerLoginSuccessPacket extends Packet +const HEADER := 0x082d +const BYTE_LENGTH := 0 + + ## Byte Length: 2 var unknown: int @@ -27,18 +31,12 @@ var unused: PackedByteArray static func from_bytes(bytes: PackedByteArray): var packet = CharacterServerLoginSuccessPacket.new() - packet.unknown = bytes.decode_u16(0) - packet.normal_slot_count = bytes.decode_u8(2) - packet.vip_slot_count = bytes.decode_u8(3) - packet.billing_slot_count = bytes.decode_u8(4) - packet.producible_slot_count = bytes.decode_u8(5) - packet.valid_slot = bytes.decode_u8(6) - packet.unused = bytes.slice(7, 7 + 20) + packet.unknown = bytes.decode_u16(6) + packet.normal_slot_count = bytes.decode_u8(8) + packet.vip_slot_count = bytes.decode_u8(9) + packet.billing_slot_count = bytes.decode_u8(10) + packet.producible_slot_count = bytes.decode_u8(11) + packet.valid_slot = bytes.decode_u8(12) + packet.unused = bytes.slice(13, 13 + 20) return packet - -static func from_bytes_via_peer(peer: StreamPeer): - var _header = peer.get_data(6) - var remaining_bytes = peer.get_data(peer.get_available_bytes()) - - return from_bytes(remaining_bytes[1]) -- cgit v1.2.3