Hello everyone!
I am trying to understand UE4’s replication system a bit better, by trying to implement it into a little system I made.
Currently, I have a UMyAnimNotify Notify that when is generated, goes to a UWorldSingleton Object, and passes it a TArray<FMyStruct> of data.
I want that Object to, eventually, be a server authoritative object that replicates data back to the clients. Basically, client presses a button, this generates Notify to be spawned, which in turn gives data to Object, which is processed, and sent back to all clients (when & if required).
At the moment I want to pass this TArray<FMyStruct> of data through a function call which I wrote as:
UFUNCTION(reliable, server, WithValidation)
void Server_SendData(TArray<FMyStruct> const& ArrayOfData);
with .cpp implementations that are just empty:
/START SERVER COMMUNICATION/
bool UMyAnimNotify::Server_SendData_Validate(TArray<FMyStruct> const& ArrayOfData)
{
return true;
}
void UMyAnimNotify::Server_SendData_Implementation(TArray<FMyStruct> const& ArrayOfData)
{
}
/END SERVER COMMUNICATION/
but when I do this I get a ton of errors, namely:
…].gen.cpp(26): error C2511: ‘void UMyAnimNotify::Server_SendData(const TArray<FMyStruct,FDefaultAllocator> &) const’: overloaded member function not found in ‘UMyAnimNotify’
…].h(15): note: see declaration of ‘UMyAnimNotify’
…].gen.cpp(29): error C2671: ‘UMyAnimNotify::Server_SendData’: static member functions do not have ‘this’ pointers
…].gen.cpp(29): error C2227: left of ‘->ProcessEvent’ must point to class/struct/union/generic type
…].gen.cpp(29): error C2352: ‘UObject::FindFunctionChecked’: illegal call of non-static member function
UObject/Object.h(875): note: see declaration of ‘UObject::FindFunctionChecked’
…].cpp(178): error C2511: ‘void UMyAnimNotify::Server_SendData_Implementation(const TArray<FMyStruct,FDefaultAllocator> &)’: overloaded member function not found in ‘UMyAnimNotify’
…].h(15): note: see declaration of ‘UMyAnimNotify’
Am I missing something here? The documentation doesn’t seem to be all that well written, and is all over the place, which makes it real hard to know where to start. I hope I can get some advice on how to approach this!
Thanks in advance for any and all help!