2
0
mirror of https://github.com/rehlds/rehlds.git synced 2024-12-29 08:05:50 +03:00

Reworked sv_rcon_condebug (#214)

This commit is contained in:
s1lentq 2016-06-13 17:42:49 +06:00 committed by theAsmodai
parent 762923fbc3
commit b6630824a3
2 changed files with 14 additions and 16 deletions

View File

@ -3387,11 +3387,7 @@ int SV_Rcon_Validate(void)
if (SV_CheckRconFailure(&net_from))
{
#ifdef REHLDS_FIXES
if (sv_rcon_condebug.value > 0.0f)
#endif
Con_Printf("Banning %s for rcon hacking attempts\n", NET_AdrToString(net_from));
Con_Printf("Banning %s for rcon hacking attempts\n", NET_AdrToString(net_from));
Cbuf_AddText(va("addip %i %s\n", (int)sv_rcon_banpenalty.value, NET_BaseAdrToString(net_from)));
return 3;
}
@ -3421,13 +3417,9 @@ void SV_Rcon(netadr_t *net_from_)
Q_memcpy(remaining, &net_message.data[Q_strlen("rcon")], len);
remaining[len] = 0;
#ifndef REHLDS_FIXES
bool bConDebug = true;
#else
bool bConDebug = (sv_rcon_condebug.value > 0.0f);
#ifdef REHLDS_FIXES
if (sv_rcon_condebug.value > 0.0f)
#endif
if (bConDebug)
{
if (invalid)
{
@ -3442,7 +3434,8 @@ void SV_Rcon(netadr_t *net_from_)
}
SV_BeginRedirect(RD_PACKET, net_from_);
if (bConDebug && invalid)
if (invalid)
{
if (invalid == 2)
Con_Printf("Bad rcon_password.\n");
@ -3450,15 +3443,14 @@ void SV_Rcon(netadr_t *net_from_)
Con_Printf("Bad rcon_password.\nNo password set for this server.\n");
else
Con_Printf("Bad rcon_password.\n");
SV_EndRedirect();
return;
}
char *data = COM_Parse(COM_Parse(COM_Parse(remaining)));
if (!data)
{
if (bConDebug)
Con_Printf("Empty rcon\n");
Con_Printf("Empty rcon\n");
#ifdef REHLDS_FIXES
//missing SV_EndRedirect()

View File

@ -1341,7 +1341,13 @@ void EXT_FUNC Con_Printf(const char *fmt, ...)
FR_Log("REHLDS_CON", Dest);
#endif
Sys_Printf("%s", Dest);
#ifdef REHLDS_FIXES
if (sv_redirected == RD_NONE || sv_rcon_condebug.value > 0.0f)
#endif
{
Sys_Printf("%s", Dest);
}
if (sv_redirected)
{
if ((Q_strlen(outputbuf) + Q_strlen(Dest)) > sizeof(outputbuf) - 1)