diff options
author | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2022-01-31 00:19:36 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-31 00:19:36 +0000 |
commit | 186a4e2dbcb8a7c2f1a24f6657f0c5daa00a7fd5 (patch) | |
tree | b5d45cea23a50f0ff453684cb20d5fed5fef8bf1 /NorthstarDedicatedTest/configurables.cpp | |
parent | a589bb0082cbae6d326644292179c9427e76e795 (diff) | |
parent | 033c8989c28384529fef72e0e8e17e824ceac8d4 (diff) | |
download | NorthstarLauncher-186a4e2dbcb8a7c2f1a24f6657f0c5daa00a7fd5.tar.gz NorthstarLauncher-186a4e2dbcb8a7c2f1a24f6657f0c5daa00a7fd5.zip |
Merge pull request #61 from emma-miler/cla
Added command line option for custom northstar directory
Diffstat (limited to 'NorthstarDedicatedTest/configurables.cpp')
-rw-r--r-- | NorthstarDedicatedTest/configurables.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/NorthstarDedicatedTest/configurables.cpp b/NorthstarDedicatedTest/configurables.cpp new file mode 100644 index 00000000..7096b2e9 --- /dev/null +++ b/NorthstarDedicatedTest/configurables.cpp @@ -0,0 +1,32 @@ +#include <string> +#include "pch.h" +#include "configurables.h" + +std::string GetNorthstarPrefix() { + return NORTHSTAR_FOLDER_PREFIX; +} + +void parseConfigurables() { + char* clachar = strstr(GetCommandLineA(), "-profile="); + if (clachar) { + std::string cla = std::string(clachar); + if (strncmp(cla.substr(9, 1).c_str(), "\"", 1)) { + int space = cla.find(" "); + std::string dirname = cla.substr(9, space - 9); + spdlog::info("Found profile in command line arguments: " + dirname); + NORTHSTAR_FOLDER_PREFIX = dirname; + } + else { + std::string quote = "\""; + int quote1 = cla.find(quote); + int quote2 = (cla.substr(quote1 + 1)).find(quote); + std::string dirname = cla.substr(quote1 + 1, quote2); + spdlog::info("Found profile in command line arguments: " + dirname); + NORTHSTAR_FOLDER_PREFIX = dirname; + } + } + else { + spdlog::info("Didnt' find profile in command line arguments. Using default: R2Northstar"); + NORTHSTAR_FOLDER_PREFIX = "R2Northstar"; + } +}
\ No newline at end of file |