X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fcoremods%2Fcore_oper%2Fcmd_restart.cpp;h=4fad752a221962f083d5d1dea5cff7c0fa589cf4;hb=045747290ba1088daf7f70d5d36d0eb4c8ba2b4e;hp=33627b5405049411f5e44b9262de0b1b48316282;hpb=c67d3103e9f7397f0ab9631bf07a5e5547deb2c3;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/coremods/core_oper/cmd_restart.cpp b/src/coremods/core_oper/cmd_restart.cpp index 33627b540..4fad752a2 100644 --- a/src/coremods/core_oper/cmd_restart.cpp +++ b/src/coremods/core_oper/cmd_restart.cpp @@ -19,27 +19,19 @@ #include "inspircd.h" +#include "core_oper.h" -/** Handle /RESTART - */ -class CommandRestart : public Command +CommandRestart::CommandRestart(Module* parent) + : Command(parent, "RESTART", 1, 1) { - public: - /** Constructor for restart. - */ - CommandRestart(Module* parent) : Command(parent,"RESTART",1,1) { flags_needed = 'o'; syntax = ""; } - /** Handle command. - * @param parameters The parameters to the command - * @param user The user issuing the command - * @return A value from CmdResult to indicate command success or failure. - */ - CmdResult Handle(const std::vector& parameters, User *user); -}; + flags_needed = 'o'; + syntax = ""; +} CmdResult CommandRestart::Handle (const std::vector& parameters, User *user) { ServerInstance->Logs->Log("COMMAND", LOG_DEFAULT, "Restart: %s",user->nick.c_str()); - if (ServerInstance->PassCompare(user, ServerInstance->Config->restartpass, parameters[0], ServerInstance->Config->powerhash)) + if (DieRestart::CheckPass(user, parameters[0], "restartpass")) { ServerInstance->SNO->WriteGlobalSno('a', "RESTART command from %s, restarting server.", user->GetFullRealHost().c_str()); @@ -70,6 +62,3 @@ CmdResult CommandRestart::Handle (const std::vector& parameters, Us } return CMD_FAILURE; } - - -COMMAND_INIT(CommandRestart)