mirror of
https://github.com/mordentral/AdvancedSessionsPlugin.git
synced 2025-10-22 16:04:18 +00:00
set cached unique net id in auto login as well
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
||||||
|
|
||||||
#include "AutoLoginUserCallbackProxy.h"
|
#include "AutoLoginUserCallbackProxy.h"
|
||||||
|
#include "Kismet/GameplayStatics.h"
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
// ULoginUserCallbackProxy
|
// ULoginUserCallbackProxy
|
||||||
@@ -44,6 +44,26 @@ void UAutoLoginUserCallbackProxy::OnCompleted(int32 LocalUserNum, bool bWasSucce
|
|||||||
Identity->ClearOnLoginCompleteDelegate_Handle(LocalUserNum, DelegateHandle);
|
Identity->ClearOnLoginCompleteDelegate_Handle(LocalUserNum, DelegateHandle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if(APlayerController* PController = UGameplayStatics::GetPlayerController(WorldContextObject->GetWorld(), LocalUserNum))
|
||||||
|
{
|
||||||
|
ULocalPlayer* Player = Cast<ULocalPlayer>(PController->Player);
|
||||||
|
|
||||||
|
auto uniqueId = UserId.AsShared();
|
||||||
|
|
||||||
|
if (Player)
|
||||||
|
{
|
||||||
|
Player->SetCachedUniqueNetId(uniqueId);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (APlayerState* State = PController->PlayerState)
|
||||||
|
{
|
||||||
|
// Update UniqueId. See also ShowLoginUICallbackProxy.cpp
|
||||||
|
State->SetUniqueId((const FUniqueNetIdPtr&)uniqueId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (bWasSuccessful)
|
if (bWasSuccessful)
|
||||||
{
|
{
|
||||||
OnSuccess.Broadcast();
|
OnSuccess.Broadcast();
|
||||||
|
Reference in New Issue
Block a user