Added dummy handling of consolecmd, usercmd, datatables, stringtables
This commit is contained in:
parent
271a22f148
commit
d009d019d2
|
@ -44,13 +44,14 @@ void ParseDemoSequence(const std::vector<unsigned char>& sequenceData)
|
|||
// nothing
|
||||
break;
|
||||
case dem_consolecmd:
|
||||
reader.ReadRawData(nullptr, 1024);
|
||||
break;
|
||||
case dem_usercmd:
|
||||
reader.ReadUserCmd(buffer);
|
||||
reader.ReadUserCmd(buffer, 256);
|
||||
break;
|
||||
case dem_datatables:
|
||||
// TODO: datatables
|
||||
reader.ReadRawData(nullptr, 0);
|
||||
reader.ReadRawData(nullptr, 64*1024);
|
||||
break;
|
||||
case dem_stop:
|
||||
// TODO assert frame and tick numbers
|
||||
|
@ -59,6 +60,7 @@ void ParseDemoSequence(const std::vector<unsigned char>& sequenceData)
|
|||
reader.ReadRawData(nullptr, 0);
|
||||
break;
|
||||
case dem_stringtables:
|
||||
reader.ReadRawData(nullptr, 0);
|
||||
break;
|
||||
default:
|
||||
assert(false);
|
||||
|
|
|
@ -163,7 +163,8 @@ void DemoSequenceReader::ReadCmdHeader(unsigned char& cmd, int32& tick)
|
|||
m_dataReadOffset = currentReadOffset;
|
||||
}
|
||||
|
||||
int32 DemoSequenceReader::ReadUserCmd(std::vector<unsigned char>& buf)
|
||||
int32 DemoSequenceReader::ReadUserCmd(std::vector<unsigned char>& buf,
|
||||
const int32 maxReadSize /*= MAX_READ_SIZE*/)
|
||||
{
|
||||
if (m_sequenceData.empty())
|
||||
{
|
||||
|
@ -173,7 +174,7 @@ int32 DemoSequenceReader::ReadUserCmd(std::vector<unsigned char>& buf)
|
|||
const int32 outgoing_sequence = *reinterpret_cast<const int32*>(m_sequenceData.data() + m_dataReadOffset);
|
||||
m_dataReadOffset += sizeof(int32);
|
||||
|
||||
if (!ReadRawData(buf))
|
||||
if (!ReadRawData(buf, maxReadSize))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -234,7 +234,7 @@ public:
|
|||
|
||||
void ReadCmdHeader(unsigned char &cmd, int32 &tick);
|
||||
|
||||
int32 ReadUserCmd(std::vector<unsigned char>& buf);
|
||||
int32 ReadUserCmd(std::vector<unsigned char>& buf, const int32 maxReadSize = MAX_READ_SIZE);
|
||||
|
||||
private:
|
||||
const std::vector<unsigned char>& m_sequenceData;
|
||||
|
|
Loading…
Reference in New Issue
Block a user