summaryrefslogtreecommitdiff
path: root/replay/sv_recordingsession.h
diff options
context:
space:
mode:
authorFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
committerFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
commit3bf9df6b2785fa6d951086978a3e66f49427166a (patch)
tree2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /replay/sv_recordingsession.h
downloadarchived-source-engine-2018-hl2-src-master.tar.xz
archived-source-engine-2018-hl2-src-master.zip
Diffstat (limited to 'replay/sv_recordingsession.h')
-rw-r--r--replay/sv_recordingsession.h66
1 files changed, 66 insertions, 0 deletions
diff --git a/replay/sv_recordingsession.h b/replay/sv_recordingsession.h
new file mode 100644
index 0000000..025e9fd
--- /dev/null
+++ b/replay/sv_recordingsession.h
@@ -0,0 +1,66 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+//=======================================================================================//
+
+#ifndef SV_RECORDINGSESSION_H
+#define SV_RECORDINGSESSION_H
+#ifdef _WIN32
+#pragma once
+#endif
+
+//----------------------------------------------------------------------------------------
+
+#include "baserecordingsession.h"
+#include "basethinker.h"
+#include "utlbuffer.h"
+#include "sv_filepublish.h"
+#include "replay/replaytime.h"
+#include "sessioninfoheader.h"
+
+//----------------------------------------------------------------------------------------
+
+class IFilePublisher;
+
+//----------------------------------------------------------------------------------------
+
+class CServerRecordingSession : public CBaseRecordingSession
+{
+ typedef CBaseRecordingSession BaseClass;
+public:
+ CServerRecordingSession( IReplayContext *pContext );
+ ~CServerRecordingSession();
+
+ virtual bool Read( KeyValues *pIn );
+ virtual void Write( KeyValues *pOut );
+ virtual void OnDelete();
+ virtual void SetLocked( bool bLocked );
+
+ virtual void PopulateWithRecordingData( int nCurrentRecordingStartTick );
+
+ void NotifyReplayRequested() { m_bReplaysRequested = true; }
+
+ double GetSecondsToExpiration() const;
+ bool SessionExpired() const;
+
+#ifdef _DEBUG
+ void VerifyLocks();
+#endif
+
+private:
+ virtual bool ShouldDitchSession() const;
+
+ bool m_bReplaysRequested;
+ int m_nLifeSpan;
+ CReplayTime m_RecordTime;
+};
+
+//----------------------------------------------------------------------------------------
+
+inline CServerRecordingSession *SV_CastSession( CBaseRecordingSession *pSession )
+{
+ return static_cast< CServerRecordingSession * >( pSession );
+}
+
+//----------------------------------------------------------------------------------------
+
+#endif // SV_RECORDINGSESSION_H