Indented with src/scripts/indent-emp.

This commit is contained in:
Markus Armbruster 2003-09-02 20:48:48 +00:00
parent 5f263a7753
commit 9b7adfbecc
437 changed files with 52211 additions and 51052 deletions

View file

@ -44,57 +44,60 @@ extern void shutdown_sequence();
int
shut(void)
{
extern int update_pending;
extern int shutdown_pending;
int shutdown_minutes;
int shutdown_was_pending;
s_char buf[100];
s_char newbuf[100];
struct natstr *us;
s_char *p;
if (update_pending) {
pr("Update is pending\n");
return RET_FAIL;
}
shutdown_minutes = onearg(player->argp[1], "Time until shutdown in minutes (0 to abort shutdown sequence)? ");
if (shutdown_minutes < 0)
return RET_SYN;
if (!updates_disabled())
if (!(p=getstarg(player->argp[3],"Disable update [y]? ",buf))||
*p != 'n')
disa();
extern int update_pending;
extern int shutdown_pending;
int shutdown_minutes;
int shutdown_was_pending;
s_char buf[100];
s_char newbuf[100];
struct natstr *us;
s_char *p;
shutdown_was_pending = shutdown_pending;
shutdown_pending = shutdown_minutes + !!shutdown_minutes;
buf[0] = '\0';
if (shutdown_was_pending) {
if (shutdown_minutes) {
sprintf(buf, "The shutdown time has been changed to %d minutes", shutdown_minutes);
} else {
sprintf(buf, "The server shutdown has been cancelled");
}
} else if (shutdown_minutes) {
pr("Shutdown sequence begun.\n");
logerror("Shutdown sequence begun");
empth_create(PP_SHUTDOWN, shutdown_sequence, (50*1024),
0, "shutdownSeq",
"Counts down server shutdown", 0);
}
us = getnatp(player->cnum);
if (buf[0]) {
sprintf(newbuf, ": %s!", buf);
sendmessage(us, 0, newbuf, 1);
pr("%s.\n", buf);
logerror(buf);
}
if (update_pending) {
pr("Update is pending\n");
return RET_FAIL;
}
shutdown_minutes =
onearg(player->argp[1],
"Time until shutdown in minutes (0 to abort shutdown sequence)? ");
if (shutdown_minutes < 0)
return RET_SYN;
if (!updates_disabled())
if (!(p = getstarg(player->argp[3], "Disable update [y]? ", buf))
|| *p != 'n')
disa();
shutdown_was_pending = shutdown_pending;
shutdown_pending = shutdown_minutes + !!shutdown_minutes;
buf[0] = '\0';
if (shutdown_was_pending) {
if (shutdown_minutes) {
sprintf(buf, "The server will shut down in %d minutes", shutdown_minutes);
sprintf(newbuf, ": %s!", buf);
sendmessage(us, 0, newbuf, 1);
pr("%s.\n", buf);
logerror(buf);
sprintf(buf,
"The shutdown time has been changed to %d minutes",
shutdown_minutes);
} else {
sprintf(buf, "The server shutdown has been cancelled");
}
return RET_OK;
} else if (shutdown_minutes) {
pr("Shutdown sequence begun.\n");
logerror("Shutdown sequence begun");
empth_create(PP_SHUTDOWN, shutdown_sequence, (50 * 1024),
0, "shutdownSeq", "Counts down server shutdown", 0);
}
us = getnatp(player->cnum);
if (buf[0]) {
sprintf(newbuf, ": %s!", buf);
sendmessage(us, 0, newbuf, 1);
pr("%s.\n", buf);
logerror(buf);
}
if (shutdown_minutes) {
sprintf(buf, "The server will shut down in %d minutes",
shutdown_minutes);
sprintf(newbuf, ": %s!", buf);
sendmessage(us, 0, newbuf, 1);
pr("%s.\n", buf);
logerror(buf);
}
return RET_OK;
}