added amb1447 - IRootConsoleMenu exposure

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401889
This commit is contained in:
David Anderson 2008-02-22 16:07:27 +00:00
parent d2740940fc
commit 67442ac4a0
3 changed files with 21 additions and 6 deletions

View File

@ -35,6 +35,7 @@
#include "HandleSys.h"
#include "CoreConfig.h"
#include "ConVarManager.h"
#include "ShareSys.h"
RootConsoleMenu g_RootMenu;
@ -82,6 +83,7 @@ void RootConsoleMenu::OnSourceModStartup(bool late)
void RootConsoleMenu::OnSourceModAllInitialized()
{
g_ConVarManager.AddConVarChangeListener("hostname", &s_HostnameChangeDetector);
g_ShareSys.AddInterface(NULL, this);
}
void RootConsoleMenu::OnSourceModShutdown()
@ -215,6 +217,16 @@ void RootConsoleMenu::DrawGenericOption(const char *cmd, const char *text)
}
}
const char *RootConsoleMenu::GetInterfaceName()
{
return SMINTERFACE_ROOTCONSOLE_NAME;
}
unsigned int RootConsoleMenu::GetInterfaceVersion()
{
return SMINTERFACE_ROOTCONSOLE_VERSION;
}
extern void _IntExt_EnableYams();
void RootConsoleMenu::GotRootCmd(const CCommand &cmd)

View File

@ -59,6 +59,9 @@ class RootConsoleMenu :
public:
RootConsoleMenu();
~RootConsoleMenu();
public:
const char *GetInterfaceName();
unsigned int GetInterfaceVersion();
public: //IConCommandBaseAccessor
bool RegisterConCommandBase(ConCommandBase *pCommand);
public: //SMGlobalClass

View File

@ -36,13 +36,13 @@
* @file IRootConsoleMenu.h
* @brief Defines the interface for adding options to the "sm" console command.
*
* This interface is not yet exported. It will be eventually. The initial reason should
* be obvious: we do not want users actually touching it. If we exposed this, every little
* plugin would be dropping down a silly set of user commands, and exploiting/cluttering the menu.
* Since this menu is explicitly provided for stuff that only Core itself is capable of managing,
* we won't expose it until a legitimate reason comes up.
* You must be using the compat_wrappers.h header file to use this on
* Original/Episode1 builds.
*/
#define SMINTERFACE_ROOTCONSOLE_NAME "IRootConsole"
#define SMINTERFACE_ROOTCONSOLE_VERSION 1
class CCommand;
namespace SourceMod
@ -59,7 +59,7 @@ namespace SourceMod
/**
* @brief Manages the root console menu - the "sm" command for servers.
*/
class IRootConsole
class IRootConsole : public SMInterface
{
public:
/**