sourcemm/episode2/console.cpp
author David Anderson <dvander@alliedmods.net>
Thu Oct 04 19:04:56 2007 +0000 (2007-10-04)
branchsourcemm-1.6.0
changeset 368 4a937e6e6f11
child 370 4dc28ab1c722
permissions -rw-r--r--
mm:s now works on tf2. yay!
dvander@368
     1
/**
dvander@368
     2
 * vim: set ts=4 :
dvander@368
     3
 * ======================================================
dvander@368
     4
 * Metamod:Source
dvander@368
     5
 * Copyright (C) 2004-2007 AlliedModders LLC and authors.
dvander@368
     6
 * All rights reserved.
dvander@368
     7
 * ======================================================
dvander@368
     8
 *
dvander@368
     9
 * This software is provided 'as-is', without any express or implied warranty.
dvander@368
    10
 * In no event will the authors be held liable for any damages arising from 
dvander@368
    11
 * the use of this software.
dvander@368
    12
 * 
dvander@368
    13
 * Permission is granted to anyone to use this software for any purpose, 
dvander@368
    14
 * including commercial applications, and to alter it and redistribute it 
dvander@368
    15
 * freely, subject to the following restrictions:
dvander@368
    16
 *
dvander@368
    17
 * 1. The origin of this software must not be misrepresented; you must not 
dvander@368
    18
 * claim that you wrote the original software. If you use this software in a 
dvander@368
    19
 * product, an acknowledgment in the product documentation would be 
dvander@368
    20
 * appreciated but is not required.
dvander@368
    21
 * 2. Altered source versions must be plainly marked as such, and must not be
dvander@368
    22
 * misrepresented as being the original software.
dvander@368
    23
 * 3. This notice may not be removed or altered from any source distribution.
dvander@368
    24
 *
dvander@368
    25
 * Version: $Id$
dvander@368
    26
 */
dvander@368
    27
dvander@368
    28
#include "console.h"
dvander@368
    29
#include "provider_ep2.h"
dvander@368
    30
dvander@368
    31
using namespace SourceHook;
dvander@368
    32
dvander@368
    33
SMConVarAccessor g_SMConVarAccessor;
dvander@368
    34
dvander@368
    35
static int s_nDLLIdentifier = 0x3058132;	// A unique identifier indicating which DLL this convar came from
dvander@368
    36
dvander@368
    37
bool SMConVarAccessor::RegisterConCommandBase(ConCommandBase *pCommand)
dvander@368
    38
{
dvander@368
    39
	pCommand->SetNext(NULL);
dvander@368
    40
	icvar->RegisterConCommand(pCommand);
dvander@368
    41
dvander@368
    42
	return true;
dvander@368
    43
}
dvander@368
    44
dvander@368
    45
bool SMConVarAccessor::Register(ConCommandBase *pCommand)
dvander@368
    46
{
dvander@368
    47
	pCommand->SetNext(NULL);
dvander@368
    48
	icvar->RegisterConCommand(pCommand);
dvander@368
    49
dvander@368
    50
	return true;
dvander@368
    51
}
dvander@368
    52
dvander@368
    53
void SMConVarAccessor::Unregister(ConCommandBase *pCommand)
dvander@368
    54
{
dvander@368
    55
	icvar->UnregisterConCommand(pCommand);
dvander@368
    56
}
dvander@368
    57