Use new Dev* logger functions

These get compiled in if IsCert() returns false.
This commit is contained in:
Kawe Mazidjatari 2023-08-21 20:38:07 +02:00
parent 71b0781715
commit c8752420a0
2 changed files with 14 additions and 41 deletions

View File

@ -405,24 +405,16 @@ bool CNetChan::ProcessMessages(bf_read* buf)
if (!netMsg)
{
if (IsDebug())
{
Warning(eDLL_T::ENGINE, "%s(%s): Received unknown net message (%i)!\n",
__FUNCTION__, GetAddress(), cmd);
}
DevWarning(eDLL_T::ENGINE, "%s(%s): Received unknown net message (%i)!\n",
__FUNCTION__, GetAddress(), cmd);
Assert(0);
return false;
}
if (!netMsg->ReadFromBuffer(buf))
{
if (IsDebug())
{
Warning(eDLL_T::ENGINE, "%s(%s): Failed reading message '%s'!\n",
__FUNCTION__, GetAddress(), netMsg->GetName());
}
DevWarning(eDLL_T::ENGINE, "%s(%s): Failed reading message '%s'!\n",
__FUNCTION__, GetAddress(), netMsg->GetName());
Assert(0);
return false;
}
@ -447,12 +439,8 @@ bool CNetChan::ProcessMessages(bf_read* buf)
if (!bRet)
{
if (IsDebug())
{
Warning(eDLL_T::ENGINE, "%s(%s): Failed processing message '%s'!\n",
__FUNCTION__, GetAddress(), netMsg->GetName());
}
Warning(eDLL_T::ENGINE, "%s(%s): Failed processing message '%s'!\n",
__FUNCTION__, GetAddress(), netMsg->GetName());
Assert(0);
return false;
}

View File

@ -162,34 +162,22 @@ void CPlayer::ProcessUserCmds(CUserCmd* cmds, int numCmds, int totalCmds,
{
// Too much to unlag, clamp to max !!!
recomputeUnlag = true;
if (IsDebug())
{
Warning(eDLL_T::SERVER, "%s: commandDelta( %f ) > maxUnlag( %f ) !!!\n",
__FUNCTION__, commandDelta, maxUnlag);
}
DevWarning(eDLL_T::SERVER, "%s: commandDelta( %f ) > maxUnlag( %f ) !!!\n",
__FUNCTION__, commandDelta, maxUnlag);
}
else if (commandTime < (lastCommandTime - clockDriftMsecs))
{
// Can never be lower than last !!!
recomputeUnlag = true;
if (IsDebug())
{
Warning(eDLL_T::SERVER, "%s: cmd->command_time( %f ) < (m_LastCmd.command_time( %f ) - clockDriftMsecs( %f )) !!!\n",
__FUNCTION__, commandTime, lastCommandTime, clockDriftMsecs);
}
DevWarning(eDLL_T::SERVER, "%s: cmd->command_time( %f ) < (m_LastCmd.command_time( %f ) - clockDriftMsecs( %f )) !!!\n",
__FUNCTION__, commandTime, lastCommandTime, clockDriftMsecs);
}
else if (commandTime > (serverTime + clockDriftMsecs))
{
// Too far in the future, clamp to max !!!
recomputeUnlag = true;
if (IsDebug())
{
Warning(eDLL_T::SERVER, "%s: cmd->command_time( %f ) > (g_pGlobals->m_flCurTime( %f ) + clockDriftMsecs( %f )) !!!\n",
__FUNCTION__, commandTime, serverTime, clockDriftMsecs);
}
DevWarning(eDLL_T::SERVER, "%s: cmd->command_time( %f ) > (g_pGlobals->m_flCurTime( %f ) + clockDriftMsecs( %f )) !!!\n",
__FUNCTION__, commandTime, serverTime, clockDriftMsecs);
}
if (recomputeUnlag)
@ -199,11 +187,8 @@ void CPlayer::ProcessUserCmds(CUserCmd* cmds, int numCmds, int totalCmds,
float newCommandTime = Clamp(serverTime - latencyAmount, lastCommandTime, serverTime);
cmd->command_time = newCommandTime;
if (IsDebug())
{
Warning(eDLL_T::SERVER, "%s: Clamped cmd->command_time( %f ) to %f !!!\n",
__FUNCTION__, commandTime, newCommandTime);
}
DevWarning(eDLL_T::SERVER, "%s: Clamped cmd->command_time( %f ) to %f !!!\n",
__FUNCTION__, commandTime, newCommandTime);
}
CUserCmd* queuedCmd = &m_Commands[lastCommandNumber];