From bf70ebe2f7b3c5cb5ad6a8a3140c80eb46b67443 Mon Sep 17 00:00:00 2001 From: Battlefield Duck Date: Mon, 22 Jan 2024 19:05:48 +0800 Subject: [PATCH] Update protocols --- opengsq/protocols/ase.py | 3 +-- opengsq/responses/ase/player.py | 2 ++ opengsq/responses/ase/status.py | 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/opengsq/protocols/ase.py b/opengsq/protocols/ase.py index e6ccc4d..4e02dd1 100644 --- a/opengsq/protocols/ase.py +++ b/opengsq/protocols/ase.py @@ -95,12 +95,11 @@ def __parse_players(self, br: BinaryReader) -> list[Player]: if __name__ == "__main__": import asyncio import json - from dataclasses import asdict async def main_async(): # mtasa ase = ASE(host="79.137.97.3", port=22126, timeout=10.0) status = await ase.get_status() - print(json.dumps(asdict(status), indent=None) + "\n") + print(json.dumps(status, indent=None) + "\n") asyncio.run(main_async()) diff --git a/opengsq/responses/ase/player.py b/opengsq/responses/ase/player.py index e7c0f02..fc74643 100644 --- a/opengsq/responses/ase/player.py +++ b/opengsq/responses/ase/player.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from dataclasses import asdict, dataclass diff --git a/opengsq/responses/ase/status.py b/opengsq/responses/ase/status.py index dd6c225..8c75a34 100644 --- a/opengsq/responses/ase/status.py +++ b/opengsq/responses/ase/status.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from dataclasses import asdict, dataclass, field from opengsq.responses.ase.player import Player