Documentation

Support

Multiplay Hosting

Multiplay Hosting

Class Multiplay Server Query Handler Subsystem

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

Subsystem responsible for handling Multiplay server queries.
Include
#include "MultiplayServerQueryHandlerSubsystem.h"
Syntax
UCLASS()class MULTIPLAYGAMESERVERSDK_API UMultiplayServerQueryHandlerSubsystem : public UMultiplaySubsystemBase
Inherits from: MultiplaySubsystemBase.

Overrides

Initialize(FSubsystemCollectionBase&)

Initialize overrides from USubsystem.

Declaration

virtual void Initialize(FSubsystemCollectionBase& Collection) override

Deinitialize()

Initialize overrides from USubsystem.

Declaration

virtual void Deinitialize() override

Methods

Connect()

Start listening for Multiplay server queries.

Declaration

UFUNCTION(BlueprintCallable, Category="Multiplay | ServerQuery")bool Connect()

Returns

Type

Description

bool
A bool indicating whether the query port was bound.

Disconnect()

Stop listening for Multiplay server queries.

Declaration

UFUNCTION(BlueprintCallable, Category="Multiplay | ServerQuery")void Disconnect()

IsConnected()

Indicates whether the server is actively listening for server query requests.

Declaration

UFUNCTION(BlueprintCallable, Category="Multiplay | ServerQuery")bool IsConnected() const

Returns

Type

Description

bool
A bool indicating whether the server is actively listening for server query requests.

GetCurrentPlayers()

Gets the current number of players connected to the server.

Declaration

UFUNCTION(BlueprintGetter, Category="Multiplay | ServerQuery")const int32& GetCurrentPlayers() const

Returns

Type

Description

const 
int32
&
The current number of players connected to the server.

IncrementCurrentPlayers()

Atomically increment the current number of players connected to the server. This method should be invoked whenever a player joins the match. Refer to SetCurrentPlayers() as an alternative for overwriting the current value.

Declaration

UFUNCTION(BlueprintCallable, Category="Multiplay | ServerQuery")void IncrementCurrentPlayers()

DecrementCurrentPlayers()

Atomically decrement the current number of players connected to the server. This method should be invoked whenever a player leaves the match. Refer to SetCurrentPlayers() as an alternative for overwriting the current value.

Declaration

UFUNCTION(BlueprintCallable, Category="Multiplay | ServerQuery")void DecrementCurrentPlayers()

SetCurrentPlayers(int32)

Sets the current number of players connected to the server. This method should be invoked whenever a player joins the match or leaves the match. Refer to IncrementCurrentPlayers() and DecrementCurrentPlayers() for atomic alternatives to SetCurrentPlayers(int32).

Declaration

UFUNCTION(BlueprintSetter, Category="Multiplay | ServerQuery")void SetCurrentPlayers(int32 Value)

Parameters

Name

Type

Description

Value
int32The current number of players.

GetMaxPlayers()

Gets the maximum number of players allowed on the server.

Declaration

UFUNCTION(BlueprintGetter, Category="Multiplay | ServerQuery")const int32& GetMaxPlayers() const

Returns

Type

Description

const 
int32
&
The maximum number of players allowed.

SetMaxPlayers(int32)

Sets the maximum amount of players allowed on the server.

Declaration

UFUNCTION(BlueprintSetter, Category="Multiplay | ServerQuery")void SetMaxPlayers(int32 Value)

Parameters

Name

Type

Description

Value
int32The maximum number of players.

GetServerName()

Gets the server's name.

Declaration

UFUNCTION(BlueprintGetter, Category="Multiplay | ServerQuery")const FString& GetServerName() const

Returns

Type

Description

const 
FString
&
The server's name.

SetServerName(FString)

Sets the server's name.

Declaration

UFUNCTION(BlueprintSetter, Category="Multiplay | ServerQuery")void SetServerName(FString Value)

Parameters

Name

Type

Description

Value
FStringThe server's name.

GetGameType()

Gets the game type that the server is currently being allocated for.

Declaration

UFUNCTION(BlueprintGetter, Category="Multiplay | ServerQuery")const FString& GetGameType() const

Returns

Type

Description

const 
FString
&
The server's game type name.

SetGameType(FString)

Sets the server's game type.

Declaration

UFUNCTION(BlueprintSetter, Category="Multiplay | ServerQuery")void SetGameType(FString Value)

Parameters

Name

Type

Description

Value
FStringThe server's game type.

GetBuildId()

Gets the build ID of the server.

Declaration

UFUNCTION(BlueprintGetter, Category="Multiplay | ServerQuery")const FString& GetBuildId() const

Returns

Type

Description

const 
FString
&
The server's build ID.

SetBuildId(FString)

Sets the server's build ID.

Declaration

UFUNCTION(BlueprintSetter, Category="Multiplay | ServerQuery")void SetBuildId(FString Value)

Parameters

Name

Type

Description

Value
FStringThe server's build ID.

GetMap()

Gets the map the server is currently on.

Declaration

UFUNCTION(BlueprintGetter, Category="Multiplay | ServerQuery")const FString& GetMap() const

Returns

Type

Description

const 
FString
&
The name of the server's current map.

SetMap(FString)

Sets the server's map.

Declaration

UFUNCTION(BlueprintSetter, Category="Multiplay | ServerQuery")void SetMap(FString Value)

Parameters

Name

Type

Description

Value
FStringThe server's map.

GetPort()

Gets the SQP port that the server is listening on.

Declaration

UFUNCTION(BlueprintGetter, Category="Multiplay | ServerQuery")const int32& GetPort() const

Returns

Type

Description

const 
int32
&
The server's port.

SetPort(int32)

Sets the server's SQP port that it listens on.

Declaration

UFUNCTION(BlueprintSetter, Category="Multiplay | ServerQuery")void SetPort(int32 Value)

Parameters

Name

Type

Description

Value
int32The server's port.