Skip to content

Commit

Permalink
Update source.py
Browse files Browse the repository at this point in the history
  • Loading branch information
BattlefieldDuck committed Feb 7, 2024
1 parent bc174c3 commit 47501e2
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions opengsq/protocols/source.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,6 @@ async def __receive(self, udpClient: UdpClient) -> bytes:
# Packet id
id = br.read_long()
is_compressed = id & 0x80000000 != 0
print(is_compressed)

# Check is GoldSource multi-packet response format
if self.__is_gold_source_split(BinaryReader(br.read())):
Expand Down Expand Up @@ -378,13 +377,15 @@ async def __parse_gold_source_packet(self, udpClient: UdpClient, packets: list):
import asyncio

async def main_async():
source = Source(host="146.19.87.161", port=27015, timeout=5.0)
# info = await source.get_info()
# print(info)
# Compressed response
# source = Source(host="146.19.87.161", port=27015, timeout=5.0)
source = Source(host="45.62.160.71", port=27015, timeout=5.0)
info = await source.get_info()
print(info)

# await asyncio.sleep(1)
# players = await source.get_players()
# print(players)
await asyncio.sleep(1)
players = await source.get_players()
print(players)

await asyncio.sleep(1)
rules = await source.get_rules()
Expand Down

0 comments on commit 47501e2

Please sign in to comment.