question

dan avatar image
dan asked

Is there a way to see if a player is currently logged-in?

Hello!

As part of my multiplayer UX flow, I would like to be able to see if players in my friends list are currently logged-in. (So that I can start games with people who are currently on-line).

Is there a way of doing this?

Player DataFriends
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
brendan avatar image
brendan answered

PlayFab is a Web API based service, so there aren't active socket connections to players. So while you can check via the player's account info what their last login time was, there's no way to tell if the player is currently active by default. However, you do have a number of options for how to manage this. Two of the simplest would be:

1. Use custom game servers. Since you're already talking about having players "start games with people who are currently on-line", you could simply have them in a session at all times while they're active in the game. That way, their LobbyId would show up in their player info.

2. Write a clock tick to a leaderboard every five minutes or so. That way, when you query the friends leaderboard, all the folks at the top will be the ones who were most recently active.

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

dan avatar image dan commented ·

Nice! Thanks for the info, Brendan.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.