Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions com.playeveryware.eos/Runtime/Core/EOSManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ public partial class EOSSingleton
static private NotifyEventHandle s_notifyLoginStatusChangedCallbackHandle;
static private NotifyEventHandle s_notifyConnectLoginStatusChangedCallbackHandle;
static private NotifyEventHandle s_notifyConnectAuthExpirationCallbackHandle;
static private bool s_isConnectAuthExpirationLoginInProgress;

// Setting it twice will cause an exception
static bool hasSetLoggingCallback;
Expand Down Expand Up @@ -1000,6 +1001,8 @@ public void CreateConnectUserWithContinuanceToken(ContinuanceToken token,
SetLocalProductUserId(createUserCallbackInfo.LocalUserId);
}

s_isConnectAuthExpirationLoginInProgress = false;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this ever be true here? If we're re-authing then we should never be creating a user


if (onCreateUserCallback != null)
{
onCreateUserCallback(createUserCallbackInfo);
Expand Down Expand Up @@ -1177,6 +1180,8 @@ public void StartConnectLoginWithOptions(Epic.OnlineServices.Connect.LoginOption
connectInterface.Login(ref connectLoginOptions, null,
(ref Epic.OnlineServices.Connect.LoginCallbackInfo connectLoginData) =>
{
s_isConnectAuthExpirationLoginInProgress = false;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add this check? There's a convenient extension function for it in the Epic.OnlineServices namespace.
I've also created a thread to discuss this function in general, as I can't see it used elsewhere.

Suggested change
s_isConnectAuthExpirationLoginInProgress = false;
if (!connectLoginData.ResultCode.IsOperationComplete())
{
Log($"Ignoring connect login result that will be retried. ResultCode: {connectLoginData.ResultCode}");
return;
}
s_isConnectAuthExpirationLoginInProgress = false;


if (connectLoginData.ResultCode != Result.Success)
{
Log($"Connect login was not successful. ResultCode: {connectLoginData.ResultCode}", LogType.Error);
Expand Down Expand Up @@ -1364,6 +1369,12 @@ private void ConfigureConnectExpirationCallback(Epic.OnlineServices.Connect.Logi
ulong callbackHandle = EOSConnectInterface.AddNotifyAuthExpiration(
ref addNotifyAuthExpirationOptions, null, (ref AuthExpirationCallbackInfo callbackInfo) =>
{
if (s_isConnectAuthExpirationLoginInProgress)
{
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add logging here to say that it's being ignored. It could be useful to debug an issue

return;
}

s_isConnectAuthExpirationLoginInProgress = true;
StartConnectLoginWithOptions(connectLoginOptions, null);
});

Expand Down