You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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 ArraySchema, you may be experiencing one: colyseus/colyseus#641
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!
open the defold project and do Project -> fetch libraries
you need to bundle first the authority game server so from defold, choose "project -> bundle" then pick your platform, and build it headless
start colyseus, it's in the server directory
start the authority game server from the command line
now you can start the game choosing "build" command from defold.
the parts you might want to look are:
server\src\rooms\schema\MyRoomState.ts the remove_projectile method.
lib\multiplayer.lua line 152 the on_remove callback.
again, the callback works if i don't use splice and i use something like pop in Colyseus.
Also, i have tried the this.broadcastPatch() method, and it seems to solve the issue, but I understand it should not be invoked under normal circumstances right?
EDIT: even by using this.broadcastPatch() the callback is invoked very inconsistently, so it's not very reliable either.
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: