Updating the player's active games list with info from rooms they're not in?

Hello,

I'm using the Turnbased SDK. I want to display a list of the player's active games. I want to be able to pull current score and whose turn it is (stored in the room's customProperties,) to update this list. I'm not seeing how to do this in the tutorials/documentation.

Can anyone give me a quick rundown on how to do this or at least point me in the direction of where I can find an explanation?

Thanks!

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    edited July 2015
    Hi duggo42,

    I think by "active" you mean a game that was started, joined then left without abandoning it. In this case, you need to save the State (data or snapshot) of those Rooms when leaving them using WebHooks or custom server side code/plugins. If you choose WebHooks as a meaning of persisting data, then you should start here.
    Then, if you want to list previously saved games, you need to implement "GetGameList like" WebRPC from server side and client side. The "Memory Demo" illustrates how to achieve what you are seeking. Exitgames' WebHooks github repositories contain samples of server side implementation for "GetGameList".

    It is worth mentioning that if you choose to work with the default implementation, the "score" and "turn" CustomProperties should be visible to the lobby !

    HL
  • Hey JT,

    You got it, I do mean games that were left but not abandoned (so as the player may return to it the next time they play.) I am planning on using WebHooks, so the links you've provided should be just what I'm looking for.

    Many thanks for taking the time once again to help!
  • The Memory Demo from the package uses room properties for "who's turn is it" and shows that in the list of "saved games". That should be useful for you, too.

    We do a WebRPC to get the saved games list.
    This is described here:
    http://doc.photonengine.com/en/turnbased/current/tutorials/memory-demo
    The source of the web service is here (but easy to miss in that doc's text):
    https://github.com/exitgames/photon.webhooks.turnbased.waws
  • Thanks!