diff --git a/rehlds/engine/sv_main.cpp b/rehlds/engine/sv_main.cpp index 183509a..62717b1 100644 --- a/rehlds/engine/sv_main.cpp +++ b/rehlds/engine/sv_main.cpp @@ -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() diff --git a/rehlds/engine/sys_dll.cpp b/rehlds/engine/sys_dll.cpp index 10c5709..b31cc5b 100644 --- a/rehlds/engine/sys_dll.cpp +++ b/rehlds/engine/sys_dll.cpp @@ -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)