(kill_cmd): Add authority check for deities before allowing a kill.

Closes #1215088.  Add banned host check before allowing a kill.
This commit is contained in:
Ron Koenderink 2005-11-21 18:35:08 +00:00
parent 779a41c71b
commit 71641cf712

View file

@ -316,11 +316,24 @@ static int
kill_cmd(void) kill_cmd(void)
{ {
struct player *other; struct player *other;
struct natstr *np;
if (player->cnum == 255 || !player->validated) { if (player->cnum == 255 || !player->validated) {
pr_id(player, C_CMDERR, "need country and password\n"); pr_id(player, C_CMDERR, "need country and password\n");
return RET_FAIL; return RET_FAIL;
} }
if (match_user(banfil, player)) {
logerror("Attempted login by BANNED host %s", praddr(player));
pr_id(player, C_EXIT, "Your login has been banned from this game\n");
io_shutdown(player->iop, IO_READ);
return RET_FAIL;
}
np = getnatp(player->cnum);
if (np->nat_stat & STAT_GOD && !match_user(authfil, player)) {
logerror("NON-AUTHed Login attempted by %s", praddr(player));
pr_id(player, C_EXIT, "You're not a deity!\n");
return RET_FAIL;
}
other = getplayer(player->cnum); other = getplayer(player->cnum);
if (!other) { if (!other) {
pr_id(player, C_EXIT, "country not in use\n"); pr_id(player, C_EXIT, "country not in use\n");