diff options
author | Emma Miler <27428383+emma-miler@users.noreply.github.com> | 2022-01-30 20:32:33 +0100 |
---|---|---|
committer | Emma Miler <27428383+emma-miler@users.noreply.github.com> | 2022-01-30 20:32:33 +0100 |
commit | 7e338fac5c15a3cd6efdd570a93e6d8586856143 (patch) | |
tree | 910dae9926776e39462153f7a135dbd9c9eef7a8 /NorthstarDedicatedTest/bansystem.cpp | |
parent | a589bb0082cbae6d326644292179c9427e76e795 (diff) | |
download | NorthstarLauncher-7e338fac5c15a3cd6efdd570a93e6d8586856143.tar.gz NorthstarLauncher-7e338fac5c15a3cd6efdd570a93e6d8586856143.zip |
Added command line option for custom northstar dir
Added command line option for custom northstar dir
https://github.com/orgs/R2Northstar/projects/1#card-76312632
Diffstat (limited to 'NorthstarDedicatedTest/bansystem.cpp')
-rw-r--r-- | NorthstarDedicatedTest/bansystem.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/NorthstarDedicatedTest/bansystem.cpp b/NorthstarDedicatedTest/bansystem.cpp index a4d994d0..b9e3fd33 100644 --- a/NorthstarDedicatedTest/bansystem.cpp +++ b/NorthstarDedicatedTest/bansystem.cpp @@ -5,14 +5,15 @@ #include "concommand.h" #include "miscserverscript.h" #include <filesystem> +#include "configurables.h" -const char* BANLIST_PATH = "R2Northstar/banlist.txt"; +const char* BANLIST_PATH_SUFFIX = "/banlist.txt"; ServerBanSystem* g_ServerBanSystem; void ServerBanSystem::OpenBanlist() { - std::ifstream enabledModsStream(BANLIST_PATH); + std::ifstream enabledModsStream(GetNorthstarPrefix() + "/banlist.txt"); std::stringstream enabledModsStringStream; if (!enabledModsStream.fail()) @@ -25,7 +26,7 @@ void ServerBanSystem::OpenBanlist() } // open write stream for banlist - m_sBanlistStream.open(BANLIST_PATH, std::ofstream::out | std::ofstream::binary | std::ofstream::app); + m_sBanlistStream.open(GetNorthstarPrefix() + "/banlist.txt", std::ofstream::out | std::ofstream::binary | std::ofstream::app); } void ServerBanSystem::ClearBanlist() @@ -34,7 +35,7 @@ void ServerBanSystem::ClearBanlist() // reopen the file, don't provide std::ofstream::app so it clears on open m_sBanlistStream.close(); - m_sBanlistStream.open(BANLIST_PATH, std::ofstream::out | std::ofstream::binary); + m_sBanlistStream.open(GetNorthstarPrefix() + "/banlist.txt", std::ofstream::out | std::ofstream::binary); } void ServerBanSystem::BanUID(uint64_t uid) |