]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - include/ctables.h
erm, why are we doing this twice?
[user/henk/code/inspircd.git] / include / ctables.h
index c0c094e6f5562dc33c4450fd929fa7480123a2b1..9b433d6f94630e1ce2ca9a65d3d23dff1d2466e8 100644 (file)
@@ -85,16 +85,9 @@ struct RouteDescriptor
 /** A structure that defines a command. Every command available
  * in InspIRCd must be defined as derived from Command.
  */
-class CoreExport Command : public Extensible
+class CoreExport Command : public ServiceProvider
 {
  public:
-       /** Command name
-       */
-       std::string command;
-
-       /** Creator module - never NULL */
-       Module* const creator;
-
        /** User flags needed to execute the command or 0
         */
        char flags_needed;
@@ -151,7 +144,7 @@ class CoreExport Command : public Extensible
         * NICK, optionally PASS, and been resolved).
         */
        Command(Module* me, const std::string &cmd, int minpara = 0, int maxpara = 0) :
-               command(cmd), creator(me), flags_needed(0), min_params(minpara), max_params(maxpara),
+               ServiceProvider(me, cmd, SERVICE_COMMAND), flags_needed(0), min_params(minpara), max_params(maxpara),
                use_count(0), total_bytes(0), disabled(false), works_before_reg(false), Penalty(1)
        {
        }
@@ -211,14 +204,19 @@ class CoreExport Command : public Extensible
                return works_before_reg;
        }
 
-       virtual ~Command()
-       {
-       }
+       virtual ~Command();
 };
 
-/** A hash of commands used by the core
- */
-typedef nspace::hash_map<std::string,Command*> Commandtable;
+class CoreExport SplitCommand : public Command
+{
+ public:
+       SplitCommand(Module* me, const std::string &cmd, int minpara = 0, int maxpara = 0)
+               : Command(me, cmd, minpara, maxpara) {}
+       virtual CmdResult Handle(const std::vector<std::string>& parameters, User* user);
+       virtual CmdResult HandleLocal(const std::vector<std::string>& parameters, LocalUser* user);
+       virtual CmdResult HandleRemote(const std::vector<std::string>& parameters, RemoteUser* user);
+       virtual CmdResult HandleServer(const std::vector<std::string>& parameters, FakeUser* user);
+};
 
 /** Shortcut macros for defining translation lists
  */