question

Bren Lynne avatar image
Bren Lynne asked

Best practices for Steam in Offline mode, disconnected platforms in general?

Hi all,

Wondering about how we should handle disconnected clients, for example, Steam in offline mode, or when a console/PC is not connected to the net.

When Steam is in offline mode, I get a "/Client/LoginWithSteam: Steam WebAPI error: 100 (User is offline)" error. However, I often see the same error when Steam IS online/connected, and repeated attempts will eventually succeed, so I'm not sure this error can be relied on to catch this condition. Maybe just fail after X attempts or something?

In general, though, what is the practice here? Is it possible to login to a platform using the Playfab API and get a platform user id without a connection? Or are we expected to fallback to direct platform API calls at that point? Should we just cache everything locally and resolve if/when we connect in the future?

Playfab does a pretty good job of wrapping most platform auth functions, so I'm curious about the offline case. Apologies if this is in the docs somewhere, but I haven't found any specific mention of offline auth.

2 comments
10 |1200

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

Bren Lynne avatar image Bren Lynne commented ·

On further investigation, when Steam is in offline mode, I also get a "/Client/LoginWithSteam: Invalid input parameters" error because the Steamworks.SteamUser.GetAuthSessionTicket() function returns an empty ticket. This occurs instead of the "User is offline" error, when Steam does return a ticket. The difference may have something to do with testing in the Unity editor?

-1 Like -1 ·
Sarah Zhang avatar image Sarah Zhang Bren Lynne commented ·

We will research it.

0 Likes 0 ·

1 Answer

·
Sarah Zhang avatar image
Sarah Zhang answered

>> However, I often see the same error when Steam IS online/connected, and repeated attempts will eventually succeed, so I'm not sure this error can be relied on to catch this condition. Maybe just fail after X attempts or something?

This error is from SteamWebAPI call that is not under the control of PlayFab. The error that returned from LoginWithSteam API call should be InvalidSteamTicket in that case.If your demand is to increase its success rate of LoginWithSteam, you can consider such solutions. For example, validate the “SteamTicket” via corresponding Steam API before your call the LoginWithSteam API, only call the LoginWithSteam when the “SteamTicket” is validated successfully. You can design the count-limited or time-limited retry mechanism, ask players to check if they are offline if the retry always fails.

>> Is it possible to login to a platform using the Playfab API and get a platform user id without a connection? Or are we expected to fallback to direct platform API calls at that point? Should we just cache everything locally and resolve if/when we connect in the future?

If you mean the PlayFabId, Players can log in their Playfab accounts directly using PlayFab API LoginWithPlayFab, LoginWithEmailAddress, LoginWithCustomID, etc. You can check the doc Login basics and best practices and Account linking quickstart for more information. If so, you may need to call AddUsernamePassword to add the username and password for these accounts. As this section Best practice said, we do not recommend to keep any identifiable or secure information in memory longer than you need it, and don't save it to a file or remote location. The PlayFab APIs are designed to utilize only the minimum required information.

>> This occurs instead of the "User is offline" error, when Steam does return a ticket. The difference may have something to do with testing in the Unity editor?

We lack the test environment of SteamWorks. I'm not very sure what causes the difference between responses. But as the first answer said, this "User is offline" error is from SteamWebAPI. You can try to validate the SteamTicket via the Steam API to target the specific errors.

2 comments
10 |1200

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

Bren Lynne avatar image Bren Lynne commented ·

Perhaps I wasn't clear, but I'm referring to time when the user is playing in Steam Offline mode, which is independent of an internet connection.

So, two questions here really.

What's the best practice for logging into a platform through Playfab when:

1) Steam is in offline mode

2) User is offline completely, not connected to the Internet (may be the case on any platform)

0 Likes 0 ·
Sarah Zhang avatar image Sarah Zhang Bren Lynne commented ·

1) Steam is in offline mode

You can log the users in Playfab via other Playfab login API methods, such as LoginWithPlayFab. You can check our API references Authentication to search for the API that can be used to log in.

2) User is offline completely, not connected to the Internet (may be the case on any platform)

PlayFab doesn’t support being logged in offline, all PlayFab API methods rely on the Internet connection. You may need to design the offline validation mechanism on your own.

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.