BA Replication Array - Actor Component - Functions OnAuthority
The functions listed will add/delete another Replciation Array to/from the Actor Component. The arrays are named, so you can have one per inventory, actor list or whatever you need to replicate. The Replication Array itself is an non placeable Actor (AInfo) that acts as entry point to one FBA_FFA_ObjectArray (child of FFastArraySerializer). It makes all the functions of that FFastArraySerializer available to BP while hosting all replicated objects (as you need an Actor toa actually replicate things). This makes the Replication Array independant from the Actor Component, so it can be transferred to anything else if needed.
Functions - OnAuthority
Be sure to develop the game as client and always split the logic between server and client side code with the "HasAuthority" Blueprint macro:
Add Replication Array
- @brief Initializes and adds a Replication Array actor to this Actor Component.
- @param ArrayName The name of the array to be added. This name can be used to identify and select the array later.
- @param WasAdded A boolean reference that will be set to true if the array was successfully added, false otherwise.
- @note This function can only be called on Authority.
- @return void
Delete Replication Array
- @brief Deletes a Replication Array actor from this Actor Component.
- @param ArrayName The case-sensitive name of the array to be removed.
- @param WasDeleted A boolean reference that will be set to true if the array was successfully deleted, false otherwise.
- @note All entries of the array will be deleted. This function can only be called on Authority.
- @return void
Example how to Add or Remove
The BA Replication Arrays are implementations of the 'FFastArraySerializer' struct class with entries of 'FFastArraySerializerItem'.
Access
- Source code https://github.com/DeveloperBastian/BA_ReplicationArray
- a video tutorial https://youtu.be/rrGx6bwwM6U (german version)