-
Notifications
You must be signed in to change notification settings - Fork 10
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
I don't think on_remove callbacks are working on ArraySchema when using splice #58
Comments
Hi Matteo 👋 Thank you for the kind words 💙 I've just tried splicing a single item and it seems to be working. Do you mind sharing a reproduction scenario? There are a few known issues regarding I'll go ahead and suggest a workaround: this.state.projectiles.splice(index, 1);
this.broadcastPatch(); // consume/broadcast the changes immediately There's a major refactoring of schemas going on colyseus/colyseus#709, I'm currently finishing one last issue before releasing Colyseus 0.16 and v3 of schemas. Initially, only the JavaScript SDK will be supported, and as things are stable, other SDKs will be implemented as well! Cheers! |
hey endel, you should be able to access the game repo here: https://gitlab.com/mrosati/defold-real-time-multiplayer to reproduce, you need to perform a few steps:
the parts you might want to look are:
again, the callback works if i don't use Also, i have tried the EDIT: even by using Thanks! |
Hi and first of all THANK YOU for this great project. i love it!
I might have encountered an issue.
I'm running a Defold project, and I'm experiencing an unexpected result when trying to remove an item from ArraySchema using the splice method, as suggested in the documentation.
Here's a snippet of my code of my room state class:
this code works like a charm when inspecting the state in Colyseus, however this is not triggering the on_remove on my Defold code:
but strangely, this callback in Defold actually works if i use for instance the
pop()
method in Colyseus (here's the modified code)of course i can't use
pop()
for my intent because i need to remove a specific item.Have i found an issue or am i doing something wrong here?
Thanks!
Matteo
The text was updated successfully, but these errors were encountered: