mirror of
https://github.com/rehlds/rehlds.git
synced 2025-01-05 19:45:33 +03:00
Fixed assertion with enabled debug (isctype)
Added bantime in kick reason in banid and addip
This commit is contained in:
parent
6bbce69f04
commit
504a14a010
@ -2101,7 +2101,7 @@ void SV_ReplaceSpecialCharactersInName(char *newname, const char *oldname)
|
|||||||
if (*s == '#' ||
|
if (*s == '#' ||
|
||||||
*s == '%' ||
|
*s == '%' ||
|
||||||
*s == '&' ||
|
*s == '&' ||
|
||||||
(n && newname[n-1] == '+' && (isdigit(*s) || isalpha(*s))))
|
(n && newname[n-1] == '+' && (signed char)*s > 0 && isalnum(*s)))
|
||||||
{
|
{
|
||||||
if (remainChars < 3)
|
if (remainChars < 3)
|
||||||
break;
|
break;
|
||||||
@ -6063,7 +6063,11 @@ void SV_BanId_f(void)
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
SV_ClientPrintf("You have been kicked and banned %s by the server op.\n", szreason);
|
SV_ClientPrintf("You have been kicked and banned %s by the server op.\n", szreason);
|
||||||
|
#ifdef REHLDS_FIXES
|
||||||
|
SV_DropClient(host_client, FALSE, "Kicked and banned %s", szreason);
|
||||||
|
#else // REHLDS_FIXES
|
||||||
SV_DropClient(host_client, FALSE, "Kicked and banned");
|
SV_DropClient(host_client, FALSE, "Kicked and banned");
|
||||||
|
#endif // REHLDS_FIXES
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -6436,6 +6440,14 @@ void SV_AddIP_f(void)
|
|||||||
ipfilters[i].banEndTime = (banTime == 0.0f) ? 0.0f : banTime * 60.0f + realtime;
|
ipfilters[i].banEndTime = (banTime == 0.0f) ? 0.0f : banTime * 60.0f + realtime;
|
||||||
ipfilters[i].mask = tempFilter.mask;
|
ipfilters[i].mask = tempFilter.mask;
|
||||||
|
|
||||||
|
#ifdef REHLDS_FIXES
|
||||||
|
char reason[32];
|
||||||
|
if (banTime == 0.0f)
|
||||||
|
Q_strcpy(reason, "permanently");
|
||||||
|
else
|
||||||
|
Q_sprintf(reason, "for %g minutes", banTime);
|
||||||
|
#endif // REHLDS_FIXES
|
||||||
|
|
||||||
for (int i = 0; i < g_psvs.maxclients; i++)
|
for (int i = 0; i < g_psvs.maxclients; i++)
|
||||||
{
|
{
|
||||||
host_client = &g_psvs.clients[i];
|
host_client = &g_psvs.clients[i];
|
||||||
@ -6445,8 +6457,13 @@ void SV_AddIP_f(void)
|
|||||||
Q_memcpy(&net_from, &host_client->netchan.remote_address, sizeof(net_from));
|
Q_memcpy(&net_from, &host_client->netchan.remote_address, sizeof(net_from));
|
||||||
if (SV_FilterPacket())
|
if (SV_FilterPacket())
|
||||||
{
|
{
|
||||||
|
#ifdef REHLDS_FIXES
|
||||||
|
SV_ClientPrintf("The server operator has added you to banned list %s\n", reason);
|
||||||
|
SV_DropClient(host_client, 0, "Added to banned list %s", reason);
|
||||||
|
#else // REHLDS_FIXES
|
||||||
SV_ClientPrintf("The server operator has added you to banned list\n");
|
SV_ClientPrintf("The server operator has added you to banned list\n");
|
||||||
SV_DropClient(host_client, 0, "Added to banned list");;
|
SV_DropClient(host_client, 0, "Added to banned list");
|
||||||
|
#endif // REHLDS_FIXES
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user