From 309b3ade644a482d1a1f633cd975909a8d8d9186 Mon Sep 17 00:00:00 2001 From: student_2333 Date: Sat, 3 Jul 2021 13:42:05 +0800 Subject: [PATCH] Add game version corresponding to the server --- mcstatus/bedrock_status.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mcstatus/bedrock_status.py b/mcstatus/bedrock_status.py index 49b486a..0f39beb 100644 --- a/mcstatus/bedrock_status.py +++ b/mcstatus/bedrock_status.py @@ -32,6 +32,7 @@ def parse_response(data: bytes, latency: float): return BedrockStatusResponse( protocol=decoded_data[2], brand=decoded_data[0], + version=decoded_data[3], latency=latency, players_online=decoded_data[4], players_max=decoded_data[5], @@ -70,14 +71,16 @@ async def read_status_async(self): class BedrockStatusResponse: class Version: - def __init__(self, protocol, brand): + def __init__(self, protocol, brand, version): self.protocol = protocol self.brand = brand + self.version = version def __init__( self, protocol, brand, + version, latency, players_online, players_max, @@ -85,7 +88,7 @@ def __init__( map_, gamemode, ): - self.version = self.Version(protocol, brand) + self.version = self.Version(protocol, brand, version) self.latency = latency self.players_online = players_online self.players_max = players_max