文档

支持

Authentication for Unreal Engine

Authentication for Unreal Engine

类 UAuthenticationBlueprintApi

Reference the Blueprint Application Programming Interface for authentication operations.
阅读时间7 分钟最后更新于 4 天前

声明
UCLASS()class UAuthenticationBlueprintApi : public UBlueprintFunctionLibrary

委托

FAuthenticationResponseDelegate

声明

DECLARE_DYNAMIC_DELEGATE_OneParam(FAuthenticationResponseDelegate, FAuthenticationResponse, Response)

返回类型

FAuthenticationResponse

FAuthenticationStateChangedResponseDelegate

声明

DECLARE_DYNAMIC_DELEGATE_OneParam(FAuthenticationStateChangedResponseDelegate, FAuthenticationStateChangedResponse, Response)

返回类型

FAuthenticationStateChangedResponse

FAuthenticationGetUserDelegate

声明

DECLARE_DYNAMIC_DELEGATE_OneParam(FAuthenticationGetUserDelegate, FAuthenticationUserResponse, Response)

返回类型

FAuthenticationUserResponse

FAuthenticationDeleteUserDelegate

声明

DECLARE_DYNAMIC_DELEGATE_OneParam(FAuthenticationDeleteUserDelegate, bool, bResponse)

返回类型

布尔值

FAuthenticationPlayerProfileChangedResponseDelegate

声明

DECLARE_DYNAMIC_DELEGATE_OneParam(FAuthenticationPlayerProfileChangedResponseDelegate, FAuthenticationPlayerProfileChangedResponse, Response)

返回类型

FAuthenticationPlayerProfileChangedResponse

FAuthenticationPlayerProfileDeletedResponseDelegate

声明

DECLARE_DYNAMIC_DELEGATE_OneParam(FAuthenticationPlayerProfileDeletedResponseDelegate, FAuthenticationPlayerProfileDeletedResponse, Response)

返回类型

FAuthenticationPlayerProfileDeletedResponse

方法

Sign In Anonymously

匿名登录当前用户。不需要任何凭据,并且会话仅限于当前设备。

声明

UFUNCTION(BlueprintCallable, Category = "Unity Gaming Services | Authentication")static void SignInAnonymously(FAuthenticationSignInOptions Options, FAuthenticationResponseDelegate ResponseDelegate)

参数

Name

类型

描述

期权 (Options)FAuthenticationSignInOptions登录选项。
Response Delegate(响应委托)FAuthenticationResponseDelegate当 API 返回一个响应时执行的委托。

Get User Info

返回当前玩家的玩家信息,例如帐户创建时间和关联的外部 ID。

声明

UFUNCTION(BlueprintCallable, Category = "Unity Gaming Services | Authentication")void GetUserInfo(FAuthenticationGetUserDelegate ResponseDelegate) const

参数

Name

类型

描述

Response Delegate(响应委托)FAuthenticationGetUserDelegate当 API 返回一个响应时执行的委托。

Delete User

永久删除当前登录的用户。

声明

UFUNCTION(BlueprintCallable, Category = "Unity Gaming Services | Authentication")static void DeleteUser(FAuthenticationDeleteUserDelegate ResponseDelegate)

参数

Name

类型

描述

Response Delegate(响应委托)FAuthenticationDeleteUserDelegate当 API 返回一个响应时执行的委托。

Register State Changed Callback

挂接到在身份验证状态更改时执行的委托。

声明

UFUNCTION(BlueprintCallable, Category = "Unity Gaming Services | Authentication")static void RegisterStateChangedCallback(FAuthenticationStateChangedResponseDelegate ResponseDelegate)

参数

Name

类型

描述

Response Delegate(响应委托)FAuthenticationStateChangedResponseDelegate在身份验证状态更改时执行的委托。

Sign Out

在提供的配置文件名称下注销当前用户。

声明

UFUNCTION(BlueprintCallable, Category = "Unity Gaming Services | Authentication")static bool SignOut(bool bClearCredentials = false)

参数

Name

类型

描述

Clear Credentials(清除凭据)布尔值清除用于登录同一帐户的会话令牌的选项。

Switch Profile

将当前配置文件切换为新的配置文件名称。如果在该名称下未找到配置文件,则会创建新的配置文件。

声明

UFUNCTION(BlueprintCallable, Category = "Unity Gaming Services | Authentication")void SwitchProfile(FString ProfileName)

参数

Name

类型

描述

Profile Name(配置文件名称)字符串要切换到的配置文件的名称,如果尚不存在,则会添加该名称。

Profile Exists

检查配置文件是否存在。

声明

UFUNCTION(BlueprintPure, Category = "Unity Gaming Services | Authentication")bool ProfileExists(FString ProfileName) const

参数

Name

类型

描述

Profile Name(配置文件名称)字符串要检查的配置文件的名称。

Get Current Profile Name

返回当前配置文件的名称。

声明

UFUNCTION(BlueprintPure, Category = "Unity Gaming Services | Authentication")FString GetCurrentProfileName() const

返回

类型

描述

字符串当前配置文件的名称。

Get Profile Names

返回所有活跃玩家配置文件名称。

声明

UFUNCTION(BlueprintPure, Category = "Unity Gaming Services | Authentication")TArray<FString> GetProfileNames() const

返回

类型

描述

字符串数组所有活跃玩家配置文件名称。

Register Profile Changed Callback

挂接到在玩家配置文件更改时执行的处理程序。

声明

UFUNCTION(BlueprintCallable, Category = "Unity Gaming Services | Authentication")void RegisterProfileChangedCallback(FAuthenticationPlayerProfileChangedResponseDelegate ResponseDelegate)

参数

Name

类型

描述

Response Delegate(响应委托)FAuthenticationPlayerProfileChangedResponseDelegate在玩家配置文件更改时执行的处理程序。

Register Profile Deleted Callback

挂接到在玩家配置文件被删除时执行的处理程序。

声明

UFUNCTION(BlueprintCallable, Category = "Unity Gaming Services | Authentication")void RegisterProfileDeletedCallback(FAuthenticationPlayerProfileDeletedResponseDelegate ResponseDelegate)

参数

Name

类型

描述

Response Delegate(响应委托)FAuthenticationPlayerProfileDeletedResponseDelegate在玩家配置文件被删除时执行的处理程序。

IsSignedIn

检查用户是否已登录。

声明

UFUNCTION(BlueprintPure, Category = "Unity Gaming Services | Authentication")bool IsSignedIn() const

返回

类型

描述

bool如果用户已登录,为 true,否则为 false。

IsAnonymous

检查用户是否匿名登录。

声明

UFUNCTION(BlueprintPure, Category = "Unity Gaming Services | Authentication")bool IsAnonymous() const

返回

类型

描述

bool如果用户匿名登录,为 true,否则为 false。

IsAuthorized

检查用户是否仍然被授权。

声明

UFUNCTION(BlueprintPure, Category = "Unity Gaming Services | Authentication")bool IsAuthorized() const

返回

类型

描述

bool如果用户被授权,为 true,否则为 false。

IsExpired

检查用户会话是否到期。

声明

UFUNCTION(BlueprintPure, Category = "Unity Gaming Services | Authentication")bool IsExpired() const

返回

类型

描述

bool如果用户会话已到期,为 true,否则为 false。

SessionTokenExists

检查是否为当前配置文件存储了现有会话令牌。

声明

UFUNCTION(BlueprintPure, Category = "Unity Gaming Services | Authentication")bool SessionTokenExists() const

返回

类型

描述

bool如果为当前配置文件存储了现有会话令牌,则为 true。

GetUnityProjectId

返回 Unity Project ID。

声明

UFUNCTION(BlueprintPure, Category = "Unity Gaming Services | Authentication")FGuid GetUnityProjectId() const

返回

类型

描述

GuidUnity Project ID。

GetUnityEnvironmentName

返回 Unity 环境名称。

声明

UFUNCTION(BlueprintPure, Category = "Unity Gaming Services | Authentication")FString GetUnityEnvironmentName() const

返回

类型

描述

字符串Unity 环境名称。

GetAccessToken

返回当前用户的访问令牌。

声明

UFUNCTION(BlueprintPure, Category = "Unity Gaming Services | Authentication")FString GetAccessToken() const

返回

类型

描述

字符串如果当前用户已登录,为当前用户的访问令牌字符串,否则为空字符串。

GetSessionToken

返回当前用户的会话令牌。

声明

UFUNCTION(BlueprintPure, Category = "Unity Gaming Services | Authentication")FString GetSessionToken() const

返回

类型

描述

字符串如果当前用户已登录,为当前用户的会话令牌字符串,否则为空字符串。

GetUserId

当前登录用户的 ID。

声明

UFUNCTION(BlueprintPure, Category = "Unity Gaming Services | Authentication")FString GetUserId() const

返回

类型

描述

字符串如果当前用户已登录,为当前用户的 ID,否则为空字符串。

GetState

Authentication 子系统的当前状态。

声明

UFUNCTION(BlueprintPure, Category = "Unity Gaming Services | Authentication")EAuthenticationStates GetState() const

返回

类型

描述

身份验证状态Authentication 子系统的当前状态。

GetState

设置 Unity Project ID。

声明

UFUNCTION(BlueprintCallable, Category = "Unity Gaming Services | Authentication")static void SetUnityProjectId(FGuid Value)

参数

Name

类型

描述

Guid新的 Unity Project ID。

SetUnityEnvironmentName

设置 Unity 环境名称。

声明

UFUNCTION(BlueprintCallable, Category = "Unity Gaming Services | Authentication")static void SetUnityEnvironmentName(FString Value)

参数

Name

类型

描述

字符串新的 Unity 环境 ID。