GameFramework.User.VerifyMovingPosition C# (CSharp) Method

VerifyMovingPosition() private method

private VerifyMovingPosition ( float x, float z, float velocity ) : bool
x float
z float
velocity float
return bool
        internal bool VerifyMovingPosition(float x, float z, float velocity)
        {
            bool ret = true;
            if (m_LastSampleTime > 0) {
                long time = TimeUtility.GetLocalMilliseconds();
                Vector3 pos = new Vector3(x, 0, z);
                float distSqr = Geometry.DistanceSquare(pos, m_LastClientPosition);
                float v = Geometry.Max(velocity, m_LastMoveVelocity);
                float t = (time - m_LastSampleTime) / 1000.0f;
                float enableDist = v * t;
                float enableDistSqr = enableDist * enableDist;
                if (distSqr > 1 && (distSqr > enableDistSqr * 2 + 1/* || distSqr < enableDistSqr / 2 - 1*/)) {
                    ret = false;
                    float sx = m_LastClientPosition.X + enableDist * m_LastMoveDirSinAngle;
                    float sz = m_LastClientPosition.Z + enableDist * m_LastMoveDirCosAngle;

                    LogSys.Log(LOG_TYPE.ERROR, "VerifyMoveData user:{0}({1},{2},{3}) t:{4} v:{5} x:{6} z:{7} sx:{8} sz:{9} distSqr:{10} enableDistSqr:{11}", RoleId, GetKey(), Guid, Name, t, v, x, z, sx, sz, distSqr, enableDistSqr);
                }
            }
            return ret;
        }