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


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?



  • 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 !

  • 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:
    The source of the web service is here (but easy to miss in that doc's text):
  • Thanks!