Hi @gurulantern ,
I download the SDK from git instead of the package by Package Manager, and then copy Colyseus folder into the Assets folder of my project and alter the MetadataReflection.cs source code directly.
Hi @gurulantern ,
I download the SDK from git instead of the package by Package Manager, and then copy Colyseus folder into the Assets folder of my project and alter the MetadataReflection.cs source code directly.
Hi @coco ,
I'm glad to see your reply.
But about the issue I encounter is happening in the 0.14.18 SDK.
I had downloaded the https://github.com/colyseus/colyseus-unity-sdk/archive/refs/tags/0.14.18.zip and used its example which is inside Assets\Colyseus\Runtime\Example~.
When the client joins the room(my_room, not lobby), and scene is changed to ExampleScene, the exception shows up...
I had traced the source code, and found that GameDevWare.Serialization may not be compatible with WebGL, iOS, and IL2CPP.
For the following reasons.
When Colyseus Unity SDK serializes message, it will never get the defaultConstructor. So it will always encounter the exception in WebGL, iOS, and IL2CPP build.
Currently I move the code if (AotRuntime || ...
after if (defaultConstructor == null) return false;
to continue my test.
Although it works fine, but I'm still looking forward the official update.
Hi, there's an issue, need guys to help!
platform: WebGL
There has no exception when running in Unity Editor, but has an exception in the browser.
When the client joins the room, the exception shows up:
JsonSerializationException: Unable to deserialize instance of 'Colyseus.Schema.MapSchema`1[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]' because there is no parameterless constructor is defined on type.
at GameDevWare.Serialization.Metadata.TypeDescription.CreateInstance () [0x00000] in <00000000000000000000000000000000>:0
Rethrow as SerializationException: Failed to read value for member 'attributes' of 'ExampleNetworkedUser' type.
More detailed information in inner exception.
at GameDevWare.Serialization.Serializers.ObjectSerializer.DeserializeMembers (GameDevWare.Serialization.IJsonReader reader, GameDevWare.Serialization.IndexedDictionary`2[KeyT,ValueT] container, GameDevWare.Serialization.Serializers.ObjectSerializer& serializerOverride) [0x00000] in <00000000000000000000000000000000>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <00000000000000000000000000000000>:0