Files
UnrealEngineUWP/Engine/Source/Runtime/CookOnTheFly/Private/CookOnTheFlyModule.cpp
zousar shaker c27625b056 Integrating //UE5/Dev-Cooker [at] 16678003 to //UE5/Main (Zousar.Shaker-YEG-0943-Quaternary)
Non-DevIteration_ShooterGame


#ROBOMERGE-SOURCE: CL 16678907 in //UE5/Main/...
#ROBOMERGE-BOT: STARSHIP (Main -> Release-Engine-Test) (v835-16672529)

[CL 16678928 by zousar shaker in ue5-release-engine-test branch]
2021-06-15 16:38:03 -04:00

70 lines
1.6 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "CookOnTheFly.h"
#include "Modules/ModuleManager.h"
DEFINE_LOG_CATEGORY(LogCookOnTheFly);
namespace UE { namespace Cook
{
TUniquePtr<ICookOnTheFlyConnectionServer> MakeCookOnTheFlyConnectionServer(FCookOnTheFlyServerOptions Options);
TUniquePtr<ICookOnTheFlyServerConnection> MakeServerConnection();
}}
class FCookOnTheFlyModule final
: public UE::Cook::ICookOnTheFlyModule
{
public:
//
// IModuleInterface interface
//
virtual void StartupModule( ) override { }
virtual void ShutdownModule( ) override
{
if (ServerConnection.IsValid())
{
ServerConnection->Disconnect();
ServerConnection.Reset();
}
}
virtual bool SupportsDynamicReloading( ) override { return false; }
//
// ICookOnTheFlyModule interface
//
virtual TUniquePtr<UE::Cook::ICookOnTheFlyConnectionServer> CreateConnectionServer(UE::Cook::FCookOnTheFlyServerOptions Options) override
{
return UE::Cook::MakeCookOnTheFlyConnectionServer(Options);
}
virtual bool ConnectToServer(const UE::Cook::FCookOnTheFlyHostOptions& HostOptions) override
{
if (!ServerConnection.IsValid())
{
ServerConnection = UE::Cook::MakeServerConnection();
return ServerConnection->Connect(HostOptions);
}
return ServerConnection->IsConnected();
}
virtual UE::Cook::ICookOnTheFlyServerConnection& GetServerConnection() override
{
checkf(ServerConnection.IsValid(), TEXT("Call connect before accessing the server connection"));
return *ServerConnection;
}
private:
TUniquePtr<UE::Cook::ICookOnTheFlyServerConnection> ServerConnection;
};
IMPLEMENT_MODULE(FCookOnTheFlyModule, CookOnTheFly);