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

Coop leaderboard results are not resolved appropriately #560

Closed
Askaholic opened this issue Mar 29, 2020 · 0 comments · Fixed by #767
Closed

Coop leaderboard results are not resolved appropriately #560

Askaholic opened this issue Mar 29, 2020 · 0 comments · Fixed by #767

Comments

@Askaholic
Copy link
Collaborator

In handle_operation_complete the leaderboard results are taken from the first player who reports them, and any further results throw a mysql error.

ERROR    Mar 22  04:33:05 GameConnection                 Something awful happened in a game thread!
Traceback (most recent call last):
  File "/code/server/gameconnection.py", line 192, in handle_action
    await COMMAND_HANDLERS[command](self, *args)
  File "/code/server/gameconnection.py", line 321, in handle_operation_complete
    (mission, self.game.id, secondary, delta, len(self.game.players))
  File "/src/aiomysql/aiomysql/sa/connection.py", line 145, in _execute
    await cursor.execute(query, dp or None)
  File "/src/aiomysql/aiomysql/cursors.py", line 239, in execute
    await self._query(query)
  File "/src/aiomysql/aiomysql/cursors.py", line 457, in _query
    await conn.query(q)
  File "/src/aiomysql/aiomysql/connection.py", line 428, in query
    await self._read_query_result(unbuffered=unbuffered)
  File "/src/aiomysql/aiomysql/connection.py", line 622, in _read_query_result
    await result.read()
  File "/src/aiomysql/aiomysql/connection.py", line 1105, in read
    first_packet = await self.connection._read_packet()
  File "/src/aiomysql/aiomysql/connection.py", line 593, in _read_packet
    packet.check_error()
  File "/usr/local/lib/python3.6/site-packages/pymysql/protocol.py", line 220, in check_error
    err.raise_mysql_exception(self._data)
  File "/usr/local/lib/python3.6/site-packages/pymysql/err.py", line 109, in raise_mysql_exception
    raise errorclass(errno, errval)
pymysql.err.IntegrityError: (1062, "Duplicate entry '11297472' for key 'gameuid'")

I'm also not sure what the int(army) == 1 check is doing there.

eoinnoble added a commit to eoinnoble/server that referenced this issue Apr 8, 2021
Askaholic pushed a commit that referenced this issue Apr 17, 2021
* Issue/#560 Fix co-op leaderboard IntegrityError

* Reduce DB queries and standardize handler input

* OperationComplete should only be called for co-op games

* Remove un-needed import

* Clean up docstrings and light refactoring

* Increase timeout for control server tests

* Correct docstring and remove logging statement

* Increase timeout for matchmaker integration test

* Revert fast_forward changes, simplify secondary handling
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.

1 participant