Documentation

Support

Multiplay Hosting

Multiplay Hosting

Class Multiplay Game Server Subsystem

Reference documentation for the Multiplay Game Server Subsystem class.
Read time 3 minutesLast updated 3 days ago

Subsystem responsible for communicating with the Multiplay SDK daemon.
Include
#include "MultiplayGameServerSubsystem.h"
Syntax
UCLASS()class MULTIPLAYGAMESERVERSDK_API UMultiplayGameServerSubsystem : public UMultiplaySubsystemBase
Inherits from: MultiplaySubsystemBase.

Delegates

FAllocateDelegate

Declaration

DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FAllocateDelegate, FMultiplayAllocation, Allocation)

Return Type

FMultiplayAllocation.

FDeallocateDelegate

Declaration

DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FDeallocateDelegate, FMultiplayDeallocation, Deallocation)

Return Type

FMultiplayDeallocation.

FReadyServerSuccessDelegate

Declaration

DECLARE_DYNAMIC_DELEGATE(FReadyServerSuccessDelegate)

FReadyServerFailureDelegate

Declaration

DECLARE_DYNAMIC_DELEGATE_OneParam(FReadyServerFailureDelegate, FMultiplayErrorResponse, ErrorResponse)

Return Type

FMultiplayErrorResponse.

FUnreadyServerSuccessDelegate

Declaration

DECLARE_DYNAMIC_DELEGATE(FUnreadyServerSuccessDelegate)

FUnreadyServerFailureDelegate

Declaration

DECLARE_DYNAMIC_DELEGATE_OneParam(FUnreadyServerFailureDelegate, FMultiplayErrorResponse, ErrorResponse)

Return Type

FMultiplayErrorResponse.

FPayloadAllocationSuccessDelegate

Declaration

DECLARE_DYNAMIC_DELEGATE_OneParam(FPayloadAllocationSuccessDelegate, FString, Payload)

Return Type

FString.

FPayloadAllocationFailureDelegate

Declaration

DECLARE_DYNAMIC_DELEGATE_OneParam(FPayloadAllocationFailureDelegate, FMultiplayPayloadAllocationErrorResponse, ErrorResponse)

Return Type

FMultiplayPayloadAllocationErrorResponse.

FPayloadTokenSuccessDelegate

Declaration

DECLARE_DYNAMIC_DELEGATE_OneParam(FPayloadTokenSuccessDelegate, FMultiplayPayloadTokenResponse, TokenResponse)

Return Type

FMultiplayPayloadTokenResponse.

FPayloadTokenFailureDelegate

Declaration

DECLARE_DYNAMIC_DELEGATE_OneParam(FPayloadTokenFailureDelegate, FMultiplayPayloadTokenResponse, ErrorResponse)

Return Type

FMultiplayPayloadTokenResponse.

Constructors

UMultiplayGameServerSubsystem()

Default constructor for the Authentication subsystem.

Declaration

UMultiplayGameServerSubsystem()

UMultiplayGameServerSubsystem(FVTableHelper&)

Override constructor for forward declaration.

Declaration

UMultiplayGameServerSubsystem(FVTableHelper& Helper)

Parameters

Name

Description

HelperHelper class to invoke specialized hot-reload constructor.

Destructors

~UMultiplayGameServerSubsystem()

Default destructor for the Authentication subsystem.

Declaration

virtual ~UMultiplayGameServerSubsystem()

Overrides

Initialize(FSubsystemCollectionBase&)

Initialize overrides from USubsystem.

Declaration

virtual void Initialize(FSubsystemCollectionBase& Collection) override

Deinitialize()

Initialize overrides from USubsystem.

Declaration

virtual void Deinitialize() override

Fields

OnAllocate

Delegate that is invoked when this server has been allocated.

Declaration

UPROPERTY(BlueprintAssignable, Category="Multiplay | GameServer")FAllocateDelegate OnAllocate

Blueprint

Name

Type

On AllocateFAllocateDelegate

C++

Name

Type

OnAllocate
FAllocateDelegate

OnDeallocate

Delegate that is invoked when this server has been deallocated.

Declaration

UPROPERTY(BlueprintAssignable, Category="Multiplay | GameServer")FDeallocateDelegate OnDeallocate

Blueprint

Name

Type

On DeallocateFDeallocateDelegate

C++

Name

Type

OnDeallocate
FDeallocateDelegate

Methods

ReadyServerForPlayers(FReadyServerSuccessDelegate, FReadyServerFailureDelegate)

Marks the server as ready for players. The client invokes this method when it is ready to start accepting connections.

Declaration

UFUNCTION(BlueprintCallable, Category="Multiplay | GameServer")void ReadyServerForPlayers(FReadyServerSuccessDelegate OnSuccess, FReadyServerFailureDelegate OnFailure)

Parameters

Name

Type

Description

OnSuccess
FReadyServerSuccessDelegateThis delegate is invoked if the operation completes successfully.
OnFailure
FReadyServerFailureDelegateThis delegate is invoked if the operation is unsuccessful.

UnreadyServer(FUnreadyServerSuccessDelegate, FUnreadyServerFailureDelegate)

Marks the server as not ready for players. The client invokes this method when wants to stop accepting connections.

Declaration

UFUNCTION(BlueprintCallable, Category="Multiplay | GameServer")void UnreadyServer(FUnreadyServerSuccessDelegate OnSuccess, FUnreadyServerFailureDelegate OnFailure)

Parameters

Name

Type

Description

OnSuccess
FUnreadyServerSuccessDelegateThis delegate is invoked if the operation completes successfully.
OnFailure
FUnreadyServerFailureDelegateThis delegate is invoked if the operation is unsuccessful.

SubscribeToServerEvents()

Establishes a connection to the Multiplay SDK daemon and subscribes to allocation messages.

Declaration

UFUNCTION(BlueprintCallable, Category="Multiplay | GameServer")void SubscribeToServerEvents()

UnsubscribeToServerEvents()

Cleans up connection to the Multiplay SDK daemon and unsubscribe from allocation messages.

Declaration

UFUNCTION(BlueprintCallable, Category="Multiplay | GameServer")void UnsubscribeToServerEvents()

GetPayloadAllocation(FPayloadAllocationSuccessDelegate, FPayloadAllocationFailureDelegate)

Retrieves the allocation payload.

Declaration

UFUNCTION(BlueprintCallable, Category="Multiplay | GameServer")void GetPayloadAllocation(FPayloadAllocationSuccessDelegate OnSuccess, FPayloadAllocationFailureDelegate OnFailure)

Parameters

Name

Type

Description

OnSuccess
FPayloadAllocationSuccessDelegateThis delegate is invoked if the operation completes successfully.
OnFailure
FPayloadAllocationFailureDelegateThis delegate is invoked if the operation is unsuccessful.

GetPayloadToken(FPayloadTokenSuccessDelegate, FPayloadTokenFailureDelegate)

Retrieves a JWT token for payloads.

Declaration

UFUNCTION(BlueprintCallable, Category="Multiplay | GameServer")void GetPayloadToken(FPayloadTokenSuccessDelegate OnSuccess, FPayloadTokenFailureDelegate OnFailure)

Parameters

Name

Type

Description

OnSuccess
FPayloadAllocationSuccessDelegateThis delegate is invoked if the operation completes successfully.
OnFailure
FPayloadAllocationFailureDelegateThis delegate is invoked if the operation is unsuccessful.