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
When using ColyseusRoom.OnMessage twice on the same message ID, I get the following exception:
ArgumentException: An item with the same key has already been added. Key: myMessage
An easy fix would be to modify the OnMessage method to take in consideration if a previous message with the given id already exists. However, I wanted to know if this is a bug or a real design choice before submitting a PR.
The text was updated successfully, but these errors were encountered:
We've added support for multiple callbacks on the other clients for upcoming version 0.15 but it turns out the Unity SDK is still missing this feature (on #177)
Ideally, the Unity SDK should be able to attach and detach multiple callbacks, for example:
vardetachCallback1=room.OnMessage("xx",()=>{/* first */});vardetachCallback2=room.OnMessage("xx",()=>{/* second */});// detaching the "OnMessage" callback:detachCallback1();detachCallback2();
sticmac
added a commit
to sticmac/colyseus-unity3d
that referenced
this issue
Jul 8, 2022
When using
ColyseusRoom.OnMessage
twice on the same message ID, I get the following exception:An easy fix would be to modify the
OnMessage
method to take in consideration if a previous message with the given id already exists. However, I wanted to know if this is a bug or a real design choice before submitting a PR.The text was updated successfully, but these errors were encountered: