Compare commits

..

No commits in common. "0e96b4619aa69fa6b318030e256a7dbe37683fd8" and "4dac834555be1705c9f083d0354ad928cc1e60ac" have entirely different histories.

View File

@ -11,7 +11,7 @@ namespace AxiReplay
/// <summary>
/// 服务器远端当前帧
/// </summary>
public int mRemoteFrameIdx { get; private set; }
public int mRemoteFrameIdx { get; private set; } = int.MinValue;
/// <summary>
/// Remote 2 Client Frame Gap
/// </summary>
@ -40,7 +40,6 @@ namespace AxiReplay
mCurrReplay.FrameStartID = int.MinValue;
mNextReplay = default(ReplayStep);
mNextReplay.FrameStartID = 0;
mRemoteFrameIdx = 0;
}
public void InData(ReplayStep inputData, int ServerFrameIdx)
{
@ -52,22 +51,10 @@ namespace AxiReplay
TakeFrame(1, out data, out frameDiff, out inputDiff);
return frameDiff > 0;
}
public bool TryGetNextFrame(int targetFrame, out ReplayStep data, out int frameDiff, out bool inputDiff)
{
TakeFrameToTargetFrame(targetFrame, out data, out frameDiff, out inputDiff);
return frameDiff > 0;
}
void TakeFrame(int addFrame, out ReplayStep data, out int bFrameDiff, out bool inputDiff)
{
int targetFrame = mCurrClientFrameIdx + addFrame;
TakeFrameToTargetFrame(targetFrame, out data, out bFrameDiff, out inputDiff);
}
void TakeFrameToTargetFrame(int targetFrame, out ReplayStep data, out int bFrameDiff, out bool inputDiff)
{
inputDiff = false;
int targetFrame = mCurrClientFrameIdx + addFrame;
if (targetFrame <= mNextReplay.FrameStartID + 1 && targetFrame <= mRemoteFrameIdx && mNetReplayQueue.Count > 0)
{
//当前帧追加