From c69f146e653cbb1747b6759beb473be51f83d821 Mon Sep 17 00:00:00 2001 From: kovagoadi Date: Mon, 29 Jun 2026 19:58:16 +0200 Subject: [PATCH] Fixed ruff issues --- check_public_calls.py | 2 +- lib/openttd/protocol.py | 20 +++++++++++++------- tests/test_e2e.py | 5 +---- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/check_public_calls.py b/check_public_calls.py index f1f9a6a..839ee61 100755 --- a/check_public_calls.py +++ b/check_public_calls.py @@ -10,6 +10,7 @@ sys.path.insert(0, os.path.dirname(__file__)) from openttd import OpenTTDClient, OpenTTDAdminClient from openttd.protocol import OpenTTDProtocol, OpenTTDAdminProtocol +import tests.test_e2e as test_e2e # 1. Gather public functions dynamically at runtime using reflection classes = [OpenTTDClient, OpenTTDAdminClient, OpenTTDProtocol, OpenTTDAdminProtocol] @@ -48,7 +49,6 @@ for cls in classes: public_funcs[name] = has_params # 2. Inspect E2E test module dynamically at runtime using reflection -import tests.test_e2e as test_e2e calls = {name: [] for name in public_funcs} diff --git a/lib/openttd/protocol.py b/lib/openttd/protocol.py index d85c8f9..2a745ff 100644 --- a/lib/openttd/protocol.py +++ b/lib/openttd/protocol.py @@ -253,7 +253,8 @@ class OpenTTDAdminProtocol(OpenTTDProtocol): updates = {} while True: has_more, data = read_uint8(data) - if not has_more: break + if not has_more: + break ut, data = read_uint16(data) freqs, data = read_uint16(data) updates[ut] = freqs @@ -413,14 +414,19 @@ class OpenTTDAdminProtocol(OpenTTDProtocol): def receive_ServerCompanyEconomy(source, data): import struct cid, data = read_uint8(data) - money = struct.unpack("