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.

63 lines
1.9 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. //=======================================================================================//
  4. #ifndef SV_RECORDINGSESSIONBLOCK_H
  5. #define SV_RECORDINGSESSIONBLOCK_H
  6. #ifdef _WIN32
  7. #pragma once
  8. #endif
  9. //----------------------------------------------------------------------------------------
  10. #include "baserecordingsessionblock.h"
  11. //----------------------------------------------------------------------------------------
  12. class IFilePublisher;
  13. //----------------------------------------------------------------------------------------
  14. class CServerRecordingSessionBlock : public CBaseRecordingSessionBlock
  15. {
  16. typedef CBaseRecordingSessionBlock BaseClass;
  17. public:
  18. CServerRecordingSessionBlock( IReplayContext *pContext );
  19. virtual bool Read( KeyValues *pIn );
  20. virtual void Write( KeyValues *pOut );
  21. double GetSecondsToExpiration();
  22. enum WriteStatus_t
  23. {
  24. WRITESTATUS_INVALID = -1,
  25. WRITESTATUS_WORKING,
  26. WRITESTATUS_SUCCESS,
  27. WRITESTATUS_FAILED
  28. };
  29. WriteStatus_t m_nWriteStatus; // SERVER: initially set to WRITESTATUS_INVALID, then set to STATUS_WORKING, STATUS_SUCCESS,
  30. // or STATUS_FAILED, depending on the state of the write process (which runs on a separate thread
  31. IFilePublisher *m_pPublisher; // Managed by session recorder
  32. private:
  33. virtual void OnDelete();
  34. };
  35. //----------------------------------------------------------------------------------------
  36. inline CServerRecordingSessionBlock *SV_CastBlock( IReplaySerializeable *pBlock )
  37. {
  38. return static_cast< CServerRecordingSessionBlock * >( pBlock );
  39. }
  40. inline const CServerRecordingSessionBlock *SV_CastBlock( const IReplaySerializeable *pBlock )
  41. {
  42. return static_cast< const CServerRecordingSessionBlock * >( pBlock );
  43. }
  44. //----------------------------------------------------------------------------------------
  45. #endif // SV_RECORDINGSESSIONBLOCK_H