Skip to content

Commit

Permalink
Merge pull request #18 from derkalle4/battlefield
Browse files Browse the repository at this point in the history
battlefield protocol sometimes missing fields and result in unpacking too many values
  • Loading branch information
BattlefieldDuck authored Oct 2, 2024
2 parents 9197b0c + 7a89781 commit d8d4edc
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 d8d4edc

Please sign in to comment.