Rise
The Vieneo Province
Loading...
Searching...
No Matches
isteamapps.h
Go to the documentation of this file.
1//====== Copyright © 1996-2008, Valve Corporation, All rights reserved. =======
2//
3// Purpose: interface to app data in Steam
4//
5//=============================================================================
6
7#ifndef ISTEAMAPPS_H
8#define ISTEAMAPPS_H
9#ifdef _WIN32
10#pragma once
11#endif
12
13#include "steam_api_common.h"
14
15const int k_cubAppProofOfPurchaseKeyMax = 240; // max supported length of a legacy cd key
16
17// Games can specify what settings the user has selected or has been selected by default based
18// on the user's machine.
28
29//-----------------------------------------------------------------------------
30// Purpose: interface to app data
31//-----------------------------------------------------------------------------
33{
34public:
35 virtual bool BIsSubscribed() = 0;
36 virtual bool BIsLowViolence() = 0;
37 virtual bool BIsCybercafe() = 0;
38 virtual bool BIsVACBanned() = 0;
39 virtual const char *GetCurrentGameLanguage() = 0;
40 virtual const char *GetAvailableGameLanguages() = 0;
41
42 // only use this member if you need to check ownership of another game related to yours, a demo for example
43 virtual bool BIsSubscribedApp( AppId_t appID ) = 0;
44
45 // Takes AppID of DLC and checks if the user owns the DLC & if the DLC is installed
46 virtual bool BIsDlcInstalled( AppId_t appID ) = 0;
47
48 // returns the Unix time of the purchase of the app
50
51 // Checks if the user is subscribed to the current app through a free weekend
52 // This function will return false for users who have a retail or other type of license
53 // Before using, please ask your Valve technical contact how to package and secure your free weekend
54 virtual bool BIsSubscribedFromFreeWeekend() = 0;
55
56 // Returns the number of DLC pieces for the running app
57 virtual int GetDLCCount() = 0;
58
59 // Returns metadata for DLC by index, of range [0, GetDLCCount()]
60 virtual bool BGetDLCDataByIndex( int iDLC, AppId_t *pAppID, bool *pbAvailable, char *pchName, int cchNameBufferSize ) = 0;
61
62 // Install/Uninstall control for optional DLC
63 virtual void InstallDLC( AppId_t nAppID ) = 0;
64 virtual void UninstallDLC( AppId_t nAppID ) = 0;
65
66 // Request legacy cd-key for yourself or owned DLC. If you are interested in this
67 // data then make sure you provide us with a list of valid keys to be distributed
68 // to users when they purchase the game, before the game ships.
69 // You'll receive an AppProofOfPurchaseKeyResponse_t callback when
70 // the key is available (which may be immediately).
71 virtual void RequestAppProofOfPurchaseKey( AppId_t nAppID ) = 0;
72
73 virtual bool GetCurrentBetaName( char *pchName, int cchNameBufferSize ) = 0; // returns current beta branch name, 'public' is the default branch
74 virtual bool MarkContentCorrupt( bool bMissingFilesOnly ) = 0; // signal Steam that game files seems corrupt or missing
75 virtual uint32 GetInstalledDepots( AppId_t appID, DepotId_t *pvecDepots, uint32 cMaxDepots ) = 0; // return installed depots in mount order
76
77 // returns current app install folder for AppID, returns folder name length
78 virtual uint32 GetAppInstallDir( AppId_t appID, char *pchFolder, uint32 cchFolderBufferSize ) = 0;
79 virtual bool BIsAppInstalled( AppId_t appID ) = 0; // returns true if that app is installed (not necessarily owned)
80
81 // returns the SteamID of the original owner. If this CSteamID is different from ISteamUser::GetSteamID(),
82 // the user has a temporary license borrowed via Family Sharing
83 virtual CSteamID GetAppOwner() = 0;
84
85 // Returns the associated launch param if the game is run via steam://run/<appid>//?param1=value1&param2=value2&param3=value3 etc.
86 // Parameter names starting with the character '@' are reserved for internal use and will always return and empty string.
87 // Parameter names starting with an underscore '_' are reserved for steam features -- they can be queried by the game,
88 // but it is advised that you not param names beginning with an underscore for your own features.
89 // Check for new launch parameters on callback NewUrlLaunchParameters_t
90 virtual const char *GetLaunchQueryParam( const char *pchKey ) = 0;
91
92 // get download progress for optional DLC
93 virtual bool GetDlcDownloadProgress( AppId_t nAppID, uint64 *punBytesDownloaded, uint64 *punBytesTotal ) = 0;
94
95 // return the buildid of this app, may change at any time based on backend updates to the game
96 virtual int GetAppBuildId() = 0;
97
98 // Request all proof of purchase keys for the calling appid and associated DLC.
99 // A series of AppProofOfPurchaseKeyResponse_t callbacks will be sent with
100 // appropriate appid values, ending with a final callback where the m_nAppId
101 // member is k_uAppIdInvalid (zero).
103
105 virtual SteamAPICall_t GetFileDetails( const char* pszFileName ) = 0;
106
107 // Get command line if game was launched via Steam URL, e.g. steam://run/<appid>//<command line>/.
108 // This method of passing a connect string (used when joining via rich presence, accepting an
109 // invite, etc) is preferable to passing the connect string on the operating system command
110 // line, which is a security risk. In order for rich presence joins to go through this
111 // path and not be placed on the OS command line, you must set a value in your app's
112 // configuration on Steam. Ask Valve for help with this.
113 //
114 // If game was already running and launched again, the NewUrlLaunchParameters_t will be fired.
115 virtual int GetLaunchCommandLine( char *pszCommandLine, int cubCommandLine ) = 0;
116
117 // Check if user borrowed this game via Family Sharing, If true, call GetAppOwner() to get the lender SteamID
119
120 // check if game is a timed trial with limited playtime
121 virtual bool BIsTimedTrial( uint32* punSecondsAllowed, uint32* punSecondsPlayed ) = 0;
122
123 // set current DLC AppID being played (or 0 if none). Allows Steam to track usage of major DLC extensions
124 virtual bool SetDlcContext( AppId_t nAppID ) = 0;
125
126 // returns total number of known app branches (including default "public" branch ). nAvailable is number of available betas
127 virtual int GetNumBetas( int *pnAvailable, int *pnPrivate ) = 0; //
128
129 // return beta branch details, name, description, current BuildID and state flags (EBetaBranchFlags)
130 virtual bool GetBetaInfo( int iBetaIndex, uint32 *punFlags, uint32 *punBuildID, char *pchBetaName, int cchBetaName, char *pchDescription, int cchDescription, uint32 *punLastUpdated ) = 0; // iterate through
131
132 // select this beta branch for this app as active, might need the game to restart so Steam can update to that branch
133 virtual bool SetActiveBeta( const char *pchBetaName ) = 0;
134
135 // game performance settings
137 virtual void SetGameRenderResolution( uint32 unWidth, uint32 unHeight ) = 0;
138};
139
140#define STEAMAPPS_INTERFACE_VERSION "STEAMAPPS_INTERFACE_VERSION009"
141
142// Global interface accessor
145
146// callbacks
147#if defined( VALVE_CALLBACK_PACK_SMALL )
148#pragma pack( push, 4 )
149#elif defined( VALVE_CALLBACK_PACK_LARGE )
150#pragma pack( push, 8 )
151#else
152#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx
153#endif
154//-----------------------------------------------------------------------------
155// Purpose: posted after the user gains ownership of DLC & that DLC is installed
156//-----------------------------------------------------------------------------
158{
160 AppId_t m_nAppID; // AppID of the DLC
161};
162
163
164//---------------------------------------------------------------------------------
165// Purpose: posted after the user gains executes a Steam URL with command line or query parameters
166// such as steam://run/<appid>//-commandline/?param1=value1&param2=value2&param3=value3 etc
167// while the game is already running. The new params can be queried
168// with GetLaunchQueryParam and GetLaunchCommandLine
169//---------------------------------------------------------------------------------
174
175
176//-----------------------------------------------------------------------------
177// Purpose: response to RequestAppProofOfPurchaseKey/RequestAllProofOfPurchaseKeys
178// for supporting third-party CD keys, or other proof-of-purchase systems.
179//-----------------------------------------------------------------------------
188
189
190//-----------------------------------------------------------------------------
191// Purpose: response to GetFileDetails
192//-----------------------------------------------------------------------------
194{
197 uint64 m_ulFileSize; // original file size in bytes
198 uint8 m_FileSHA[20]; // original file SHA1 hash
200};
201
202
203//-----------------------------------------------------------------------------
204// Purpose: called for games in Timed Trial mode
205//-----------------------------------------------------------------------------
207{
210 bool m_bIsOffline; // if true, time allowed / played refers to offline time, not total time
211 uint32 m_unSecondsAllowed; // how many seconds the app can be played in total
212 uint32 m_unSecondsPlayed; // how many seconds the app was already played
213};
214
215#pragma pack( pop )
216#endif // ISTEAMAPPS_H
virtual int GetAppBuildId()=0
virtual bool BIsSubscribedApp(AppId_t appID)=0
virtual bool BIsVACBanned()=0
virtual const char * GetLaunchQueryParam(const char *pchKey)=0
virtual void RequestAppProofOfPurchaseKey(AppId_t nAppID)=0
virtual int GetNumBetas(int *pnAvailable, int *pnPrivate)=0
virtual bool BIsDlcInstalled(AppId_t appID)=0
virtual void RequestAllProofOfPurchaseKeys()=0
virtual bool GetCurrentBetaName(char *pchName, int cchNameBufferSize)=0
virtual const char * GetCurrentGameLanguage()=0
virtual bool SetDlcContext(AppId_t nAppID)=0
virtual bool BIsCybercafe()=0
virtual bool BIsSubscribed()=0
virtual bool BIsSubscribedFromFreeWeekend()=0
virtual void InstallDLC(AppId_t nAppID)=0
virtual bool BIsTimedTrial(uint32 *punSecondsAllowed, uint32 *punSecondsPlayed)=0
virtual bool BGetDLCDataByIndex(int iDLC, AppId_t *pAppID, bool *pbAvailable, char *pchName, int cchNameBufferSize)=0
virtual uint32 GetAppInstallDir(AppId_t appID, char *pchFolder, uint32 cchFolderBufferSize)=0
virtual void SetGameRenderResolution(uint32 unWidth, uint32 unHeight)=0
virtual SteamAPICall_t GetFileDetails(const char *pszFileName)=0
virtual void SetGamePerformanceSetting(EGamePerformanceSetting setting)=0
virtual void UninstallDLC(AppId_t nAppID)=0
virtual bool BIsLowViolence()=0
virtual uint32 GetEarliestPurchaseUnixTime(AppId_t nAppID)=0
virtual int GetDLCCount()=0
virtual const char * GetAvailableGameLanguages()=0
virtual bool MarkContentCorrupt(bool bMissingFilesOnly)=0
virtual bool GetBetaInfo(int iBetaIndex, uint32 *punFlags, uint32 *punBuildID, char *pchBetaName, int cchBetaName, char *pchDescription, int cchDescription, uint32 *punLastUpdated)=0
virtual bool GetDlcDownloadProgress(AppId_t nAppID, uint64 *punBytesDownloaded, uint64 *punBytesTotal)=0
virtual bool BIsSubscribedFromFamilySharing()=0
virtual bool SetActiveBeta(const char *pchBetaName)=0
virtual int GetLaunchCommandLine(char *pszCommandLine, int cubCommandLine)=0
virtual uint32 GetInstalledDepots(AppId_t appID, DepotId_t *pvecDepots, uint32 cMaxDepots)=0
virtual CSteamID GetAppOwner()=0
virtual bool BIsAppInstalled(AppId_t appID)=0
#define STEAMAPPS_INTERFACE_VERSION
Definition isteamapps.h:140
const int k_cubAppProofOfPurchaseKeyMax
Definition isteamapps.h:15
EGamePerformanceSetting
Definition isteamapps.h:20
@ k_EGamePerformanceSetting_Custom
Definition isteamapps.h:26
@ k_EGamePerformanceSetting_NotSet
Definition isteamapps.h:21
@ k_EGamePerformanceSetting_Ultra
Definition isteamapps.h:25
@ k_EGamePerformanceSetting_High
Definition isteamapps.h:24
@ k_EGamePerformanceSetting_Medium
Definition isteamapps.h:23
@ k_EGamePerformanceSetting_Low
Definition isteamapps.h:22
ISteamApps * SteamApps()
const char *typedef uint32(S_CALLTYPE *SteamAPI_CheckCallbackRegistered_t)(int iCallbackNum)
#define STEAM_DEFINE_USER_INTERFACE_ACCESSOR(type, name, version)
#define STEAM_CALL_RESULT(RESULT_TYPE)
@ k_iSteamAppsCallbacks
uint32 AppId_t
Definition steamtypes.h:81
unsigned long long uint64
Definition steamtypes.h:60
uint64 SteamAPICall_t
Definition steamtypes.h:93
uint32 DepotId_t
Definition steamtypes.h:85
unsigned char uint8
Definition steamtypes.h:11
char m_rgchKey[k_cubAppProofOfPurchaseKeyMax]
Definition isteamapps.h:186
AppId_t m_nAppID
Definition isteamapps.h:160
uint32 m_unSecondsAllowed
Definition isteamapps.h:211