dvander@370: /** ds@653: * vim: set ts=4 : ds@1330: * ============================================================================= dvander@1231: * SourceMod dvander@1231: * Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved. ds@1330: * ============================================================================= dvander@370: * ds@1330: * This program is free software; you can redistribute it and/or modify it under ds@1330: * the terms of the GNU General Public License, version 3.0, as published by the ds@1330: * Free Software Foundation. dvander@1231: * ds@1330: * This program is distributed in the hope that it will be useful, but WITHOUT ds@1330: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS ds@1330: * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more ds@1330: * details. dvander@1231: * ds@1330: * You should have received a copy of the GNU General Public License along with ds@1330: * this program. If not, see . dvander@1231: * ds@1330: * As a special exception, AlliedModders LLC gives you permission to link the ds@1330: * code of this program (as well as its derivative works) to "Half-Life 2," the ds@1330: * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software ds@1330: * by the Valve Corporation. You must obey the GNU General Public License in ds@1330: * all respects for all other code used. Additionally, AlliedModders LLC grants ds@1330: * this exception to all derivative works. AlliedModders LLC defines further ds@1330: * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), ds@1330: * or . dvander@370: * dvander@370: * Version: $Id$ dvander@370: */ dvander@370: dvander@223: #ifndef _INCLUDE_SOURCEMOD_SERVERCOMMANDS_H_ dvander@223: #define _INCLUDE_SOURCEMOD_SERVERCOMMANDS_H_ dvander@223: dvander@223: #include "sourcemod.h" dvander@308: #include dvander@223: #include "PluginSys.h" faluco@216: #include "sourcemm_api.h" dvander@308: #include dvander@308: #include dvander@1547: #include dvander@308: #include "sm_trie.h" faluco@216: faluco@216: using namespace SourceMod; dvander@308: using namespace SourceHook; faluco@216: dvander@308: struct ConsoleEntry faluco@216: { dvander@308: String command; dvander@308: String description; dvander@223: }; dvander@223: dvander@308: class RootConsoleMenu : dvander@308: public IConCommandBaseAccessor, dvander@308: public SMGlobalClass, dvander@308: public IRootConsoleCommand, dvander@308: public IRootConsole dvander@308: { dvander@308: public: dvander@308: RootConsoleMenu(); dvander@308: ~RootConsoleMenu(); dvander@308: public: //IConCommandBaseAccessor dvander@308: bool RegisterConCommandBase(ConCommandBase *pCommand); dvander@308: public: //SMGlobalClass dvander@308: void OnSourceModStartup(bool late); dvander@1770: void OnSourceModAllInitialized(); dvander@308: void OnSourceModShutdown(); dvander@308: public: //IRootConsoleCommand faluco@1541: void OnRootConsoleCommand(const char *cmdname, const CCommand &command); dvander@308: public: //IRootConsole dvander@308: bool AddRootConsoleCommand(const char *cmd, const char *text, IRootConsoleCommand *pHandler); dvander@308: bool RemoveRootConsoleCommand(const char *cmd, IRootConsoleCommand *pHandler); dvander@308: void ConsolePrint(const char *fmt, ...); dvander@309: void DrawGenericOption(const char *cmd, const char *text); dvander@308: public: faluco@1541: void GotRootCmd(const CCommand &cmd); dvander@308: private: dvander@978: bool m_CfgExecDone; dvander@308: Trie *m_pCommands; dvander@308: List m_Menu; dvander@308: }; dvander@308: dvander@308: extern RootConsoleMenu g_RootMenu; dvander@308: dvander@223: #endif //_INCLUDE_SOURCEMOD_SERVERCOMMANDS_H_