// Copyright Epic Games, Inc. All Rights Reserved. #pragma once #include "HAL/CriticalSection.h" #include "HAL/PlatformTime.h" #include "HAL/Thread.h" #include "InterchangeWorker.h" #include "InterchangeCommands.h" #include "InterchangeDispatcherNetworking.h" #include "InterchangeFbxParser.h" struct FFileStatData; class FImportParameters; class FInterchangeWorkerImpl { public: FInterchangeWorkerImpl(int32 InServerPID, int32 InServerPort, FString& InResultFolder); bool Run(const FString& WorkerVersionError); private: void InitiatePing(); void ProcessCommand(const UE::Interchange::FPingCommand& PingCommand); void ProcessCommand(const UE::Interchange::FBackPingCommand& BackPingCommand); void ProcessCommand(const TSharedPtr Command, const FString& ThreadName); void ProcessCommand(const UE::Interchange::FQueryTaskProgressCommand& QueryTaskProgressCommand); UE::Interchange::ETaskState LoadFbxFile(const UE::Interchange::FJsonLoadSourceCmd& LoadSourceCommand, FString& OutJSonResult, TArray& OutJSonMessages); UE::Interchange::ETaskState FetchFbxPayload(const UE::Interchange::FJsonFetchPayloadCmd& FetchPayloadCommand, FString& OutJSonResult, TArray& OutJSonMessages); UE::Interchange::ETaskState FetchFbxPayload(const UE::Interchange::FJsonFetchMeshPayloadCmd& FetchMeshPayloadCommand, FString& OutJSonResult, TArray& OutJSonMessages); UE::Interchange::ETaskState FetchFbxPayload(const UE::Interchange::FJsonFetchAnimationQueriesCmd& FetchAnimationBakeTransformPayloadCommand, FString& OutJSonResult, TArray& OutJSonMessages); private: UE::Interchange::FNetworkClientNode NetworkInterface; UE::Interchange::FCommandQueue CommandIO; int32 ServerPID; int32 ServerPort; uint64 PingStartCycle; FString ResultFolder; FCriticalSection TFinishThreadCriticalSection; TArray CurrentFinishThreads; TMap > ActiveThreads; UE::Interchange::FInterchangeFbxParser FbxParser; };