Skip to main content

BA_RepArrayReplicationInfo_AuthorativeFunctions

--- sidebar_position: 0 sidebar_label: Authorative Functions title: BA Replication Array - Replication Info Actor - Authorative Functions slug: ReplicationInfoActor_AuthorativeFunctions authors: name: devbastian title: Owner url: https://github.com/DeveloperBastian image_url: /img/developer-bastian-blogimage.jpg tags: [Marketplace,Unreal Epics,Plugins] description: BA Replication Array - Actor Component - Authorative Functions keywords:


BA Replication Array - Replication Info Actor - Authorative Functions

All functions shown here are demonstrated in the 'BP_ThirdPersonCharacter_Rep' class.

The functions listed here are only available on Authoritive (Server side). If you play the game as 'Client', you always would have to split the BP logic with 'Switch Has Authority':

Authorative Functions

The following functions are available:

Add Object

Here we construct a BP Object and set its 'Weight' property to a random value. Then we add it one time to the Replication Array.

BA Replication - Add Object The Object(s) will be added to the Replication Array and its Instance Guid and Instance Identifier (2 adjectives and one name) will be returned.

There is a hard coded limit of how many bytes can be replicated at the same time in Unreal - you can add as many instances of the created object as you like here, but you will overfill the Data Channel:
  • UChannel::SendBunch - 'Attempted to send bunch exceeding max allowed size. BunchSize=%d, MaximumSize=%d Channel: %s'
  • The maximum size allowed is defined in 'NetMaxConstructedPartialBunchSizeBytes' and is set as default to 65536 Byte

Clear Array

The Replication Array will be cleared, all registered objects deleted.

BA Replication - Clear Array

Remove Entry

The objects stored in the Replication Array are part of an Entry, essentially a 'FBA_FFA_Object' that is child to the 'FFastArraySerializerItem'.

This object is called an 'Entry' and adds some more functionality (Guid, Identifier, Sort Index) to the Object added.

Here we first get a random Entry from the Replication Array, then remove that entry using its Instance Guid. The Remove function will return the entry removed - this needs to be cast to its regarding class.

BA Replication - Delete Entry