aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDedicatedTest/serverauthentication.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/serverauthentication.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/serverauthentication.cpp')
-rw-r--r--NorthstarDedicatedTest/serverauthentication.cpp7
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);