1.1 --- a/core/smn_console.cpp Fri Mar 29 12:28:02 2013 -0400
1.2 +++ b/core/smn_console.cpp Fri Mar 29 11:37:29 2013 -0700
1.3 @@ -32,10 +32,8 @@
1.4 #include "sm_globals.h"
1.5 #include "HalfLife2.h"
1.6 #include "sourcemm_api.h"
1.7 -#include "HandleSys.h"
1.8 #include "ConVarManager.h"
1.9 #include "ConCmdManager.h"
1.10 -#include "PluginSys.h"
1.11 #include "sm_stringutil.h"
1.12 #include "PlayerManager.h"
1.13 #include "ChatTriggers.h"
1.14 @@ -47,6 +45,7 @@
1.15 #include "Logger.h"
1.16 #include "ConsoleDetours.h"
1.17 #include "ConCommandBaseIterator.h"
1.18 +#include "logic_bridge.h"
1.19
1.20 #if SOURCE_ENGINE == SE_CSGO || SOURCE_ENGINE == SE_DOTA
1.21 #include <netmessages.pb.h>
1.22 @@ -88,13 +87,13 @@
1.23 {
1.24 HandleAccess access;
1.25
1.26 - g_HandleSys.InitAccessDefaults(NULL, &access);
1.27 + handlesys->InitAccessDefaults(NULL, &access);
1.28
1.29 - htConCmdIter = g_HandleSys.CreateType("ConCmdIter", this, 0, NULL, &access, g_pCoreIdent, NULL);
1.30 + htConCmdIter = handlesys->CreateType("ConCmdIter", this, 0, NULL, &access, g_pCoreIdent, NULL);
1.31
1.32 access.access[HandleAccess_Clone] = HANDLE_RESTRICT_OWNER | HANDLE_RESTRICT_IDENTITY;
1.33
1.34 - hCmdIterType = g_HandleSys.CreateType("CmdIter", this, 0, NULL, &access, g_pCoreIdent, NULL);
1.35 + hCmdIterType = handlesys->CreateType("CmdIter", this, 0, NULL, &access, g_pCoreIdent, NULL);
1.36 }
1.37 virtual void OnHandleDestroy(HandleType_t type, void *object)
1.38 {
1.39 @@ -726,7 +725,7 @@
1.40 return pContext->ThrowNativeError("Invalid function id (%X)", params[2]);
1.41 }
1.42
1.43 - CPlugin *pPlugin = g_PluginSys.GetPluginByCtx(pContext->GetContext());
1.44 + IPlugin *pPlugin = scripts->FindPluginByContext(pContext->GetContext());
1.45 const char *group = pPlugin->GetFilename();
1.46 if (!g_ConCmds.AddAdminCommand(pFunction, name, group, 0, help, params[4]))
1.47 {
1.48 @@ -757,7 +756,7 @@
1.49
1.50 if (group[0] == '\0')
1.51 {
1.52 - CPlugin *pPlugin = g_PluginSys.GetPluginByCtx(pContext->GetContext());
1.53 + IPlugin *pPlugin = scripts->FindPluginByContext(pContext->GetContext());
1.54 group = pPlugin->GetFilename();
1.55 }
1.56
1.57 @@ -1211,7 +1210,7 @@
1.58 GlobCmdIter *iter = new GlobCmdIter;
1.59 iter->started = false;
1.60
1.61 - Handle_t hndl = g_HandleSys.CreateHandle(hCmdIterType, iter, pContext->GetIdentity(), g_pCoreIdent, NULL);
1.62 + Handle_t hndl = handlesys->CreateHandle(hCmdIterType, iter, pContext->GetIdentity(), g_pCoreIdent, NULL);
1.63 if (hndl == BAD_HANDLE)
1.64 {
1.65 delete iter;
1.66 @@ -1226,7 +1225,7 @@
1.67 HandleError err;
1.68 HandleSecurity sec(pContext->GetIdentity(), g_pCoreIdent);
1.69
1.70 - if ((err = g_HandleSys.ReadHandle(params[1], hCmdIterType, &sec, (void **)&iter))
1.71 + if ((err = handlesys->ReadHandle(params[1], hCmdIterType, &sec, (void **)&iter))
1.72 != HandleError_None)
1.73 {
1.74 return pContext->ThrowNativeError("Invalid GlobCmdIter Handle %x", params[1]);
1.75 @@ -1365,7 +1364,7 @@
1.76 pContext->StringToLocalUTF8(params[5], params[6], (desc && desc[0]) ? desc : "", NULL);
1.77 }
1.78
1.79 - if ((hndl = g_HandleSys.CreateHandle(htConCmdIter, pIter, pContext->GetIdentity(), g_pCoreIdent, NULL))
1.80 + if ((hndl = handlesys->CreateHandle(htConCmdIter, pIter, pContext->GetIdentity(), g_pCoreIdent, NULL))
1.81 == BAD_HANDLE)
1.82 {
1.83 delete pIter;
1.84 @@ -1384,7 +1383,7 @@
1.85 const ConCommandBase *pConCmd;
1.86 HandleSecurity sec(pContext->GetIdentity(), g_pCoreIdent);
1.87
1.88 - if ((err = g_HandleSys.ReadHandle(params[1], htConCmdIter, &sec, (void **)&pIter)) != HandleError_None)
1.89 + if ((err = handlesys->ReadHandle(params[1], htConCmdIter, &sec, (void **)&pIter)) != HandleError_None)
1.90 {
1.91 return pContext->ThrowNativeError("Invalid Handle %x (error %d)", params[1], err);
1.92 }