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

Construct3: switching event sheets may interrupt "On change" conditions #144

Open
endel opened this issue Jul 10, 2023 · 1 comment
Open
Assignees

Comments

@endel
Copy link
Member

endel commented Jul 10, 2023

Need to document this limitation

(Requested by @Alaadel)

@endel endel self-assigned this Jul 10, 2023
@Alaadel
Copy link

Alaadel commented Jul 10, 2023

We have 2 layouts: Lobby has eLobby sheet, and Game has eGame sheet.
eGame contains the OnChange handlers.
eLobby is where the join happens.
When the players join, the server sends "StartGame" message, which triggers the transition to the Game layout.
But the OnChange do not fire in eGame.
What happen is that the state updates are sent while the game is still in Lobby. And since there are no handlers in eLobby, the changes are ignored.
When the eGame is loaded, Colyseus has already fired the events while in eLobby, so the handlers in eGame do not fire.

The SDK solution would be to avoid firing during layout transitions.

A simpler workaround is to check for state at the start of the new layout, and use "Colyseus.State()" to initialize the variables and update them to the latest state value. But it is hard to figure out this workaround; because this happens too fast.

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