Multiplay Hosting SDK for Unreal Engine Class Multiplay Server Query Handler Subsystem Reference documentation for the Multiplay Server Query Handler Subsystem class.
Read time 4 minutes
Last updated 3 hours ago Warning
We are winding down our direct support for the Unity Multiplay Game Server Hosting Service . Unity will support the Multiplay Game Server Hosting Service through March 31, 2026 . To ensure continuity for live titles, we are licensing our Multiplay Game Server Hosting software to Rocket Science Group. Learn more about them here .
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 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 A bool indicating whether the server is actively listening for server query requests.
GetCurrentPlayers()
Gets the current number of players connected to the server.
Note
The current players value is represented using a in the server query protocol.
The maximum representable value for the current number of players is .
Declaration
UFUNCTION(BlueprintGetter, Category="Multiplay | ServerQuery") const int32& GetCurrentPlayers() const
Returns
Type Description 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.
Note
The current players value is represented using a in the server query protocol.
The maximum representable value for the current number of players is .
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.
Note
The current players value is represented using a in the server query protocol.
The maximum representable value for the current number of players is .
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.
Note
The current players value is represented using a in the server query protocol.
The maximum representable value for the current number of players is .
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 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 int32 The maximum number of players allowed.
SetMaxPlayers(int32)
Sets the maximum amount of players allowed on the server.
Note
Only values up to (max ) are supported.
Declaration
UFUNCTION(BlueprintSetter, Category="Multiplay | ServerQuery") void SetMaxPlayers(int32 Value)
Parameters
Name Type Description 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 FString The server's name.
SetServerName(FString)
Sets the server's name.
Note
Must be under 255 characters.
Declaration
UFUNCTION(BlueprintSetter, Category="Multiplay | ServerQuery") void SetServerName(FString Value)
Parameters
Name Type Description 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 FString The server's game type name.
SetGameType(FString)
Sets the server's game type.
Note
Must be under 255 characters.
Declaration
UFUNCTION(BlueprintSetter, Category="Multiplay | ServerQuery") void SetGameType(FString Value)
Parameters
Name Type Description 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 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 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 FString The name of the server's current map.
SetMap(FString)
Sets the server's map.
Note
Must be under 255 characters.
Declaration
UFUNCTION(BlueprintSetter, Category="Multiplay | ServerQuery") void SetMap(FString Value)
Parameters
Name Type Description 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 int32 The server's port.
SetPort(int32)
Sets the server's SQP port that it listens on.
Note
Only values up to (max ) are supported.
Declaration
UFUNCTION(BlueprintSetter, Category="Multiplay | ServerQuery") void SetPort(int32 Value)
Parameters
Name Type Description int32 The server's port.