diff options
| author | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
|---|---|---|
| committer | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
| commit | 3bf9df6b2785fa6d951086978a3e66f49427166a (patch) | |
| tree | 2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /replay/sessioninfoheader.h | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'replay/sessioninfoheader.h')
| -rw-r--r-- | replay/sessioninfoheader.h | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/replay/sessioninfoheader.h b/replay/sessioninfoheader.h new file mode 100644 index 0000000..9359e66 --- /dev/null +++ b/replay/sessioninfoheader.h @@ -0,0 +1,56 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +//=======================================================================================// + +#ifndef SESSIONINFOHEADER_H +#define SESSIONINFOHEADER_H +#ifdef _WIN32 +#pragma once +#endif + +//---------------------------------------------------------------------------------------- + +#include "replay/shared_defs.h" +#include "compression.h" +#include "strtools.h" + +//---------------------------------------------------------------------------------------- + +#define SESSION_INFO_VERSION 1 + +//---------------------------------------------------------------------------------------- + +struct SessionInfoHeader_t +{ + inline SessionInfoHeader_t() + { + V_memset( this, 0, sizeof( SessionInfoHeader_t ) ); + m_nCompressorType = COMPRESSORTYPE_INVALID; + m_uVersion = SESSION_INFO_VERSION; + } + + // + // Session info files may be around for days, during which this format may change - so + // we need to be careful not to break it. + // + // Therefore, any changes to data here should be reflected in the size of m_aUnused. + // + uint8 m_uVersion; + char m_szSessionName[MAX_SESSIONNAME_LENGTH]; // Name of session + bool m_bRecording; // Is this session currenty recording? + int32 m_nNumBlocks; // # blocks in the session so far if recording, or total if not recording + CompressorType_t m_nCompressorType; // COMPRESSORTYPE_INVALID if header is not compressed + uint8 m_aHash[16]; // MD5 digest on payload + uint32 m_uPayloadSize; // Size of the payload - the compressed payload if it's compressed + uint32 m_uPayloadSizeUC; // Size of the uncompressed payload, if its compressed, otherwise 0 + + uint8 m_aUnused[128]; +}; + +//---------------------------------------------------------------------------------------- + +bool ReadSessionInfoHeader( const void *pBuf, int nBufSize, SessionInfoHeader_t &outHeader ); + +//---------------------------------------------------------------------------------------- + +#endif // SESSIONINFOHEADER_H |