How to save room state manually

I know room state is saved with PathLeave and PathClose. But i want to do it manually. because when i use GetGameList and get room properties (CustomPropertiesForLobby) they are not up to date.

In my scenario i have a turnbased game and two players. One is in the game and the other is main menu. Second player is refreshing his list of games and first (in-game) player made a move and change a property second player should see it, but he cannot. if first player leave the game, then room state is saved, therefore now second player can see the up-to-date room properties.

My question is how can i save room state manually so an inactive player uses GetGameList method he can get updated room properties.

Best Answer

  • Tobias
    Tobias admin
    edited October 25 Answer ✓

    I am slightly the wrong person to answer and will ask my colleagues to chime in but:

    You should be able to use the WebFlags (sparingly) to trigger an update via the WebHooks. In OpRaiseEvent, the WebFlags are part of the RaiseEventOptions. You can define flags which will do a HttpForward and SendState. That should do it, afaik.

    SetProperties has the same WebFlags as option.

Answers

  • Tobias
    Tobias admin
    edited October 25 Answer ✓

    I am slightly the wrong person to answer and will ask my colleagues to chime in but:

    You should be able to use the WebFlags (sparingly) to trigger an update via the WebHooks. In OpRaiseEvent, the WebFlags are part of the RaiseEventOptions. You can define flags which will do a HttpForward and SendState. That should do it, afaik.

    SetProperties has the same WebFlags as option.

  • hi, @yasela

    tobi is absolutely right. you can add web flags to your operation request and entire game state will be sent to backend on every turn.


    best,

    ilya