diff options
Diffstat (limited to 'src/commands/cmd_admin.cpp')
-rw-r--r-- | src/commands/cmd_admin.cpp | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/src/commands/cmd_admin.cpp b/src/commands/cmd_admin.cpp index 95170e069..a0d99ea09 100644 --- a/src/commands/cmd_admin.cpp +++ b/src/commands/cmd_admin.cpp @@ -12,13 +12,36 @@ */ #include "inspircd.h" -#include "commands/cmd_admin.h" +#ifndef __CMD_ADMIN_H__ +#define __CMD_ADMIN_H__ -extern "C" DllExport Command* init_command(InspIRCd* Instance) +#include "users.h" +#include "channels.h" + +/** Handle /ADMIN. 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 CommandAdmin : public Command { - return new CommandAdmin(Instance); -} + public: + /** Constructor for admin. + */ + CommandAdmin (InspIRCd* Instance, Module* parent) : Command(Instance,parent,"ADMIN",0,0) { syntax = "[<servername>]"; } + /** 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); +}; + +#endif + + /** Handle /ADMIN */ @@ -31,3 +54,5 @@ CmdResult CommandAdmin::Handle (const std::vector<std::string>& parameters, User user->WriteNumeric(RPL_ADMINEMAIL, "%s :E-Mail - %s",user->nick.c_str(),ServerInstance->Config->AdminEmail); return CMD_SUCCESS; } + +COMMAND_INIT(CommandAdmin) |