Class Multiplay Server Query Handler Subsystem

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
TypeDescription
boolA 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
TypeDescription
boolA bool indicating whether the server is actively listening for server query requests.

GetCurrentPlayers()

Gets the current number of players connected to the server.

The current players value is represented using a uint16 in the server query protocol. The maximum representable value for the current number of players is 65535.

Declaration
UFUNCTION(BlueprintGetter, Category="Multiplay | ServerQuery")
const int32& GetCurrentPlayers() const
Returns
TypeDescription
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.

The current players value is represented using a uint16 in the server query protocol. The maximum representable value for the current number of players is 65535.

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.

The current players value is represented using a uint16 in the server query protocol. The maximum representable value for the current number of players is 65535.

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.

The current players value is represented using a uint16 in the server query protocol. The maximum representable value for the current number of players is 65535.

Refer to IncrementCurrentPlayers() and DecrementCurrentPlayers() for atomic alternatives to SetCurrentPlayers(int32).

Declaration
UFUNCTION(BlueprintSetter, Category="Multiplay | ServerQuery")
void SetCurrentPlayers(int32 Value)
Parameters
NameTypeDescription
Valueint32The 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
TypeDescription
const int32&The maximum number of players allowed.

SetMaxPlayers(int32)

Sets the maximum amount of players allowed on the server.

Only values up to 65535 (max uint16) are supported.

Declaration
UFUNCTION(BlueprintSetter, Category="Multiplay | ServerQuery")
void SetMaxPlayers(int32 Value)
Parameters
NameTypeDescription
Valueint32The maximum number of players.

GetServerName()

Gets the server's name.

Declaration
UFUNCTION(BlueprintGetter, Category="Multiplay | ServerQuery")
const FString& GetServerName() const
Returns
TypeDescription
const FString&The server's name.

SetServerName(FString)

Sets the server's name.

Must be under 255 characters.

Declaration
UFUNCTION(BlueprintSetter, Category="Multiplay | ServerQuery")
void SetServerName(FString Value)
Parameters
NameTypeDescription
ValueFStringThe 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
TypeDescription
const FString&The server's game type name.

SetGameType(FString)

Sets the server's game type.

Must be under 255 characters.

Declaration
UFUNCTION(BlueprintSetter, Category="Multiplay | ServerQuery")
void SetGameType(FString Value)
Parameters
NameTypeDescription
ValueFStringThe server's game type.

GetBuildId()

Gets the build ID of the server.

Declaration
UFUNCTION(BlueprintGetter, Category="Multiplay | ServerQuery")
const FString& GetBuildId() const
Returns
TypeDescription
const FString&The server's build ID.

SetBuildId(FString)

Sets the server's build ID.

Must be under 255 characters. Wide characters are not supported.

Declaration
UFUNCTION(BlueprintSetter, Category="Multiplay | ServerQuery")
void SetBuildId(FString Value)
Parameters
NameTypeDescription
ValueFStringThe server's build ID.

GetMap()

Gets the map the server is currently on.

Declaration
UFUNCTION(BlueprintGetter, Category="Multiplay | ServerQuery")
const FString& GetMap() const
Returns
TypeDescription
const FString&The name of the server's current map.

SetMap(FString)

Sets the server's map.

Must be under 255 characters.

Declaration
UFUNCTION(BlueprintSetter, Category="Multiplay | ServerQuery")
void SetMap(FString Value)
Parameters
NameTypeDescription
ValueFStringThe 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
TypeDescription
const int32&The server's port.

SetPort(int32)

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

Only values up to 65535 (max uint16) are supported.

Declaration
UFUNCTION(BlueprintSetter, Category="Multiplay | ServerQuery")
void SetPort(int32 Value)
Parameters
NameTypeDescription
Valueint32The server's port.