mirror of
https://github.com/Dinnerbone/mcstatus.git
synced 2026-04-06 03:51:23 +08:00
Pack the ID byte when sending Query packets
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import random
|
import random
|
||||||
|
import struct
|
||||||
from mcstatus.protocol.connection import Connection
|
from mcstatus.protocol.connection import Connection
|
||||||
|
|
||||||
|
|
||||||
@@ -14,7 +15,7 @@ class ServerQuerier:
|
|||||||
def _create_packet(self, id):
|
def _create_packet(self, id):
|
||||||
packet = Connection()
|
packet = Connection()
|
||||||
packet.write(self.MAGIC_PREFIX)
|
packet.write(self.MAGIC_PREFIX)
|
||||||
packet.write(chr(id))
|
packet.write(struct.pack("!B", id))
|
||||||
packet.write_uint(0)
|
packet.write_uint(0)
|
||||||
packet.write_uint(self.challenge)
|
packet.write_uint(self.challenge)
|
||||||
return packet
|
return packet
|
||||||
|
|||||||
Reference in New Issue
Block a user