From 42de16029da37f08ce1827352aa78b4b29d888cb Mon Sep 17 00:00:00 2001 From: Attila Molnar Date: Mon, 23 Nov 2015 12:50:35 +0100 Subject: Implement Command::RegisterService() --- src/command_parse.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/command_parse.cpp') 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()) -- cgit v1.2.3