sourcemm/concommands.h
branchsourcemm-1.6.0
changeset 347 e82968c21606
child 348 716af2e7be78
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/sourcemm/concommands.h	Tue Sep 18 20:03:47 2007 +0000
     1.3 @@ -0,0 +1,53 @@
     1.4 +/* ======== SourceMM ========
     1.5 + * Copyright (C) 2004-2007 Metamod:Source Development Team
     1.6 + * No warranties of any kind
     1.7 + *
     1.8 + * License: zlib/libpng
     1.9 + *
    1.10 + * Author(s): David "BAILOPAN" Anderson
    1.11 + * ============================
    1.12 + */
    1.13 +
    1.14 +#ifndef _INCLUDE_CONCOMMANDS_H
    1.15 +#define _INCLUDE_CONCOMMANDS_H
    1.16 +
    1.17 +/**
    1.18 + * @brief Header for console commands
    1.19 + * @file concommands.h
    1.20 + */
    1.21 +
    1.22 +#include <interface.h>
    1.23 +#include <eiface.h>
    1.24 +#include "sourcemm.h"
    1.25 +#include "convar_smm.h"
    1.26 +#include "sh_list.h"
    1.27 +
    1.28 +class SMConVarAccessor : public IConCommandBaseAccessor
    1.29 +{
    1.30 +	SourceHook::List<ConCommandBase*> m_RegisteredCommands;
    1.31 +public:
    1.32 +	virtual bool RegisterConCommandBase(ConCommandBase *pCommand);
    1.33 +	bool Register(ConCommandBase *pCommand);
    1.34 +	void MarkCommandsAsGameDLL();
    1.35 +	void Unregister(ConCommandBase *pCommand);
    1.36 +	void UnregisterGameDLLCommands();
    1.37 +};
    1.38 +
    1.39 +class CAlwaysRegisterableCommand : public ConCommandBase
    1.40 +{
    1.41 +	ICvar *m_pICvar;
    1.42 +public:
    1.43 +	CAlwaysRegisterableCommand();
    1.44 +	bool IsRegistered( void ) const;
    1.45 +	// If already registered, removes us
    1.46 +	// Then it registers us again
    1.47 +	void BringToFront();
    1.48 +};
    1.49 +
    1.50 +void ClientCommand_handler(edict_t *client);
    1.51 +
    1.52 +const char *GetPluginsFile();
    1.53 +
    1.54 +extern SMConVarAccessor g_SMConVarAccessor;
    1.55 +
    1.56 +#endif //_INCLUDE_CONCOMMANDS_H