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_sessionpublishmanager.h | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'replay/sv_sessionpublishmanager.h')
| -rw-r--r-- | replay/sv_sessionpublishmanager.h | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/replay/sv_sessionpublishmanager.h b/replay/sv_sessionpublishmanager.h new file mode 100644 index 0000000..c928915 --- /dev/null +++ b/replay/sv_sessionpublishmanager.h @@ -0,0 +1,76 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +//=======================================================================================// + +#ifndef SV_SESSIONPUBLISHMANAGER_H +#define SV_SESSIONPUBLISHMANAGER_H +#ifdef _WIN32 +#pragma once +#endif + +//---------------------------------------------------------------------------------------- + +#include "replay/replayhandle.h" + +//---------------------------------------------------------------------------------------- + +class CServerRecordingSession; +class CSessionBlockPublisher; +class CSessionInfoPublisher; + +//---------------------------------------------------------------------------------------- + +// +// CSessionPublishManager takes care of all the publishing for a particular session. +// For asynchronous publishing of block and session info data, publishing can +// sometimes overlap between rounds, as is sometimes the case for FTP. +// +// A CSessionPublishManager instance are created by passing in the in-progress recording +// session into the constructor. +// +// CSessionRecorder maintains a list of CSessionPublishManager instances and cleans +// them up once all publishing for their corresponding session is completed. +// + +class CSessionPublishManager +{ +public: + CSessionPublishManager( CServerRecordingSession *pSession ); + ~CSessionPublishManager(); + + void Think(); // Called explicitly + + // Finish any publish jobs synchronously + void PublishAllSynchronous(); + + // Have all publish job completed? + bool IsDone() const; + + // This will flag this publish manager as recording + void OnStartRecording(); + + // This will write out and publish any final session block + void OnStopRecord( bool bAborting ); + + // Get the handle for the associated session + ReplayHandle_t GetSessionHandle() const; + + // Unlock the associated session - this should only be called if IsDone() returns true. + void UnlockSession(); + + // Abort publishing + void AbortPublish(); + +#ifdef _DEBUG + void Validate(); +#endif + +private: + CServerRecordingSession *m_pSession; + CSessionBlockPublisher *m_pBlockPublisher; + CSessionInfoPublisher *m_pSessionInfoPublisher; +}; + +//---------------------------------------------------------------------------------------- + +#endif // SV_SESSIONPUBLISHMANAGER_H |