I will try to do something like this.
//.H
USTRUCT(BlueprintType)
struct FMyTestStruct
{
GENERATED_USTRUCT_BODY()
UPROPERTY()
int32 TestValueClient;
UPROPERTY()
int32 TestValueServer;
FMyTestStruct()
{}
};
void TestStructReplication();
UFUNCTION(Server, Reliable, WithValidation)
void ServerUpdateStruct();
virtual void ServerUpdateStruct_Implementation();
virtual bool ServerUpdateStruct_Validate();
UPROPERTY(Replicated)
FMyTestStruct TestStruct;
//.CPP
void TestStructReplication()
{
TestStruct.TestValueClient = 1;
ServerUpdateStruct();
}
void ServerUpdateStruct_Implementation()
{
TestStruct.TestValueServer = 2;
}
bool ServerUpdateStruct_Validate()
{
return true;
}
Results
Expected if Server replicates changes only
ClientValue = 1
ServerValue = 2
Expected If Server replicates entire struct
ClientValue = 0
ServerValue = 2
Actual Result
ClientValue = 1
ServerValue = 2
The server only replicates changes that have been executed on the server and does not replicate changes the client has made locally.