Esempio n. 1
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);
        }
Esempio n. 2
0
        private void Setup(Stream m_stream)
        {
            this.m_stream = m_stream;

            // instanciate the replay file header
            m_header = new ReplayHeader(m_stream);

            // instanciate the replay file payload header
            m_payloadHeader = new ReplayPayloadHeader(m_stream);

            // set state vars
            m_currentEntry    = 0;
            m_entryDataOffset = m_header.PayloadOffset + (17 * (m_payloadHeader.ChunkCount + m_payloadHeader.KeyframeCount));
        }
Esempio n. 3
0
        public Replay(string p_path)
        {
            // save the file's absolute path
            m_path = p_path;

            // instanciate a binary file stream
            m_stream = File.Open(m_path, FileMode.Open, FileAccess.Read);

            // instanciate the replay file header
            m_header = new ReplayHeader(m_stream);

            // instanciate the replay file payload header
            m_payloadHeader = new ReplayPayloadHeader(m_stream);

            // set state vars
            m_currentEntry    = int.MinValue;
            m_entryDataOffset = m_header.PayloadOffset + (17 * (m_payloadHeader.ChunkCount + m_payloadHeader.KeyframeCount));
        }
Esempio n. 4
0
        public Replay(string p_path)
        {
            // save the file's absolute path
            m_path = p_path;

            // instanciate a binary file stream
            m_stream = File.Open(m_path, FileMode.Open, FileAccess.Read);

            // instanciate the replay file header
            m_header = new ReplayHeader(m_stream);

            // instanciate the replay file payload header
            m_payloadHeader = new ReplayPayloadHeader(m_stream);

            // set state vars
            m_currentEntry = 0;
            m_entryDataOffset = m_header.PayloadOffset + (17 * (m_payloadHeader.ChunkCount + m_payloadHeader.KeyframeCount));
        }