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/serverauthentication.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/serverauthentication.cpp')
-rw-r--r-- | NorthstarDedicatedTest/serverauthentication.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/NorthstarDedicatedTest/serverauthentication.cpp b/NorthstarDedicatedTest/serverauthentication.cpp index d6a74008..5235761a 100644 --- a/NorthstarDedicatedTest/serverauthentication.cpp +++ b/NorthstarDedicatedTest/serverauthentication.cpp @@ -12,6 +12,7 @@ #include <fstream> #include <filesystem> #include <thread> +#include "configurables.h" const char* AUTHSERVER_VERIFY_STRING = "I am a northstar server!"; @@ -143,7 +144,7 @@ bool ServerAuthenticationManager::AuthenticatePlayer(void* player, int64_t uid, // reset from disk if we're doing that if (m_bForceReadLocalPlayerPersistenceFromDisk && !strcmp(authData.uid, g_LocalPlayerUserID)) { - std::fstream pdataStream("R2Northstar/placeholder_playerdata.pdata", std::ios_base::in); + std::fstream pdataStream(GetNorthstarPrefix() + "/placeholder_playerdata.pdata", std::ios_base::in); if (!pdataStream.fail()) { @@ -183,13 +184,13 @@ bool ServerAuthenticationManager::AuthenticatePlayer(void* player, int64_t uid, strcpy((char*)player + 0xF500, strUid.c_str()); // try reading pdata file for player - std::string pdataPath = "R2Northstar/playerdata_"; + std::string pdataPath = GetNorthstarPrefix() + "/playerdata_"; pdataPath += strUid; pdataPath += ".pdata"; std::fstream pdataStream(pdataPath, std::ios_base::in); if (pdataStream.fail()) // file doesn't exist, use placeholder - pdataStream = std::fstream("R2Northstar/placeholder_playerdata.pdata"); + pdataStream = std::fstream(GetNorthstarPrefix() + "/placeholder_playerdata.pdata"); // get file length pdataStream.seekg(0, pdataStream.end); |