From 7c3994dfc280d8312632c9256f40a776c13158a4 Mon Sep 17 00:00:00 2001 From: IcePixelx <41352111+PixieCore@users.noreply.github.com> Date: Wed, 5 Jan 2022 19:23:53 +0100 Subject: [PATCH] dedicated refuselist --- r5dev/engine/host_state.cpp | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/r5dev/engine/host_state.cpp b/r5dev/engine/host_state.cpp index 48996e75..4ebcb622 100644 --- a/r5dev/engine/host_state.cpp +++ b/r5dev/engine/host_state.cpp @@ -6,6 +6,7 @@ #include "client/IVEngineClient.h" #include "networksystem/r5net.h" #include "squirrel/sqinit.h" +#include "public/include/bansystem.h" //----------------------------------------------------------------------------- // Purpose: Send keep alive request to Pylon Master Server. @@ -115,6 +116,37 @@ void HCHostState_FrameUpdate(void* rcx, void* rdx, float time) { Cbuf_ExecuteFn(); oldState = g_pHostState->m_iCurrentState; + + if (g_pBanSystem->IsRefuseListValid()) + { + for (int i = 0; i < g_pBanSystem->vsvrefuseList.size(); i++) // Loop through vector. + { + for (int c = 0; c < MAX_PLAYERS; c++) // Loop through all possible client instances. + { + CClient* client = g_pClient->GetClientInstance(c); // Get client instance. + if (!client) + { + continue; + } + + if (!client->GetNetChan()) // Netchan valid? + { + continue; + } + + int clientID = g_pClient->m_iUserID + 1; // Get UserID + 1. + if (clientID != g_pBanSystem->vsvrefuseList[i].second) // See if they match. + { + continue; + } + + NET_DisconnectClient(g_pClient, c, g_pBanSystem->vsvrefuseList[i].first.c_str(), 0, 1); + g_pBanSystem->DeleteConnectionRefuse(clientID); + break; + } + } + } + switch (g_pHostState->m_iCurrentState) { case HostStates_t::HS_NEW_GAME: