diff options
author | Attila Molnar <attilamolnar@hush.com> | 2016-03-29 12:29:38 +0200 |
---|---|---|
committer | Attila Molnar <attilamolnar@hush.com> | 2016-03-29 12:29:38 +0200 |
commit | f74734e41694e4ff7c8164858864030521279eb4 (patch) | |
tree | aa3dd1f52b78b15196cb7cffb0c4c911b78b78cb | |
parent | 8d716c51554b19d112b22ad84a97f6e2233eedaa (diff) |
core_info Add class ServerTargetCommand
-rw-r--r-- | src/coremods/core_info/core_info.cpp | 7 | ||||
-rw-r--r-- | src/coremods/core_info/core_info.h | 13 |
2 files changed, 20 insertions, 0 deletions
diff --git a/src/coremods/core_info/core_info.cpp b/src/coremods/core_info/core_info.cpp index 56c3c956d..37fbed273 100644 --- a/src/coremods/core_info/core_info.cpp +++ b/src/coremods/core_info/core_info.cpp @@ -20,6 +20,13 @@ #include "inspircd.h" #include "core_info.h" +RouteDescriptor ServerTargetCommand::GetRouting(User* user, const std::vector<std::string>& parameters) +{ + if (!parameters.empty()) + return ROUTE_UNICAST(parameters[0]); + return ROUTE_LOCALONLY; +} + class CoreModInfo : public Module { CommandAdmin cmdadmin; diff --git a/src/coremods/core_info/core_info.h b/src/coremods/core_info/core_info.h index f5dd9e648..f01daa819 100644 --- a/src/coremods/core_info/core_info.h +++ b/src/coremods/core_info/core_info.h @@ -21,6 +21,19 @@ #include "inspircd.h" +/** These commands require no parameters, but if there is a parameter it is a server name where the command will be routed to. + */ +class ServerTargetCommand : public Command +{ + public: + ServerTargetCommand(Module* mod, const std::string& Name) + : Command(mod, Name) + { + } + + RouteDescriptor GetRouting(User* user, const std::vector<std::string>& parameters); +}; + /** Handle /ADMIN. */ class CommandAdmin : public Command |