VaRest
VaRest copied to clipboard
Cannot pass Json object from server to client, works as string
Hi There,
It seems passing Json object from server to client results in null/empty value. Ive read about older versions of unreal failing to pass arrays/sets, so may not be an old UE bug creeping in... Could you please confirm, UE5 EA, VaRest 5.0 (I was seeing this issue on UE 4.21 as well)
for example:
Server calling client function and passing object and encoded string
Client function prints string
result:
As you can see the client "object:" echo is empty.
Im also seeing this warning alot in console but suspect its a variable not set to replicated... LogNetPackageMap: Warning: FNetGUIDCache::SupportsObject: VaRestJsonObject /Engine/Transient.VaRestJsonObject_321 NOT Supported. LogNetPackageMap: Warning: FNetGUIDCache::SupportsObject: VaRestJsonObject /Engine/Transient.VaRestJsonObject_321 NOT Supported. LogNetPackageMap: Warning: FNetGUIDCache::SupportsObject: VaRestJsonObject /Engine/Transient.VaRestJsonObject_321 NOT Supported.
I can get by with encode->decode string if this is current functionality, passing object seems cleaner/neater. Thanks, any help appreciated.
It's by design, VaRestJsonObject is not supported to be transferred this way. You should pass strings instead.
Thanks for the heads up...
Just wondering if I could do this in the class maybe? As per this discussion: https://answers.unrealengine.com/questions/140212/view.html
bool IsNameStableForNetworking() const override;
bool IsSupportedForNetworking() const override { return true; }
My c++ is a bit rusty but doesn't seem too heavy.