aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDedicatedTest/bansystem.cpp
diff options
context:
space:
mode:
authorBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2022-01-31 00:19:36 +0000
committerGitHub <noreply@github.com>2022-01-31 00:19:36 +0000
commit186a4e2dbcb8a7c2f1a24f6657f0c5daa00a7fd5 (patch)
treeb5d45cea23a50f0ff453684cb20d5fed5fef8bf1 /NorthstarDedicatedTest/bansystem.cpp
parenta589bb0082cbae6d326644292179c9427e76e795 (diff)
parent033c8989c28384529fef72e0e8e17e824ceac8d4 (diff)
downloadNorthstarLauncher-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/bansystem.cpp')
-rw-r--r--NorthstarDedicatedTest/bansystem.cpp9
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)