mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-11-10 07:12:03 +00:00
Complete BANFORMAT header implementation.
* Warn the user when an incompatible ban.txt is being loaded, and stop early. * Don't inexplicably assign as a boolean, you bafooligan!
This commit is contained in:
parent
3ff5e3f8cd
commit
7c92a7efbb
1 changed files with 13 additions and 1 deletions
|
@ -2789,7 +2789,7 @@ void D_LoadBan(boolean warning)
|
|||
char *username, *reason;
|
||||
time_t unbanTime = NO_BAN_TIME;
|
||||
char buffer[MAX_WADPATH];
|
||||
boolean banmode = 0;
|
||||
UINT8 banmode = 0;
|
||||
|
||||
if (!I_ClearBans)
|
||||
return;
|
||||
|
@ -2816,6 +2816,18 @@ void D_LoadBan(boolean warning)
|
|||
if (i == 0 && !strncmp(address, "BANFORMAT", 9))
|
||||
{
|
||||
banmode = atoi(mask);
|
||||
switch (banmode)
|
||||
{
|
||||
case BANFORMAT: // currently supported format
|
||||
//case 0: -- permitted only when BANFORMAT string not present
|
||||
break;
|
||||
default:
|
||||
{
|
||||
fclose(f);
|
||||
CONS_Alert(CONS_WARNING, "Could not load unknown ban.txt for ban list (BANFORMAT %d, expected %d)\n", banmode, BANFORMAT);
|
||||
return;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue