public int PlaybackEvents(NetFrames frames, int fromFrame, int toFrame)
        {
            int num = -1;
            int count;

            lock (frames.framesLock)
            {
                count = frames.eventQueue.Count;
            }
            for (int i = 0; i < count; i++)
            {
                FrameState frameState;
                lock (frames.framesLock)
                {
                    frameState = frames.eventQueue[i];
                }
                int frameId = frameState.frameId;
                if (frameId > fromFrame && frameId <= toFrame)
                {
                    num = Mathf.Max(num, frameId);
                    NetStream stream = frameState.stream;
                    stream.Seek(0);
                    uint        num2 = stream.ReadNetId();
                    NetIdentity value;
                    while (num2 != 0 && (!map.TryGetValue(num2, out value) || value.DeliverEvent(stream)))
                    {
                        num2 = stream.ReadNetId();
                    }
                }
            }
            return(num);
        }
        public int RenderState(NetFrames frames, int renderedFrame, float fraction)
        {
            bool      state;
            int       frame0id;
            float     mix;
            NetStream frame;
            NetStream frame2;

            lock (frames.framesLock)
            {
                state = frames.GetState(renderedFrame, fraction, out frame0id, out frame, out frame2, out mix);
            }
            try
            {
                if (!state)
                {
                    return(frame0id);
                }
                if (!(mix <= 0f))
                {
                    if (!(mix >= 1f))
                    {
                        frame.Seek(0);
                        frame2.Seek(0);
                        for (int i = 0; i < list.Count; i++)
                        {
                            list[i].ApplyLerpedState(frame, frame2, mix);
                        }
                        return(frame0id);
                    }
                    frame2.Seek(0);
                    for (int j = 0; j < list.Count; j++)
                    {
                        list[j].ApplyState(frame2);
                    }
                    return(frame0id);
                }
                frame.Seek(0);
                for (int k = 0; k < list.Count; k++)
                {
                    list[k].ApplyState(frame);
                }
                return(frame0id);
            }
            finally
            {
                if (frame != null)
                {
                    frame = frame.Release();
                }
                if (frame2 != null)
                {
                    frame2 = frame2.Release();
                }
            }
        }