okay can anyone tell me if this is going to work how i think it will?
i have an ActorComponent called UBuffContainer:
void UBuffContainer::GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const
{
DOREPLIFETIME(UBuffContainer, Buffs);
DOREPLIFETIME(UBuffContainer, Debuffs);
DOREPLIFETIME(UBuffContainer, HiddenBuffs);
}
bool UBuffContainer::ReplicateSubobjects(UActorChannel* Channel, FOutBunch* Bunch, FReplicationFlags* RepFlags)
{
bool bWroteSomething = Super::ReplicateSubobjects(Channel, Bunch, RepFlags);
bWroteSomething |= Channel->ReplicateSubobjectList(Buffs, *Bunch, *RepFlags);
bWroteSomething |= Channel->ReplicateSubobjectList(Debuffs, *Bunch, *RepFlags);
bWroteSomething |= Channel->ReplicateSubobjectList(HiddenBuffs, *Bunch, *RepFlags);
return bWroteSomething;
}
Now, each of those subobject lists (Buffs, Debuffs, HiddenBuffs) is a TArray of UBuff*, and i want to be replicating those buffs.
Here is some of UBuff:
virtual bool IsSupportedForNetworking() const override { return true; }
void UBuff::GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const
{
Super::GetLifetimeReplicatedProps(OutLifetimeProps);
DOREPLIFETIME(UBuff, CreationEvent);
DOREPLIFETIME(UBuff, LastApplyEvent);
}