mirror of
https://github.com/mordentral/AdvancedSessionsPlugin.git
synced 2025-10-22 16:04:18 +00:00
Add type parameter to LoginUser
Add type parameter so EOS can use "accountportal" to authenticate, falls back to default implementation if left blank
This commit is contained in:
@@ -21,8 +21,8 @@ class ULoginUserCallbackProxy : public UOnlineBlueprintCallProxyBase
|
||||
FEmptyOnlineDelegate OnFailure;
|
||||
|
||||
// Logs into the identity interface
|
||||
UFUNCTION(BlueprintCallable, meta=(BlueprintInternalUseOnly = "true", WorldContext="WorldContextObject"), Category = "Online|AdvancedIdentity")
|
||||
static ULoginUserCallbackProxy* LoginUser(UObject* WorldContextObject, class APlayerController* PlayerController, FString UserID, FString UserToken);
|
||||
UFUNCTION(BlueprintCallable, meta=(BlueprintInternalUseOnly = "true", WorldContext="WorldContextObject", AdvancedDisplay = "Type"), Category = "Online|AdvancedIdentity")
|
||||
static ULoginUserCallbackProxy* LoginUser(UObject* WorldContextObject, class APlayerController* PlayerController, FString UserID, FString UserToken, FString Type);
|
||||
|
||||
// UOnlineBlueprintCallProxyBase interface
|
||||
virtual void Activate() override;
|
||||
@@ -42,6 +42,8 @@ private:
|
||||
// The user pass / token
|
||||
FString UserToken;
|
||||
|
||||
FString Type;
|
||||
|
||||
// The delegate executed by the online subsystem
|
||||
FOnLoginCompleteDelegate Delegate;
|
||||
|
||||
|
@@ -12,12 +12,13 @@ ULoginUserCallbackProxy::ULoginUserCallbackProxy(const FObjectInitializer& Objec
|
||||
{
|
||||
}
|
||||
|
||||
ULoginUserCallbackProxy* ULoginUserCallbackProxy::LoginUser(UObject* WorldContextObject, class APlayerController* PlayerController, FString UserID, FString UserToken)
|
||||
ULoginUserCallbackProxy* ULoginUserCallbackProxy::LoginUser(UObject* WorldContextObject, class APlayerController* PlayerController, FString UserID, FString UserToken, FString Type)
|
||||
{
|
||||
ULoginUserCallbackProxy* Proxy = NewObject<ULoginUserCallbackProxy>();
|
||||
Proxy->PlayerControllerWeakPtr = PlayerController;
|
||||
Proxy->UserID = UserID;
|
||||
Proxy->UserToken = UserToken;
|
||||
Proxy->Type = Type;
|
||||
Proxy->WorldContextObject = WorldContextObject;
|
||||
return Proxy;
|
||||
}
|
||||
@@ -43,8 +44,13 @@ void ULoginUserCallbackProxy::Activate()
|
||||
|
||||
if (Identity.IsValid())
|
||||
{
|
||||
// Fallback to default AuthType if nothing is specified
|
||||
if (Type.IsEmpty())
|
||||
{
|
||||
Type = Identity->GetAuthType();
|
||||
}
|
||||
DelegateHandle = Identity->AddOnLoginCompleteDelegate_Handle(Player->GetControllerId(), Delegate);
|
||||
FOnlineAccountCredentials AccountCreds(Identity->GetAuthType(), UserID, UserToken);
|
||||
FOnlineAccountCredentials AccountCreds(Type, UserID, UserToken);
|
||||
Identity->Login(Player->GetControllerId(), AccountCreds);
|
||||
return;
|
||||
}
|
||||
|
Reference in New Issue
Block a user