Currently, on the server side, the army movement is processed in three steps. First the single movements are checked for sanity (e.g., tiles within map bounds, continuous paths), then they are sorted and processed.
If a movement item fails the check, the server currently silently drops all movements for the offending army. This should be improved by an additional check on the client side as follows:
- Split the current MovementChecker into two classes: One does the checking, one acts on failed checks.
- The checking should be outsourced to a separate class that is also available on the client side. It returns the ArmyMovementItems that fail the check.
- Improve the checking: Check for continuous paths (i.e., one tile next to the other)
- The client should have some system in place where it checks its movements for sanity before sending them to the server, ideally when they are created.
- The server should do something better on errors. At least log them (which may mean sending error updates back to the client)
Diff:
Chat summary:
Splitting off the checking part of the MovementChecker as a first step.
MovementChecker uses the validator for the filtering
Minor ticket modification: We will need a mechanism to report errors to the client while rejecting ArmyMovementItems on the server side.
Chat summary:
Chat summary:
Error handling on the client side. First the high-level discussion:
Implementation details:
Last edit: Ulf Lorenz 2017-05-16