2022-05-24 02:50:39 -04:00
|
|
|
// 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:
|
2023-04-03 01:51:40 -04:00
|
|
|
return MakeShared<FCookOnTheFlyServerTCP>(Options.Port, Options.TargetPlatforms);
|
2022-05-24 02:50:39 -04:00
|
|
|
case ECookOnTheFlyNetworkServerProtocol::Platform:
|
2023-04-03 01:51:40 -04:00
|
|
|
return MakeShared<FCookOnTheFlyServerPlatformProtocol>(Options.TargetPlatforms);
|
2022-05-24 02:50:39 -04:00
|
|
|
default:
|
2023-05-26 15:52:39 -04:00
|
|
|
UE_LOG(LogCookOnTheFlyNetworkServer, Fatal, TEXT("Unsupported protocol: %d"), int(Options.Protocol));
|
2022-05-24 02:50:39 -04:00
|
|
|
return nullptr;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
IMPLEMENT_MODULE(FCookOnTheFlyNetworkServerModule, CookOnTheFlyNetServer);
|