summaryrefslogtreecommitdiff
path: root/replay/sv_sessionrecorder.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_sessionrecorder.h
downloadarchived-source-engine-2018-hl2-src-master.tar.xz
archived-source-engine-2018-hl2-src-master.zip
Diffstat (limited to 'replay/sv_sessionrecorder.h')
-rw-r--r--replay/sv_sessionrecorder.h78
1 files changed, 78 insertions, 0 deletions
diff --git a/replay/sv_sessionrecorder.h b/replay/sv_sessionrecorder.h
new file mode 100644
index 0000000..1987df5
--- /dev/null
+++ b/replay/sv_sessionrecorder.h
@@ -0,0 +1,78 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+//=======================================================================================//
+
+#ifndef SV_SESSIONRECORDER_H
+#define SV_SESSIONRECORDER_H
+#ifdef _WIN32
+#pragma once
+#endif
+
+//----------------------------------------------------------------------------------------
+
+#include "basethinker.h"
+#include "utllinkedlist.h"
+#include "replay/ireplaysessionrecorder.h"
+#include "replay/replayhandle.h"
+#include "sv_filepublish.h"
+
+//----------------------------------------------------------------------------------------
+
+class IGameEvent;
+class CServerRecordingSessionBlock;
+class CServerRecordingSessionManager;
+class CBaseRecordingSessionBlockManager;
+class CSessionPublishManager;
+class IDemoBuffer;
+class CServerRecordingSession;
+
+//----------------------------------------------------------------------------------------
+
+class CSessionRecorder : public CBaseThinker,
+ public IReplaySessionRecorder
+{
+public:
+ CSessionRecorder();
+ ~CSessionRecorder();
+
+ bool Init();
+ void AbortCurrentSessionRecording();
+
+ int GetCurrentRecordingStartTick() const { return m_nCurrentRecordingStartTick; }
+
+ void UpdateSessionLocks(); // Looks at publish managers and unlocks sessions as needed
+
+ //
+ // IReplaySessionRecorder
+ //
+ virtual void StartRecording(); // Will waiting for recording to stop, then will begin recording
+ virtual void StopRecording( bool bAborting );
+ virtual void SetCurrentRecordingStartTick( int nStartTick );
+
+ // Finish any publish jobs synchronously
+ void PublishAllSynchronous();
+
+ bool RecordingAborted() const { return m_bRecordingAborted; }
+
+private:
+ //
+ // CBaseThinker
+ //
+ float GetNextThinkTime() const;
+ void Think();
+
+ void PublishThink();
+
+ CSessionPublishManager *GetCurrentPublishManager() const; // Get the publish manager for the currently recording session
+ void CreateAndAddNewPublishManager( CServerRecordingSession *pSession );
+
+ int m_nCurrentRecordingStartTick;
+ bool m_bRecordingAborted;
+
+ typedef CUtlLinkedList< CSessionPublishManager *, int > PublishManagerContainer_t;
+ PublishManagerContainer_t m_lstPublishManagers;
+};
+
+//----------------------------------------------------------------------------------------
+
+#endif // SV_SESSIONRECORDER_H