2005-04-16 21:59:26 +02:00
|
|
|
/* ======== SourceMM ========
|
2007-02-10 01:31:34 +01:00
|
|
|
* Copyright (C) 2004-2007 Metamod:Source Development Team
|
|
|
|
* No warranties of any kind
|
|
|
|
*
|
|
|
|
* License: zlib/libpng
|
|
|
|
*
|
|
|
|
* Author(s): David "BAILOPAN" Anderson
|
|
|
|
* ============================
|
|
|
|
*/
|
2005-04-16 21:59:26 +02:00
|
|
|
|
|
|
|
#ifndef _INCLUDE_CONCOMMANDS_H
|
|
|
|
#define _INCLUDE_CONCOMMANDS_H
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Header for console commands
|
|
|
|
* @file concommands.h
|
|
|
|
*/
|
|
|
|
|
2005-05-01 20:42:16 +02:00
|
|
|
#include <interface.h>
|
|
|
|
#include <eiface.h>
|
2005-04-16 21:59:26 +02:00
|
|
|
#include "sourcemm.h"
|
2007-02-08 10:19:19 +01:00
|
|
|
#include "convar_smm.h"
|
2005-08-12 19:44:53 +02:00
|
|
|
#include "sh_list.h"
|
2005-04-16 21:59:26 +02:00
|
|
|
|
|
|
|
class SMConVarAccessor : public IConCommandBaseAccessor
|
|
|
|
{
|
2005-08-12 19:44:53 +02:00
|
|
|
SourceHook::List<ConCommandBase*> m_RegisteredCommands;
|
2005-04-16 21:59:26 +02:00
|
|
|
public:
|
|
|
|
virtual bool RegisterConCommandBase(ConCommandBase *pCommand);
|
2005-05-26 10:06:23 +02:00
|
|
|
bool Register(ConCommandBase *pCommand);
|
2005-05-06 11:44:41 +02:00
|
|
|
void MarkCommandsAsGameDLL();
|
2005-05-26 10:06:23 +02:00
|
|
|
void Unregister(ConCommandBase *pCommand);
|
2005-09-24 23:10:53 +02:00
|
|
|
void UnregisterGameDLLCommands();
|
2005-05-26 10:06:23 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
class CAlwaysRegisterableCommand : public ConCommandBase
|
|
|
|
{
|
|
|
|
ICvar *m_pICvar;
|
|
|
|
public:
|
|
|
|
CAlwaysRegisterableCommand();
|
|
|
|
bool IsRegistered( void ) const;
|
|
|
|
// If already registered, removes us
|
|
|
|
// Then it registers us again
|
|
|
|
void BringToFront();
|
2005-04-16 21:59:26 +02:00
|
|
|
};
|
|
|
|
|
2006-04-21 08:35:47 +02:00
|
|
|
void ClientCommand_handler(edict_t *client);
|
|
|
|
|
2005-07-07 22:58:05 +02:00
|
|
|
const char *GetPluginsFile();
|
|
|
|
|
2005-04-16 21:59:26 +02:00
|
|
|
extern SMConVarAccessor g_SMConVarAccessor;
|
|
|
|
|
|
|
|
#endif //_INCLUDE_CONCOMMANDS_H
|