Iris - NetBlob/NetBlobHandler do not properly support derived classes outside the Iris module

Hello,

We’ve been working on creating a custom net blob, which I can also see suggested as intended to be possible from [Content removed] However, doing so leads to several unresolved external symbols, and the requirement to include private headers from Iris in order to utilize FReplicationStateOperationsInternal and FReplicationStateOperations.

The following were required to be exported in order for our custom net blob and net blob handler to work:

- ~FNetObjectAttachment()

- UNetBlobHandler (we removed minimal api, exported the whole class) <- Can probably keep minimal api, but things like the deconstructor and CreateNetBlob needed exporting, it was easier to export it whole

- explicit FInternalNetSerializationContext(UReplicationSystem* InReplicationSystem) (this also required a private header include)

FReplicationStateOperationsInternal::FreeDynamicState was used to free the dynamic state of quantized state stored in the deconstructor of our custom FNetBlob. In addition to the FNetBlob::QuantizedBlobState, we required storing additional quantized states for use during serialization.

These are just the ones we had to export for our use cases, but I suspect for different kind of net blobs it might need more or different ones. With the engine changes we did, this is also compiling now, however since the intention appears to be that this should be possible out of the box, I wanted to bring this to your attention so these things can be exported by default, without needing engine changes from us.

The FInternalNetSerializationContext (and thus private header include as well) is required to use things like FReplicationStateOperations::Quantize, where we need to create a FNetSerializationContext and set the internal context. Without access to the internal context, quantization and serialization failed. To avoid requiring to include a private header, perhaps a function inside a public API such as “CreateNetSerializationContext” can create the context and set the internal one directly, omitting the need to

Looking at UMockNetBlobHandler, it appears possible to inherit from UNetBlobHandler without these exports, but perhaps because this is in a test module it works differently.

We’ve also had to expose things like AddReadJournalEntry in the past when creating custom net serializers.

Thank you for your time,

With kind regards,

Céleste Neukirchen

[Attachment Removed]

Steps to Reproduce
-

[Attachment Removed]

Hi,

Thank you for bringing this to our attention. It was originally intended for projects to be able to create classes derived from NetBlob/NetBlobHandler, but with other work taking priority, I don’t believe we’ve explored creating a custom NetBlob in a separate project like this ourselves (outside of the test plugin).

I’ve opened a new internal task to look more into this, and I’ve included the info you’ve provided here. If you’d be willing to submit a PR of your changes, we’d also be more than happy to take a look at that.

Thanks,

Alex

[Attachment Removed]