Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions opengsq/protocols/flatout2.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,10 +232,6 @@ def _verify_packet(self, data: bytes) -> bool:
if len(data) < 14: # Minimum length for header + session ID + padding + game ID
return False

# Check response header - accept any of the valid response headers
response_header = data[:2]
header_valid = response_header in self.RESPONSE_HEADERS

# Check game identifier (position 10-14, after session ID and padding)
# This is the most reliable indicator for Flatout 2 servers
game_id = data[10:14]
Expand Down
18 changes: 9 additions & 9 deletions opengsq/protocols/udk.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,22 +68,22 @@ def _parse_response(self, buffer: bytes) -> dict:

# Parse connection info
num_open_public_conn = struct.unpack("!I", br.read_bytes(4))[0]
num_open_private_conn = struct.unpack("!I", br.read_bytes(4))[0]
_ = struct.unpack("!I", br.read_bytes(4))[0] # num_open_private_conn
num_public_conn = struct.unpack("!I", br.read_bytes(4))[0]
num_private_conn = struct.unpack("!I", br.read_bytes(4))[0]
_ = struct.unpack("!I", br.read_bytes(4))[0] # num_private_conn

# Parse flags
should_advertise = br.read_bytes(1)[0] == 1
_ = br.read_bytes(1)[0] == 1 # should_advertise
is_lan_match = br.read_bytes(1)[0] == 1
uses_stats = br.read_bytes(1)[0] == 1
allow_join_in_progress = br.read_bytes(1)[0] == 1
allow_invites = br.read_bytes(1)[0] == 1
uses_presence = br.read_bytes(1)[0] == 1
allow_join_via_presence = br.read_bytes(1)[0] == 1
uses_arbitration = br.read_bytes(1)[0] == 1
_ = br.read_bytes(1)[0] == 1 # allow_join_in_progress
_ = br.read_bytes(1)[0] == 1 # allow_invites
_ = br.read_bytes(1)[0] == 1 # uses_presence
_ = br.read_bytes(1)[0] == 1 # allow_join_via_presence
_ = br.read_bytes(1)[0] == 1 # uses_arbitration

if self.packet_version >= 5:
anti_cheat_protected = br.read_bytes(1)[0] == 1
_ = br.read_bytes(1)[0] == 1 # anti_cheat_protected

# Read owner info
owner_id = br.read_bytes(8)
Expand Down
4 changes: 1 addition & 3 deletions opengsq/protocols/w40kdow.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,7 @@ def _parse_broadcast(self, data: bytes, addr: tuple) -> Status:

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

# Read map/scenario name (UTF-16LE with length in code units)
map_scenario_len_units = br.read_long(unsigned=True)
Expand Down
6 changes: 3 additions & 3 deletions opengsq/protocols/warcraft3.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,9 @@ async def get_status(self) -> Status:
slots_total = int.from_bytes(br.read_bytes(4), "little")
game_flags = GameFlags(int.from_bytes(br.read_bytes(4), "little"))
slots_used = int.from_bytes(br.read_bytes(4), "little")
slots_available = int.from_bytes(br.read_bytes(4), "little")
uptime_seconds = int.from_bytes(br.read_bytes(4), "little")
port = int.from_bytes(br.read_bytes(2), "little")
_ = int.from_bytes(br.read_bytes(4), "little") # slots_available
_ = int.from_bytes(br.read_bytes(4), "little") # uptime_seconds
_ = int.from_bytes(br.read_bytes(2), "little") # port

# Store raw data for debugging
raw = {
Expand Down
Loading