Navigation
API > API/Plugins > API/Plugins/MultiServerReplication
The MultiServer node is a system / control scheme for connecting multiple dedicated server processes to each other and allowing them to communicate via online beacons.
The basic usage pattern is to create a UMultiServerNode in project code via UMultiServerNode::Create. For a typical UE game, a good place might be in an AGameSession subclass in the RegisterServer override. The node manages all the connections to other servers, and will attempt to establish them upon creation based on the PeerAddresses in the FMultiServerNodeCreateParams.
The main user-extension point is to subclass AMultiServerBeaconClient. This subclass can implement its own RPCs to send custom messages to other servers connected to the node. The OnMultiServerConnected callback in the FMultiServerNodeCreateParams will be called when a new connection is established, with the instance of the user beacon as an argument. The user code can call its RPCs on the instance.
| Name | UMultiServerNode |
| Type | class |
| Header File | /Engine/Plugins/Runtime/MultiServerReplication/Source/MultiServerReplication/Public/MultiServerNode.h |
| Include Path | #include "MultiServerNode.h" |
Syntax
UCLASS (Config=Engine, Transient, DisplayName="MultiServer Node")
class UMultiServerNode : public UObject
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → UMultiServerNode
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
UMultiServerNode() |
MultiServerNode.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| AMultiServerBeaconClient | friend | MultiServerNode.h | ||
| BeaconHost | TObjectPtr< AMultiServerBeaconHost > | MultiServerNode.h | ||
| BeaconHostObject | TObjectPtr< AMultiServerBeaconHostObject > | MultiServerNode.h | ||
| LocalPeerId | FString | MultiServerNode.h | ||
| OnMultiServerConnected | FOnMultiServerConnected | MultiServerNode.h | ||
| PeerConnections | TArray< TObjectPtr< UMultiServerPeerConnection > > | MultiServerNode.h | ||
| RetryConnectDelay | float | MultiServerNode.h |
|
|
| RetryConnectMaxDelay | float | MultiServerNode.h |
|
|
| TickDispatchDelegateHandle | FDelegateHandle | Multi-server nodes handle ticking of their NetDrivers directly instead of letting the world tick them. | MultiServerNode.h | |
| TickFlushDelegateHandle | FDelegateHandle | MultiServerNode.h | ||
| UserBeaconClass | TSubclassOf< AMultiServerBeaconClient > | MultiServerNode.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void ForEachBeaconClient
(
TFunctionRef< void(AMultiServerBeaconClient*)> Operation |
MultiServerNode.h | ||
void ForEachNetDriver
(
TFunctionRef< void(UNetDriver*)> Operation |
MultiServerNode.h | ||
T * GetBeaconClientForRemotePeer
(
FStringView RemotePeerId |
MultiServerNode.h | ||
AMultiServerBeaconClient * GetBeaconClientForRemotePeer
(
FStringView RemotePeerId |
MultiServerNode.h | ||
AMultiServerBeaconClient * GetBeaconClientForURL
(
const FString& InURL |
MultiServerNode.h | ||
T * GetBeaconClientForURL
(
const FString& InURL |
MultiServerNode.h | ||
int32 GetConnectionCount() |
MultiServerNode.h | ||
FString GetLocalPeerId() |
MultiServerNode.h | ||
float GetRetryConnectDelay() |
MultiServerNode.h | ||
float GetRetryConnectMaxDelay() |
MultiServerNode.h | ||
TSubclassOf< AMultiServerBeaconClient > GetUserBeaconClass() |
MultiServerNode.h | ||
bool RegisterServer
(
const FMultiServerNodeCreateParams& Params |
MultiServerNode.h |
Overridden from UObject
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void BeginDestroy() |
MultiServerNode.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static UMultiServerNode * Create
(
const FMultiServerNodeCreateParams& Params |
MultiServerNode.h | ||
static void ParseCommandLineIntoCreateParams
(
FMultiServerNodeCreateParams& InOutParams |
MultiServerNode.h |