From 47501e2e3cc865d73a8cf7a5dac93f5023f11b0f Mon Sep 17 00:00:00 2001 From: Battlefield Duck Date: Thu, 8 Feb 2024 01:15:47 +0800 Subject: [PATCH] Update source.py --- opengsq/protocols/source.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/opengsq/protocols/source.py b/opengsq/protocols/source.py index b9d0239..c4b0450 100644 --- a/opengsq/protocols/source.py +++ b/opengsq/protocols/source.py @@ -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())): @@ -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()