diff options
Diffstat (limited to 'packets/login_server_login_packet.gd')
-rw-r--r-- | packets/login_server_login_packet.gd | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/packets/login_server_login_packet.gd b/packets/login_server_login_packet.gd index 29f23cd..5b4c1f3 100644 --- a/packets/login_server_login_packet.gd +++ b/packets/login_server_login_packet.gd @@ -2,6 +2,10 @@ class_name LoginServerLoginPacket extends Packet +static var header := 0x064 + + +## Byte Type: u32 ## Byte Length: 4 var version: int = 0 @@ -11,13 +15,12 @@ var username: String ## Byte Length: 24 var password: String +## Byte Type: u8 ## Byte Length: 1 var client_type: int = 0 func to_bytes(): - var header = PackedByteArray([100, 0]) - var username_bytes = username.to_utf8_buffer() username_bytes.resize(24) @@ -27,8 +30,11 @@ func to_bytes(): var payload = PackedByteArray([]) payload.resize(4) payload.encode_u32(0, version) + payload.append_array(username_bytes) payload.append_array(password_bytes) - payload.append(client_type) - return header + payload + payload.resize(53) + payload.encode_u8(52, client_type) + + return get_header() + payload |