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

[1849] modification to code for variants #11417

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

philcampeau
Copy link
Collaborator

@philcampeau philcampeau commented Dec 23, 2024

Hopefully fixes issues with Variants rules. I'll manually close the bug reports after confirming. (see below)

Before clicking "Create"

  • Branch is derived from the latest master
  • Add the pins or archive_alpha_games label if this change will break existing games
  • Code passes linter with docker compose exec rack rubocop -a
  • Tests pass cleanly with docker compose exec rack rake

Implementation Notes

Explanation of Change

Players trying the variants have all encountered variations of this error at various points:

image

Often, refreshing and trying again and again seems to resolve the issue temporarily, but that's obviously not a solution. This issue has proven difficult to troubleshoot, since it doesn't happen in Hotseat mode, or even when playing multiplayer on my local environment.

I tried changing the code for def operating_round, removing the logic that gates the inclusion of the variant steps, and instead adding log_pass and log_skip methods to those steps to mask those steps unless using the variants.

Once I did this, rake would fail on the fixture files, which I found interesting since the fixture doesn't use the variants. I went through the logic of the variants themselves, and added a gate to the def actions to return [] if that variant isn't active.

That resolved the Rake error, and I still seem to be able to play through local games, so at worst this is no worse than the current state, and I think the code is cleaner and closer to the standard code seen throughout the site.

Screenshots

Any Assumptions / Hacks

This may well require archiving/pinning any games using the Bonds/Electric Dreams/Buy Tokens variants, but I don't believe it would affect other games of 1849.

@philcampeau philcampeau added pins PR that will require some games to be pinned archive_alpha_games Needs alpha games archiving 1849 variants labels Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1849 variants archive_alpha_games Needs alpha games archiving pins PR that will require some games to be pinned
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant