BOOL KPlayerBaseProcess::OnSyncAdjustMove( LPCBYTE pData, UINT uDataLen ) { KS2C_SYNC_ADJUST_MOVE* pReceived = (KS2C_SYNC_ADJUST_MOVE*)pData; //cprintf("Adjust: %d\n", pPak->nMoveCount); KPlayer* pPlayer = g_cPlayerMgr.GetById(g_cOrpgWorld.m_dwClientPlayerId); QCONFIRM_RET_FALSE(pPlayer); //if (pReceived->nMoveCount < pPlayer->m_sMoveCtrl.nMoveCount || pPlayer->m_pScene == NULL) //{ // QLogPrintf( // LOG_DEBUG, "[move] apply adjust(%d < %d)", // pReceived->nMoveCount, pPlayer->m_sMoveCtrl.nMoveCount // ); // DoApplyMoveAdjust(); // goto EXIT0; //} INT nX = 0, nY = 0, nZ = 0; pPlayer->GetPosition(nX, nY, nZ); { printf("[MoveAdjust] S[%d-%d],c[%d,%d,%d]s[%d,%d,%d],F[%d-%d] Diff[%d]\n", pPlayer->m_eMoveState, pReceived->nMoveState, nX, nY, nZ, pReceived->nX, pReceived->nY, pReceived->nZ, g_cOrpgWorld.m_dwLogicFrames, pReceived->dwVirtualFrame, g_cOrpgWorld.m_dwLogicFrames - pReceived->dwVirtualFrame); } pPlayer->SetPosition(pReceived->nX, pReceived->nY, pReceived->nZ); pPlayer->SetMoveState((KE_MOVE_STATE)pReceived->nMoveState); pPlayer->m_nVelocityXY = pReceived->nVelocityXY; pPlayer->m_nDirectionXY = pReceived->nDirectionXY; pPlayer->m_nDestX = pReceived->nDestX; pPlayer->m_nDestY = pReceived->nDestY; pPlayer->m_nDestZ = pReceived->nDestZ; if (pReceived->dwVirtualFrame < g_cOrpgWorld.m_dwLogicFrames) { pPlayer->ForwardPosition(g_cOrpgWorld.m_dwLogicFrames - pReceived->dwVirtualFrame); } EXIT0: return TRUE; }