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.

70 lines
1.6 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #ifndef HLTVDEMO_H
  7. #define HLTVDEMO_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include <filesystem.h>
  12. #include "demo.h"
  13. #include "demofile.h"
  14. class CHLTVFrame;
  15. class CHLTVDemoRecorder : public IDemoRecorder
  16. {
  17. public:
  18. CHLTVDemoRecorder();
  19. virtual ~CHLTVDemoRecorder();
  20. CDemoFile *GetDemoFile();
  21. int GetRecordingTick( void );
  22. void StartRecording( const char *filename, bool bContinuously );
  23. void StartAutoRecording();
  24. void SetSignonState( int state ) {}; // not need by HLTV recorder
  25. bool IsRecording( void );
  26. void PauseRecording( void ) {};
  27. void ResumeRecording( void ) {};
  28. void StopRecording( void );
  29. void RecordCommand( const char *cmdstring );
  30. void RecordUserInput( int cmdnumber ) {} ; // not need by HLTV recorder
  31. void RecordMessages( bf_read &data, int bits );
  32. void RecordPacket( void );
  33. void RecordServerClasses( ServerClass *pClasses );
  34. void RecordStringTables();
  35. void ResetDemoInterpolation( void ) {};
  36. public:
  37. void WriteFrame( CHLTVFrame *pFrame );
  38. void CloseFile();
  39. void Reset();
  40. void WriteServerInfo();
  41. int WriteSignonData(); // write all necessary signon data and returns written bytes
  42. void WriteMessages( unsigned char cmd, bf_write &message );
  43. int GetMaxAckTickCount();
  44. public:
  45. CDemoFile m_DemoFile;
  46. bool m_bIsRecording;
  47. int m_nFrameCount;
  48. float m_nStartTick;
  49. int m_SequenceInfo;
  50. int m_nDeltaTick;
  51. int m_nSignonTick;
  52. bf_write m_MessageData; // temp buffer for all network messages
  53. };
  54. #endif // HLTVDEMO_H