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

View File

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