You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
[FYI] Jason.Nadro Original CL Desc ----------------------------------------------------------------- [ODSC] - Break out recompile shaders functionality into its own file. - Break out common functionality for both ShaderCompiler.cpp and RecompileShaders.cpp into it's own shared file. #rb Ben.Ingram #jira none #preflight 619cffb0801b361978aa77d3 #ROBOMERGE-AUTHOR: jason.nadro #ROBOMERGE-SOURCE: CL 18273892 in //UE5/Release-5.0/... via CL 18273919 #ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469) [CL 18273945 by jason nadro in ue5-release-engine-test branch]
126 lines
3.9 KiB
C++
126 lines
3.9 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
#include "CoreMinimal.h"
|
|
#include "Modules/ModuleInterface.h"
|
|
#include "ShaderCompiler.h"
|
|
|
|
class INetworkFileServer;
|
|
|
|
/**
|
|
* 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.
|
|
*/
|
|
DECLARE_DELEGATE_ThreeParams(FFileRequestDelegate, FString&, const FString&, TArray<FString>&);
|
|
|
|
/**
|
|
* Delegate type for handling shader recompilation requests from a network client.
|
|
*/
|
|
DECLARE_DELEGATE_OneParam(FRecompileShadersDelegate, const FShaderRecompileData&);
|
|
|
|
/**
|
|
* Delegate which returns an override for the sandbox path
|
|
*/
|
|
DECLARE_DELEGATE_RetVal( FString, FSandboxPathDelegate);
|
|
|
|
/**
|
|
* Delegate which is called when an outside system modifies a file
|
|
*/
|
|
DECLARE_MULTICAST_DELEGATE_OneParam( FOnFileModifiedDelegate, const FString& );
|
|
|
|
|
|
/**
|
|
* Delegate which is called when a new connection is made to a file server client
|
|
*
|
|
* @param 1 Version string
|
|
* @param 2 Platform name
|
|
* @return return false if the connection should be destroyed
|
|
*/
|
|
DECLARE_DELEGATE_RetVal_TwoParams( bool, FNewConnectionDelegate, const FString&, const FString& );
|
|
|
|
|
|
// container struct for delegates which the network file system uses
|
|
struct FNetworkFileDelegateContainer
|
|
{
|
|
public:
|
|
FNetworkFileDelegateContainer() :
|
|
NewConnectionDelegate(nullptr),
|
|
SandboxPathOverrideDelegate(nullptr),
|
|
FileRequestDelegate(nullptr),
|
|
RecompileShadersDelegate(nullptr),
|
|
OnFileModifiedCallback(nullptr)
|
|
{}
|
|
FNewConnectionDelegate NewConnectionDelegate;
|
|
FSandboxPathDelegate SandboxPathOverrideDelegate;
|
|
FFileRequestDelegate FileRequestDelegate;
|
|
FRecompileShadersDelegate RecompileShadersDelegate;
|
|
|
|
FOnFileModifiedDelegate* OnFileModifiedCallback; // this is called from other systems to notify the network file system that a file has been modified hence the terminology callback
|
|
};
|
|
|
|
enum ENetworkFileServerProtocol
|
|
{
|
|
NFSP_Tcp,
|
|
NFSP_Http,
|
|
};
|
|
|
|
// Network file server options
|
|
struct FNetworkFileServerOptions
|
|
{
|
|
/* File server protocol*/
|
|
ENetworkFileServerProtocol Protocol = NFSP_Tcp;
|
|
|
|
/* The port number to bind to (-1 = default port, 0 = any available port) */
|
|
int32 Port = INDEX_NONE;
|
|
|
|
/* Optional delegates to be invoked when a file is requested by a client */
|
|
FNetworkFileDelegateContainer Delegates;
|
|
|
|
/* Active target platform(s) */
|
|
TArray<ITargetPlatform*> TargetPlatforms;
|
|
|
|
/* When running cook on the fly this options restricts package assets being sent from the project content folder */
|
|
bool bRestrictPackageAssetsToSandbox = false;
|
|
};
|
|
|
|
/**
|
|
* Interface for network file system modules.
|
|
*/
|
|
class INetworkFileSystemModule
|
|
: public IModuleInterface
|
|
{
|
|
public:
|
|
|
|
/**
|
|
* Creates a new network file server.
|
|
*
|
|
* @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.
|
|
*
|
|
* @return The new file server, or nullptr if creation failed.
|
|
*/
|
|
virtual INetworkFileServer* CreateNetworkFileServer( bool bLoadTargetPlatforms, int32 Port = -1, FNetworkFileDelegateContainer InNetworkFileDelegateContainer = FNetworkFileDelegateContainer(), const ENetworkFileServerProtocol Protocol = NFSP_Tcp ) const = 0;
|
|
|
|
/**
|
|
* Creates a new network file server.
|
|
*
|
|
* @param FileServerOptions File server options
|
|
* @param bLoadTargetPlatforms If true, gets the target platform from the command line or all available target platforms
|
|
*
|
|
* @return The new file server, or nullptr if creation failed.
|
|
*/
|
|
virtual INetworkFileServer* CreateNetworkFileServer(FNetworkFileServerOptions FileServerOptions, bool bLoadTargetPlatforms) const = 0;
|
|
|
|
public:
|
|
|
|
/**
|
|
* Virtual destructor.
|
|
*/
|
|
virtual ~INetworkFileSystemModule( ) { }
|
|
};
|