From 504a14a01059ae375b3bd1ef996571be4be67b26 Mon Sep 17 00:00:00 2001 From: WPMGPRoSToTeMa Date: Sat, 6 Feb 2016 13:38:34 +0300 Subject: [PATCH] Fixed assertion with enabled debug (isctype) Added bantime in kick reason in banid and addip --- rehlds/engine/sv_main.cpp | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/rehlds/engine/sv_main.cpp b/rehlds/engine/sv_main.cpp index dd89aab..362b9a9 100644 --- a/rehlds/engine/sv_main.cpp +++ b/rehlds/engine/sv_main.cpp @@ -2101,7 +2101,7 @@ void SV_ReplaceSpecialCharactersInName(char *newname, const char *oldname) if (*s == '#' || *s == '%' || *s == '&' || - (n && newname[n-1] == '+' && (isdigit(*s) || isalpha(*s)))) + (n && newname[n-1] == '+' && (signed char)*s > 0 && isalnum(*s))) { if (remainChars < 3) 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); +#ifdef REHLDS_FIXES + SV_DropClient(host_client, FALSE, "Kicked and banned %s", szreason); +#else // REHLDS_FIXES SV_DropClient(host_client, FALSE, "Kicked and banned"); +#endif // REHLDS_FIXES break; } } @@ -6436,6 +6440,14 @@ void SV_AddIP_f(void) ipfilters[i].banEndTime = (banTime == 0.0f) ? 0.0f : banTime * 60.0f + realtime; 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++) { 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)); 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_DropClient(host_client, 0, "Added to banned list");; + SV_DropClient(host_client, 0, "Added to banned list"); +#endif // REHLDS_FIXES } } }