My first question would be is who calls SpawnActor on the AInventory class you have setup? The server should make this class, attach it to some replicating AActor (like APlayerController) and then let it replicate down to the client.
The client will know that this object has been created/sent via
Header
UPROPERTY(ReplicatedUsing=OnRep_Inventory)
AMyInventory* PlayerInventoryVar;
UFUNCTION()
virtual void OnRep_WorldInventory();
CPP
void AMyPlayerController::GetLifetimeReplicatedProps( TArray< FLifetimeProperty > & OutLifetimeProps ) const
{
Super::GetLifetimeReplicatedProps( OutLifetimeProps );
DOREPLIFETIME_CONDITION( AMyPlayerController, PlayerInventoryVar, COND_OwnerOnly );
// more code here
}
You could initialize this in AMyPlayerController::Possess(APawn* Pawn)
if (Role == ROLE_Authority && PlayerInventoryVar == nullptr)
{
FActorSpawnParameters SpawnInfo;
SpawnInfo.Owner = this;
PlayerInventoryVar= GetWorld()->SpawnActor<AMyInventory>(SpawnInfo);
}
Now you have a server initiated spawning of an object, the lack of this before is probably the cause of your warnings above.
Then use the ServerDoWorkOnInventory() RPCs to modify/use/manipulate your inventories, making it server authoritative.