Navigation
API > API/Plugins > API/Plugins/MassReplication
Inheritance Hierarchy
- UObjectBase
- UObjectBaseUtility
- UObject
- USubsystem
- UWorldSubsystem
- UMassReplicationSubsystem
References
| Module | MassReplication |
| Header | /Engine/Plugins/Runtime/MassGameplay/Source/MassReplication/Public/MassReplicationSubsystem.h |
| Include | #include "MassReplicationSubsystem.h" |
Syntax
UCLASS&40;&41;
class UMassReplicationSubsystem : public UWorldSubsystem
Remarks
Manages the creation of NetworkIDs, ClientBubbles and ClientReplicationInfo. NetworkIDs are per replicated Agent Entity and are unique and replicated between server and clients. ClientBubbles relate to the player controller that owns the parent UNetConnection to a Client machine. ClientReplicationInfo relate to all the player controllers that have a parent or child UNetConnection to a single Client machine (split screen etc).
Variables
| Type | Name | Description | |
|---|---|---|---|
| TArray< FMassClientBubbleInfoData > | BubbleInfoArray | ||
| FMassClientHandleManager | ClientHandleManager | Clients free list FMassClientHandle manager, handles will to the indices of FMassClientReplicationData::ClientBubbles | |
| TArray< FMassClientReplicationInfo > | ClientsReplicationInfo | An Array of each Clients viewer handles (split screen players sharing the same client connections). | |
| TArray< FViewerClientPair > | ClientToViewerHandleArray | A free list array of FViewerClientPairs. | |
| TMap< FMassNetworkID, FMassReplicationEntityInfo > | EntityInfoMap | ||
| TSharedPtr< FMassEntityManager > | EntityManager | ||
| uint64 | LastSynchronizedFrame | Used to make sure the FMassEntityHandle_ClientReplications are synchronized immediately before they are needed | |
| TObjectPtr< UMassLODSubsystem > | MassLODSubsystem | ||
| UE::MassReplication::FMassAgentDelegate | OnMassAgentAdded | Broadcast just after a mass agent is added to the client simulation | |
| UE::MassReplication::FMassAgentDelegate | OnRemovingMassAgent | Broadcast just before a mass agent is removed from the client simulation | |
| FReplicationHashGrid2D | ReplicationGrid | ||
| TArray< FViewerClientPair > | ViewerToClientHandleArray | A free list array of FViewerClientPairs. | |
| TObjectPtr< UWorld > | World |
Constructors
| Type | Name | Description | |
|---|---|---|---|
Functions
| Type | Name | Description | |
|---|---|---|---|
| void | AddClient
(
FMassViewerHandle ViewerHandle, |
Adds a Client and sets up all the data relevant to the bubble. | |
| void | |||
| EFindOrAddMassEntityInfo | FindAndUpdateOrAddMassEntityInfo
(
const FMassNetworkID NetworkID, |
Finds or adds an FMassReplicationEntityInfo to the EntityInfoMap for an Entity with NetWorkID. | |
| FMassEntityHandle | FindEntity
(
const FMassNetworkID NetworkID |
||
| const FMassReplicationEntityInfo * | FindMassEntityInfo
(
const FMassNetworkID NetworkID |
Finds the FMassReplicationEntityInfo for the Entity with NetworkID. | |
| FMassReplicationEntityInfo * | FindMassEntityInfoMutable
(
const FMassNetworkID NetworkID |
||
| FMassBubbleInfoClassHandle | GetBubbleInfoClassHandle
(
const TSubclassOf< AMassClientBubbleInfoBase >& BubbleInfoClass |
||
| AMassClientBubbleInfoBase * | GetClientBubble
(
FMassBubbleInfoClassHandle BubbleClassHandle, |
Gets the client bubble safely | |
| AMassClientBubbleInfoBase * | GetClientBubbleChecked
(
FMassBubbleInfoClassHandle BubbleClassHandle, |
Get the client bubble. Faster version using check()s | |
| const TArray< FMassClientHandle > & | |||
| const FMassClientReplicationInfo * | GetClientReplicationInfo
(
FMassClientHandle Handle |
Gets the client replication info safely | |
| const FMassClientReplicationInfo & | GetClientReplicationInfoChecked
(
FMassClientHandle Handle |
Gets the client replication info. Faster version using check()s | |
| const TMap< FMassNetworkID, FMassReplicationEntityInfo > & | |||
| const FReplicationHashGrid2D & | GetGrid () |
||
| FReplicationHashGrid2D & | |||
| FMassClientReplicationInfo * | GetMutableClientReplicationInfo
(
FMassClientHandle Handle |
Gets the client replication info. Faster version using check()s | |
| FMassClientReplicationInfo & | Gets the client replication info. Faster version using check()s | ||
| FMassNetworkID | GetNetIDFromHandle
(
const FMassEntityHandle Handle |
Retrieve network id from Mass handle. | |
| FMassNetworkID | |||
| UE::MassReplication::FMassAgentDelegate & | |||
| UE::MassReplication::FMassAgentDelegate & | |||
| TType * | GetTypedClientBubble
(
FMassBubbleInfoClassHandle BubbleClassHandle, |
Gets the client bubble safely returning the template type | |
| TType * | GetTypedClientBubbleChecked
(
FMassBubbleInfoClassHandle BubbleClassHandle, |
Gets the client bubble returning the template type. Faster version using check()s | |
| bool | |||
| bool | IsValidClientHandle
(
FMassClientHandle ClientHandle |
||
| FMassBubbleInfoClassHandle | RegisterBubbleInfoClass
(
const TSubclassOf< AMassClientBubbleInfoBase >& BubbleInfoClass |
Registers BubbleInfoClass with the system. | |
| void | RemoveClient
(
FMassClientHandle ClientHandle |
Removes a Client and removes up all the data relevant to the bubble | |
| void | RemoveFromEntityInfoMap
(
const FMassNetworkID NetworkID |
||
| FMassEntityHandle | ResetEntityIfValid
(
const FMassNetworkID NetworkID, |
Resets the item with NetworkID in the EntityInfoMap if its currently Set / Valid and its the most recent ReplicationID. | |
| void | SetEntity
(
const FMassNetworkID NetworkID, |
Must be called immediately after an Entity is added to the simulation and after FindAndUpdateOrAddMassEntityInfo has been called | |
| bool | SynchronizeClients
(
const TArray< FViewerInfo >& Viewers |
||
| void | |||
| void | SynchronizeClientViewers
(
const TArray< FViewerInfo >& Viewers |
Overridden from USubsystem
| Type | Name | Description | |
|---|---|---|---|
| void | Deinitialize () |
Implement this for deinitialization of instances of the system | |
| void | Initialize
(
FSubsystemCollectionBase& Collection |
USubsystem BEGIN. |
Enums
| Type | Name | Description | |
|---|---|---|---|
| EFindOrAddMassEntityInfo |
Constants
| Name | Description |
|---|---|
| CurrentNetMassCounter |