Added dummy handling of consolecmd, usercmd, datatables, stringtables

This commit is contained in:
Jordan Cristiano 2015-05-03 22:46:04 -04:00
parent 271a22f148
commit d009d019d2
3 changed files with 8 additions and 5 deletions

View File

@ -44,13 +44,14 @@ void ParseDemoSequence(const std::vector<unsigned char>& sequenceData)
// nothing // nothing
break; break;
case dem_consolecmd: case dem_consolecmd:
reader.ReadRawData(nullptr, 1024);
break; break;
case dem_usercmd: case dem_usercmd:
reader.ReadUserCmd(buffer); reader.ReadUserCmd(buffer, 256);
break; break;
case dem_datatables: case dem_datatables:
// TODO: datatables // TODO: datatables
reader.ReadRawData(nullptr, 0); reader.ReadRawData(nullptr, 64*1024);
break; break;
case dem_stop: case dem_stop:
// TODO assert frame and tick numbers // TODO assert frame and tick numbers
@ -59,6 +60,7 @@ void ParseDemoSequence(const std::vector<unsigned char>& sequenceData)
reader.ReadRawData(nullptr, 0); reader.ReadRawData(nullptr, 0);
break; break;
case dem_stringtables: case dem_stringtables:
reader.ReadRawData(nullptr, 0);
break; break;
default: default:
assert(false); assert(false);

View File

@ -163,7 +163,8 @@ void DemoSequenceReader::ReadCmdHeader(unsigned char& cmd, int32& tick)
m_dataReadOffset = currentReadOffset; 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()) 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); const int32 outgoing_sequence = *reinterpret_cast<const int32*>(m_sequenceData.data() + m_dataReadOffset);
m_dataReadOffset += sizeof(int32); m_dataReadOffset += sizeof(int32);
if (!ReadRawData(buf)) if (!ReadRawData(buf, maxReadSize))
{ {
return 0; return 0;
} }

View File

@ -234,7 +234,7 @@ public:
void ReadCmdHeader(unsigned char &cmd, int32 &tick); 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: private:
const std::vector<unsigned char>& m_sequenceData; const std::vector<unsigned char>& m_sequenceData;