]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/commands/cmd_kill.cpp
Remove InspIRCd* parameters and fields
[user/henk/code/inspircd.git] / src / commands / cmd_kill.cpp
index 2f1a4783e4c6e02a0b71f6f447bc1c567e17db02..88db2764de5c17e0d07662df45621e967dcccff2 100644 (file)
  */
 
 #include "inspircd.h"
-#include "commands/cmd_kill.h"
 
-extern "C" DllExport Command* init_command(InspIRCd* Instance)
+/** Handle /KILL. These command handlers can be reloaded by the core,
+ * and handle basic RFC1459 commands. Commands within modules work
+ * the same way, however, they can be fully unloaded, where these
+ * may not.
+ */
+class CommandKill : public Command
 {
-       return new CommandKill(Instance);
-}
+ public:
+       /** Constructor for kill.
+        */
+       CommandKill ( Module* parent) : Command(parent,"KILL",2,2) { flags_needed = 'o'; syntax = "<nickname> <reason>"; }
+       /** Handle command.
+        * @param parameters The parameters to the comamnd
+        * @param pcnt The number of parameters passed to teh command
+        * @param user The user issuing the command
+        * @return A value from CmdResult to indicate command success or failure.
+        */
+       CmdResult Handle(const std::vector<std::string>& parameters, User *user);
+};
 
 /** Handle /KILL
  */
@@ -46,7 +60,7 @@ CmdResult CommandKill::Handle (const std::vector<std::string>& parameters, User
                         * Moved this event inside the IS_LOCAL check also, we don't want half the network killing a user
                         * and the other half not. This would be a bad thing. ;p -- w00t
                         */
-                       FIRST_MOD_RESULT(ServerInstance, OnKill, MOD_RESULT, (user, u, parameters[1]));
+                       FIRST_MOD_RESULT(OnKill, MOD_RESULT, (user, u, parameters[1]));
 
                        if (MOD_RESULT == MOD_RES_DENY)
                                return CMD_FAILURE;
@@ -113,3 +127,5 @@ CmdResult CommandKill::Handle (const std::vector<std::string>& parameters, User
        return CMD_SUCCESS;
 }
 
+
+COMMAND_INIT(CommandKill)