+ /** Handle the command from a user.
+ * @param user The user who issued the command.
+ * @param parameters The parameters for the command.
+ * @return Returns CMD_FAILURE on failure, CMD_SUCCESS on success, or CMD_INVALID
+ * if the command was malformed.
+ */
+ virtual CmdResult Handle(User* user, const Params& parameters) = 0;
+
+ /** Registers this command with the command parser. */
+ void RegisterService() CXX11_OVERRIDE;
+
+ /** Tells the user they did not specify enough parameters.
+ * @param user The user who issued the command.
+ * @param parameters The parameters for the command.
+ */
+ virtual void TellNotEnoughParameters(LocalUser* user, const Params& parameters);
+
+ /** Tells the user they need to be registered to execute this command.
+ * @param user The user who issued the command.
+ * @param parameters The parameters for the command.
+ */
+ virtual void TellNotRegistered(LocalUser* user, const Params& parameters);
+};
+
+class CoreExport SplitCommand : public Command
+{
+protected:
+ /** Initializes a new instance of the SplitCommand class.
+ * @param me The module which created this instance.
+ * @param cmd The name of the command.
+ * @param minpara The minimum number of parameters that the command accepts.
+ * @param maxpara The maximum number of parameters that the command accepts.
+ */
+ SplitCommand(Module* me, const std::string& cmd, unsigned int minpara = 0, unsigned int maxpara = 0);
+
+ public:
+ /** @copydoc Command::Handle */
+ CmdResult Handle(User* user, const Params& parameters) CXX11_OVERRIDE;
+
+ /** Handle the command from a local user.
+ * @param user The user who issued the command.
+ * @param parameters The parameters for the command.
+ * @return Returns CMD_FAILURE on failure, CMD_SUCCESS on success, or CMD_INVALID
+ * if the command was malformed.
+ */
+ virtual CmdResult HandleLocal(LocalUser* user, const Params& parameters);
+
+ /** Handle the command from a remote user.
+ * @param user The user who issued the command.
+ * @param parameters The parameters for the command.
+ * @return Returns CMD_FAILURE on failure, CMD_SUCCESS on success, or CMD_INVALID
+ * if the command was malformed.
+ */
+ virtual CmdResult HandleRemote(RemoteUser* user, const Params& parameters);
+
+ /** Handle the command from a server user.
+ * @param user The user who issued the command.
+ * @param parameters The parameters for the command.
+ * @return Returns CMD_FAILURE on failure, CMD_SUCCESS on success, or CMD_INVALID
+ * if the command was malformed.
+ */
+ virtual CmdResult HandleServer(FakeUser* user, const Params& parameters);
+};
+
+/** Shortcut macros for defining translation lists
+ */
+#define TRANSLATE1(x1) translation.push_back(x1);
+#define TRANSLATE2(x1,x2) translation.push_back(x1);translation.push_back(x2);
+#define TRANSLATE3(x1,x2,x3) translation.push_back(x1);translation.push_back(x2);translation.push_back(x3);
+#define TRANSLATE4(x1,x2,x3,x4) translation.push_back(x1);translation.push_back(x2);translation.push_back(x3);translation.push_back(x4);
+#define TRANSLATE5(x1,x2,x3,x4,x5) translation.push_back(x1);translation.push_back(x2);translation.push_back(x3);translation.push_back(x4);\
+ translation.push_back(x5);
+#define TRANSLATE6(x1,x2,x3,x4,x5,x6) translation.push_back(x1);translation.push_back(x2);translation.push_back(x3);translation.push_back(x4);\
+ translation.push_back(x5);translation.push_back(x6);
+#define TRANSLATE7(x1,x2,x3,x4,x5,x6,x7) translation.push_back(x1);translation.push_back(x2);translation.push_back(x3);translation.push_back(x4);\
+ translation.push_back(x5);translation.push_back(x6);translation.push_back(x7);
+#define TRANSLATE8(x1,x2,x3,x4,x5,x6,x7,x8) translation.push_back(x1);translation.push_back(x2);translation.push_back(x3);translation.push_back(x4);\
+ translation.push_back(x5);translation.push_back(x6);translation.push_back(x7);translation.push_back(x8);