Skip to content

Commit

Permalink
fix: battlefield protocol sometimes missing fields and result in unpa…
Browse files Browse the repository at this point in the history
…cking too many values
  • Loading branch information
derkalle4 committed Sep 4, 2024
1 parent 9197b0c commit 7a89781
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions opengsq/protocols/battlefield.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ async def get_info(self) -> Info:
info["teams"] = [float(data.pop(0)) for _ in range(num_teams)]
info["target_score"] = int(data.pop(0))
info["status"] = data.pop(0)
info["ranked"] = data.pop(0) == "true"
info["punk_buster"] = data.pop(0) == "true"
info["password"] = data.pop(0) == "true"
info["uptime"] = int(data.pop(0))
info["round_time"] = int(data.pop(0))
info["ranked"] = (data.pop(0) == "true") if data else "false"
info["punk_buster"] = (data.pop(0) == "true") if data else "false"
info["password"] = (data.pop(0) == "true") if data else "false"
info["uptime"] = int(data.pop(0)) if data else 0
info["round_time"] = int(data.pop(0)) if data else 0

try:
if data[0] == "BC2":
Expand Down

0 comments on commit 7a89781

Please sign in to comment.