Add support for listening to, blocking, changing, and faking ClientCommandKeyValues.

This commit is contained in:
Nicholas Hastings
2015-07-12 13:14:46 -04:00
parent 705b5d3f5f
commit c85cc5cbf7
7 changed files with 239 additions and 11 deletions
+8 -8
View File
@@ -2,7 +2,7 @@
* vim: set ts=4 :
* =============================================================================
* SourceMod
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved.
* Copyright (C) 2004-2015 AlliedModders LLC. All rights reserved.
* =============================================================================
*
* This program is free software; you can redistribute it and/or modify it under
@@ -29,6 +29,8 @@
* Version: $Id$
*/
#include "smn_keyvalues.h"
#include "sourcemod.h"
#include "sourcemm_api.h"
#include "sm_stringutil.h"
@@ -39,12 +41,6 @@
HandleType_t g_KeyValueType;
struct KeyValueStack
{
KeyValues *pBase;
CStack<KeyValues *> pCurRoot;
};
class KeyValueNatives :
public SMGlobalClass,
public IHandleTypeDispatch
@@ -62,7 +58,11 @@ public:
void OnHandleDestroy(HandleType_t type, void *object)
{
KeyValueStack *pStk = reinterpret_cast<KeyValueStack *>(object);
pStk->pBase->deleteThis();
if (pStk->m_bDeleteOnDestroy)
{
pStk->pBase->deleteThis();
}
delete pStk;
}
int CalcKVSizeR(KeyValues *pv)