Skip to content

Commit 7e8ebcb

Browse files
committed
Fixing Linting Errors
1 parent da346c7 commit 7e8ebcb

File tree

4 files changed

+13
-19
lines changed

4 files changed

+13
-19
lines changed

opengsq/protocols/flatout2.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -232,10 +232,6 @@ def _verify_packet(self, data: bytes) -> bool:
232232
if len(data) < 14: # Minimum length for header + session ID + padding + game ID
233233
return False
234234

235-
# Check response header - accept any of the valid response headers
236-
response_header = data[:2]
237-
header_valid = response_header in self.RESPONSE_HEADERS
238-
239235
# Check game identifier (position 10-14, after session ID and padding)
240236
# This is the most reliable indicator for Flatout 2 servers
241237
game_id = data[10:14]

opengsq/protocols/udk.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -68,22 +68,22 @@ def _parse_response(self, buffer: bytes) -> dict:
6868

6969
# Parse connection info
7070
num_open_public_conn = struct.unpack("!I", br.read_bytes(4))[0]
71-
num_open_private_conn = struct.unpack("!I", br.read_bytes(4))[0]
71+
_ = struct.unpack("!I", br.read_bytes(4))[0] # num_open_private_conn
7272
num_public_conn = struct.unpack("!I", br.read_bytes(4))[0]
73-
num_private_conn = struct.unpack("!I", br.read_bytes(4))[0]
73+
_ = struct.unpack("!I", br.read_bytes(4))[0] # num_private_conn
7474

7575
# Parse flags
76-
should_advertise = br.read_bytes(1)[0] == 1
76+
_ = br.read_bytes(1)[0] == 1 # should_advertise
7777
is_lan_match = br.read_bytes(1)[0] == 1
7878
uses_stats = br.read_bytes(1)[0] == 1
79-
allow_join_in_progress = br.read_bytes(1)[0] == 1
80-
allow_invites = br.read_bytes(1)[0] == 1
81-
uses_presence = br.read_bytes(1)[0] == 1
82-
allow_join_via_presence = br.read_bytes(1)[0] == 1
83-
uses_arbitration = br.read_bytes(1)[0] == 1
79+
_ = br.read_bytes(1)[0] == 1 # allow_join_in_progress
80+
_ = br.read_bytes(1)[0] == 1 # allow_invites
81+
_ = br.read_bytes(1)[0] == 1 # uses_presence
82+
_ = br.read_bytes(1)[0] == 1 # allow_join_via_presence
83+
_ = br.read_bytes(1)[0] == 1 # uses_arbitration
8484

8585
if self.packet_version >= 5:
86-
anti_cheat_protected = br.read_bytes(1)[0] == 1
86+
_ = br.read_bytes(1)[0] == 1 # anti_cheat_protected
8787

8888
# Read owner info
8989
owner_id = br.read_bytes(8)

opengsq/protocols/w40kdow.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,7 @@ def _parse_broadcast(self, data: bytes, addr: tuple) -> Status:
154154

155155
# Read unknown ASCII field (appears to be a version like "1.0", length in bytes)
156156
unknown_ascii_len = br.read_long(unsigned=True)
157-
unknown_ascii = br.read_bytes(unknown_ascii_len).decode(
158-
"ascii", errors="ignore"
159-
)
157+
_ = br.read_bytes(unknown_ascii_len) # unknown_ascii, skip for now
160158

161159
# Read map/scenario name (UTF-16LE with length in code units)
162160
map_scenario_len_units = br.read_long(unsigned=True)

opengsq/protocols/warcraft3.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,9 @@ async def get_status(self) -> Status:
183183
slots_total = int.from_bytes(br.read_bytes(4), "little")
184184
game_flags = GameFlags(int.from_bytes(br.read_bytes(4), "little"))
185185
slots_used = int.from_bytes(br.read_bytes(4), "little")
186-
slots_available = int.from_bytes(br.read_bytes(4), "little")
187-
uptime_seconds = int.from_bytes(br.read_bytes(4), "little")
188-
port = int.from_bytes(br.read_bytes(2), "little")
186+
_ = int.from_bytes(br.read_bytes(4), "little") # slots_available
187+
_ = int.from_bytes(br.read_bytes(4), "little") # uptime_seconds
188+
_ = int.from_bytes(br.read_bytes(2), "little") # port
189189

190190
# Store raw data for debugging
191191
raw = {

0 commit comments

Comments
 (0)