debug draw: drops

This commit is contained in:
miwarnec 2024-11-04 10:41:48 +01:00
parent 8b906f16de
commit 4373ec921c

View File

@ -282,6 +282,12 @@ protected virtual void OnClientToServerDeltaSync(byte baselineTick, Vector3? pos
// we should never apply a delta on top of a wrong baseline. // we should never apply a delta on top of a wrong baseline.
if (baselineTick != lastDeserializedBaselineTick) if (baselineTick != lastDeserializedBaselineTick)
{ {
// debug draw: drop
if (debugDraw)
{
if (position.HasValue) Debug.DrawLine(position.Value, position.Value + Vector3.up, Color.red, 10f);
}
// this can happen if unreliable arrives before reliable etc. // this can happen if unreliable arrives before reliable etc.
// no need to log this except when debugging. // no need to log this except when debugging.
// Debug.Log($"[{name}] Server: received delta for wrong baseline #{baselineTick} from: {connectionToClient}. Last was {lastDeserializedBaselineTick}. Ignoring."); // Debug.Log($"[{name}] Server: received delta for wrong baseline #{baselineTick} from: {connectionToClient}. Last was {lastDeserializedBaselineTick}. Ignoring.");
@ -426,6 +432,12 @@ protected virtual void OnServerToClientDeltaSync(byte baselineTick, Vector3 posi
// we should never apply a delta on top of a wrong baseline. // we should never apply a delta on top of a wrong baseline.
if (baselineTick != lastDeserializedBaselineTick) if (baselineTick != lastDeserializedBaselineTick)
{ {
// debug draw: drop
if (debugDraw)
{
Debug.DrawLine(position, position + Vector3.up, Color.red, 10f);
}
// this can happen if unreliable arrives before reliable etc. // this can happen if unreliable arrives before reliable etc.
// no need to log this except when debugging. // no need to log this except when debugging.
// Debug.Log($"[{name}] Client: received delta for wrong baseline #{baselineTick}. Last was {lastDeserializedBaselineTick}. Ignoring."); // Debug.Log($"[{name}] Client: received delta for wrong baseline #{baselineTick}. Last was {lastDeserializedBaselineTick}. Ignoring.");