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

Phantom games report results in a different format #663

Closed
Askaholic opened this issue Sep 15, 2020 · 1 comment · Fixed by #674
Closed

Phantom games report results in a different format #663

Askaholic opened this issue Sep 15, 2020 · 1 comment · Fixed by #674

Comments

@Askaholic
Copy link
Collaborator

Right now the result reporting assumes that results always have the form string number, which is correct for vanilla games. However, as it turns out, the phantom mod also sends an additional string indicating whether or not the player was a phantom. Maybe it would be worth rewriting the game result processing to handle this format as well. At the very least it would make the scores be saved in the database for phantom games.

WARNING  Sep 05  03:10:18 GameConnection                 Invalid result for 5 reported: innocent defeat -3
WARNING  Sep 05  03:17:05 GameConnection                 Invalid result for 3 reported: phantom defeat -1

Source code:

try:
label, score = result.split(" ")
await self.game.add_result(self.player.id, army, label, int(score))
except (KeyError, ValueError): # pragma: no cover
self._logger.warning("Invalid result for %s reported: %s", army, result)

@ahsanbagwan
Copy link
Contributor

I would like to take this up.

ahsanbagwan added a commit to ahsanbagwan/server that referenced this issue Sep 29, 2020
ahsanbagwan added a commit to ahsanbagwan/server that referenced this issue Oct 2, 2020
ahsanbagwan added a commit to ahsanbagwan/server that referenced this issue Oct 3, 2020
Askaholic pushed a commit that referenced this issue Oct 3, 2020
* #663 - Phantom games report format

* #663 - Add unit test

* #663 - Fix housekeeping
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants