I'm very new to C# so please excuse me if i am asking silly question. I am using Newtownsoft json. (https://www.newtonsoft.com/json)
Here is my code:
public void SpawnPlayer(Dictionary<string, string> playerData, int cnnId)
{
string jsonData = JsonConvert.SerializeObject(playerData, Formatting.None);
Console.WriteLine(jsonData);
}
Here is what jsonData
contains:
{"1":"{\r\n \"characterId\": 1,\r\n \"connectionId\": 1,\r\n \"accountId\": 1,\r\n \"name\": \"Riorage\",\r\n \"level\": 2,\r\n \"characterRace\": 1,\r\n \"characterClass\": 1,\r\n \"characterPosition\": {\r\n \"x\": \"15.42661\",\r\n \"y\": \"7.477493\",\r\n \"z\": \"-32.30045\",\r\n \"map\": 1\r\n },\r\n \"characterRotation\": {\r\n \"x\": \"1\",\r\n \"y\": \"203\",\r\n \"z\": \"1\"\r\n },\r\n \"charactrerInstance\": {\r\n \"instanceId\": 0,\r\n \"groupId\": 0\r\n },\r\n \"characterState\": 1,\r\n \"characterMovementState\": 0,\r\n \"characterActionState\": 1,\r\n \"characterEmotionState\": 1,\r\n \"lastOnline\": \"5.4.2018 г. 14:59:16\",\r\n \"onlineTime\": \"1\"\r\n}"}
I would like to know how can i reach the value of 1
,CharacterPosition
,x
.
I want to give these keys and receive an output 15.42661
Is it even possible and if so how ?