I’m sending JSON objects from server to client that have a lot of nested lists and dictionaries.
Using a NodeJS server and socketIO.
socket.On("MSG",ReceiveMsg);
...
private void ReceiveMsg(SocketIOEvent evt)
{
//receive JSON object from server
}
Suppose I receive a JSON object in a SocketIOEvent like that.
var table = {};
table["id"] = 1;
table["rules"] = "rule1|rule2|rule3";
table["seat1"]={"user":{},"bank":0,"bet":0,"hand":{"hand1":[],"hand2":[]}};
table["deck"]=[];
socket.emit("MSG",table);
I have a JSON object like that. You can see their are nested dictionaries and lists etc. I’m trying to handle this in my C# code but I’m not sure the best methods.