diff options
| author | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
|---|---|---|
| committer | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
| commit | 3bf9df6b2785fa6d951086978a3e66f49427166a (patch) | |
| tree | 2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /replay/sv_recordingsessionmanager.h | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'replay/sv_recordingsessionmanager.h')
| -rw-r--r-- | replay/sv_recordingsessionmanager.h | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/replay/sv_recordingsessionmanager.h b/replay/sv_recordingsessionmanager.h new file mode 100644 index 0000000..15f41cb --- /dev/null +++ b/replay/sv_recordingsessionmanager.h @@ -0,0 +1,64 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +//=======================================================================================// + +#ifndef SV_PUBLISHMANAGER_H +#define SV_PUBLISHMANAGER_H +#ifdef _WIN32 +#pragma once +#endif + +//---------------------------------------------------------------------------------------- + +#include "baserecordingsessionmanager.h" + +//---------------------------------------------------------------------------------------- + +class CServerRecordingSession; + +//---------------------------------------------------------------------------------------- + +// +// Manages and serializes all replay recording session data on the server +// +class CServerRecordingSessionManager : public CBaseRecordingSessionManager +{ + typedef CBaseRecordingSessionManager BaseClass; + +public: + CServerRecordingSessionManager( IReplayContext *pContext ); + ~CServerRecordingSessionManager(); + + void Think(); + + const char *GetNewSessionName() const; + + virtual CBaseRecordingSession *OnSessionStart( int nCurrentRecordingStartTick, const char *pSessionName ); + virtual void OnSessionEnd(); + + void EnableCleanupOnSessionEnd( bool bState ); + + // Offload session data to external fileserver? Cached once per session based on replay_fileserver_offload_enable. + bool ShouldOffload() const { return m_bOffload; } + +protected: + // + // CGenericPersistentManager + // + virtual CBaseRecordingSession *Create(); + virtual int GetVersion() const; + virtual bool ShouldSerializeIndexWithFullPath() { return false; } // On the server, write one file per session + virtual IReplayContext *GetReplayContext() const; + + virtual bool CanDeleteSession( ReplayHandle_t hSession ) const; + virtual bool ShouldUnloadSessions() const { return true; } + virtual void OnAllSessionsDeleted(); + +private: + float m_flNextScheduledCleanup; + bool m_bOffload; +}; + +//---------------------------------------------------------------------------------------- + +#endif // SV_PUBLISHMANAGER_H |