Skip to content

Commit

Permalink
make some messages debug only
Browse files Browse the repository at this point in the history
  • Loading branch information
RandomityGuy committed Mar 16, 2024
1 parent 0ba6eeb commit 07476e3
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions engine/source/sim/netDownload.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,7 @@ struct FastFileState
// Just for progress indicators
out->write(U32(mSend.totalSize));

#if TORQUE_DEBUG
Con::warnf(
"%s @%d %d %d %d",
__func__,
Expand All @@ -335,6 +336,7 @@ struct FastFileState
mSend.fileChunks.size(),
mSend.totalSize
);
#endif
}

/// [Receiver] Read packet for start of transfer
Expand All @@ -348,6 +350,7 @@ struct FastFileState
stream->read(&chunkCount);
stream->read(&totalSize);

#if TORQUE_DEBUG
Con::warnf(
"%s @%d %d %d %d",
__func__,
Expand All @@ -356,6 +359,7 @@ struct FastFileState
chunkCount,
totalSize
);
#endif

// This is the start of receiving a file, so init recv state here

Expand Down Expand Up @@ -390,6 +394,7 @@ struct FastFileState
out->write(U8(mSend.fileChunks[index].bytes[i]));
}

#if TORQUE_DEBUG
Con::warnf(
"%s @%d %d %d %d %d %d",
__func__,
Expand All @@ -400,6 +405,7 @@ struct FastFileState
mSend.fileChunks[index].offset,
mSend.fileChunks[index].bytes.size()
);
#endif
}

/// [Receiver] Read packet for data chunk
Expand All @@ -416,6 +422,7 @@ struct FastFileState
stream->read(&offset);
stream->read(&size);

#if TORQUE_DEBUG
Con::warnf(
"%s @%d %d %d %d %d",
__func__,
Expand All @@ -425,6 +432,7 @@ struct FastFileState
offset,
size
);
#endif

// Basic checks to make sure nothing fishy is happening
if (transferID == 0 || transferID != mRecv.transferID)
Expand Down Expand Up @@ -607,7 +615,7 @@ struct FastFileState
}
// Null terminate
debugStr[ackCount] = 0;

#if TORQUE_DEBUG
Con::warnf(
"%s @%d %d %d %d %s",
__func__,
Expand All @@ -617,6 +625,7 @@ struct FastFileState
ackCount,
debugStr
);
#endif
}

/// [Sender] Read the packet saying which chunks the receiver has received
Expand Down Expand Up @@ -660,7 +669,7 @@ struct FastFileState
{
return false;
}

#if TORQUE_DEBUG
Con::warnf(
"%s @%d %d %d %d %s",
__func__,
Expand All @@ -670,6 +679,7 @@ struct FastFileState
ackCount,
debugStr
);
#endif

// Save this state for handleAcknowledgement because NetEvent does this in 2 steps
mSend.lastAckStart = minNonAcknowledged;
Expand All @@ -687,11 +697,13 @@ struct FastFileState
// Bounds check for sanity
if (index >= mSend.acknowledgedChunks.size())
{
#if TORQUE_DEBUG
Con::errorf(
"%s @%d Index >= ackChunks.size()",
__func__,
__LINE__
);
#endif
return false;
}
mSend.acknowledgedChunks[index] = true;
Expand Down

0 comments on commit 07476e3

Please sign in to comment.