-
Notifications
You must be signed in to change notification settings - Fork 102
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
OnStateChange Called When Current Value And Previous Values are same #217
Comments
Hi @TarunPhonato, could you please provide a small project that reproduces this issue? (with code for both server and client) |
Hello Endel,
I have attached a small project that reproduces this issue (with code for
both server and client). Please look into it.
*- Issue Points :- *
-When Current Value And Previous Values are the same, why did I receive
OnStateChange callback at the same time ( LGameManager.
PawnOnStepsMovedChange)
-When resetting value of stepsMoved to -1 after reaching to 57 the change
is not getting triggered on client side
*Client Side :-*
Unity version: 2020.2.2f1
Colyseus SDK version : 0.15.4
* Server Side :-*
Node JS version : v14 .17.6
Colyseus SDK version : 0.15.6
Testproject.zip
<https://drive.google.com/file/d/1dhKc7DD7Yd41kYT_xiTkC8rvhDEOsNpr/view?usp=drive_web>
TestServer.zip
<https://drive.google.com/file/d/159QMJ27DlepgeAVXYea8ar5xGpSvXhmS/view?usp=drive_web>
|
Hi @TarunPhonato, thanks for the reproduction scenario. I can confirm the misbehavior - they're 2 known-issues from the state sync structures (aka schemas): 1) The re-triggering of events, even if
|
Thanks for the Help!
Actually we are starting a new project. I will talk to management regarding
sponsors.
…On Tue, Aug 22, 2023 at 7:16 AM Endel Dreyer ***@***.***> wrote:
Hi @TarunPhonato <https://github.com/TarunPhonato>, thanks for the
reproduction scenario.
I can confirm the misbehavior - they're 2 known-issues from the state sync
structures (aka schemas):
*1) The re-triggering of events, even if currentValue and previousValue
are the same*
This is due to the usage of experimental filters. I'd suggest treating
this edge case on your end. (There are plans on replacing the current
filter/filterChildren implementation with a different solution
<https://github.com/colyseus/colyseus/wiki/Public-Roadmap#colyseus-framework>
- filters are going to be slowly deprecated in the future)
*2) The callback is not being triggered on the client-side*
This can happen when the same schema instance is being re-used in many
places within the state. I've just created an issue describing the
problem here. <colyseus/schema#151>. One easy
way to fix this, is by calling instance.clone() instead of sharing the
same instance.
This issue does not happen when cloning the instances, only when sharing
the same instance - which will result in the instance being shared on the
client-side as well.
------------------------------
I see you work for Phonato Studios, it would be great if you can convince
them to sponsor the project, if the company is benefiting from Colyseus 🙏
Cheers, I hope this helps, and let me know if you have any other questions
—
Reply to this email directly, view it on GitHub
<#217 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BAFSD4BDGGLHYPSPYXOE6QDXWQFNRANCNFSM6AAAAAA3T6MBWM>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
Regards
Tarun Kumar
|
When Current Value And Previous Values are same why I received OnState Change callback on same time.
It's working fine while playing on Unity Editor.
Unity version : 2020.2.2f1
Colyseus SDK version : 0.15.4
The text was updated successfully, but these errors were encountered: