heroiclabs / nakama-unity

Unity client for Nakama server.
https://heroiclabs.com/docs/unity-client-guide
Other
411 stars 75 forks source link

TinyJson does not properly serialize long data type #90

Closed thegoldenmule closed 4 years ago

thegoldenmule commented 4 years ago

Repro steps:

The Nakama TinyJson library does not properly support the long data type.

public class Foo
{
    public long Bar;
}

var a = new Foo { Bar = 100 };
a.ToJson(); // { "Bar": {} }

We have switched to using Newtonsoft JSON which properly serializes/deserializes longs.

novabyte commented 4 years ago

Hmmm this is an odd one. We use the TinyJson library from here. We'll have a look to see what we can do to sort it.

thegoldenmule commented 4 years ago

Looks like it actually doesn't support most primitives (unsigned and signed, short, long, etc). I can create a PR in that repo if it would be helpful.

novabyte commented 4 years ago

@thegoldenmule That would be awesome if you have time 🙏

thegoldenmule commented 4 years ago

@novabyte https://github.com/zanders3/json/pull/36

thegoldenmule commented 4 years ago

@novabyte The json PR has been merged to master btw.

novabyte commented 4 years ago

Ah yes - good reminder. I'll re-import that code into the .NET client so we can cut a release of the Unity client.

novabyte commented 4 years ago

I've updated the TinyJson library in the .NET client - https://github.com/heroiclabs/nakama-dotnet/commit/651930a568473d0995a4c1a65760d1098ee651e8

novabyte commented 4 years ago

We've got a release planned for the .NET client code and will then bundle it into the next Unity client.

novabyte commented 4 years ago

This is resolved in the v2.5.0 release.