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

Fix multiplayer turn checker potentially stopping turn checks for everyone that plays that game if a file was not found remotely #6901

Merged

Conversation

Azzurite
Copy link
Collaborator

@Azzurite Azzurite commented May 22, 2022

This is a commit I already had on my feature branch but that I should PR separately.

Basically, with #6826 (so this problem is not released yet) I removed all usages of updateCurrentTurn. updateCurrentTurn was only used because the turn checker set GameInfoPreview.turnNotification to false as a marker that this game should not be checked anymore because it was not found on the multiplayer server (dropbox).

However, this likely happened because the user messed with the multiplayer server settings and set it to a wrong server. So when they fix those settings, turnNotification=false potentially gets uploaded to the server if the game was up to date already and it was their turn, thus resulting in the turnNotification being false for everyone playing that game and no one getting turn notifications.

The original fix for this behavior was using updateCurrentTurn instead of simply replacing the GameInfoPreview (verified with the original author). I think using a simple field in the turn checker for this is a better solution, less code and no pollution of the GameInfoPreview with "useless" information. I just forgot to include this in the other PR where I removed updateCurrentTurn.

…ryone that plays that game if a file was not found remotely
Copy link
Collaborator

@GGGuenni GGGuenni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original idea of the GameInfoPreview variable was to use it as a toggle inside the multiplayer menu game settings to be able to disable turn checks per game. Since it never saw the light of day and I can't find the feature request anyway, it's better to clean it up. 👍

@GGGuenni GGGuenni merged commit f34b97a into yairm210:master May 22, 2022
@Azzurite Azzurite deleted the fix-turnchecker-filenotfound branch May 22, 2022 11:56
Azzurite added a commit to Azzurite-ServerAccount/Unciv that referenced this pull request May 27, 2022
The fix in yairm210#6901 caused `arrayIndex` to go out of sync, because the `continue` happened before `arrayIndex` was incremented. This caused a later game preview to be saved to the previous game name, overwriting and duplicating it.
Azzurite added a commit that referenced this pull request May 27, 2022
#6976)

The fix in #6901 caused `arrayIndex` to go out of sync, because the `continue` happened before `arrayIndex` was incremented. This caused a later game preview to be saved to the previous game name, overwriting and duplicating it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants