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));
});
}