Skip to content
This repository has been archived by the owner on May 5, 2020. It is now read-only.

How do you use MessagePack? #1

Open
valkyrienyanko opened this issue Sep 20, 2019 · 0 comments
Open

How do you use MessagePack? #1

valkyrienyanko opened this issue Sep 20, 2019 · 0 comments
Assignees
Labels
good first issue Good for newcomers help wanted Extra attention is needed question Further information is requested

Comments

@valkyrienyanko
Copy link
Collaborator

Does anyone have experience with Unity and MessagePack? I'm trying to figure out how to use it. I have a list of Player objects and I want to send them over the network.

List<Player> players = Player.GetPlayers();
byte[] buffer = new byte[BYTE_SIZE];
buffer = MessagePackSerializer.Serialize(players);

Player mc2 = MessagePackSerializer.Deserialize<Player>(buffer);
var json = MessagePackSerializer.ToJson(buffer);

Debug.Log(json);

Right now I'm just trying to log the results right away but I'm getting a FormatterNotRegisteredException

@valkyrienyanko valkyrienyanko added help wanted Extra attention is needed good first issue Good for newcomers question Further information is requested labels Sep 20, 2019
@valkyrienyanko valkyrienyanko self-assigned this Sep 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
good first issue Good for newcomers help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant