#include "users.h"
#include "commands.h"
#include "helperfuncs.h"
-#include "cmd_die.h"
+#include "commands/cmd_die.h"
-extern ServerConfig* Config;
+extern InspIRCd* ServerInstance;
extern std::vector<userrec*> all_opers;
-void cmd_die::Handle (char **parameters, int pcnt, userrec *user)
+void cmd_die::Handle (const char** parameters, int pcnt, userrec *user)
{
- if (!strcmp(parameters[0],Config->diepass))
+ if (!strcmp(parameters[0],ServerInstance->Config->diepass))
{
- log(SPARSE, "/DIE command from %s!%s@%s, terminating in %d seconds...", user->nick, user->ident, user->host, Config->DieDelay);
+ log(SPARSE, "/DIE command from %s!%s@%s, terminating in %d seconds...", user->nick, user->ident, user->host, ServerInstance->Config->DieDelay);
/* This would just be WriteOpers(), but as we just sleep() and then die then the write buffers never get flushed.
* so we iterate the oper list, writing the message and immediately trying to flush their write buffer.
{
userrec* a = *i;
- if (IS_LOCAL(a) && (a->modebits & UM_SERVERNOTICE))
+ if (IS_LOCAL(a) && (a->modes[UM_SERVERNOTICE]))
{
- WriteServ(a->fd, "NOTICE %s :*** DIE command from %s!%s@%s, terminating...", a->nick, a->nick, a->ident, a->host);
+ a->WriteServ("NOTICE %s :*** DIE command from %s!%s@%s, terminating...", a->nick, a->nick, a->ident, a->host);
a->FlushWriteBuf();
}
}
- sleep(Config->DieDelay);
+ sleep(ServerInstance->Config->DieDelay);
Exit(ERROR);
}
else