Files
UnrealEngineUWP/Engine/Source/Developer/CookOnTheFlyNetServer/Private/CookOnTheFlyNetServer.cpp
CarlMagnus Nordin 0282a5aef6 Unified Zen and legacy COTF network protocols.
*Reduces code duplication
*Enables the same ODSC flow to be used for both COTF variants
*The client will now autodetect if it should run in Zen mode or not
#rb pj.kack,per.larsson
#preflight 628c79bdf057b981ca479b3e

[CL 20344832 by CarlMagnus Nordin in ue5-main branch]
2022-05-24 02:50:39 -04:00

32 lines
1.1 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "CookOnTheFlyNetServer.h"
#include "Modules/ModuleManager.h"
#include "TCPServer.h"
#include "PlatformProtocolServer.h"
DEFINE_LOG_CATEGORY(LogCookOnTheFlyNetworkServer);
class FCookOnTheFlyNetworkServerModule final
: public UE::Cook::ICookOnTheFlyNetworkServerModule
{
public:
virtual TSharedPtr<UE::Cook::ICookOnTheFlyNetworkServer> CreateServer(const UE::Cook::FCookOnTheFlyNetworkServerOptions& Options) override
{
using namespace UE::Cook;
switch (Options.Protocol)
{
case ECookOnTheFlyNetworkServerProtocol::Tcp:
return MakeShared<FCookOnTheFlyServerTCP>(Options.Port, Options.TargetPlatforms, Options.ZenProjectName);
case ECookOnTheFlyNetworkServerProtocol::Platform:
return MakeShared<FCookOnTheFlyServerPlatformProtocol>(Options.TargetPlatforms, Options.ZenProjectName);
default:
UE_LOG(LogCookOnTheFlyNetworkServer, Fatal, TEXT("Unsupported protocol: %d"), Options.Protocol);
return nullptr;
}
}
};
IMPLEMENT_MODULE(FCookOnTheFlyNetworkServerModule, CookOnTheFlyNetServer);