diff --git a/Source/VAPlugin/Private/VAReceiverActor.cpp b/Source/VAPlugin/Private/VAReceiverActor.cpp index 794ada27190d04c570d6986d4ffef87cab73edaf..dae0ccdf0cf8289d8c19e138b7266317e0eeada0 100644 --- a/Source/VAPlugin/Private/VAReceiverActor.cpp +++ b/Source/VAPlugin/Private/VAReceiverActor.cpp @@ -57,7 +57,7 @@ void AVAReceiverActor::BeginPlay() if (bAutomaticRemoteVAStart) { FVAPlugin::VAServerLauncher.StartVAServerLauncher(); //if possible - bStartedVAServer = FVAPlugin::VAServerLauncher.RemoteStartVAServer(GetIPAddress(), RemoteVAStarterPort, WhichVAServerVersionToStart); + bStartedVAServer = FVAPlugin::VAServerLauncher.RemoteStartVAServer(GetIPAddress(), RemoteVAStarterPort, WhichVAServerVersionToStart, VARendererIniFile); if(bStartedVAServer){ FVAPlugin::SetUseVA(true); } diff --git a/Source/VAPlugin/Private/VAServerLauncher.cpp b/Source/VAPlugin/Private/VAServerLauncher.cpp index 38a8abeea4d600ad2e0d77ba93e4614298d8be67..37b1ebd8e78bfcd65eb4ccd3d7f66ed717255ad5 100644 --- a/Source/VAPlugin/Private/VAServerLauncher.cpp +++ b/Source/VAPlugin/Private/VAServerLauncher.cpp @@ -13,7 +13,7 @@ #include "VAPlugin.h" -bool FVAServerLauncher::RemoteStartVAServer(const FString& Host, const int Port, const FString& VersionName) +bool FVAServerLauncher::RemoteStartVAServer(const FString& Host, const int Port, const FString& VersionName, const FString& VARendererIniFile) { if (!UVirtualRealityUtilities::IsMaster()) { @@ -53,8 +53,18 @@ bool FVAServerLauncher::RemoteStartVAServer(const FString& Host, const int Port, } FVAUtils::LogStuff("[FVAServerLauncher::RemoteStartVAServer()]: Successfully connected to Launcher", false); + const bool bSendVARendererIni = !VARendererIniFile.IsEmpty(); + if (bSendVARendererIni) + { + if (!SendFileToVAServer(VARendererIniFile)) + { + FVAUtils::OpenMessageBox("[FVAServerLauncher::RemoteStartVAServer()]: VARenderer.ini file '" + VARendererIniFile + + "' could not be copied to VAServer. Does the file exist? See error log for additional info. VAServer will be launched with default settings.", true); + } + } + //Send requested version - TArray<uint8> RequestData = ConvertString(VersionName); + TArray<uint8> RequestData = ConvertString(VersionName); int BytesSend = 0; VAServerLauncherSocket->Send(RequestData.GetData(), RequestData.Num(), BytesSend); FVAUtils::LogStuff("[FVAServerLauncher::RemoteStartVAServer()]: Send " + FString::FromInt(BytesSend) + @@ -102,6 +112,7 @@ bool FVAServerLauncher::RemoteStartVAServer(const FString& Host, const int Port, VAServerLauncherSocket = nullptr; return false; } + return true; } diff --git a/Source/VAPlugin/Private/VAServerLauncher.h b/Source/VAPlugin/Private/VAServerLauncher.h index 69db7155dafbde41e233020a9fddbda2fe1e0642..acc4b1f2a991a591b90f641036cfb0b9840c578e 100644 --- a/Source/VAPlugin/Private/VAServerLauncher.h +++ b/Source/VAPlugin/Private/VAServerLauncher.h @@ -7,7 +7,7 @@ class FVAServerLauncher public: // Remote Start VAServer bool RemoteStartVAServer(const FString& Host, int Port, - const FString& VersionName); + const FString& VersionName, const FString& VARendererIni = ""); bool StartVAServerLauncher(); diff --git a/Source/VAPlugin/Public/VAReceiverActor.h b/Source/VAPlugin/Public/VAReceiverActor.h index ee7b7d59c2660d9ae7f8d841f58dc37f2cbd3a70..dfb9cd05bfce0a2658d02900f946e59f04c0e45c 100644 --- a/Source/VAPlugin/Public/VAReceiverActor.h +++ b/Source/VAPlugin/Public/VAReceiverActor.h @@ -47,7 +47,7 @@ protected: bool bAskForDebugMode = false; // Check if should try to use Python Automatic Remote star - UPROPERTY(EditAnywhere, meta = (DisplayName = "Use Automatic Remote VA Start via Python?", Category = "General Settings")) + UPROPERTY(EditAnywhere, meta = (DisplayName = "Use Automatic Remote VA Start via Python?", Category = "Connection")) bool bAutomaticRemoteVAStart = true; // Choose how to connect to the Server (automatic: build with windows connect with 127.0.0.1:12340, build with linux connect to cave) @@ -88,6 +88,10 @@ protected: "General Settings")) FString WhichVAServerVersionToStart = TEXT("2020.a"); + // Ini file with VA renderer settings. File will be sent to VAServer launcher on startup if not empty + UPROPERTY(EditAnywhere, meta = (DisplayName = "VARenderer.ini file", Category = "Connection")) + FString VARendererIniFile = TEXT(""); + // Controller for global auraliztion modes UPROPERTY(EditAnywhere, Instanced, NoClear, meta = (DisplayName = "Auraliztion Mode Controller", Category = "Auralization Modes")) UVAAuralizationModeController* AuralizationModeController;