summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/command_parse.cpp6
-rw-r--r--src/modules.cpp4
2 files changed, 6 insertions, 4 deletions
diff --git a/src/command_parse.cpp b/src/command_parse.cpp
index 7998d9cc3..c123353b0 100644
--- a/src/command_parse.cpp
+++ b/src/command_parse.cpp
@@ -379,6 +379,12 @@ Command::~Command()
ServerInstance->Parser.RemoveCommand(this);
}
+void Command::RegisterService()
+{
+ if (!ServerInstance->Parser.AddCommand(this))
+ throw ModuleException("Command already exists: " + name);
+}
+
void CommandParser::ProcessBuffer(std::string &buffer,LocalUser *user)
{
if (buffer.empty())
diff --git a/src/modules.cpp b/src/modules.cpp
index 3ff8aad14..d28657ca8 100644
--- a/src/modules.cpp
+++ b/src/modules.cpp
@@ -556,10 +556,6 @@ void ModuleManager::AddService(ServiceProvider& item)
{
switch (item.service)
{
- case SERVICE_COMMAND:
- if (!ServerInstance->Parser.AddCommand(static_cast<Command*>(&item)))
- throw ModuleException("Command "+std::string(item.name)+" already exists.");
- return;
case SERVICE_MODE:
{
ModeHandler* mh = static_cast<ModeHandler*>(&item);