question

fajarsetya avatar image
fajarsetya asked

LinkSteamAccount is always forced, even when the 'ForceLink' request parameter is set to False.

Let me explain.

I have one PlayFab (game) account, "Alpha," which I created using email and password. Additionally, I have two Steam accounts, "A" and "B."

I logged into my "Alpha" account and successfully linked it to my "A" Steam account. Then, I switched to another computer with Steam account B. I attempted to log into my "Alpha" account and link it to my "B" Steam account for testing purposes. Surprisingly, it linked successfully, even though I had set the 'ForceLink' request parameter to false.

Is this a bug or intended behavior?

 void LinkSteamAccount()
         {
             LoadingScreen.Instance.StartLoadingConnection("Linking Steam Account");
    
             // Try to link steam account
             PlayfabManager.Instance.AuthService.LinkSteamAccount(
             false,
             (result) =>
             {
                 LoadingScreen.Instance.StopLoadingConnection();
    
                 var neutralPrompt = GameManager.Instance.Prompts.InitPrompt(GameManager.Instance.Prompts.NeutralPrompt);
                 neutralPrompt.WriteMessage("Linked successfully", "Your Steam Account has been linked successfully!");
             },
             (error) =>
             {
                 LoadingScreen.Instance.StopLoadingConnection();
    
                 var errorPrompt = GameManager.Instance.Prompts.InitPrompt(GameManager.Instance.Prompts.ErrorPrompt);
                 PlayfabManager.Instance.AuthService.ClearRememberMe();
    
                 if (error.Error == PlayFabErrorCode.LinkedAccountAlreadyClaimed)
                 {
                     errorPrompt.WriteErrorMessage("This Steam account has already been linked to another Dadoo account.");
                     Debug.Log("This Steam account has already been linked to another Dadoo account.");
                 }
                 else if (error.Error == PlayFabErrorCode.AccountAlreadyLinked)
                 {
                     errorPrompt.WriteErrorMessage("This Dadoo account has already been linked to different Steam account.");
                     Debug.Log("This Dadoo account has already been linked to different Steam account.");
                 }
                 else
                 {
                     errorPrompt.WriteErrorMessage(error);
                     Debug.LogError(error);
                 }
             });
         }

 public void LinkSteamAccount(bool forceLink = false, Action<LinkSteamAccountResult> linkingSuccess = null, Action<PlayFabError> linkingError = null)
         {
             SteamManager.Instance.GetAuthSessionTicket((ticket) =>
             {
                 var request = new LinkSteamAccountRequest
                 {
                     ForceLink = forceLink,
                     SteamTicket = ticket,
                     TicketIsServiceSpecific = false
                 };
    
                 // Proccess of steam account linking
                 PlayFabClientAPI.LinkSteamAccount(request,
                 (LinkSteamAccountResult result) =>
                 {
                     // Process of get account info after linking succeed
                     PlayFabClientAPI.GetAccountInfo(new GetAccountInfoRequest(),
                     (GetAccountInfoResult resultAccountInfo) =>
                     {
                         s_userAccountInfo = resultAccountInfo.AccountInfo;
                         linkingSuccess?.Invoke(result);
                     },
                     (PlayFabError error) =>
                     {
                         // Process of retry to get account info after linking succeed
                         PlayFabClientAPI.GetAccountInfo(new GetAccountInfoRequest(),
                         (GetAccountInfoResult resultAccountInfo) =>
                         {
                             s_userAccountInfo = resultAccountInfo.AccountInfo;
                             linkingSuccess?.Invoke(result);
                         },
                         (PlayFabError error) =>
                         {
                             OnPlayFabError?.Invoke(error);
                         });
                     });
                 },
                 (PlayFabError error) => linkingError?.Invoke(error));
             });
         }
apisAuthentication
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

·
Neils Shi avatar image
Neils Shi answered

To clarify, the “ForceLink” is designed for: the Steam Account (which you want to link) has linked with other PlayFab player account. Then you can set it as True to make the Steam Account unlink the original PlayFab player account and link the current PlayFab player account. In your case, since your Steam Account B has not been linked to other PlayFab player accounts, the 'ForceLink' will not affect its results. In addition, now that you have linked both Steam Account A and Steam Account B to the same PlayFab player account, could you try to use Steam Account A's SteamTicket and Steam Account B's SteamTicket respectively, and check if they can both log in successfully through the API LoginWithSteam?

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.

fajarsetya avatar image fajarsetya commented ·

I'm facing another issue with Steam linking.

Somehow, now I cannot link one of my accounts with a PlayFab account, neither with 'ForceLink = true' nor 'ForceLink = false'. However, I can still link and unlink the other one without any issues.

The response from LinkSteamAccount is always successful, but the Steam account info does not appear in the linked account list in the player overview in the PlayFab Game Manager.

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.