Closed hesham-akmal closed 5 months ago
Hi @hesham-akmal, apologies for the delayed response. Can you tell me which version of the plugin you are using? Based on your posted code I'm wondering whether you might be using an older version of the plugin.
In the absence of that possibility, did you perhaps refactor UILoginMenu.cs
?
@paulhazen no worries! Version is 3.0.3 Sample imported from the unity package manager
Sorry for the confusion, the above code images is after my refactoring and fixes.
Original UILoginMenu.cs, this is where the issue resides, the loginCallbackInfo.LocalUserId (used in method StartConnectLoginWithLoginCallbackInfo) was null/empty as loginCallbackInfo.ResultCode is Epic.OnlineServices.Result.InvalidUser (line 1330)
However for some reason I think this was working for me like 6 months ago, not really sure.
Ah I think I see the error with this: The code is using what appears to be the wrong callback for information. It should be using the other callback information. I can probably throw together a little fix for this.
@hesham-akmal I'm closing this issue as it has been fixed in the development
branch via pull #626. If you are still having difficulty with it please feel free to re-open the issue with additional context about the problem.
Re-opening because I realized that the PR (while open) has not been merged.
I have encountered a null exception and I've fixed it in my project, so I'm sharing the fix.
The error log:
In the sample "Standard Pack : EOS Plugin for Unity Samples", a script named UILoginMenu.cs (I used it as reference for steam login, steam account linking with EOS on the first session).
The method named StartConnectLoginWithLoginCallbackInfo(LoginCallbackInfo loginCallbackInfo), the paramater LoginCallbackInfo is used to get loginCallbackInfo.LocalUserId. But in the case of "loginCallbackInfo.ResultCode == Epic.OnlineServices.Result.InvalidUser" (User is linking steam with an active Epic account), the loginCallbackInfo.LocalUserId was null in my case, so I needed to use linkAccountCallbackInfo.LocalUserId instead (callback of AuthLinkExternalAccountWithContinuanceToken).
I changed StartConnectLoginWithLoginCallbackInfo parameter of LoginCallbackInfo to EpicAccountId, and to send the LocalUserId accordingly.
Like so: