core/sm_srvcmds.h
author David Anderson <dvander@alliedmods.net>
Sun Jul 29 02:44:37 2007 +0000 (2007-07-29)
changeset 1209 abcf0a55a177
parent 978 54782a83a1ef
child 1231 17badaf66ce4
permissions -rw-r--r--
fixed linux build for mysql
     1 /**
     2  * vim: set ts=4 :
     3  * ===============================================================
     4  * SourceMod (C)2004-2007 AlliedModders LLC.  All rights reserved.
     5  * ===============================================================
     6  *
     7  * This file is not open source and may not be copied without explicit
     8  * written permission of AlliedModders LLC.  This file may not be redistributed 
     9  * in whole or significant part.
    10  * For information, see LICENSE.txt or http://www.sourcemod.net/license.php
    11  *
    12  * Version: $Id$
    13  */
    14 
    15 #ifndef _INCLUDE_SOURCEMOD_SERVERCOMMANDS_H_
    16 #define _INCLUDE_SOURCEMOD_SERVERCOMMANDS_H_
    17 
    18 #include "sourcemod.h"
    19 #include <IRootConsoleMenu.h>
    20 #include "PluginSys.h"
    21 #include "sourcemm_api.h"
    22 #include <sh_list.h>
    23 #include <sh_string.h>
    24 #include "sm_trie.h"
    25 
    26 using namespace SourceMod;
    27 using namespace SourceHook;
    28 
    29 struct ConsoleEntry
    30 {
    31 	String command;
    32 	String description;
    33 };
    34 
    35 class RootConsoleMenu : 
    36 	public IConCommandBaseAccessor,
    37 	public SMGlobalClass,
    38 	public IRootConsoleCommand,
    39 	public IRootConsole
    40 {
    41 public:
    42 	RootConsoleMenu();
    43 	~RootConsoleMenu();
    44 public: //IConCommandBaseAccessor
    45 	bool RegisterConCommandBase(ConCommandBase *pCommand);
    46 public: //SMGlobalClass
    47 	void OnSourceModStartup(bool late);
    48 	void OnSourceModShutdown();
    49 public: //IRootConsoleCommand
    50 	void OnRootConsoleCommand(const char *cmd, unsigned int argcount);
    51 public: //IRootConsole
    52 	bool AddRootConsoleCommand(const char *cmd, const char *text, IRootConsoleCommand *pHandler);
    53 	bool RemoveRootConsoleCommand(const char *cmd, IRootConsoleCommand *pHandler);
    54 	void ConsolePrint(const char *fmt, ...);
    55 	const char *GetArgument(unsigned int argno);
    56 	unsigned int GetArgumentCount();
    57 	const char *GetArguments();
    58 	void DrawGenericOption(const char *cmd, const char *text);
    59 public:
    60 	void GotRootCmd();
    61 private:
    62 	bool m_CfgExecDone;
    63 	Trie *m_pCommands;
    64 	List<ConsoleEntry *> m_Menu;
    65 };
    66 
    67 extern RootConsoleMenu g_RootMenu;
    68 
    69 #endif //_INCLUDE_SOURCEMOD_SERVERCOMMANDS_H_