Network: some user commands must be synced (GameController->sendPlayerAction, related to ConcurrentModificationException)
- Dominant language
- Java
- Stars
- 2.4k
- Forks
- 940
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 160
Description
From #11458 and #11437, related to random `ConcurrentModificationException` errors and other random bugs (e.g. with undo/rollback usage).
Original problem:
* game executes by one thread (GAME xxx) but almost all user commands executes by another thread (CALL xxx) at random time. So if command thread changes game data (example: undo/rollback) then it can broke game in random time (user can call it in the middle of the slow game calculation and raise `ConcurrentModificationException`).
Recommended fixes:
* move game changes commands to GAME thread (example: undo) -- need sync code, see `asyncWantConcede` and `asyncWantCheat`. Maybe needs more easy sync code (there are too much client commands);
* keep other commands in original thread (example: updates of user skip settings -- it keep data inside game object, but it's hard to catch concurrent modification with it unlike the game changes from a previous point);

Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.