-
Notifications
You must be signed in to change notification settings - Fork 56
Open
Description
Description
Arch.Persistence is broken under MessagePack 3.x - throws exception on serialize, see data below.
I cannot fallback do MessagePack 2.x due to AOT requirements (IL2CPP platform).
The exception is thrown due to attempt to serialize boxed struct as non-generic object. This is not support under MessagePack 3.x
MRE:
New console app, install:
- MessagePack 3.1.4
- Arch 2.0.0
- Arch.Persistence 2.0
Run under IL2CPP platform
public struct MyComponent
{
public ushort Data;
public MyComponent(ushort data)
{
Data = data;
}
}
public class Test
{
static Test()
{
ComponentRegistry.Add<MyComponent>();
}
static void Main(string[] args)
{
var ecs = World.Create();
var entity = ecs.Create(new MyComponent(1));
var serializer = new ArchBinarySerializer();
ecs = serializer.Deserialize(serializer.Serialize(ecs));
}
}Expected result
Correct execution of the program, exceptionless
Actual result
MessagePackSerializationException: Not supported primitive object resolver. type:MyComponent
at MessagePack.Formatters.PrimitiveObjectFormatter.Serialize (MessagePack.MessagePackWriter& writer, System.Object value, MessagePack.MessagePackSerializerOptions options)
Thrown at Arch.Persistence/Binary.cs:118
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels