diff --git a/core/sm_srvcmds.cpp b/core/sm_srvcmds.cpp index 657a8176..4e374084 100644 --- a/core/sm_srvcmds.cpp +++ b/core/sm_srvcmds.cpp @@ -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) diff --git a/core/sm_srvcmds.h b/core/sm_srvcmds.h index c3950909..5d38d666 100644 --- a/core/sm_srvcmds.h +++ b/core/sm_srvcmds.h @@ -59,6 +59,9 @@ class RootConsoleMenu : public: RootConsoleMenu(); ~RootConsoleMenu(); +public: + const char *GetInterfaceName(); + unsigned int GetInterfaceVersion(); public: //IConCommandBaseAccessor bool RegisterConCommandBase(ConCommandBase *pCommand); public: //SMGlobalClass diff --git a/public/IRootConsoleMenu.h b/public/IRootConsoleMenu.h index 928d8758..dd0da8c9 100644 --- a/public/IRootConsoleMenu.h +++ b/public/IRootConsoleMenu.h @@ -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: /**