Skip to content

Commit

Permalink
Merge branch 'master' into switch-type-checker
Browse files Browse the repository at this point in the history
  • Loading branch information
ItsDrike committed Feb 1, 2022
2 parents 346c2c1 + 900af52 commit 4491571
Show file tree
Hide file tree
Showing 5 changed files with 193 additions and 168 deletions.
2 changes: 1 addition & 1 deletion mcstatus/protocol/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def read_varint(self) -> int:
raise IOError("Server sent a varint that was too big!")

def write_varint(self, value: int) -> None:
if value < -(2 ** 31) or 2 ** 31 - 1 < value:
if value < -(2**31) or 2**31 - 1 < value:
raise ValueError("Minecraft varints must be in the range of [-2**31, 2**31 - 1].")
remaining = unsigned_int32(value).value
for _ in range(5):
Expand Down
2 changes: 1 addition & 1 deletion mcstatus/querier.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def __init__(self, connection: UDPSocketConnection):
@staticmethod
def _generate_session_id() -> int:
# minecraft only supports lower 4 bits
return random.randint(0, 2 ** 31) & 0x0F0F0F0F
return random.randint(0, 2**31) & 0x0F0F0F0F

def _create_packet(self) -> Connection:
packet = Connection()
Expand Down

0 comments on commit 4491571

Please sign in to comment.