Update UniqueId in login callback. See also ShowLoginUICallbackProxy.cpp in UE sources.

(cherry picked from commit 826bef7b861e8c20013033b57dd45cd8fec304e5)
This commit is contained in:
Lothar May
2021-12-12 17:25:56 +01:00
parent b986d7be2d
commit 31c4be3629

View File

@@ -64,6 +64,7 @@ void ULoginUserCallbackProxy::OnCompleted(int32 LocalUserNum, bool bWasSuccessfu
if (PlayerControllerWeakPtr.IsValid())
{
ULocalPlayer* Player = Cast<ULocalPlayer>(PlayerControllerWeakPtr->Player);
auto uniqueId = UserId.AsShared();
if (Player)
{
@@ -73,6 +74,15 @@ void ULoginUserCallbackProxy::OnCompleted(int32 LocalUserNum, bool bWasSuccessfu
{
Identity->ClearOnLoginCompleteDelegate_Handle(Player->GetControllerId(), DelegateHandle);
}
Player->SetCachedUniqueNetId(uniqueId);
}
APlayerState* State = PlayerControllerWeakPtr->PlayerState;
if (State)
{
// Update UniqueId. See also ShowLoginUICallbackProxy.cpp
State->SetUniqueId(uniqueId);
}
}