示例#1
0
        public bool ReadEntry()
        {
            // make sure we have no read beyond the bounds of the entry data
            if (m_currentEntry < (m_payloadHeader.ChunkCount + m_payloadHeader.KeyframeCount))
            {
                // set the current entry index
                if (m_currentEntry < 0)
                {
                    m_currentEntry = 0;
                }
                else
                {
                    m_currentEntry++;
                }

                // seek to this entry's starting offset
                m_stream.Seek(m_header.PayloadOffset + (17 * m_currentEntry), SeekOrigin.Begin);

                // read out the payload entry
                m_payloadEntry = new ReplayPayloadEntry(m_stream, m_entryDataOffset);

                return(true);
            }

            return(false);
        }
示例#2
0
        public List <(ReplayPayloadHeader, ReplayPayloadEntry)> GetAllPayloads(int limit = -1, bool justKeyframes = false)
        {
            var payloads = new List <(ReplayPayloadHeader, ReplayPayloadEntry)>();

            while (this.ReadEntry() && limit != 0)
            {
                ReplayPayloadHeader payloadHeader = this.PayloadHeader;
                ReplayPayloadEntry  payloadEntry  = this.PayloadEntry;

                if (justKeyframes)
                {
                    if (payloadEntry.Type == ReplayPayloadEntryType.Chunk)
                    {
                        continue;
                    }
                    else
                    {
                        limit--;
                    }
                }

                payloads.Add((payloadHeader, payloadEntry));
            }

            return(payloads);
        }
示例#3
0
        public bool ReadEntry()
        {
            // make sure we have no read beyond the bounds of the entry data
            if (m_currentEntry < (m_payloadHeader.ChunkCount + m_payloadHeader.KeyframeCount))
            {
                // seek to this entry's starting offset
                m_stream.Seek(m_header.PayloadOffset + (17 * m_currentEntry), SeekOrigin.Begin);

                // read out the payload entry
                m_payloadEntry = new ReplayPayloadEntry(this, m_stream, m_entryDataOffset);

                // set the current entry index
                m_currentEntry++;

                return true;
            }

            return false;
        }