Redesigned how server commands work. The "plugins" command will be back soon.
--HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40313
This commit is contained in:
+40
-7
@@ -2,20 +2,53 @@
|
||||
#define _INCLUDE_SOURCEMOD_SERVERCOMMANDS_H_
|
||||
|
||||
#include "sourcemod.h"
|
||||
#include <IRootConsoleMenu.h>
|
||||
#include "PluginSys.h"
|
||||
#include "sourcemm_api.h"
|
||||
#include <convar.h>
|
||||
#include <sh_list.h>
|
||||
#include <sh_string.h>
|
||||
#include "sm_trie.h"
|
||||
|
||||
using namespace SourceMod;
|
||||
using namespace SourceHook;
|
||||
|
||||
class ConVarAccessor :
|
||||
public IConCommandBaseAccessor,
|
||||
public SMGlobalClass
|
||||
struct ConsoleEntry
|
||||
{
|
||||
public: // IConCommandBaseAccessor
|
||||
virtual bool RegisterConCommandBase(ConCommandBase *pCommand);
|
||||
public: // SMGlobalClass
|
||||
virtual void OnSourceModStartup(bool late);
|
||||
String command;
|
||||
String description;
|
||||
};
|
||||
|
||||
class RootConsoleMenu :
|
||||
public IConCommandBaseAccessor,
|
||||
public SMGlobalClass,
|
||||
public IRootConsoleCommand,
|
||||
public IRootConsole
|
||||
{
|
||||
public:
|
||||
RootConsoleMenu();
|
||||
~RootConsoleMenu();
|
||||
public: //IConCommandBaseAccessor
|
||||
bool RegisterConCommandBase(ConCommandBase *pCommand);
|
||||
public: //SMGlobalClass
|
||||
void OnSourceModStartup(bool late);
|
||||
void OnSourceModShutdown();
|
||||
public: //IRootConsoleCommand
|
||||
void OnRootConsoleCommand(const char *cmd, unsigned int argcount);
|
||||
public: //IRootConsole
|
||||
bool AddRootConsoleCommand(const char *cmd, const char *text, IRootConsoleCommand *pHandler);
|
||||
bool RemoveRootConsoleCommand(const char *cmd, IRootConsoleCommand *pHandler);
|
||||
void ConsolePrint(const char *fmt, ...);
|
||||
const char *GetArgument(unsigned int argno);
|
||||
unsigned int GetArgumentCount();
|
||||
const char *GetArguments();
|
||||
public:
|
||||
void GotRootCmd();
|
||||
private:
|
||||
Trie *m_pCommands;
|
||||
List<ConsoleEntry *> m_Menu;
|
||||
};
|
||||
|
||||
extern RootConsoleMenu g_RootMenu;
|
||||
|
||||
#endif //_INCLUDE_SOURCEMOD_SERVERCOMMANDS_H_
|
||||
|
||||
Reference in New Issue
Block a user