Skip to content

Commit

Permalink
fix: negative spectator values
Browse files Browse the repository at this point in the history
- Added workaround for negative spectator values, thrown by api when
server runs some out of date mod without dedicated spectator slots.
- Since the issue above needs to be fixed asap, bumped version to 1.0.1
  • Loading branch information
moonburnt committed Dec 11, 2021
1 parent 529581b commit 156dbca
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion notashark/fetcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ def clean_server_info(self, info: dict) -> parts.KagServerInfo:
game_mode += " (modded)"

capacity = f"{len(info['playerList'])}/{info['maxPlayers']}"
if info["spectatorPlayers"]:
if info["spectatorPlayers"] > 0: #old mods may give negative values
capacity += f" ({info['spectatorPlayers']} spectating)"

link = f"<kag://{info['IPv4Address']}:{info['port']}>"
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setup(
name="notashark",
version="1.0.0",
version="1.0.1",
description="notashark - discord bot for King Arthur's Gold",
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down

0 comments on commit 156dbca

Please sign in to comment.