summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2015-01-25 13:46:21 +0100
committerAttila Molnar <attilamolnar@hush.com>2015-01-25 13:46:21 +0100
commit1ea821e8c1c7a65f826553bea7d5b7503f04243d (patch)
tree9e2e447007a619185d85050337741a7497635c7b /src
parentbdc70892c647f0d7672aba413100730819a4b217 (diff)
parentb127d368e33aa89ed567c438f905bdf3f263891c (diff)
Merge branch 'master+cmdcleanup'
Diffstat (limited to 'src')
-rw-r--r--src/command_parse.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/command_parse.cpp b/src/command_parse.cpp
index 793569d5b..c93dac65f 100644
--- a/src/command_parse.cpp
+++ b/src/command_parse.cpp
@@ -327,10 +327,38 @@ void CommandParser::RemoveCommand(Command* x)
cmdlist.erase(n);
}
+CommandBase::CommandBase(Module* mod, const std::string& cmd, unsigned int minpara, unsigned int maxpara)
+ : ServiceProvider(mod, cmd, SERVICE_COMMAND)
+ , flags_needed(0)
+ , min_params(minpara)
+ , max_params(maxpara)
+ , use_count(0)
+ , disabled(false)
+ , works_before_reg(false)
+ , allow_empty_last_param(true)
+ , Penalty(1)
+{
+}
+
CommandBase::~CommandBase()
{
}
+void CommandBase::EncodeParameter(std::string& parameter, int index)
+{
+}
+
+RouteDescriptor CommandBase::GetRouting(User* user, const std::vector<std::string>& parameters)
+{
+ return ROUTE_LOCALONLY;
+}
+
+Command::Command(Module* mod, const std::string& cmd, unsigned int minpara, unsigned int maxpara)
+ : CommandBase(mod, cmd, minpara, maxpara)
+ , force_manual_route(false)
+{
+}
+
Command::~Command()
{
ServerInstance->Parser.RemoveCommand(this);