Files
louisphilippe seguin 149844147d Iris:
* Added NetObjectFactory API
* Users can now create their own net object factories to handle discovery and instantiation of any replicated object types.
* An exemple of using this factory is to create your own replicated root objects that are not derived from the Actor class.

Iris ActorBridge:
* Created new Actor and SubObject net object factories.
* Deleted existing code handling discovery and instantiation of actors from the Bridge

ReplicationSystemTest:
* Converted Test bridge to use the new net object factory API

#jira UE-223565
#rb Mattias.Hornlund

[CL 36240214 by louisphilippe seguin in 5.5 branch]
2024-09-12 15:23:12 -04:00

31 lines
1.1 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "ReplicationSystemTestPlugin/ReplicationSystemTestPlugin.h"
#include "Iris/ReplicationState/PropertyNetSerializerInfoRegistry.h"
#include "Iris/ReplicationSystem/NetObjectFactoryRegistry.h"
#include "Tests/ReplicationSystem/ReplicatedTestObjectFactory.h"
class FReplicationSystemTestPlugin: public IReplicationSystemTestPlugin
{
/** IModuleInterface implementation */
virtual void StartupModule() override;
virtual void ShutdownModule() override;
};
IMPLEMENT_MODULE( FReplicationSystemTestPlugin, ReplicationSystemTestPlugin )
void FReplicationSystemTestPlugin::StartupModule()
{
UE::Net::FNetObjectFactoryRegistry::RegisterFactory(UReplicatedTestObjectFactory::StaticClass(), UReplicatedTestObjectFactory::GetFactoryName());
}
void FReplicationSystemTestPlugin::ShutdownModule()
{
// This function may be called during shutdown to clean up your module. For modules that support dynamic reloading,
// we call this function before unloading the module.
UE::Net::FNetObjectFactoryRegistry::UnregisterFactory(UReplicatedTestObjectFactory::GetFactoryName());
}