From dce58b1611e275118d418bfb3b4402bd14d279dd Mon Sep 17 00:00:00 2001 From: danieldg Date: Mon, 18 Jan 2010 23:49:23 +0000 Subject: Move lots of spanningtree items to commands git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12296 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_spanningtree/main.cpp | 43 ++++++++++++++++++++++++------------- 1 file changed, 28 insertions(+), 15 deletions(-) (limited to 'src/modules/m_spanningtree/main.cpp') diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp index 18f399bbf..7ac67221b 100644 --- a/src/modules/m_spanningtree/main.cpp +++ b/src/modules/m_spanningtree/main.cpp @@ -30,17 +30,34 @@ ModuleSpanningTree::ModuleSpanningTree() { Utils = new SpanningTreeUtilities(this); - command_rconnect = new CommandRConnect(this, Utils); - command_rsquit = new CommandRSQuit(this, Utils); - command_svsjoin = new CommandSVSJoin(this); - command_svspart = new CommandSVSPart(this); - command_svsnick = new CommandSVSNick(this); + commands = new SpanningTreeCommands(this); +} + +SpanningTreeCommands::SpanningTreeCommands(ModuleSpanningTree* module) + : rconnect(module, module->Utils), rsquit(module, module->Utils), + svsjoin(module), svspart(module), svsnick(module), metadata(module), + uid(module), opertype(module), fjoin(module), fmode(module), ftopic(module), + fhost(module), fident(module), fname(module) +{ +} + +void ModuleSpanningTree::init() +{ RefreshTimer = new CacheRefreshTimer(Utils); - ServerInstance->AddCommand(command_rconnect); - ServerInstance->AddCommand(command_rsquit); - ServerInstance->AddCommand(command_svsjoin); - ServerInstance->AddCommand(command_svspart); - ServerInstance->AddCommand(command_svsnick); + ServerInstance->Modules->AddService(commands->rconnect); + ServerInstance->Modules->AddService(commands->rsquit); + ServerInstance->Modules->AddService(commands->svsjoin); + ServerInstance->Modules->AddService(commands->svspart); + ServerInstance->Modules->AddService(commands->svsnick); + ServerInstance->Modules->AddService(commands->metadata); + ServerInstance->Modules->AddService(commands->uid); + ServerInstance->Modules->AddService(commands->opertype); + ServerInstance->Modules->AddService(commands->fjoin); + ServerInstance->Modules->AddService(commands->fmode); + ServerInstance->Modules->AddService(commands->ftopic); + ServerInstance->Modules->AddService(commands->fhost); + ServerInstance->Modules->AddService(commands->fident); + ServerInstance->Modules->AddService(commands->fname); ServerInstance->Timers->AddTimer(RefreshTimer); Implementation eventlist[] = @@ -898,11 +915,7 @@ ModuleSpanningTree::~ModuleSpanningTree() /* This will also free the listeners */ delete Utils; - delete command_rconnect; - delete command_rsquit; - delete command_svsjoin; - delete command_svspart; - delete command_svsnick; + delete commands; } Version ModuleSpanningTree::GetVersion() -- cgit v1.3.1-10-gc9f91