m_spanningtree Implement ServerCommand::RegisterService()

This commit is contained in:
Attila Molnar 2015-12-06 12:16:37 +01:00
parent 7343ac33fb
commit d1bb97f3fb
2 changed files with 9 additions and 2 deletions

View File

@ -24,8 +24,11 @@
ServerCommand::ServerCommand(Module* Creator, const std::string& Name, unsigned int MinParams, unsigned int MaxParams)
: CommandBase(Creator, Name, MinParams, MaxParams)
{
this->ServiceProvider::DisableAutoRegister();
ModuleSpanningTree* st = static_cast<ModuleSpanningTree*>(Creator);
}
void ServerCommand::RegisterService()
{
ModuleSpanningTree* st = static_cast<ModuleSpanningTree*>(static_cast<Module*>(creator));
st->CmdManager.AddCommand(this);
}

View File

@ -38,6 +38,10 @@ class ServerCommand : public CommandBase
public:
ServerCommand(Module* Creator, const std::string& Name, unsigned int MinPara = 0, unsigned int MaxPara = 0);
/** Register this object in the ServerCommandManager
*/
void RegisterService() CXX11_OVERRIDE;
virtual CmdResult Handle(User* user, std::vector<std::string>& parameters) = 0;
virtual RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters);