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.

64 lines
2.0 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. //=======================================================================================//
  4. #ifndef SV_PUBLISHMANAGER_H
  5. #define SV_PUBLISHMANAGER_H
  6. #ifdef _WIN32
  7. #pragma once
  8. #endif
  9. //----------------------------------------------------------------------------------------
  10. #include "baserecordingsessionmanager.h"
  11. //----------------------------------------------------------------------------------------
  12. class CServerRecordingSession;
  13. //----------------------------------------------------------------------------------------
  14. //
  15. // Manages and serializes all replay recording session data on the server
  16. //
  17. class CServerRecordingSessionManager : public CBaseRecordingSessionManager
  18. {
  19. typedef CBaseRecordingSessionManager BaseClass;
  20. public:
  21. CServerRecordingSessionManager( IReplayContext *pContext );
  22. ~CServerRecordingSessionManager();
  23. void Think();
  24. const char *GetNewSessionName() const;
  25. virtual CBaseRecordingSession *OnSessionStart( int nCurrentRecordingStartTick, const char *pSessionName );
  26. virtual void OnSessionEnd();
  27. void EnableCleanupOnSessionEnd( bool bState );
  28. // Offload session data to external fileserver? Cached once per session based on replay_fileserver_offload_enable.
  29. bool ShouldOffload() const { return m_bOffload; }
  30. protected:
  31. //
  32. // CGenericPersistentManager
  33. //
  34. virtual CBaseRecordingSession *Create();
  35. virtual int GetVersion() const;
  36. virtual bool ShouldSerializeIndexWithFullPath() { return false; } // On the server, write one file per session
  37. virtual IReplayContext *GetReplayContext() const;
  38. virtual bool CanDeleteSession( ReplayHandle_t hSession ) const;
  39. virtual bool ShouldUnloadSessions() const { return true; }
  40. virtual void OnAllSessionsDeleted();
  41. private:
  42. float m_flNextScheduledCleanup;
  43. bool m_bOffload;
  44. };
  45. //----------------------------------------------------------------------------------------
  46. #endif // SV_PUBLISHMANAGER_H