summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/coremods/core_info/core_info.cpp7
-rw-r--r--src/coremods/core_info/core_info.h13
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