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.

83 lines
1.5 KiB

  1. //========= Copyright � 1996-2009, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=====================================================================================//
  6. #ifndef _MM_DLC_H_
  7. #define _MM_DLC_H_
  8. #include "utlvector.h"
  9. #include "utlmap.h"
  10. class CDlcManager :
  11. public IDlcManager,
  12. public IMatchEventsSink
  13. {
  14. public :
  15. CDlcManager();
  16. virtual ~CDlcManager();
  17. //
  18. // IDlcManager implementation
  19. //
  20. public:
  21. //
  22. // RequestDlcUpdate
  23. // requests a background DLC update
  24. //
  25. virtual void RequestDlcUpdate();
  26. virtual bool IsDlcUpdateFinished( bool bWaitForFinish = false );
  27. //
  28. // GetDataInfo
  29. // retrieves the last acquired dlc information
  30. //
  31. virtual KeyValues * GetDataInfo();
  32. //
  33. // IMatchEventsSink implementation
  34. //
  35. public:
  36. virtual void OnEvent( KeyValues *kvEvent );
  37. //
  38. // Interface for match system
  39. //
  40. public:
  41. void Update();
  42. protected:
  43. KeyValues *m_pDataInfo;
  44. #ifdef _X360
  45. HANDLE m_hEnumerator;
  46. XOVERLAPPED m_xOverlapped;
  47. int32 m_dwNumItems;
  48. DWORD m_dwLicenseMask;
  49. CUtlVector< XCONTENT_DATA > m_arrContentData;
  50. void CreateNextContent();
  51. void ProcessNextContent();
  52. #endif
  53. #if !defined( NO_STEAM ) && !defined( SWDS )
  54. STEAM_CALLBACK_MANUAL( CDlcManager, Steam_OnDLCInstalled, DlcInstalled_t, m_CallbackOnDLCInstalled );
  55. #endif
  56. enum State_t
  57. {
  58. STATE_IDLE,
  59. #ifdef _X360
  60. STATE_XENUMERATE,
  61. STATE_XCONTENT_CREATE
  62. #endif
  63. };
  64. State_t m_eState;
  65. bool m_bNeedToDiscoverAllDlcs;
  66. bool m_bNeedToUpdateFileSystem;
  67. float m_flTimestamp;
  68. };
  69. extern class CDlcManager *g_pDlcManager;
  70. #endif // _DATACENTER_H_