core/sm_srvcmds.h
author Scott Ehlert <ds@alliedmods.net>
Wed Aug 15 06:19:30 2007 +0000 (2007-08-15)
changeset 1330 ab94316bb52b
parent 1231 17badaf66ce4
child 1541 e46ad208b9b4
permissions -rw-r--r--
Updated license headers on virtually all files with extremely minor changes in the name of some sort of strange consistency.
All plugin and include file headers also have been changed to say about GPL3 instead of GPL2.

(This day shall henceforth be known as the Eighty Column Massacre of '07)
     1 /**
     2  * vim: set ts=4 :
     3  * =============================================================================
     4  * SourceMod
     5  * Copyright (C) 2004-2007 AlliedModders LLC.  All rights reserved.
     6  * =============================================================================
     7  *
     8  * This program is free software; you can redistribute it and/or modify it under
     9  * the terms of the GNU General Public License, version 3.0, as published by the
    10  * Free Software Foundation.
    11  * 
    12  * This program is distributed in the hope that it will be useful, but WITHOUT
    13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
    14  * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
    15  * details.
    16  *
    17  * You should have received a copy of the GNU General Public License along with
    18  * this program.  If not, see <http://www.gnu.org/licenses/>.
    19  *
    20  * As a special exception, AlliedModders LLC gives you permission to link the
    21  * code of this program (as well as its derivative works) to "Half-Life 2," the
    22  * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
    23  * by the Valve Corporation.  You must obey the GNU General Public License in
    24  * all respects for all other code used.  Additionally, AlliedModders LLC grants
    25  * this exception to all derivative works.  AlliedModders LLC defines further
    26  * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
    27  * or <http://www.sourcemod.net/license.php>.
    28  *
    29  * Version: $Id$
    30  */
    31 
    32 #ifndef _INCLUDE_SOURCEMOD_SERVERCOMMANDS_H_
    33 #define _INCLUDE_SOURCEMOD_SERVERCOMMANDS_H_
    34 
    35 #include "sourcemod.h"
    36 #include <IRootConsoleMenu.h>
    37 #include "PluginSys.h"
    38 #include "sourcemm_api.h"
    39 #include <sh_list.h>
    40 #include <sh_string.h>
    41 #include "sm_trie.h"
    42 
    43 using namespace SourceMod;
    44 using namespace SourceHook;
    45 
    46 struct ConsoleEntry
    47 {
    48 	String command;
    49 	String description;
    50 };
    51 
    52 class RootConsoleMenu : 
    53 	public IConCommandBaseAccessor,
    54 	public SMGlobalClass,
    55 	public IRootConsoleCommand,
    56 	public IRootConsole
    57 {
    58 public:
    59 	RootConsoleMenu();
    60 	~RootConsoleMenu();
    61 public: //IConCommandBaseAccessor
    62 	bool RegisterConCommandBase(ConCommandBase *pCommand);
    63 public: //SMGlobalClass
    64 	void OnSourceModStartup(bool late);
    65 	void OnSourceModShutdown();
    66 public: //IRootConsoleCommand
    67 	void OnRootConsoleCommand(const char *cmd, unsigned int argcount);
    68 public: //IRootConsole
    69 	bool AddRootConsoleCommand(const char *cmd, const char *text, IRootConsoleCommand *pHandler);
    70 	bool RemoveRootConsoleCommand(const char *cmd, IRootConsoleCommand *pHandler);
    71 	void ConsolePrint(const char *fmt, ...);
    72 	const char *GetArgument(unsigned int argno);
    73 	unsigned int GetArgumentCount();
    74 	const char *GetArguments();
    75 	void DrawGenericOption(const char *cmd, const char *text);
    76 public:
    77 	void GotRootCmd();
    78 private:
    79 	bool m_CfgExecDone;
    80 	Trie *m_pCommands;
    81 	List<ConsoleEntry *> m_Menu;
    82 };
    83 
    84 extern RootConsoleMenu g_RootMenu;
    85 
    86 #endif //_INCLUDE_SOURCEMOD_SERVERCOMMANDS_H_