Can an arbitrary struct be passed via an RPC?
My project has custom networking requirements, with a need to send data directly between server and clients. I've been able to send data to a client RPC using an FString as a parameter, but I cannot send a struct - the project will not compile if I try. Is sending a struct possible? And if so, are there any examples for how this is done?
If it helps, here is the code I'm using that fails to compile:
I get this error when I try to compile:
asked Nov 26 '14 at 06:48 PM in C++ Programming
Did you try to send the struct itself ?
answered Dec 07 '14 at 09:37 PM
About the first question, you should mark your member variables _Data and _Hash with a UPROPERTY() definition. This would allow UHT to generate serialization, retrospection and replication code for this type.
According to the compilation problem and this: https://docs.unrealengine.com/latest/INT/Gameplay/Networking/Replication/RPCs/index.html your code looks good.
answered Nov 27 '14 at 10:06 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here