Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document bottleneck messages #1046

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
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
47 changes: 40 additions & 7 deletions server/gameconnection.py
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@
self.finished_sim = True
await self.game.check_game_finish(self.player)

async def handle_rehost(self, *args: list[Any]):
async def handle_rehost(self, *args: Any):
"""
Signals that the user has rehosted the game. This is currently unused but
included for documentation purposes.
Expand All @@ -519,21 +519,54 @@
"""
pass

async def handle_bottleneck(self, *args: list[Any]):
async def handle_bottleneck(self, code: str, *args: str):
"""
Not sure what this command means. This is currently unused but
included for documentation purposes.
"""
pass

async def handle_bottleneck_cleared(self, *args: list[Any]):
self._logger.debug("Bottleneck: %s", list((code, *args)))

Check warning on line 527 in server/gameconnection.py

View check run for this annotation

Codecov / codecov/patch

server/gameconnection.py#L527

Added line #L527 was not covered by tests

if code == "ack":
# Example
# ```python
# {
# "command": "Bottleneck",
# "target": "game",
# "args": ["ack", "17654", "466996,436136,443631,402513,302866", "14222.5"],
# }
# ```
pass

Check warning on line 538 in server/gameconnection.py

View check run for this annotation

Codecov / codecov/patch

server/gameconnection.py#L538

Added line #L538 was not covered by tests
elif code == "data":
# Example
# ```python
# {
# "command": "Bottleneck",
# "target": "game",
# "args": ["data", "19508", "517268,516974,344419", "5980.1"],
# }
# ```
# 517268,516974,344419 are the player ids of other players (not the sender)
# 5980.1 is an increasing value
pass

Check warning on line 550 in server/gameconnection.py

View check run for this annotation

Codecov / codecov/patch

server/gameconnection.py#L550

Added line #L550 was not covered by tests
elif code == "readiness":
# Example
# ```python
# {
# "command": "Bottleneck",
# "target": "game",
# "args": ["readiness", "1", "234112", "5220.7"],
# }
# ```
pass

Check warning on line 560 in server/gameconnection.py

View check run for this annotation

Codecov / codecov/patch

server/gameconnection.py#L560

Added line #L560 was not covered by tests

async def handle_bottleneck_cleared(self):
"""
Not sure what this command means. This is currently unused but
included for documentation purposes.
"""
pass
self._logger.debug("BottleneckCleared")

async def handle_disconnected(self, *args: list[Any]):
async def handle_disconnected(self, *args: Any):
"""
Not sure what this command means. This is currently unused but
included for documentation purposes.
Expand Down
Loading