Where are saved the PlayerCustomProperties ?

Options
Hello,

as i said in a previous topic, i used roomcustomProperties to persist who's turn for my turned based game, with playfab. It works fine, now i would like to save the datas of players in room (the color of their gameobject, their position).

To detail the game, the actions are just: 1)moving in the room, 2)changing color of the GO and 3)validate my turn (which validate color and positions. At this point, color and pos need to be saved). The game doesn't make sense but this is just for my test...

How do I save those data ?

I wanted first to add an array of the data's players in the RoomCustomProperties.
Then i though it would be easier to set it in PlayerCustomProperties for each player.
BUT I have read that PlayerCustomProperties is used to persist datas between rooms. For my case, i want playercustomproperties to be unique for each room.

If I can use PlayerCustomProperties, where is it saved in the state? In the same key as for RoomCustomProperties ?

Thank you for your time.

PS: I wasn't in the good category of topic so there is a doublon, if you could delete the one missplaced, thanks.

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    edited April 2019
    Options
    Hi @antigode,

    Both room and actor properties are saved in binary form (serialized binary state converted to base64 string) inside the state send as PathClose webhook argument.
    The string representation of those can be obtained as read-only for debug purposes (hence "DebugInfo or DEBUG_" in the naming) and won't be used when loading the state to reconstruct the room.

    If you want to save actor properties outside of the state and not as a binary form you can get those from PathGameProperties, Type="Player". In order to trigger webhook forward using SetProperties operation, you need to set the proper WebFlags, WebFlags.HttpForward, e.g.

    player.SetCustomProperties(properties, webFlags = new WebFlags(WebFlags.HttpForwardConst));