Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds game validity to the
game_info
messages. This requires quite a lot of refactoring because the validity needs to be re-evaluated every time any of the attributes that affect validity change. Previously, each of the checks only ran at certain times such as when the game launched or after it was finished. Refactoring this was also made more difficult by the fact that the game handling logic is already such a mess. Hopefully this approach of moving the validation code out of theGame
class helps with that, but I'm still not 100% happy with it. There are still some problems with it:ValidationRule
s are very tightly coupled to theGame
class, some of them even use 'private' variables fromGame
Some other issues that came up:
ScenarioFile
game option is set, we need to query the database in order to get the map id and to check if the map is ranked. This is an async operation, but it doesn't otherwise make sense to makeset_game_option
an async function. So it's a little unclear where exactly theawait
should happen.to_dict
method would actually changeCloses #858