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
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.
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
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.
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
Name | Type | Description |
---|---|---|
Value | int32 | The 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.
Only values up to 65535
(max uint16
) are supported.
Declaration
UFUNCTION(BlueprintSetter, Category="Multiplay | ServerQuery")
void SetMaxPlayers(int32 Value)
Parameters
Name | Type | Description |
---|---|---|
Value | int32 | The 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.
Must be under 255 characters.
Declaration
UFUNCTION(BlueprintSetter, Category="Multiplay | ServerQuery")
void SetServerName(FString Value)
Parameters
Name | Type | Description |
---|---|---|
Value | FString | The 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.
Must be under 255 characters.
Declaration
UFUNCTION(BlueprintSetter, Category="Multiplay | ServerQuery")
void SetGameType(FString Value)
Parameters
Name | Type | Description |
---|---|---|
Value | FString | The 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.
Must be under 255 characters. Wide characters are not supported.
Declaration
UFUNCTION(BlueprintSetter, Category="Multiplay | ServerQuery")
void SetBuildId(FString Value)
Parameters
Name | Type | Description |
---|---|---|
Value | FString | The 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.
Must be under 255 characters.
Declaration
UFUNCTION(BlueprintSetter, Category="Multiplay | ServerQuery")
void SetMap(FString Value)
Parameters
Name | Type | Description |
---|---|---|
Value | FString | The 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.
Only values up to 65535
(max uint16
) are supported.
Declaration
UFUNCTION(BlueprintSetter, Category="Multiplay | ServerQuery")
void SetPort(int32 Value)
Parameters
Name | Type | Description |
---|---|---|
Value | int32 | The server's port. |