player_login() skips sending C_EXIT and flushing server output when
io_eof() is true. That's the case after a read from the socket
returned zero, which means the client has shut down transmission on
his socket, or closed it. If it's the former, then dropping output
like that is bad. Our client never does that, but others might.
Condition was introduced in Empire 2, don't know why.
}
}
player->state = PS_SHUTDOWN;
- if (!io_eof(player->iop)) {
- pr_id(player, C_EXIT, "so long...\n");
- while (io_output(player->iop, 1) > 0) ;
- }
+ pr_id(player, C_EXIT, "so long...\n");
+ while (io_output(player->iop, 1) > 0) ;
player_delete(player);
empth_exit();
/*NOTREACHED*/
static int
quit_cmd(void)
{
- pr_id(player, C_EXIT, "so long\n");
io_shutdown(player->iop, IO_READ);
return RET_OK;
}