Clean up how quit and server shutdown trigger connection close

Simply set the player connection's EOF indicator.  Cleaner than
setting player->state to PS_SHUTDOWN from random places.

Move the assignment of PS_PLAYING from player_main() to its caller
play_cmd(), so that player->state is exclusively controlled in
login.c.
This commit is contained in:
Markus Armbruster 2012-01-29 10:44:28 +01:00
parent 0a7306a5ac
commit 8549efbc19
3 changed files with 7 additions and 7 deletions

View file

@ -419,9 +419,9 @@ shutdwn(int sig)
if (p->state != PS_PLAYING)
continue;
pr_flash(p, "Server shutting down...\n");
p->state = PS_SHUTDOWN;
io_set_eof(p->iop);
p->aborted = 1;
p->may_sleep = PLAYER_SLEEP_NEVER;
p->aborted++;
if (p->command) {
pr_flash(p, "Shutdown aborting command\n");
}