Files
UnrealEngineUWP/Engine/Source/Runtime/NetworkFileSystem/Private/NetworkFileSystemModule.cpp
Ankit Khare 75222b223a #UE4
TTP: 318779  HTML5: Network File System.
          Allow the network file system to also serve HTTP clients besides TCP, defaults to  TCP.

      -   Refactor NFS to avoid socket depedency in code path, provide switchable implementations for the transport used.
      -   Remove INetworkFileServerConnection Interface, was not being used publically.
      -   WIP: Build improvments, more testing for target HTML5 platform, comments, support on Mac and Linux Platforms.

#codereview: peter.sauerbrei

[CL 2103382 by Ankit Khare in Main branch]
2014-06-12 17:02:52 -04:00

56 lines
1.7 KiB
C++

// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
/*=============================================================================
NetworkFileSystemModule.cpp: Implements the FNetworkFileSystemModule class.
=============================================================================*/
#include "NetworkFileSystemPrivatePCH.h"
#include "TargetDeviceId.h"
#include "ITargetDevice.h"
#include "ITargetPlatformManagerModule.h"
#include "ModuleManager.h"
DEFINE_LOG_CATEGORY(LogFileServer);
/**
* Implements the NetworkFileSystem module.
*/
class FNetworkFileSystemModule
: public INetworkFileSystemModule
{
public:
// Begin INetworkFileSystemModule interface
virtual INetworkFileServer* CreateNetworkFileServer( int32 Port, const FFileRequestDelegate* InFileRequestDelegate, const FRecompileShadersDelegate* InRecompileShadersDelegate ) const OVERRIDE
{
if (Port < 0)
{
Port = DEFAULT_FILE_SERVING_PORT;
}
TArray<ITargetPlatform*> ActiveTargetPlatforms;
// only bother getting the target platforms if there was "-targetplatform" on the commandline, otherwise UnrealFileServer will
// log out some scary sounding, but innocuous logs
FString Platforms;
if (FParse::Value(FCommandLine::Get(), TEXT("TARGETPLATFORM="), Platforms))
{
ITargetPlatformManagerModule& TPM = GetTargetPlatformManagerRef();
ActiveTargetPlatforms = TPM.GetActiveTargetPlatforms();
}
#if !USE_HTTP_FOR_NFS
return new FNetworkFileServer(Port, InFileRequestDelegate, InRecompileShadersDelegate, ActiveTargetPlatforms);
#else
return new FNetworkFileServerHttp(Port, InFileRequestDelegate, InRecompileShadersDelegate, ActiveTargetPlatforms);
#endif
}
// End INetworkFileSystemModule interface
};
IMPLEMENT_MODULE(FNetworkFileSystemModule, NetworkFileSystem);