BA Replication Array - Replication Info Actor - Events
The Replication Info Actor ('ABA_ReplicationInfo') is the Actor exposing all functions of the underlaying FFastArraySerializer. It can be accessed via its name from the Actor Component or directly spawned as AInfo Actor: You can use the node 'Spawn Actor' and spawn a 'BA Replication Info' Actor - or use the Actor Component and its function 'Add Replication Array'.
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FBA_SingleEntrySignature, FBA_FFA_Object, Entry);
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FBA_ArrayCountChange, int32, ArrayCount);
DECLARE_DYNAMIC_MULTICAST_DELEGATE(FBA_ArrayChange);
The events that are available from the Replication Info Actor:
Events
The Replication Arrays are implementations of the 'FFastArraySerializer' struct class with entries of 'FFastArraySerializerItem'.
Example to register an Event - Replication Array added
The following examples can be seen in the 'BP_ThirdPersonCharacter_Rep' event graph. The BAInfo variable shown above is set when a Replication Array has been added to the Actor Component (right side, last step). This happens on Server side:
The variable is set as 'RepNotify'. This will automatically create a function OnRep_BAInfo. This function is triggered after the variable has been replicated to the client. It can be used to register events that should happen on the client side. If you try to access that variable prioir of replication on client side, you will get null pointer errors.
All available client side events
- [On Entry Post Replicated Change]
- [On Entry Post Replicated Receive]
- [On Entry Pre Replicated Remove]
- [On Full Array Change Empty]
- [On Full Array Change Sort]
Access
- Source code https://github.com/DeveloperBastian/BA_ReplicationArray
- a video tutorial https://youtu.be/rrGx6bwwM6U (german version)