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

Fetch game ID for game creator #115

Open
norswap opened this issue Feb 1, 2024 · 1 comment
Open

Fetch game ID for game creator #115

norswap opened this issue Feb 1, 2024 · 1 comment

Comments

@norswap
Copy link
Member

norswap commented Feb 1, 2024

Currently, we fetch the game ID on load from the inGame dict which is only populated when effectively joining (not creating) a game.

This was by design, as we want to enable a game creator to create multiple games that he may not necessarily participate in (for tournaments, etc).

However, for the current UX flow which assumes 2-player matches where the creator takes part, this is annoying, as the creator can create a game, reload, and lose track of the created game.

This is not fatal (it's still possible to join the previously created game, or create a new one), but for the demo we should store on chain the ID for a created game and fetch.

Probably just populating inGame at creation time (and modifying later checks to allow the creator to join) is the way to go for now.

@norswap
Copy link
Member Author

norswap commented Feb 1, 2024

This will also fix another issue that we have:

  • create game
  • reload
  • join game and type the ID of the previously created game

→ both the joinGame and createModal are displayed, with the createGame modal displaying on top and displaying the option to join the game (even though it's already joined)

Proper redirects as per the above will prevent this from happening.

However it is still abnormal: the createGameModal should autoupdate to detect the game was successfully joined and so not offer to join. That's what the code seems to be doing too, so there's a need to investigate this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant