From f858164deed48f2dcacd5ffc06a55398a54da7e8 Mon Sep 17 00:00:00 2001 From: Adam Date: Thu, 14 Jul 2011 02:31:12 -0400 Subject: Rewrote how commands are handled within Anope. This allows naming commands and having spaces within command names. --- src/modules.cpp | 43 ------------------------------------------- 1 file changed, 43 deletions(-) (limited to 'src/modules.cpp') diff --git a/src/modules.cpp b/src/modules.cpp index c379a66dd..241054715 100644 --- a/src/modules.cpp +++ b/src/modules.cpp @@ -65,49 +65,6 @@ std::vector Anope::FindMessage(const Anope::string &name) return messages; } -/******************************************************************************* - * Command Functions - *******************************************************************************/ - -int Module::AddCommand(BotInfo *bi, Command *c) -{ - if (!bi || !c) - return MOD_ERR_PARAMS; - - c->module = this; - c->service = bi; - - std::pair it = bi->Commands.insert(std::make_pair(c->name, c)); - - if (it.second != true) - { - Log() << "Error creating command " << c->name << ". Command already exists!"; - return MOD_ERR_EXISTS; - } - - return MOD_ERR_OK; -} - -/** - * Delete a command from the service given. - * @param cmdTable the cmdTable for the services to remove the command from - * @param name the name of the command to delete from the service - * @return returns MOD_ERR_OK on success - */ -int Module::DelCommand(BotInfo *bi, Command *c) -{ - if (!bi || !c) - return MOD_ERR_PARAMS; - - if (!bi->Commands.erase(c->name)) - return MOD_ERR_NOEXIST; - - c->module = NULL; - c->service = NULL; - - return MOD_ERR_OK; -} - Service::Service(Module *o, const Anope::string &n) : owner(o), name(n) { } -- cgit