(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:
parent
779a41c71b
commit
71641cf712
1 changed files with 13 additions and 0 deletions
|
@ -316,11 +316,24 @@ static int
|
|||
kill_cmd(void)
|
||||
{
|
||||
struct player *other;
|
||||
struct natstr *np;
|
||||
|
||||
if (player->cnum == 255 || !player->validated) {
|
||||
pr_id(player, C_CMDERR, "need country and password\n");
|
||||
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);
|
||||
if (!other) {
|
||||
pr_id(player, C_EXIT, "country not in use\n");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue