From 319b534d62fc70c30bbbc4ef977aa1b0605a9619 Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Thu, 20 Jul 2023 22:00:00 +0200 Subject: [PATCH] Enable plugin system Plugin system works and is stable. --- r5dev/engine/server/server.cpp | 16 ++++++++-------- r5dev/engine/sys_dll.cpp | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/r5dev/engine/server/server.cpp b/r5dev/engine/server/server.cpp index 2242269b..f29e5435 100644 --- a/r5dev/engine/server/server.cpp +++ b/r5dev/engine/server/server.cpp @@ -147,14 +147,14 @@ CClient* CServer::ConnectClient(CServer* pServer, user_creds_s* pChallenge) CClient* pClient = v_CServer_ConnectClient(pServer, pChallenge); - //for (auto& callback : !g_pPluginSystem->GetConnectClientCallbacks()) - //{ - // if (!callback(pServer, pClient, pChallenge)) - // { - // pClient->Disconnect(REP_MARK_BAD, "#Valve_Reject_Banned"); - // return nullptr; - // } - //} + for (auto& callback : !g_pPluginSystem->GetConnectClientCallbacks()) + { + if (!callback(pServer, pClient, pChallenge)) + { + pClient->Disconnect(REP_MARK_BAD, "#Valve_Reject_Banned"); + return nullptr; + } + } if (pClient && sv_globalBanlist->GetBool()) { diff --git a/r5dev/engine/sys_dll.cpp b/r5dev/engine/sys_dll.cpp index 6fb38cfb..f1194bc8 100644 --- a/r5dev/engine/sys_dll.cpp +++ b/r5dev/engine/sys_dll.cpp @@ -107,8 +107,8 @@ bool CModAppSystemGroup::StaticCreate(CModAppSystemGroup* pModAppSystemGroup) g_pFactory->AddFactory(INTERFACEVERSION_PLUGINSYSTEM, g_pPluginSystem); g_pFactory->AddFactory(KEYVALUESSYSTEM_INTERFACE_VERSION, g_pKeyValuesSystem); - //InitPluginSystem(pModAppSystemGroup); - //CALL_PLUGIN_CALLBACKS(g_pPluginSystem->GetCreateCallbacks(), pModAppSystemGroup); + InitPluginSystem(pModAppSystemGroup); + CALL_PLUGIN_CALLBACKS(g_pPluginSystem->GetCreateCallbacks(), pModAppSystemGroup); g_pModSystem->Init();