diff options
author | Attila Molnar <attilamolnar@hush.com> | 2015-11-23 12:50:35 +0100 |
---|---|---|
committer | Attila Molnar <attilamolnar@hush.com> | 2015-11-23 12:50:35 +0100 |
commit | 42de16029da37f08ce1827352aa78b4b29d888cb (patch) | |
tree | b8f61d0a518df5d480285d4d6c16250921cdf42e /src/command_parse.cpp | |
parent | 820f229a9efe2678d1e85578aa086a1efdd73a30 (diff) |
Implement Command::RegisterService()
Diffstat (limited to 'src/command_parse.cpp')
-rw-r--r-- | src/command_parse.cpp | 6 |
1 files changed, 6 insertions, 0 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()) |