VaRest icon indicating copy to clipboard operation
VaRest copied to clipboard

Cannot pass Json object from server to client, works as string

Open Gatts011 opened this issue 2 years ago • 2 comments

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 image

Client function prints string image

result: image

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.

Gatts011 avatar Dec 14 '21 15:12 Gatts011

It's by design, VaRestJsonObject is not supported to be transferred this way. You should pass strings instead.

ufna avatar Dec 14 '21 21:12 ufna

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.

Gatts011 avatar Dec 15 '21 18:12 Gatts011