|
|||
|
|||
|
#include <cmd_restart.h>
Inheritance diagram for cmd_restart:


Public Member Functions | |
| cmd_restart (InspIRCd *Instance) | |
| Constructor for restart. | |
| CmdResult | Handle (const char **parameters, int pcnt, userrec *user) |
| Handle command. | |
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.
Definition at line 30 of file cmd_restart.h.
|
|
Constructor for restart.
Definition at line 35 of file cmd_restart.h. References command_t::syntax.
|
|
||||||||||||||||
|
Handle command.
Implements command_t. Definition at line 24 of file cmd_restart.cpp. References CMD_FAILURE, CMD_SUCCESS, InspIRCd::Config, DEFAULT, connection::host, userrec::ident, InspIRCd::Log(), userrec::nick, InspIRCd::Restart(), ServerConfig::restartpass, command_t::ServerInstance, and InspIRCd::WriteOpers(). 00025 { 00026 ServerInstance->Log(DEFAULT,"Restart: %s",user->nick); 00027 if (!strcmp(parameters[0],ServerInstance->Config->restartpass)) 00028 { 00029 ServerInstance->WriteOpers("*** RESTART command from %s!%s@%s, restarting server.",user->nick,user->ident,user->host); 00030 00031 try 00032 { 00033 ServerInstance->Restart("Server restarting."); 00034 } 00035 catch (...) 00036 { 00037 /* We dont actually get here unless theres some fatal and unrecoverable error. */ 00038 exit(0); 00039 } 00040 } 00041 else 00042 { 00043 ServerInstance->WriteOpers("*** Failed RESTART Command from %s!%s@%s.",user->nick,user->ident,user->host); 00044 return CMD_FAILURE; 00045 } 00046 00047 return CMD_SUCCESS; 00048 }
|