Counter Strike : Global Offensive Source Code
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.

47 lines
1.1 KiB

  1. //=========== Copyright Valve Corporation, All rights reserved. ==============//
  2. #pragma once
  3. #include "GameEventListener.h"
  4. #include "igamesystem.h"
  5. // This is completely disabled in release builds. We overwrite client Rel DLLs with client Staging DLLs on our cluster.
  6. #if !defined( CSTRIKE_REL_BUILD )
  7. // Records game state to a fat demo format.
  8. class CCSFatDemoRecorder : public CAutoGameSystem, public CGameEventListener
  9. {
  10. public:
  11. CCSFatDemoRecorder();
  12. virtual ~CCSFatDemoRecorder();
  13. void Reset();
  14. virtual void FireGameEvent( IGameEvent *event ) OVERRIDE;
  15. virtual void PostInit() OVERRIDE;
  16. virtual void LevelInitPreEntity() OVERRIDE;
  17. virtual void LevelShutdownPostEntity() OVERRIDE;
  18. void OnTickPre( int tickcount );
  19. private:
  20. void OutputProtobuf( ::google::protobuf::Message* pTick );
  21. void BeginFile();
  22. void FinalizeFile();
  23. private:
  24. CUtlString m_currentMap;
  25. int m_tickcount;
  26. bool m_bInLevel;
  27. MLTick* m_pCurrentTick;
  28. FileHandle_t m_outFile;
  29. CUtlBuffer m_tempPacketStorage;
  30. };
  31. // The global to get at the instance of this class.
  32. extern CCSFatDemoRecorder* g_pFatDemoRecorder;
  33. #endif