core/provider/console.cpp
author Scott Ehlert <ds@alliedmods.net>
Mon Nov 17 00:57:17 2008 -0600 (2008-11-17)
changeset 557 0a8ad2b12708
parent 539 db914129ae01
child 637 b66489d8aedc
permissions -rw-r--r--
Added Windows support for loader, core, and core-legacy
dvander@371
     1
/**
dvander@371
     2
 * vim: set ts=4 :
dvander@371
     3
 * ======================================================
dvander@371
     4
 * Metamod:Source
ds@523
     5
 * Copyright (C) 2004-2008 AlliedModders LLC and authors.
dvander@371
     6
 * All rights reserved.
dvander@371
     7
 * ======================================================
dvander@371
     8
 *
dvander@371
     9
 * This software is provided 'as-is', without any express or implied warranty.
dvander@371
    10
 * In no event will the authors be held liable for any damages arising from 
dvander@371
    11
 * the use of this software.
dvander@371
    12
 * 
dvander@371
    13
 * Permission is granted to anyone to use this software for any purpose, 
dvander@371
    14
 * including commercial applications, and to alter it and redistribute it 
dvander@371
    15
 * freely, subject to the following restrictions:
dvander@371
    16
 *
dvander@371
    17
 * 1. The origin of this software must not be misrepresented; you must not 
dvander@371
    18
 * claim that you wrote the original software. If you use this software in a 
dvander@371
    19
 * product, an acknowledgment in the product documentation would be 
dvander@371
    20
 * appreciated but is not required.
dvander@371
    21
 * 2. Altered source versions must be plainly marked as such, and must not be
dvander@371
    22
 * misrepresented as being the original software.
dvander@371
    23
 * 3. This notice may not be removed or altered from any source distribution.
dvander@371
    24
 *
dvander@371
    25
 * Version: $Id$
dvander@371
    26
 */
dvander@371
    27
dvander@371
    28
#include "console.h"
dvander@371
    29
#include "provider_ep2.h"
dvander@371
    30
dvander@371
    31
using namespace SourceHook;
dvander@371
    32
dvander@371
    33
SMConVarAccessor g_SMConVarAccessor;
dvander@371
    34
dvander@371
    35
bool SMConVarAccessor::RegisterConCommandBase(ConCommandBase *pCommand)
dvander@371
    36
{
dvander@371
    37
	pCommand->SetNext(NULL);
dvander@371
    38
	icvar->RegisterConCommand(pCommand);
dvander@371
    39
dvander@371
    40
	return true;
dvander@371
    41
}
dvander@371
    42
dvander@371
    43
bool SMConVarAccessor::Register(ConCommandBase *pCommand)
dvander@371
    44
{
dvander@371
    45
	pCommand->SetNext(NULL);
dvander@371
    46
	icvar->RegisterConCommand(pCommand);
dvander@371
    47
dvander@371
    48
	return true;
dvander@371
    49
}
dvander@371
    50
dvander@371
    51
void SMConVarAccessor::Unregister(ConCommandBase *pCommand)
dvander@371
    52
{
dvander@371
    53
	icvar->UnregisterConCommand(pCommand);
dvander@371
    54
}
dvander@371
    55