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_recordingsessionblock.cpp | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'replay/sv_recordingsessionblock.cpp')
| -rw-r--r-- | replay/sv_recordingsessionblock.cpp | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/replay/sv_recordingsessionblock.cpp b/replay/sv_recordingsessionblock.cpp new file mode 100644 index 0000000..7a9ca63 --- /dev/null +++ b/replay/sv_recordingsessionblock.cpp @@ -0,0 +1,48 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +//=======================================================================================// + +#include "sv_recordingsessionblock.h" +#include "qlimits.h" +#include "sv_fileservercleanup.h" +#include "sv_replaycontext.h" + +// memdbgon must be the last include file in a .cpp file!!! +#include "tier0/memdbgon.h" + +//---------------------------------------------------------------------------------------- + +CServerRecordingSessionBlock::CServerRecordingSessionBlock( IReplayContext *pContext ) +: CBaseRecordingSessionBlock( pContext ), + m_nWriteStatus( WRITESTATUS_INVALID ), + m_pPublisher( NULL ) +{ +} + +bool CServerRecordingSessionBlock::Read( KeyValues *pIn ) +{ + if ( !BaseClass::Read( pIn ) ) + return false; + + m_nWriteStatus = (WriteStatus_t)pIn->GetInt( "write_status", (int)WRITESTATUS_INVALID ); Assert( m_nWriteStatus != WRITESTATUS_INVALID ); + V_strcpy_safe( m_szFullFilename, pIn->GetString( "filename" ) ); Assert( V_strlen( m_szFullFilename ) > 0 ); + + return true; +} + +void CServerRecordingSessionBlock::Write( KeyValues *pOut ) +{ + BaseClass::Write( pOut ); + + pOut->SetInt( "write_status", (int)m_nWriteStatus ); Assert( m_nWriteStatus != WRITESTATUS_INVALID ); + pOut->SetString( "filename", m_szFullFilename ); +} + +void CServerRecordingSessionBlock::OnDelete() +{ + BaseClass::OnDelete(); + + SV_GetFileserverCleaner()->MarkFileForDelete( V_UnqualifiedFileName( m_szFullFilename ) ); +} + +//---------------------------------------------------------------------------------------- |