Giter Site home page Giter Site logo

Comments (6)

deniszykov avatar deniszykov commented on July 23, 2024

Hi @Mol0ko!
This is must be Dictionary<KeyT, ValueT> representation problem. Some serializers serialize them as arrays of [key, value] tuples, and some as arrays of { "key": xxx, "value": xxx } objects.
Can you transform message.arguments[0] to JSON and review find where such Dictionary is located and how it is represented (tuples/objects etc).

 GameDevWare.Serialization.Json.SerializeToString(message.arguments[0]);

from msgpack-unity3d.

Mol0ko avatar Mol0ko commented on July 23, 2024

@deniszykov thanks for your answer. Here is an example of GameDevWare.Serialization.Json.SerializeToString(message.arguments[0]);:

[
  1,
  1632823892325699,
  [
    [
      [
        [
          [3,0,1,3,1,3],
          [2,0,0,3,2,3],
          [3,2,2,0,1,0],
          [2,1,0,2,1,1],
          [3,3,2,1,3,3]
        ]
      ],
      []
    ]
  ],
  [],
  [],
  [
    [0,1,1.2,66,2664,null,null],
    [1,1,1.2,22,2642,null,null]
  ],
  [],
  null,
  [
    [0,1,false,false],
    [1,1,false,false],
    [2,1,false,false],
    [3,1,false,false],
    [4,1,false,false]
  ],
  [
    [0,1,false,false],
    [1,1,false,false],
    [2,1,false,false],
    [3,1,false,false],
    [4,1,false,false]
  ],
  []
]

from msgpack-unity3d.

deniszykov avatar deniszykov commented on July 23, 2024

He is problem, all your object are represented as tuples [a,b,c,d] instead of objects { a: x, b: x, c: x, d: x}.
You need to tune server-size serializer to send object or write custom object serializer for tuples and register it in SerializationContext.SerializerFactory

from msgpack-unity3d.

BinhNguyenPSA avatar BinhNguyenPSA commented on July 23, 2024

I have the same problem, I found that if I remove the attribute [DataContract] everything will work ok.

from msgpack-unity3d.

BinhNguyenPSA avatar BinhNguyenPSA commented on July 23, 2024

@deniszykov could you please write the "write custom object serializer for tuples and register it in" you mention above :-)

from msgpack-unity3d.

deniszykov avatar deniszykov commented on July 23, 2024

@BinhNguyenPSA sorry I have no plans to expand this package. I gladly accept PR with new object serializer.

from msgpack-unity3d.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.