Counter Strike : Global Offensive Source Code
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.

92 lines
2.6 KiB

  1. //========= Copyright (c) 1996-2009, Valve Corporation, All rights reserved. ============//
  2. //
  3. //=======================================================================================//
  4. #ifndef IREPLAYHISTORYMANAGER_H
  5. #define IREPLAYHISTORYMANAGER_H
  6. #ifdef _WIN32
  7. #pragma once
  8. #endif
  9. //----------------------------------------------------------------------------------------
  10. #include "interface.h"
  11. #include "timeutils.h"
  12. #include "qlimits.h"
  13. #include "convar.h"
  14. #include "tier1/utllinkedlist.h"
  15. #include <time.h>
  16. //----------------------------------------------------------------------------------------
  17. #define REPLAYHISTORYMANAGER_INTERFACE_VERSION "VENGINE_REPLAY_HISTORY_MANAGER_001"
  18. //----------------------------------------------------------------------------------------
  19. class CBaseReplayHistoryEntryData
  20. {
  21. public:
  22. virtual ~CBaseReplayHistoryEntryData() {}
  23. char m_szFilename[ MAX_OSPATH ];
  24. char m_szMapName[ MAX_OSPATH ];
  25. int m_nRecordTime; // Gets cast to a time_t
  26. int m_nLifeSpan; // How many seconds from the record time until deletion
  27. DmeTime_t m_DemoLength; // Length of the demo
  28. int m_nBytesTransferred;
  29. int m_nSize; // Size in bytes
  30. int m_nTransferId; // CNetChan transfer id
  31. bool m_bTransferComplete;
  32. bool m_bTransferring; // File currently transferring?
  33. };
  34. //----------------------------------------------------------------------------------------
  35. class CClientReplayHistoryEntryData : public CBaseReplayHistoryEntryData
  36. {
  37. public:
  38. void BeginDownload();
  39. char m_szServerAddress[ MAX_OSPATH ]; // In the form <IP address>:<port number>
  40. };
  41. //----------------------------------------------------------------------------------------
  42. class CServerReplayHistoryEntryData : public CBaseReplayHistoryEntryData
  43. {
  44. public:
  45. uint64 m_uClientSteamId;
  46. enum EFileStatus
  47. {
  48. FILESTATUS_NOTONDISK,
  49. FILESTATUS_EXISTS,
  50. FILESTATUS_EXPIRED
  51. };
  52. int m_nFileStatus;
  53. };
  54. //----------------------------------------------------------------------------------------
  55. class IReplayHistoryManager : IBaseInterface
  56. {
  57. public:
  58. virtual void Init() = 0;
  59. virtual void Shutdown() = 0;
  60. virtual bool IsInitialized() const = 0;
  61. virtual void Update() = 0;
  62. virtual void FlushEntriesToDisk() = 0;
  63. virtual void StopDownloads() = 0;
  64. virtual int GetNumEntries() const = 0;
  65. virtual const CBaseReplayHistoryEntryData *GetEntryAtIndex( int iIndex ) const = 0;
  66. virtual CBaseReplayHistoryEntryData *FindEntry( const char *pFilename ) = 0;
  67. virtual bool RecordEntry( CBaseReplayHistoryEntryData *pNewEntry ) = 0;
  68. };
  69. //----------------------------------------------------------------------------------------
  70. #endif // IREPLAYHISTORYMANAGER_H