I am using the Unity SDK and have made an call to the api function "PlayFabMultiplayerAPI.CreateMatchmakingTicket"
The request accept custom data through "MatchmakingPlayerAttributes"
in this tutorial https://api.playfab.com/docs/tutorials/landing-tournaments/matchmaking-unity-quickstart
they have just entered the data like this.
... // Here we specify the creator's attributes. Attributes = new MatchmakingPlayerAttributes { DataObject = new { Skill = 24.4 }, }, ...
I have however made a class for my player attributes and entered the data like this.
PlayerAttributes myPlayerAttributes = new PlayerAttributes { HostAdress = GetMyHostAdress() }; ... Attributes = new MatchmakingPlayerAttributes { DataObject = myPlayerAttributes } ...
This is all fine from what I can see. But what is the intended way to get the data back again when retrieving it from another api call.
For example when using this api call.
PlayFabMultiplayerAPI.GetMatch( new GetMatchRequest { MatchId = matchId, QueueName = "queuetest", ReturnMemberAttributes = true },
The tutorial never shows this.
I can get the DataObject and convert it back to my PlayerAttribute class structure by doing ToString on the DataObject and deserelize it from json to my PlayerAttribute class, but it feels like that isn't the intended way since the DataObject already is a PlayFab.Json.JsonObject.
How is it intended to convert "PlayFab.Json.JsonObject" to your own types?
,I am using the Unity SDK and have made an call to the api function "PlayFabMultiplayerAPI.CreateMatchmakingTicket"
The request accept custom data through "MatchmakingPlayerAttributes"
in this tutorial https://api.playfab.com/docs/tutorials/landing-tournaments/matchmaking-unity-quickstart
they have just entered the data like this.
... // Here we specify the creator's attributes. Attributes = new MatchmakingPlayerAttributes { DataObject = new { Skill = 24.4 }, }, ...
I have however made a class for my player attributes and entered the data like this.
PlayerAttributes myPlayerAttributes = new PlayerAttributes { HostAdress = GetMyHostAdress() }; ... Attributes = new MatchmakingPlayerAttributes { DataObject = myPlayerAttributes } ...
This is all fine from what I can see. But what is the intended way to get the data back again when retrieving it from another api call.
For example when using this api call.
PlayFabMultiplayerAPI.GetMatch( new GetMatchRequest { MatchId = matchId, QueueName = "queuetest", ReturnMemberAttributes = true },
The tutorial never shows this.
I can get the DataObject and convert it back to my PlayerAttribute class structure by doing ToString on the DataObject and deserelize it from json to my PlayerAttribute class, but it feels like that isn't the intended way since the DataObject already is a PlayFab.Json.JsonObject.
How is it intended to convert "PlayFab.Json.JsonObject" to your own types?