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

Game state changing when it shouldn't be #7

Open
nlupugla opened this issue Jul 19, 2015 · 2 comments
Open

Game state changing when it shouldn't be #7

nlupugla opened this issue Jul 19, 2015 · 2 comments

Comments

@nlupugla
Copy link
Owner

It seems like sometimes simply clicking on a unit will change the game's state, causing the tiles that become painted to indicate legal moves to unpaint, also requiring the user to click on the unit again. If this happens with enough frequency, it becomes very difficult to move units at all.

Here is a list of functions that change the game's state in no particular order:

  1. Game.next_turn (advances the turn)
  2. Game.next_phase (advances the phase)
  3. Game.move (moves a unit, checking legality in the process)
  4. Game.place (places a unit in a given spot on the board without checking legality, called by move and deploy)
  5. Game.take (removes a unit from play)
  6. Game.deploy (put a new unit into play, checking legality in the process)
@nlupugla
Copy link
Owner Author

After some investigation, it seems that this bug is likely an effect of server lag. If the user clicks on a piece while the server is computing a function that would change the state of the game, that function may finish while the legal moves are painted, in which case the front end will update and the interface will reset to the unpainted state.

@voynix
Copy link
Collaborator

voynix commented Jul 25, 2015

the question then becomes: whence comes the lag?
if it's client-side, there's probably something stupid I'm doing that I can stop doing, which should be easy to fix; but if it's server-side things get a bit messier, since we're running Flask through gunicorn behind nginx so there's a lot of layers for weirdness to hide in there

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

No branches or pull requests

2 participants