Removed tag system (bug 3751, r=fyren, a12=blocking).

This commit is contained in:
David Anderson
2009-03-25 03:27:32 -04:00
parent 3ee6bae4ba
commit 3ac9ecb4b7
6 changed files with 7 additions and 337 deletions
+1 -46
View File
@@ -43,7 +43,6 @@
#include <inetchannel.h>
#include <bitbuf.h>
#include <sm_trie_tpl.h>
#include "TagsSystem.h"
#if SOURCE_ENGINE == SE_LEFT4DEAD
#define NET_SETCONVAR 6
@@ -1307,55 +1306,11 @@ static cell_t SendConVarValue(IPluginContext *pContext, const cell_t *params)
static cell_t AddServerTag(IPluginContext *pContext, const cell_t *params)
{
char *value;
pContext->LocalToString(params[1], &value);
if (!g_Tags.AddTag(value))
{
return 0;
}
IPlugin *pPlugin = g_PluginSys.FindPluginByContext(pContext->GetContext());
SourceHook::List<char *> *pList = NULL;
if (!pPlugin->GetProperty("ServerTags", (void **)&pList, false) || !pList)
{
pList = new SourceHook::List<char *>;
pPlugin->SetProperty("ServerTags", pList);
}
pList->push_back(strdup(value));
return 1;
return 0;
}
static cell_t RemoveServerTag(IPluginContext *pContext, const cell_t *params)
{
char *value;
pContext->LocalToString(params[1], &value);
IPlugin *pPlugin = g_PluginSys.FindPluginByContext(pContext->GetContext());
SourceHook::List<char *> *pList = NULL;
if (!pPlugin->GetProperty("ServerTags", (void **)&pList, false) || !pList)
{
pList = new SourceHook::List<char *>;
pPlugin->SetProperty("ServerTags", pList);
}
SourceHook::List<char *>::iterator iter = pList->begin();
while (iter != pList->end())
{
if (strcmp(*iter, value) == 0)
{
g_pMemAlloc->Free(*iter);
pList->erase(iter);
return g_Tags.RemoveTag(value);
}
}
return 0;
}