aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDedicatedTest/serverauthentication.cpp
diff options
context:
space:
mode:
authorBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2022-01-13 02:20:28 +0000
committerBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2022-01-13 02:20:28 +0000
commit8ee27654d4f8c70206983164d2c4ac692ebed5de (patch)
tree4140b57589e1d25fe94addf3cfda84c72573f17e /NorthstarDedicatedTest/serverauthentication.cpp
parent4a16290a48e65d9cb30c7aef6c405043d7c5d182 (diff)
downloadNorthstarLauncher-8ee27654d4f8c70206983164d2c4ac692ebed5de.tar.gz
NorthstarLauncher-8ee27654d4f8c70206983164d2c4ac692ebed5de.zip
unbreak sp
Diffstat (limited to 'NorthstarDedicatedTest/serverauthentication.cpp')
-rw-r--r--NorthstarDedicatedTest/serverauthentication.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/NorthstarDedicatedTest/serverauthentication.cpp b/NorthstarDedicatedTest/serverauthentication.cpp
index 7253f31b..794c6c1d 100644
--- a/NorthstarDedicatedTest/serverauthentication.cpp
+++ b/NorthstarDedicatedTest/serverauthentication.cpp
@@ -20,7 +20,7 @@ const char* AUTHSERVER_VERIFY_STRING = "I am a northstar server!";
typedef void*(*CBaseServer__ConnectClientType)(void* server, void* a2, void* a3, uint32_t a4, uint32_t a5, int32_t a6, void* a7, void* a8, char* serverFilter, void* a10, char a11, void* a12, char a13, char a14, int64_t uid, uint32_t a16, uint32_t a17);
CBaseServer__ConnectClientType CBaseServer__ConnectClient;
-typedef char(*CBaseClient__ConnectType)(void* self, char* name, __int64 netchan_ptr_arg, char b_fake_player_arg, __int64 a5, char* Buffer, int a7);
+typedef bool(*CBaseClient__ConnectType)(void* self, char* name, __int64 netchan_ptr_arg, char b_fake_player_arg, __int64 a5, char* Buffer, void* a7);
CBaseClient__ConnectType CBaseClient__Connect;
typedef void(*CBaseClient__ActivatePlayerType)(void* self);
@@ -241,11 +241,14 @@ void* CBaseServer__ConnectClientHook(void* server, void* a2, void* a3, uint32_t
return CBaseServer__ConnectClient(server, a2, a3, a4, a5, a6, a7, a8, serverFilter, a10, a11, a12, a13, a14, uid, a16, a17);
}
-char CBaseClient__ConnectHook(void* self, char* name, __int64 netchan_ptr_arg, char b_fake_player_arg, __int64 a5, char* Buffer, int a7)
+bool CBaseClient__ConnectHook(void* self, char* name, __int64 netchan_ptr_arg, char b_fake_player_arg, __int64 a5, char* Buffer, void* a7)
{
// try to auth player, dc if it fails
// we connect irregardless of auth, because returning bad from this function can fuck client state p bad
- char ret = CBaseClient__Connect(self, name, netchan_ptr_arg, b_fake_player_arg, a5, Buffer, a7);
+ bool ret = CBaseClient__Connect(self, name, netchan_ptr_arg, b_fake_player_arg, a5, Buffer, a7);
+
+ if (!ret)
+ return ret;
if (!g_ServerBanSystem->IsUIDAllowed(nextPlayerUid))
{
@@ -348,7 +351,7 @@ char CGameClient__ExecuteStringCommandHook(void* self, uint32_t unknown, const c
void ConCommand__DispatchHook(ConCommand* command, const CCommand& args, void* a3)
{
// patch to ensure FCVAR_GAMEDLL concommands without FCVAR_CLIENTCMD_CAN_EXECUTE can't be executed by remote clients
- if (*sv_m_State == server_state_t::ss_active && command->GetFlags() & FCVAR_GAMEDLL && !(command->GetFlags() & FCVAR_CLIENTCMD_CAN_EXECUTE))
+ if (*sv_m_State == server_state_t::ss_active && command->IsFlagSet(FCVAR_GAMEDLL) && !command->IsFlagSet(FCVAR_CLIENTCMD_CAN_EXECUTE))
{
if (IsDedicated())
return;
@@ -413,7 +416,7 @@ void CBaseClient__SendServerInfoHook(void* self)
bool ProcessConnectionlessPacketHook(void* a1, netpacket_t* packet)
{
- if (packet->adr.type == NA_IP)
+ if (packet->adr.type == NA_IP && (!(packet->data[4] == 'N' && Cvar_net_datablock_enabled->m_nValue) || !Cvar_net_datablock_enabled->m_nValue))
{
// bad lookup: optimise later tm
UnconnectedPlayerSendData* sendData = nullptr;