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.

96 lines
3.6 KiB

  1. //====== Copyright � 1996-2008, Valve Corporation, All rights reserved. =======
  2. //
  3. // Purpose: interface to app data in Steam
  4. //
  5. //=============================================================================
  6. #ifndef ISTEAMAPPS_H
  7. #define ISTEAMAPPS_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. //-----------------------------------------------------------------------------
  12. // Purpose: interface to app data
  13. //-----------------------------------------------------------------------------
  14. class ISteamApps
  15. {
  16. public:
  17. virtual bool BIsSubscribed() = 0;
  18. virtual bool BIsLowViolence() = 0;
  19. virtual bool BIsCybercafe() = 0;
  20. virtual bool BIsVACBanned() = 0;
  21. virtual const char *GetCurrentGameLanguage() = 0;
  22. virtual const char *GetAvailableGameLanguages() = 0;
  23. // only use this member if you need to check ownership of another game related to yours, a demo for example
  24. virtual bool BIsSubscribedApp( AppId_t appID ) = 0;
  25. // Takes AppID of DLC and checks if the user owns the DLC & if the DLC is installed
  26. virtual bool BIsDlcInstalled( AppId_t appID ) = 0;
  27. // returns the Unix time of the purchase of the app
  28. virtual uint32 GetEarliestPurchaseUnixTime( AppId_t nAppID ) = 0;
  29. // Checks if the user is subscribed to the current app through a free weekend
  30. // This function will return false for users who have a retail or other type of license
  31. // Before using, please ask your Valve technical contact how to package and secure your free weekened
  32. virtual bool BIsSubscribedFromFreeWeekend() = 0;
  33. // Returns the number of DLC pieces for the running app
  34. virtual int GetDLCCount() = 0;
  35. // Returns metadata for DLC by index, of range [0, GetDLCCount()]
  36. virtual bool BGetDLCDataByIndex( int iDLC, AppId_t *pAppID, bool *pbAvailable, char *pchName, int cchNameBufferSize ) = 0;
  37. // Install/Uninstall control for optional DLC
  38. virtual void InstallDLC( AppId_t nAppID ) = 0;
  39. virtual void UninstallDLC( AppId_t nAppID ) = 0;
  40. #ifdef _PS3
  41. // Result returned in a RegisterActivationCodeResponse_t callresult
  42. virtual SteamAPICall_t RegisterActivationCode( const char *pchActivationCode ) = 0;
  43. #endif
  44. };
  45. #define STEAMAPPS_INTERFACE_VERSION "STEAMAPPS_INTERFACE_VERSION004"
  46. // callbacks
  47. #pragma pack( push, 8 )
  48. //-----------------------------------------------------------------------------
  49. // Purpose: posted after the user gains ownership of DLC & that DLC is installed
  50. //-----------------------------------------------------------------------------
  51. struct DlcInstalled_t
  52. {
  53. enum { k_iCallback = k_iSteamAppsCallbacks + 5 };
  54. AppId_t m_nAppID; // AppID of the DLC
  55. };
  56. //-----------------------------------------------------------------------------
  57. // Purpose: possible results when registering an activation code
  58. //-----------------------------------------------------------------------------
  59. enum ERegisterActivactionCodeResult
  60. {
  61. k_ERegisterActivactionCodeResultOK = 0,
  62. k_ERegisterActivactionCodeResultFail = 1,
  63. k_ERegisterActivactionCodeResultAlreadyRegistered = 2,
  64. k_ERegisterActivactionCodeResultTimeout = 3,
  65. k_ERegisterActivactionCodeAlreadyOwned = 4
  66. };
  67. //-----------------------------------------------------------------------------
  68. // Purpose: response to RegisterActivationCode()
  69. //-----------------------------------------------------------------------------
  70. struct RegisterActivationCodeResponse_t
  71. {
  72. enum { k_iCallback = k_iSteamAppsCallbacks + 8 };
  73. ERegisterActivactionCodeResult m_eResult;
  74. uint32 m_unPackageRegistered; // package that was registered. Only set on success
  75. };
  76. #pragma pack( pop )
  77. #endif // ISTEAMAPPS_H