summaryrefslogtreecommitdiff
path: root/packets/login_server_login_packet.gd
diff options
context:
space:
mode:
authorDaniel Weipert <git@mail.dweipert.de>2024-11-28 18:38:42 +0100
committerDaniel Weipert <git@mail.dweipert.de>2024-11-28 18:38:42 +0100
commite8aa9f50886b66d525307a58d71036e6fd3d4aa1 (patch)
treece6f59eecf1eb3e1ba2794166c09623d8a2d7d83 /packets/login_server_login_packet.gd
parentc89f25f59aa493d95bcac8e75ca5cdd57a0403e7 (diff)
next commit
Diffstat (limited to 'packets/login_server_login_packet.gd')
-rw-r--r--packets/login_server_login_packet.gd14
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