diff --git a/AdvancedSessions/Source/AdvancedSessions/Private/LoginUserCallbackProxy.cpp b/AdvancedSessions/Source/AdvancedSessions/Private/LoginUserCallbackProxy.cpp index 3c9fb54..b2c6b5a 100644 --- a/AdvancedSessions/Source/AdvancedSessions/Private/LoginUserCallbackProxy.cpp +++ b/AdvancedSessions/Source/AdvancedSessions/Private/LoginUserCallbackProxy.cpp @@ -64,6 +64,7 @@ void ULoginUserCallbackProxy::OnCompleted(int32 LocalUserNum, bool bWasSuccessfu if (PlayerControllerWeakPtr.IsValid()) { ULocalPlayer* Player = Cast(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); } }