diff options
author | Daniel Weipert <git@mail.dweipert.de> | 2024-11-28 18:38:42 +0100 |
---|---|---|
committer | Daniel Weipert <git@mail.dweipert.de> | 2024-11-28 18:38:42 +0100 |
commit | e8aa9f50886b66d525307a58d71036e6fd3d4aa1 (patch) | |
tree | ce6f59eecf1eb3e1ba2794166c09623d8a2d7d83 /packets/login_server_login_success_packet.gd | |
parent | c89f25f59aa493d95bcac8e75ca5cdd57a0403e7 (diff) |
next commit
Diffstat (limited to 'packets/login_server_login_success_packet.gd')
-rw-r--r-- | packets/login_server_login_success_packet.gd | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/packets/login_server_login_success_packet.gd b/packets/login_server_login_success_packet.gd index 3d74289..fd7dbf1 100644 --- a/packets/login_server_login_success_packet.gd +++ b/packets/login_server_login_success_packet.gd @@ -2,30 +2,36 @@ class_name LoginServerLoginSuccessPacket extends Packet +static var header := 0x0ac4 + + +## Byte Type: u32 ## Byte Length: 4 var login_id1: int +## Byte Type: u32 ## Byte Length: 4 var account_id: int +## Byte Type: u32 ## Byte Length: 4 var login_id2: int ## Deprecated and always 0 on rAthena +## Byte Type: u32 ## Byte Length: 4 var ip_address: PackedByteArray ## Deprecated and always 0 on rAthena -## Byte Length: 24 -var name: String - -## Always 0 on rAthena -## Byte Length: 2 -var unknown: int +## Byte Type: u8 +## Byte Length: 26 +var last_login: PackedByteArray +## Byte Type: u8 ## Byte Length: 1 var gender: Constants.Gender +## Byte Type: u8 ## Byte Length: 17 var auth_token: String @@ -39,16 +45,15 @@ static func from_bytes(bytes: PackedByteArray): packet.account_id = bytes.decode_u32(4) packet.login_id2 = bytes.decode_u32(8) packet.ip_address = bytes.slice(12, 16) - packet.name = bytes.slice(16, 16 + 24).get_string_from_utf8() - packet.unknown = bytes.decode_u16(40) + packet.last_login = bytes.slice(16, 16 + 26) packet.gender = bytes[42] - packet.auth_token = bytes.slice(43, 43 + 17 - 1).get_string_from_utf8() + packet.auth_token = bytes.slice(43, 43 + 17).get_string_from_utf8() packet.character_server_information = CharacterServerInformation.array_from_bytes(bytes.slice(60)) return packet static func from_bytes_via_peer(peer: StreamPeer): - var _header = peer.get_data(4) + var _header = peer.get_data(4) # 2 = header, 2 = packet_size var remaining_bytes = peer.get_data(peer.get_available_bytes()) return from_bytes(remaining_bytes[1]) |