From 87b8ca25e499f7ff9154a6ce66d4dddbe92c2164 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Sch=C3=A4fer?= <pschaefer@ITA.AKUSTIK.RWTH-AACHEN.DE> Date: Tue, 21 Feb 2023 17:14:27 +0100 Subject: [PATCH] VAServerLauncher: now allows sending an VARenderer.ini file while starting the VAServer remotely --- Source/VAPlugin/Private/VAReceiverActor.cpp | 2 +- Source/VAPlugin/Private/VAServerLauncher.cpp | 15 +++++++++++++-- Source/VAPlugin/Private/VAServerLauncher.h | 2 +- Source/VAPlugin/Public/VAReceiverActor.h | 6 +++++- 4 files changed, 20 insertions(+), 5 deletions(-) diff --git a/Source/VAPlugin/Private/VAReceiverActor.cpp b/Source/VAPlugin/Private/VAReceiverActor.cpp index 794ada2..dae0ccd 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 38a8abe..37b1ebd 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 69db715..acc4b1f 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 ee7b7d5..dfb9cd0 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; -- GitLab