Skip to content

Commit

Permalink
Split out more commands and removed the duplicated ident.c file.
Browse files Browse the repository at this point in the history
  • Loading branch information
amnuts committed Feb 5, 2016
1 parent a9fc6de commit bd4defd
Show file tree
Hide file tree
Showing 41 changed files with 2,295 additions and 2,552 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.settings
.cproject
.project
src/objects
55 changes: 1 addition & 54 deletions src/admin.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,60 +101,7 @@ talker_shutdown(UR_OBJECT user, const char *str, int sdboot)
}


/*
* Shutdown talker interface func. Countdown time is entered in seconds so
* we can specify less than a minute till reboot.
*/
void
shutdown_com(UR_OBJECT user)
{
if (amsys->rs_which == 1) {
write_user(user,
"The reboot countdown is currently active, you must cancel it first.\n");
return;
}
if (!strcmp(word[1], "cancel")) {
if (!amsys->rs_countdown || amsys->rs_which) {
write_user(user, "The shutdown countdown is not currently active.\n");
return;
}
if (amsys->rs_countdown && !amsys->rs_which && !amsys->rs_user) {
write_user(user,
"Someone else is currently setting the shutdown countdown.\n");
return;
}
write_room(NULL, "~OLSYSTEM:~RS~FG Shutdown cancelled.\n");
write_syslog(SYSLOG, 1, "%s cancelled the shutdown countdown.\n",
user->name);
amsys->rs_countdown = 0;
amsys->rs_announce = 0;
amsys->rs_which = -1;
amsys->rs_user = NULL;
return;
}
if (word_count > 1 && !is_number(word[1])) {
write_user(user, "Usage: shutdown [<secs>|cancel]\n");
return;
}
if (amsys->rs_countdown && !amsys->rs_which) {
write_user(user,
"The shutdown countdown is currently active, you must cancel it first.\n");
return;
}
if (word_count < 2) {
amsys->rs_countdown = 0;
amsys->rs_announce = 0;
amsys->rs_which = -1;
amsys->rs_user = NULL;
} else {
amsys->rs_countdown = atoi(word[1]);
amsys->rs_which = 0;
}
write_user(user,
"\n\07~FR~OL~LI*** WARNING - This will shutdown the talker! ***\n\nAre you sure about this (y|n)? ");
user->misc_op = 1;
no_prompt = 1;
}



/*
Expand Down
Loading

0 comments on commit bd4defd

Please sign in to comment.