UMassReplicationManager

Manages the creation of NetworkIDs, ClientBubbles and ClientViewers.

Choose your operating system:

Windows

macOS

Linux

Inheritance Hierarchy

References

Module

MassReplication

Header

/Engine/Plugins/Runtime/MassGameplay/Source/MassReplication/Public/MassReplicationManager.h

Include

#include "MassReplicationManager.h"

Syntax

UCLASS()
class UMassReplicationManager : public UWorldSubsystem

Remarks

Manages the creation of NetworkIDs, ClientBubbles and ClientViewers. 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. ClientViewers relate to all the player controllers that have a parent or child UNetConnection to a single Client machine (split screen etc).

Variables

Name Description

Protected variable UProperty Transient

TArray< FMassCl...

 

BubbleInfoArray

Protected variable

FMassClientHand...

 

ClientHandleManager

Clients free list FMassClientHandle manager, handles will to the indices of FMassClientReplicationData::ClientBubbles

Protected variable

TArray< FClient...

 

ClientsViewerHandles

An Array of each Clients viewer handles (split screen players sharing the same client connections).

Protected variable

TArray< FViewer...

 

ClientToViewerHandleArray

A free list array of FViewerClientPairs.

Protected variable

TMap< FMassNetw...

 

EntityInfoMap

Protected variable UProperty

UMassEntitySubs...

 

EntitySystem

Protected variable

uint64

 

LastSynchronizedFrame

Used to make sure the FMassEntityHandle_ClientReplications are synchronized immediately before they are needed

Protected variable UProperty

UMassLODManager...

 

MassLODManager

Protected variable

UE::MassReplica...

 

OnMassAgentAdded

Broadcast just after a mass agent is added to the client simulation

Protected variable

UE::MassReplica...

 

OnRemovingMassAgent

Broadcast just before a mass agent is removed from the client simulation

Protected variable

TArray< FViewer...

 

ViewerToClientHandleArray

A free list array of FViewerClientPairs.

Protected variable UProperty

UWorld *

 

World

Functions

Name Description

Protected function

void

 

AddClient

(
    FMassViewerHandle ViewerHandle,
    APlayerController& InController
)

Adds a Client and sets up all the data relevant to the bubble.

Protected function Static

void

 

DebugCheckArraysAreInSync()

Public function

EFindOrAddMa...

 

FindAndUpdateOrAddMassEntityInfo

(
    const FMassNetworkID NetworkID,
    int32 ReplicationID,
    const FMassReplicationEntityInfo&#...
)

Finds or adds an FMassReplicationEntityInfo to the EntityInfoMap for an Entity with NetWorkID.

Public function Const

FMassEntityH...

 

FindEntity

(
    const FMassNetworkID NetworkID
)

Public function Const

const FMassR...

 

FindMassEntityInfo

(
    const FMassNetworkID NetworkID
)

Finds the FMassReplicationEntityInfo for the Entity with NetworkID.

Protected function

FMassReplica...

 

FindMassEntityInfoMutable

(
    const FMassNetworkID NetworkID
)

Public function Const

FMassBubbleI...

 

GetBubbleInfoClassHandle

(
    const TSubclassOf< AMassClientBubbl...
)

Public function Const

AMassClientB...

 

GetClientBubble

(
    FMassBubbleInfoClassHandle BubbleCl...,
    FMassClientHandle ClientHandle
)

Gets the client bubble safely

Public function Const

AMassClientB...

 

GetClientBubbleChecked

(
    FMassBubbleInfoClassHandle BubbleCl...,
    FMassClientHandle ClientHandle
)

Get the client bubble. Faster version using check()s

Public function Const

const TArray...

 

GetClientReplicationHandles()

Public function Const

const FClien...

 

GetClientViewers

(
    FMassClientHandle Handle
)

Gets the client viewers safely

Public function Const

const FClien...

 

GetClientViewersChecked

(
    FMassClientHandle Handle
)

Gets the client viewers. Faster version using check()s

Public function Const

const TMap< ...

 

GetEntityInfoMap()

Public function Const

FMassNetwork...

 

GetNetIDFromHandle

(
    const FMassEntityHandle Handle
)

Retrieve network id from Mass handle.

Public function Static

FMassNetwork...

 

GetNextAvailableMassNetID()

Public function

UE::MassRepl...

 

GetOnMassAgentAdded()

Public function

UE::MassRepl...

 

GetOnRemovingMassAgent()

Public function Const

TType *

 

GetTypedClientBubble

(
    FMassBubbleInfoClassHandle BubbleCl...,
    FMassClientHandle ClientHandle
)

Gets the client bubble safely returning the template type

Public function Const

TType *

 

GetTypedClientBubbleChecked

(
    FMassBubbleInfoClassHandle BubbleCl...,
    FMassClientHandle ClientHandle
)

Gets the client bubble returning the template type. Faster version using check()s

Public function Const

bool

 

IsBubbleClassHandleValid

(
    FMassBubbleInfoClassHandle Handle
)

Public function

FMassBubbleI...

 

RegisterBubbleInfoClass

(
    const TSubclassOf< AMassClientBubbl...
)

Registers BubbleInfoClass with the system.

Protected function

void

 

RemoveClient

(
    FMassClientHandle ClientHandle
)

Removes a Client and removes up all the data relevant to the bubble

Public function

void

 

RemoveFromEntityInfoMap

(
    const FMassNetworkID NetworkID
)

Public function

FMassEntityH...

 

ResetEntityIfValid

(
    const FMassNetworkID NetworkID,
    int32 ReplicationID
)

Resets the item with NetworkID in the EntityInfoMap if its currently Set / Valid and its the most recent ReplicationID.

Public function

void

 

SetEntity

(
    const FMassNetworkID NetworkID,
    const FMassEntityHandle Entity
)

Must be called immediately after an Entity is added to the simulation and after FindAndUpdateOrAddMassEntityInfo has been called

Protected function

bool

 

SynchronizeClients

(
    const TArray< FViewerInfo >& Viewe...
)

Public function

void

 

SynchronizeClientsAndViewers()

Protected function

void

 

SynchronizeClientViewers

(
    const TArray< FViewerInfo >& Viewe...
)

Overridden from USubsystem

Name Description

Protected function Virtual

void

 

Deinitialize()

Implement this for deinitialization of instances of the system

Protected function Virtual

void

 

Initialize

(
    FSubsystemCollectionBase& Collecti...
)

USubsystem BEGIN.

Enums

Name

Description

Public enum

EFindOrAddMassEntityInfo

Constants

Name

Description

CurrentNetMassCounter