diff --git a/Source/VAPlugin/Private/VAServerLauncher.cpp b/Source/VAPlugin/Private/VAServerLauncher.cpp index 676e242e8fb168650f8cc47c9c527049f023bd70..b8c38ff820470b8b6a4d0a55869993813fda840a 100644 --- a/Source/VAPlugin/Private/VAServerLauncher.cpp +++ b/Source/VAPlugin/Private/VAServerLauncher.cpp @@ -11,6 +11,7 @@ #include "VAUtils.h" #include "VASettings.h" #include "VAPlugin.h" +#include "HAL/FileManagerGeneric.h" bool FVAServerLauncher::RemoteStartVAServer(const FString& Host, const int Port, const FString& VersionName, const FString& VARendererIniFile, const EReproductionInput ReproductionInputType) @@ -212,16 +213,24 @@ bool FVAServerLauncher::SendFileToVAServer(const FString& RelativeFilename) } TArray<uint8> FileBinaryArray; - FFileHelper::LoadFileToArray(FileBinaryArray, *FPaths::Combine(FPaths::ProjectContentDir(),RelativeFilename)); + FFileHelper::LoadFileToArray(FileBinaryArray, *FPaths::Combine(FPaths::ProjectContentDir(),RelativeFilename)); + FString FullPath = FPaths::Combine(FPaths::ProjectContentDir(), RelativeFilename); + const TCHAR* charFilePath = *FullPath; + FFileManagerGeneric fm; + FDateTime LastModification = fm.GetTimeStamp(charFilePath); const FString ProjectName = GetDefault<UGeneralProjectSettings>()->ProjectName; - FString MetaInfo = "file:"+RelativeFilename+":"+FString::FromInt(FileBinaryArray.Num())+":"+ProjectName; + FString MetaInfo = "file:" + +RelativeFilename+":" + +FString::FromInt(FileBinaryArray.Num())+":" + +ProjectName+":" + +FString::FromInt(LastModification.ToUnixTimestamp()); TArray<uint8> MetaInfoBinary = ConvertString(MetaInfo); int32 BytesSend; VAServerLauncherSocket->Send(MetaInfoBinary.GetData(), MetaInfoBinary.Num(), BytesSend); //Receive response - const int32 BufferSize = 16; + const int32 BufferSize = 128; int32 BytesRead = 0; uint8 Response[16]; if (VAServerLauncherSocket->Recv(Response, BufferSize, BytesRead)) @@ -239,7 +248,8 @@ bool FVAServerLauncher::SendFileToVAServer(const FString& RelativeFilename) } FVAUtils::LogStuff("[FVAServerLauncher::SendFileToVAServer()]: Entire file ("+RelativeFilename+") send!", false); VAServerLauncherSocket->Recv(Response, BufferSize, BytesRead); - if(BytesRead==3 && Response[0]=='a' && Response[1]=='c' && Response[2]=='k') + ResponseString = ByteArrayToString(Response, BytesRead); + if(ResponseString == "ack") { FVAUtils::LogStuff("[FVAServerLauncher::SendFileToVAServer()]: File was received by VAServerLauncher successfully!", false); //the search path is added potenitally multiple times, but can only be added once the folder is created (which the above guarantees)