This commit is contained in:
sin365 2024-11-11 16:31:19 +08:00
parent d0d5655681
commit abd61b4da1

View File

@ -8,11 +8,10 @@ namespace AxiReplay
/// 客户端当前帧
/// </summary>
public int mCurrClientFrameIdx => mCurrReplay.FrameStartID;
//public int mCurrClientFrameIdx
/// <summary>
/// 服务器远端当前帧
/// </summary>
public int mRemoteFrameIdx { get; private set; } = -1;
public int mRemoteFrameIdx { get; private set; } = int.MinValue;
/// <summary>
/// 网络数据队列
/// </summary>
@ -36,7 +35,7 @@ namespace AxiReplay
mCurrReplay = default(ReplayStep);
mCurrReplay.FrameStartID = 0;
mNextReplay = default(ReplayStep);
mNextReplay.FrameStartID = -1;
mNextReplay.FrameStartID = 0;
}
public void InData(ReplayStep inputData, int ServerFrameIdx)
{
@ -52,10 +51,9 @@ namespace AxiReplay
{
inputDiff = false;
int targetFrame = mCurrClientFrameIdx + addFrame;
if (targetFrame >= mNextReplay.FrameStartID && targetFrame <= mRemoteFrameIdx && mNetReplayQueue.Count > 0)
if (targetFrame <= mNextReplay.FrameStartID && targetFrame <= mRemoteFrameIdx && mNetReplayQueue.Count > 0)
{
//当前帧追加
//mCurrClientFrameIdx = targetFrame;
ulong oldInput = mCurrReplay.InPut;
mCurrReplay = mNextReplay;
if (oldInput != mCurrReplay.InPut)