Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
2.0 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. //=======================================================================================//
  4. #ifndef SESSIONINFOHEADER_H
  5. #define SESSIONINFOHEADER_H
  6. #ifdef _WIN32
  7. #pragma once
  8. #endif
  9. //----------------------------------------------------------------------------------------
  10. #include "replay/shared_defs.h"
  11. #include "compression.h"
  12. #include "strtools.h"
  13. //----------------------------------------------------------------------------------------
  14. #define SESSION_INFO_VERSION 1
  15. //----------------------------------------------------------------------------------------
  16. struct SessionInfoHeader_t
  17. {
  18. inline SessionInfoHeader_t()
  19. {
  20. V_memset( this, 0, sizeof( SessionInfoHeader_t ) );
  21. m_nCompressorType = COMPRESSORTYPE_INVALID;
  22. m_uVersion = SESSION_INFO_VERSION;
  23. }
  24. //
  25. // Session info files may be around for days, during which this format may change - so
  26. // we need to be careful not to break it.
  27. //
  28. // Therefore, any changes to data here should be reflected in the size of m_aUnused.
  29. //
  30. uint8 m_uVersion;
  31. char m_szSessionName[MAX_SESSIONNAME_LENGTH]; // Name of session
  32. bool m_bRecording; // Is this session currenty recording?
  33. int32 m_nNumBlocks; // # blocks in the session so far if recording, or total if not recording
  34. CompressorType_t m_nCompressorType; // COMPRESSORTYPE_INVALID if header is not compressed
  35. uint8 m_aHash[16]; // MD5 digest on payload
  36. uint32 m_uPayloadSize; // Size of the payload - the compressed payload if it's compressed
  37. uint32 m_uPayloadSizeUC; // Size of the uncompressed payload, if its compressed, otherwise 0
  38. uint8 m_aUnused[128];
  39. };
  40. //----------------------------------------------------------------------------------------
  41. bool ReadSessionInfoHeader( const void *pBuf, int nBufSize, SessionInfoHeader_t &outHeader );
  42. //----------------------------------------------------------------------------------------
  43. #endif // SESSIONINFOHEADER_H