aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDLL/server
diff options
context:
space:
mode:
Diffstat (limited to 'NorthstarDLL/server')
-rw-r--r--NorthstarDLL/server/auth/serverauthentication.cpp16
-rw-r--r--NorthstarDLL/server/buildainfile.cpp4
-rw-r--r--NorthstarDLL/server/serverchathooks.cpp26
-rw-r--r--NorthstarDLL/server/serverchathooks.h2
-rw-r--r--NorthstarDLL/server/servernethooks.cpp48
-rw-r--r--NorthstarDLL/server/serverpresence.cpp8
6 files changed, 52 insertions, 52 deletions
diff --git a/NorthstarDLL/server/auth/serverauthentication.cpp b/NorthstarDLL/server/auth/serverauthentication.cpp
index d5653dcc..56ecbc8e 100644
--- a/NorthstarDLL/server/auth/serverauthentication.cpp
+++ b/NorthstarDLL/server/auth/serverauthentication.cpp
@@ -192,7 +192,7 @@ void ServerAuthenticationManager::WritePersistentData(R2::CBaseClient* pPlayer)
if (pPlayer->m_iPersistenceReady == R2::ePersistenceReady::READY_REMOTE)
{
g_pMasterServerManager->WritePlayerPersistentData(
- pPlayer->m_UID, (const char*)pPlayer->m_PersistenceBuffer, m_PlayerAuthenticationData[pPlayer].pdataSize);
+ pPlayer->m_UID, (const char*)pPlayer->m_PersistenceBuffer, m_PlayerAuthenticationData[pPlayer].pdataSize);
}
else if (Cvar_ns_auth_allow_insecure_write->GetBool())
{
@@ -350,17 +350,17 @@ ON_DLL_LOAD_RELIESON("engine.dll", ServerAuthentication, (ConCommand, ConVar), (
g_pServerAuthentication = new ServerAuthenticationManager;
g_pServerAuthentication->Cvar_ns_erase_auth_info =
- new ConVar("ns_erase_auth_info", "1", FCVAR_GAMEDLL, "Whether auth info should be erased from this server on disconnect or crash");
+ new ConVar("ns_erase_auth_info", "1", FCVAR_GAMEDLL, "Whether auth info should be erased from this server on disconnect or crash");
g_pServerAuthentication->Cvar_ns_auth_allow_insecure =
- new ConVar("ns_auth_allow_insecure", "0", FCVAR_GAMEDLL, "Whether this server will allow unauthenicated players to connect");
+ new ConVar("ns_auth_allow_insecure", "0", FCVAR_GAMEDLL, "Whether this server will allow unauthenicated players to connect");
g_pServerAuthentication->Cvar_ns_auth_allow_insecure_write = new ConVar(
- "ns_auth_allow_insecure_write",
- "0",
- FCVAR_GAMEDLL,
- "Whether the pdata of unauthenticated clients will be written to disk when changed");
+ "ns_auth_allow_insecure_write",
+ "0",
+ FCVAR_GAMEDLL,
+ "Whether the pdata of unauthenticated clients will be written to disk when changed");
RegisterConCommand(
- "ns_resetpersistence", ConCommand_ns_resetpersistence, "resets your pdata when you next enter the lobby", FCVAR_NONE);
+ "ns_resetpersistence", ConCommand_ns_resetpersistence, "resets your pdata when you next enter the lobby", FCVAR_NONE);
// patch to disable kicking based on incorrect serverfilter in connectclient, since we repurpose it for use as an auth token
module.Offset(0x114655).Patch("EB");
diff --git a/NorthstarDLL/server/buildainfile.cpp b/NorthstarDLL/server/buildainfile.cpp
index d0143295..e6bd157a 100644
--- a/NorthstarDLL/server/buildainfile.cpp
+++ b/NorthstarDLL/server/buildainfile.cpp
@@ -226,7 +226,7 @@ void DumpAINInfo(CAI_Network* aiNetwork)
memcpy(diskNode.unk3, aiNetwork->nodes[i]->unk3, sizeof(diskNode.unk3));
diskNode.unk4 = aiNetwork->nodes[i]->unk6;
diskNode.unk5 =
- -1; // aiNetwork->nodes[i]->unk8; // this field is wrong, however, it's always -1 in vanilla navmeshes anyway, so no biggie
+ -1; // aiNetwork->nodes[i]->unk8; // this field is wrong, however, it's always -1 in vanilla navmeshes anyway, so no biggie
memcpy(diskNode.unk6, aiNetwork->nodes[i]->unk10, sizeof(diskNode.unk6));
spdlog::info("writing node {} from {} to {:x}", aiNetwork->nodes[i]->index, (void*)aiNetwork->nodes[i], writeStream.tellp());
@@ -386,7 +386,7 @@ ON_DLL_LOAD("server.dll", BuildAINFile, (CModule module))
AUTOHOOK_DISPATCH()
Cvar_ns_ai_dumpAINfileFromLoad = new ConVar(
- "ns_ai_dumpAINfileFromLoad", "0", FCVAR_NONE, "For debugging: whether we should dump ain data for ains loaded from disk");
+ "ns_ai_dumpAINfileFromLoad", "0", FCVAR_NONE, "For debugging: whether we should dump ain data for ains loaded from disk");
pUnkStruct0Count = module.Offset(0x1063BF8).RCast<int*>();
pppUnkNodeStruct0s = module.Offset(0x1063BE0).RCast<UnkNodeStruct0***>();
diff --git a/NorthstarDLL/server/serverchathooks.cpp b/NorthstarDLL/server/serverchathooks.cpp
index cb3af244..fff3c1d9 100644
--- a/NorthstarDLL/server/serverchathooks.cpp
+++ b/NorthstarDLL/server/serverchathooks.cpp
@@ -20,7 +20,7 @@ class CRecipientFilter
CServerGameDLL* g_pServerGameDLL;
void(__fastcall* CServerGameDLL__OnReceivedSayTextMessage)(
- CServerGameDLL* self, unsigned int senderPlayerId, const char* text, int channelId);
+ CServerGameDLL* self, unsigned int senderPlayerId, const char* text, int channelId);
void(__fastcall* CRecipientFilter__Construct)(CRecipientFilter* self);
void(__fastcall* CRecipientFilter__Destruct)(CRecipientFilter* self);
@@ -56,7 +56,7 @@ void, __fastcall, (CServerGameDLL* self, unsigned int senderPlayerId, const char
return;
SQRESULT result = g_pSquirrel<ScriptContext::SERVER>->Call(
- "CServerGameDLL_ProcessMessageStartThread", static_cast<int>(senderPlayerId) - 1, text, isTeam);
+ "CServerGameDLL_ProcessMessageStartThread", static_cast<int>(senderPlayerId) - 1, text, isTeam);
if (result == SQRESULT_ERROR)
_CServerGameDLL__OnReceivedSayTextMessage(self, senderPlayerId, text, isTeam);
@@ -66,11 +66,11 @@ void ChatSendMessage(unsigned int playerIndex, const char* text, bool isTeam)
{
bShouldCallSayTextHook = true;
CServerGameDLL__OnReceivedSayTextMessage(
- g_pServerGameDLL,
- // Ensure the first bit isn't set, since this indicates a custom message
- (playerIndex + 1) & CUSTOM_MESSAGE_INDEX_MASK,
- text,
- isTeam);
+ g_pServerGameDLL,
+ // Ensure the first bit isn't set, since this indicates a custom message
+ (playerIndex + 1) & CUSTOM_MESSAGE_INDEX_MASK,
+ text,
+ isTeam);
}
void ChatBroadcastMessage(int fromPlayerIndex, int toPlayerIndex, const char* text, bool isTeam, bool isDead, CustomMessageType messageType)
@@ -125,11 +125,11 @@ ADD_SQFUNC("void", NSSendMessage, "int playerIndex, string text, bool isTeam", "
}
ADD_SQFUNC(
- "void",
- NSBroadcastMessage,
- "int fromPlayerIndex, int toPlayerIndex, string text, bool isTeam, bool isDead, int messageType",
- "",
- ScriptContext::SERVER)
+ "void",
+ NSBroadcastMessage,
+ "int fromPlayerIndex, int toPlayerIndex, string text, bool isTeam, bool isDead, int messageType",
+ "",
+ ScriptContext::SERVER)
{
int fromPlayerIndex = g_pSquirrel<ScriptContext::SERVER>->getinteger(sqvm, 1);
int toPlayerIndex = g_pSquirrel<ScriptContext::SERVER>->getinteger(sqvm, 2);
@@ -159,7 +159,7 @@ ON_DLL_LOAD_RELIESON("server.dll", ServerChatHooks, ServerSquirrel, (CModule mod
AUTOHOOK_DISPATCH_MODULE(server.dll)
CServerGameDLL__OnReceivedSayTextMessage =
- module.Offset(0x1595C0).RCast<void(__fastcall*)(CServerGameDLL*, unsigned int, const char*, int)>();
+ module.Offset(0x1595C0).RCast<void(__fastcall*)(CServerGameDLL*, unsigned int, const char*, int)>();
CRecipientFilter__Construct = module.Offset(0x1E9440).RCast<void(__fastcall*)(CRecipientFilter*)>();
CRecipientFilter__Destruct = module.Offset(0x1E9700).RCast<void(__fastcall*)(CRecipientFilter*)>();
CRecipientFilter__AddAllPlayers = module.Offset(0x1E9940).RCast<void(__fastcall*)(CRecipientFilter*)>();
diff --git a/NorthstarDLL/server/serverchathooks.h b/NorthstarDLL/server/serverchathooks.h
index d033e769..e5d63313 100644
--- a/NorthstarDLL/server/serverchathooks.h
+++ b/NorthstarDLL/server/serverchathooks.h
@@ -21,4 +21,4 @@ void ChatSendMessage(unsigned int playerIndex, const char* text, bool isteam);
// isDead: display a [DEAD] badge
// messageType: send a specific message type
void ChatBroadcastMessage(
- int fromPlayerIndex, int toPlayerIndex, const char* text, bool isTeam, bool isDead, CustomMessageType messageType);
+ int fromPlayerIndex, int toPlayerIndex, const char* text, bool isTeam, bool isDead, CustomMessageType messageType);
diff --git a/NorthstarDLL/server/servernethooks.cpp b/NorthstarDLL/server/servernethooks.cpp
index f74f2d38..1b923bd7 100644
--- a/NorthstarDLL/server/servernethooks.cpp
+++ b/NorthstarDLL/server/servernethooks.cpp
@@ -101,10 +101,10 @@ static void ProcessAtlasConnectionlessPacketSigreq1(R2::netpacket_t* packet, boo
{
if (dbg)
spdlog::warn(
- "ignoring Atlas connectionless packet (size={} type={}): invalid (data={}): no masterserver token yet",
- packet->size,
- pType,
- pData);
+ "ignoring Atlas connectionless packet (size={} type={}): invalid (data={}): no masterserver token yet",
+ packet->size,
+ pType,
+ pData);
return;
}
@@ -114,16 +114,16 @@ static void ProcessAtlasConnectionlessPacketSigreq1(R2::netpacket_t* packet, boo
{
if (dbg)
spdlog::warn(
- "ignoring Atlas connectionless packet (size={} type={}): invalid: invalid signature (key={})",
- packet->size,
- pType,
- std::string(g_pMasterServerManager->m_sOwnServerAuthToken));
+ "ignoring Atlas connectionless packet (size={} type={}): invalid: invalid signature (key={})",
+ packet->size,
+ pType,
+ std::string(g_pMasterServerManager->m_sOwnServerAuthToken));
return;
}
spdlog::warn(
- "processing Atlas connectionless packet (size={} type={}) with invalid signature due to net_debug_atlas_packet_insecure",
- packet->size,
- pType);
+ "processing Atlas connectionless packet (size={} type={}) with invalid signature due to net_debug_atlas_packet_insecure",
+ packet->size,
+ pType);
}
if (dbg)
@@ -197,22 +197,22 @@ ON_DLL_LOAD_RELIESON("engine.dll", ServerNetHooks, ConVar, (CModule module))
throw std::runtime_error("failed to initialize bcrypt");
if (!VerifyHMACSHA256(
- "test",
- "\x88\xcd\x21\x08\xb5\x34\x7d\x97\x3c\xf3\x9c\xdf\x90\x53\xd7\xdd\x42\x70\x48\x76\xd8\xc9\xa9\xbd\x8e\x2d\x16\x82\x59\xd3\xdd"
- "\xf7",
- "test"))
+ "test",
+ "\x88\xcd\x21\x08\xb5\x34\x7d\x97\x3c\xf3\x9c\xdf\x90\x53\xd7\xdd\x42\x70\x48\x76\xd8\xc9\xa9\xbd\x8e\x2d\x16\x82\x59\xd3\xdd"
+ "\xf7",
+ "test"))
throw std::runtime_error("bcrypt HMAC-SHA256 is broken");
Cvar_net_debug_atlas_packet = new ConVar(
- "net_debug_atlas_packet",
- "0",
- FCVAR_NONE,
- "Whether to log detailed debugging information for Atlas connectionless packets (warning: this allows unlimited amounts of "
- "arbitrary data to be logged)");
+ "net_debug_atlas_packet",
+ "0",
+ FCVAR_NONE,
+ "Whether to log detailed debugging information for Atlas connectionless packets (warning: this allows unlimited amounts of "
+ "arbitrary data to be logged)");
Cvar_net_debug_atlas_packet_insecure = new ConVar(
- "net_debug_atlas_packet_insecure",
- "0",
- FCVAR_NONE,
- "Whether to disable signature verification for Atlas connectionless packets (DANGEROUS: this allows anyone to impersonate Atlas)");
+ "net_debug_atlas_packet_insecure",
+ "0",
+ FCVAR_NONE,
+ "Whether to disable signature verification for Atlas connectionless packets (DANGEROUS: this allows anyone to impersonate Atlas)");
}
diff --git a/NorthstarDLL/server/serverpresence.cpp b/NorthstarDLL/server/serverpresence.cpp
index ed9185c1..158d9abd 100644
--- a/NorthstarDLL/server/serverpresence.cpp
+++ b/NorthstarDLL/server/serverpresence.cpp
@@ -201,10 +201,10 @@ void ServerPresenceManager::SetPlaylist(const char* pPlaylistName)
{
// update playlist
strncpy_s(
- m_ServerPresence.m_PlaylistName,
- sizeof(m_ServerPresence.m_PlaylistName),
- pPlaylistName,
- sizeof(m_ServerPresence.m_PlaylistName) - 1);
+ m_ServerPresence.m_PlaylistName,
+ sizeof(m_ServerPresence.m_PlaylistName),
+ pPlaylistName,
+ sizeof(m_ServerPresence.m_PlaylistName) - 1);
// update maxplayers
const char* pMaxPlayers = R2::GetCurrentPlaylistVar("max_players", true);