-
Notifications
You must be signed in to change notification settings - Fork 119
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
[Bug] JSON Replay: including seed ignores passed deck #2966
Comments
Here is an example game that includes a seed string, and terminates at turn 2 (but is a win if the seed is removed or set to ""). EDIT: I uploaded wrong file. This one is correct: |
Counterproposal: It should just reject a JSON with both seed and a deck, since it means that the end-user has a corrupt JSON and/or is confused. |
Yes that is indeed a better solution. It solve the problem and doesn't assume that either should take precedence over the other. |
can you submit a pr? |
Upon further testing, it appears that the seed typically takes precedence over the passed deck, but sometimes the deck is required to meet certain requirements but is then ignored. Cases:
|
Describe the bug
When loading a replay from JSON, if a deck is specified AND a seed is specified, the deck is thrown away and the seed is used to generate a new deck.
To Reproduce
a. Open any game replay
b. Go to the last turn in the game
c. Use
/copy
and click the copy link to get the game as JSONa. From the lobby, click "Create Replay"
b. Select "JSON Data" and paste in the copied JSON
c. Click "Watch" to start the replay. It should be fine to the end of the game.
a. Again from lobby, click "Create Replay"
b. Select "JSON Data" and paste in the copied JSON
c. Modify the seed entry to have any string as its value (instead of empty string)
d. Click "Watch" to start the replay. It should terminate after a few turns since the action specified in the JSON does not match a valid move with the calculated deck.
Expected behavior
When there is a conflict between the seed and the passed deck, the passed deck should be assumed correct rather than the seed. (Such as when using Hanab.live to review a game from another site/program which doesn't use the same seed/prng/shuffle algorithm as Hanab.live, but deck is still accurate)
The text was updated successfully, but these errors were encountered: