From f74734e41694e4ff7c8164858864030521279eb4 Mon Sep 17 00:00:00 2001 From: Attila Molnar Date: Tue, 29 Mar 2016 12:29:38 +0200 Subject: [PATCH] core_info Add class ServerTargetCommand --- src/coremods/core_info/core_info.cpp | 7 +++++++ src/coremods/core_info/core_info.h | 13 +++++++++++++ 2 files changed, 20 insertions(+) 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& 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& parameters); +}; + /** Handle /ADMIN. */ class CommandAdmin : public Command -- 2.39.5