2014-12-07 19:09:38 -05:00
|
|
|
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Delegate type for handling file requests from a network client.
|
|
|
|
|
*
|
|
|
|
|
* The first parameter is the name of the requested file.
|
|
|
|
|
* The second parameter will hold the list of unsolicited files to send back.
|
|
|
|
|
*/
|
2014-04-23 16:44:02 -04:00
|
|
|
DECLARE_DELEGATE_ThreeParams(FFileRequestDelegate, const FString&, const FString&, TArray<FString>&);
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
struct FShaderRecompileData
|
|
|
|
|
{
|
|
|
|
|
FString PlatformName;
|
|
|
|
|
/** The platform to compile shaders for, corresponds to EShaderPlatform, but a value of -1 indicates to compile for all target shader platforms. */
|
|
|
|
|
int32 ShaderPlatform;
|
|
|
|
|
TArray<FString>* ModifiedFiles;
|
|
|
|
|
TArray<uint8>* MeshMaterialMaps;
|
|
|
|
|
TArray<FString> MaterialsToLoad;
|
|
|
|
|
TArray<uint8> SerializedShaderResources;
|
2014-06-23 10:23:52 -04:00
|
|
|
bool bCompileChangedShaders;
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
FShaderRecompileData() :
|
2014-06-23 10:23:52 -04:00
|
|
|
ShaderPlatform(-1),
|
|
|
|
|
bCompileChangedShaders(true)
|
2014-03-14 14:13:41 -04:00
|
|
|
{}
|
|
|
|
|
|
|
|
|
|
FShaderRecompileData& operator=(const FShaderRecompileData& Other)
|
|
|
|
|
{
|
|
|
|
|
PlatformName = Other.PlatformName;
|
|
|
|
|
ShaderPlatform = Other.ShaderPlatform;
|
|
|
|
|
ModifiedFiles = Other.ModifiedFiles;
|
|
|
|
|
MeshMaterialMaps = Other.MeshMaterialMaps;
|
|
|
|
|
MaterialsToLoad = Other.MaterialsToLoad;
|
|
|
|
|
SerializedShaderResources = Other.SerializedShaderResources;
|
2014-06-23 10:23:52 -04:00
|
|
|
bCompileChangedShaders = Other.bCompileChangedShaders;
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
return *this;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2014-06-12 23:22:18 -04:00
|
|
|
|
2014-03-14 14:13:41 -04:00
|
|
|
/**
|
|
|
|
|
* Delegate type for handling shader recompilation requests from a network client.
|
|
|
|
|
*/
|
|
|
|
|
DECLARE_DELEGATE_OneParam(FRecompileShadersDelegate, const FShaderRecompileData&);
|
|
|
|
|
|
2014-07-07 15:39:19 -04:00
|
|
|
enum ENetworkFileServerProtocol
|
|
|
|
|
{
|
|
|
|
|
NFSP_Tcp,
|
|
|
|
|
NFSP_Http,
|
|
|
|
|
};
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Interface for network file system modules.
|
|
|
|
|
*/
|
|
|
|
|
class INetworkFileSystemModule
|
|
|
|
|
: public IModuleInterface
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Creates a new network file server.
|
|
|
|
|
*
|
2014-06-12 23:22:18 -04:00
|
|
|
* @param InPort The port number to bind to (-1 = default port, 0 = any available port).
|
|
|
|
|
* @param Streaming Whether it should be a streaming server.
|
|
|
|
|
* @param InFileRequestDelegate An optional delegate to be invoked when a file is requested by a client.
|
|
|
|
|
* @param InRecompileShadersDelegate An optional delegate to be invoked when shaders need to be recompiled.
|
2014-03-14 14:13:41 -04:00
|
|
|
*
|
2014-06-12 23:22:18 -04:00
|
|
|
* @return The new file server, or nullptr if creation failed.
|
2014-03-14 14:13:41 -04:00
|
|
|
*/
|
2014-09-08 11:51:08 -04:00
|
|
|
virtual INetworkFileServer* CreateNetworkFileServer( bool bLoadTargetPlatforms, int32 Port = -1, const FFileRequestDelegate* InFileRequestDelegate = nullptr, const FRecompileShadersDelegate* InRecompileShadersDelegate = nullptr, const ENetworkFileServerProtocol Protocol = NFSP_Tcp ) const = 0;
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Virtual destructor.
|
|
|
|
|
*/
|
|
|
|
|
virtual ~INetworkFileSystemModule( ) { }
|
|
|
|
|
};
|