C++ UObject Replication

So I was reading about this about UObject Replication:

It notes in here that the Outer for the Sub UObject must be the Actor its replicating from. My question is, can we use existing UObjects by Renaming them? (as it appears I could change the outer this way). My situation is, I have some UObjects created offline, I want to be able to move these Objects from Client to Server. I can do that just fine using Function replication but sometime later, I need to replicate these objects back down to the Clients.

If there is no way to do this, I could probably just easy create new copies of these objects, I just want to be sure. Also if the UObject is referenced within a Struct on the Actor will that make a difference?

I honestly don’t understrand your question.

If you want to replicate UObject, you need to implement at the very least this function:

bool UGISInventoryBaseComponent::ReplicateSubobjects(class UActorChannel *Channel, class FOutBunch *Bunch, FReplicationFlags *RepFlags)
	bool WroteSomething = Super::ReplicateSubobjects(Channel, Bunch, RepFlags);

		Should optimize it to replicate only items in array which changed.
		Don't know how though. Yet.

	for (const FGISTabInfo& TabInfo : Tabs.InventoryTabs)
		for (const FGISSlotInfo& SlotItem : TabInfo.TabSlots)
			if (SlotItem.ItemData)
				WroteSomething |= Channel->ReplicateSubobject(const_cast<UGISItemData*>(SlotItem.ItemData), *Bunch, *RepFlags);
	return WroteSomething;

Sample implementation.

You can’t replicate UObjects by sending them trough RPC call as function parameter (as matter of fact you can’t replicate anything, using this method beyond simple float or int).

More complex types needs to be replicated using DOREPLIFETIME macro (or _CONDITION variant). If you want to do something with replicated data, the safest route is using RepNotify along with replication, to make sure that replicated object are available on client.

You can pass Structs through RPC Calls though right? I thought I saw that going on in the Shooter Game…not just floats and ints

I think my main concern was, that the UObjects needed to be constructed by the Replicated Actor in order for it to work. My UObjects were being constructed by something outside of Replication while offline, and I wanted to pass them to a replicated actor and then have them replicated. I went ahead though and turned them into structs for now, with unique ids (so they can be referenced, the original reason I had them as UObjects was to take advantage of pointers, since pointers to Structs are not allowed by the UProperty system. The only major disadvantage with structs, is I have to pay more attention if the same data is referenced multiple places that changes to it are properly propagated to the original reference.