Skip to content

Commit

Permalink
Merge pull request #151 from lgc2333/master
Browse files Browse the repository at this point in the history
Add game version corresponding to the server
  • Loading branch information
kevinkjt2000 authored Jul 5, 2021
2 parents 8346db2 + 309b3ad commit 1c083a6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions mcstatus/bedrock_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down Expand Up @@ -70,22 +71,24 @@ 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,
motd,
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
Expand Down

0 comments on commit 1c083a6

Please sign in to comment.