类 Multiplay Game Server Subsystem
Reference documentation for the Multiplay Game Server Subsystem class.
负责与 Multiplay SDK 守护程序通信的子系统。
Include(包括)
#include "MultiplayGameServerSubsystem.h"
语法
UCLASS()class MULTIPLAYGAMESERVERSDK_API UMultiplayGameServerSubsystem : public UMultiplaySubsystemBase
继承自:MultiplaySubsystemBase。
委托
FAllocateDelegate
声明
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FAllocateDelegate, FMultiplayAllocation, Allocation)
返回类型
FMultiplayAllocation。
FDeallocateDelegate
声明
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FDeallocateDelegate, FMultiplayDeallocation, Deallocation)
返回类型
FMultiplayDeallocation。
FReadyServerSuccessDelegate
声明
DECLARE_DYNAMIC_DELEGATE(FReadyServerSuccessDelegate)
FReadyServerFailureDelegate
声明
DECLARE_DYNAMIC_DELEGATE_OneParam(FReadyServerFailureDelegate, FMultiplayErrorResponse, ErrorResponse)
返回类型
FMultiplayErrorResponse。
FUnreadyServerSuccessDelegate
声明
DECLARE_DYNAMIC_DELEGATE(FUnreadyServerSuccessDelegate)
FUnreadyServerFailureDelegate
声明
DECLARE_DYNAMIC_DELEGATE_OneParam(FUnreadyServerFailureDelegate, FMultiplayErrorResponse, ErrorResponse)
返回类型
FMultiplayErrorResponse。
FPayloadAllocationSuccessDelegate
声明
DECLARE_DYNAMIC_DELEGATE_OneParam(FPayloadAllocationSuccessDelegate, FString, Payload)
返回类型
FString。
FPayloadAllocationFailureDelegate
声明
DECLARE_DYNAMIC_DELEGATE_OneParam(FPayloadAllocationFailureDelegate, FMultiplayPayloadAllocationErrorResponse, ErrorResponse)
返回类型
FMultiplayPayloadAllocationErrorResponse。
FPayloadTokenSuccessDelegate
声明
DECLARE_DYNAMIC_DELEGATE_OneParam(FPayloadTokenSuccessDelegate, FMultiplayPayloadTokenResponse, TokenResponse)
返回类型
FMultiplayPayloadTokenResponse。
FPayloadTokenFailureDelegate
声明
DECLARE_DYNAMIC_DELEGATE_OneParam(FPayloadTokenFailureDelegate, FMultiplayPayloadTokenResponse, ErrorResponse)
返回类型
FMultiplayPayloadTokenResponse。
构造函数
UMultiplayGameServerSubsystem()
Authentication 子系统的默认构造函数。
声明
UMultiplayGameServerSubsystem()
UMultiplayGameServerSubsystem(FVTableHelper&)
用于前向声明的覆盖构造函数。
声明
UMultiplayGameServerSubsystem(FVTableHelper& Helper)
参数
Name | 描述 |
|---|
| Helper | 用于调用专用热重载构造函数的辅助类。 |
析构函数
~UMultiplayGameServerSubsystem()
Authentication 子系统的默认析构函数。
声明
virtual ~UMultiplayGameServerSubsystem()
覆盖
Initialize(FSubsystemCollectionBase&)
初始化 USubsystem 的覆盖。
声明
virtual void Initialize(FSubsystemCollectionBase& Collection) override
Deinitialize()
初始化 USubsystem 的覆盖。
声明
virtual void Deinitialize() override
字段
OnAllocate
当此服务器已被分配时调用的委托。
声明
UPROPERTY(BlueprintAssignable, Category="Multiplay | GameServer")FAllocateDelegate OnAllocate
Blueprint
C++
OnDeallocate
当此服务器已被取消分配时调用的委托。
声明
UPROPERTY(BlueprintAssignable, Category="Multiplay | GameServer")FDeallocateDelegate OnDeallocate
Blueprint
C++
方法
ReadyServerForPlayers(FReadyServerSuccessDelegate, FReadyServerFailureDelegate)
将服务器标记为已准备好供玩家使用。当客户端准备好开始接受连接时,便会调用此方法。
声明
UFUNCTION(BlueprintCallable, Category="Multiplay | GameServer")void ReadyServerForPlayers(FReadyServerSuccessDelegate OnSuccess, FReadyServerFailureDelegate OnFailure)
参数
UnreadyServer(FUnreadyServerSuccessDelegate, FUnreadyServerFailureDelegate)
将服务器标记为未准备好供玩家使用。当客户端希望停止接受连接时,便会调用此方法。
声明
UFUNCTION(BlueprintCallable, Category="Multiplay | GameServer")void UnreadyServer(FUnreadyServerSuccessDelegate OnSuccess, FUnreadyServerFailureDelegate OnFailure)
参数
SubscribeToServerEvents()
建立与 Multiplay SDK 守护程序的连接并订阅分配消息。
声明
UFUNCTION(BlueprintCallable, Category="Multiplay | GameServer")void SubscribeToServerEvents()
UnsubscribeToServerEvents()
清理与 Multiplay SDK 守护程序的连接并取消订阅分配消息。
声明
UFUNCTION(BlueprintCallable, Category="Multiplay | GameServer")void UnsubscribeToServerEvents()
GetPayloadAllocation(FPayloadAllocationSuccessDelegate, FPayloadAllocationFailureDelegate)
检索分配有效负载。
声明
UFUNCTION(BlueprintCallable, Category="Multiplay | GameServer")void GetPayloadAllocation(FPayloadAllocationSuccessDelegate OnSuccess, FPayloadAllocationFailureDelegate OnFailure)
参数
GetPayloadToken(FPayloadTokenSuccessDelegate, FPayloadTokenFailureDelegate)
检索有效负载的 JWT 令牌。
声明
UFUNCTION(BlueprintCallable, Category="Multiplay | GameServer")void GetPayloadToken(FPayloadTokenSuccessDelegate OnSuccess, FPayloadTokenFailureDelegate OnFailure)
参数