question

Christian Söllner avatar image
Christian Söllner asked

[Unity] isLoggedIn Global-Check

Hey PlayFab-Team,

we are currently creating a companion app additionally to our main game.

I would like to enable 2 modes to the companion app. One if the Player is currently logged in on his account in the main game and one if the Player isn't logged in. Depending on these states we want to enable different functions to the player.

Is it possible to check (for example from the android phone) if the player is logged in into his account already from elsewhere? "isClientLoggedIn" is only locally isn't it?

Best,

Chris

 

 

10 |1200

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

brendan avatar image
brendan answered

Yes, the isClientLoggedIn function is checking to see if there's a local Session Ticket. The main issue with a service-side "is player X logged in" call is that we actually don't have a way to know when the player signs out. What we've discussed is having a timestamp for the last login - and potentially a timestamp for the last valid API call made by the player.

However, the case you describe sounds like you're saying that you would have a companion application signed into the same player account. If so, it would also need to have signed into the player account, meaning it would be indicating that the player has signed in simply by logging itself in. It sounds like you need a way to differentiate one application from another, which we wouldn't have a good way to do. What you may want to consider is writing something to user data periodically - say, every couple of minutes - and checking that from the companion app periodically.

10 |1200

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

Christian Söllner avatar image
Christian Söllner answered

Thanks for the fast response. Just for information purposes: How much data volume does it cost to renew one or more keys in userdata? As we plan to renew the key maye all 30 seconds it would be awesome to know how much data volume will be used.

10 |1200

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

brendan avatar image
brendan answered

We try to abstract the actual read/write unit costs away by having the stated limits for our free service (https://playfab.com/limits), and then working out "overage" costs for developers who need more than those limits. The limits don't state a request rate, but by our Terms of Service, titles do need to keep their request rate down to a reasonable level. "Reasonable" really comes down to the volume of data you're reading/writing and the frequency.

So with that in mind, you're saying you want to write to a single Key in User Data once every 30 seconds. That should be fine, but how large is the Value for it? With what frequency will it be read? What, specifically, is it for - a "presence" type of system as described above? Will it only be written by the main game and not the companion app or, if they'll both be writing to it, what's the total frequency and volume of data for a single player signed into the game in all possible ways, worst-case?

10 |1200

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

Christian Söllner avatar image
Christian Söllner answered

I will open a support ticket as written on the "Limits" page to get more Information about it, I think that's a better way to communicate about it as the board. Thanks for the response. (Request #4527)

10 |1200

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

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.