Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
1.5 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. //=======================================================================================//
  4. #include "sv_recordingsessionblock.h"
  5. #include "qlimits.h"
  6. #include "sv_fileservercleanup.h"
  7. #include "sv_replaycontext.h"
  8. // memdbgon must be the last include file in a .cpp file!!!
  9. #include "tier0/memdbgon.h"
  10. //----------------------------------------------------------------------------------------
  11. CServerRecordingSessionBlock::CServerRecordingSessionBlock( IReplayContext *pContext )
  12. : CBaseRecordingSessionBlock( pContext ),
  13. m_nWriteStatus( WRITESTATUS_INVALID ),
  14. m_pPublisher( NULL )
  15. {
  16. }
  17. bool CServerRecordingSessionBlock::Read( KeyValues *pIn )
  18. {
  19. if ( !BaseClass::Read( pIn ) )
  20. return false;
  21. m_nWriteStatus = (WriteStatus_t)pIn->GetInt( "write_status", (int)WRITESTATUS_INVALID ); Assert( m_nWriteStatus != WRITESTATUS_INVALID );
  22. V_strcpy_safe( m_szFullFilename, pIn->GetString( "filename" ) ); Assert( V_strlen( m_szFullFilename ) > 0 );
  23. return true;
  24. }
  25. void CServerRecordingSessionBlock::Write( KeyValues *pOut )
  26. {
  27. BaseClass::Write( pOut );
  28. pOut->SetInt( "write_status", (int)m_nWriteStatus ); Assert( m_nWriteStatus != WRITESTATUS_INVALID );
  29. pOut->SetString( "filename", m_szFullFilename );
  30. }
  31. void CServerRecordingSessionBlock::OnDelete()
  32. {
  33. BaseClass::OnDelete();
  34. SV_GetFileserverCleaner()->MarkFileForDelete( V_UnqualifiedFileName( m_szFullFilename ) );
  35. }
  36. //----------------------------------------------------------------------------------------