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.

66 lines
1.8 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. //=======================================================================================//
  4. #ifndef SV_RECORDINGSESSION_H
  5. #define SV_RECORDINGSESSION_H
  6. #ifdef _WIN32
  7. #pragma once
  8. #endif
  9. //----------------------------------------------------------------------------------------
  10. #include "baserecordingsession.h"
  11. #include "basethinker.h"
  12. #include "utlbuffer.h"
  13. #include "sv_filepublish.h"
  14. #include "replay/replaytime.h"
  15. #include "sessioninfoheader.h"
  16. //----------------------------------------------------------------------------------------
  17. class IFilePublisher;
  18. //----------------------------------------------------------------------------------------
  19. class CServerRecordingSession : public CBaseRecordingSession
  20. {
  21. typedef CBaseRecordingSession BaseClass;
  22. public:
  23. CServerRecordingSession( IReplayContext *pContext );
  24. ~CServerRecordingSession();
  25. virtual bool Read( KeyValues *pIn );
  26. virtual void Write( KeyValues *pOut );
  27. virtual void OnDelete();
  28. virtual void SetLocked( bool bLocked );
  29. virtual void PopulateWithRecordingData( int nCurrentRecordingStartTick );
  30. void NotifyReplayRequested() { m_bReplaysRequested = true; }
  31. double GetSecondsToExpiration() const;
  32. bool SessionExpired() const;
  33. #ifdef _DEBUG
  34. void VerifyLocks();
  35. #endif
  36. private:
  37. virtual bool ShouldDitchSession() const;
  38. bool m_bReplaysRequested;
  39. int m_nLifeSpan;
  40. CReplayTime m_RecordTime;
  41. };
  42. //----------------------------------------------------------------------------------------
  43. inline CServerRecordingSession *SV_CastSession( CBaseRecordingSession *pSession )
  44. {
  45. return static_cast< CServerRecordingSession * >( pSession );
  46. }
  47. //----------------------------------------------------------------------------------------
  48. #endif // SV_RECORDINGSESSION_H