Exposes a wide range of information and actions for applications and
Downloadable Content (DLC).
Member Functions
Member functions for
ISteamApps
are called through the global accessor function
SteamApps()
.
BGetDLCDataByIndex
bool BGetDLCDataByIndex( int iDLC, AppId_t *pAppID, bool *pbAvailable, char *pchName, int cchNameBufferSize );
Name | Type | Description |
iDLC | int | Index of the DLC to get between 0 and GetDLCCount. |
pAppID | AppId_t * | Returns the App ID of the DLC. |
pbAvailable | bool * | Returns whether the DLC is currently available on the Steam store. Will be false if the DLC does not have a visible store page |
pchName | char * | Returns the name of the DLC by copying it into this buffer. |
cchNameBufferSize | int | The length of the pchName buffer. |
Returns metadata for a DLC by index.
Returns: bool
true if the current App ID has DLC's associated with it and
iDLC
falls between the range of 0 to
GetDLCCount, otherwise
false.
Example:int32 DLCCount = SteamApps()->GetDLCCount();
for ( int i = 0; i < DLCCount; ++i ) {
AppId_t appId;
bool available;
char name[128];
bool success = SteamApps()->BGetDLCDataByIndex( i, &appId, &available, name, 128 );
if ( success ) {
// Do something with the DLC Data
}
}
BIsAppInstalled
bool BIsAppInstalled( AppId_t appID );
Name | Type | Description |
appID | AppId_t | The App ID of the application to check. |
Checks if a specific app is installed.
The app may not actually be owned by the current user, they may have it left over from a free weekend, etc.
This only works for base applications, not
Downloadable Content (DLC). Use
BIsDlcInstalled for DLC instead.
Returns: bool
true if the specified App ID is installed; otherwise,
false.
BIsCybercafe
bool BIsCybercafe();
Checks whether the current App ID is for Cyber Cafes.
Returns: bool
true if the license if for cyber cafe's; otherwise,
false.
Deprecated - No longer used.
BIsDlcInstalled
bool BIsDlcInstalled( AppId_t appID );
Name | Type | Description |
appID | AppId_t | The App ID of the DLC to check. |
Checks if the user owns a specific DLC and if the DLC is installed
Returns: bool
true if the user owns the DLC and it's currently installed, otherwise
false.
Note: Should only be used for simple client side checks - not intended for granting in-game items.
BIsLowViolence
bool BIsLowViolence();
Checks if the license owned by the user provides low violence depots.
Low violence depots are useful for copies sold in countries that have content restrictions.
Returns: bool
true if the license owned by the user provides low violence depots; otherwise,
false.
See Also: Depot Mounting RulesBIsSubscribed
bool BIsSubscribed();
Checks if the active user is subscribed to the current App ID.
NOTE: This will always return
true if you're using Steam DRM or calling
SteamAPI_RestartAppIfNecessary.
Returns: bool
true if the active user owns the current AppId, otherwise
false.
BIsSubscribedApp
bool BIsSubscribedApp( AppId_t appID );
Name | Type | Description |
appID | AppId_t | The App ID to check. |
Checks if the active user is subscribed to a specified AppId.
Only use this if you need to check ownership of another game related to yours, a demo for example.
Returns: bool
true if the active user is subscribed to the specified App ID, otherwise
false.
BIsSubscribedFromFamilySharing
bool BIsSubscribedFromFamilySharing();
Checks if the active user is accessing the current appID via a temporary Family Shared license owned by another user.
If you need to determine the steamID of the permanent owner of the license, use
GetAppOwner.
Returns: bool
true if the active user is accessing the current appID via family sharing, otherwise
false.
BIsSubscribedFromFreeWeekend
bool BIsSubscribedFromFreeWeekend();
Checks if the user is subscribed to the current appID through a free weekend.
Before using this please contact a Valve technical account manager via the
Steamworks Discussion Board to properly package and secure your free weekend.
Returns: bool
true if the active user is subscribed to the current App Id via a free weekend otherwise
false any other type of license.
BIsTimedTrial
bool BIsTimedTrial(uint32* punSecondsAllowed, uint32* punSecondsPlayed);
Name | Type | Description |
punSecondsAllowed | uint32 * | Returns the number of seconds the timed trial will list. |
punSecondsPlayed | uint32 * | Returns the number of seconds that the user has played so far. |
Checks if the user is subscribed to the current appID through a timed trial. If so, returns true and gives back the total time the timed trial is allowed to play, along with the current amount of time the user has played.
Returns: bool
true if the active user is subscribed to the current appID via a timed trial otherwise
false any other type of license.
See Also: TimedTrialStatus_tBIsVACBanned
bool BIsVACBanned();
Checks if the user has a VAC ban on their account
Returns: bool
true if the user has a VAC ban on their account; otherwise,
false.
GetAppBuildId
int GetAppBuildId();
Gets the buildid of this app, may change at any time based on backend updates to the game.
Returns: int
The current Build Id of this App. Defaults to 0 if you're not running a build downloaded from steam.
GetAppInstallDir
uint32 GetAppInstallDir( AppId_t appID, char *pchFolder, uint32 cchFolderBufferSize );
Name | Type | Description |
appID | AppId_t | The App ID to get the install dir for. |
pchFolder | char * | The string buffer that the folder path will be copied into. |
cchFolderBufferSize | uint32 | The size in bytes of the pchFolder buffer. |
Gets the install folder for a specific AppID.
This works even if the application is not installed, based on where the game would be installed with the default Steam library location.
Returns: uint32Returns the install directory path as a string into the buffer provided in pchFolder and returns the number of bytes that were copied into that buffer.
GetAppOwner
CSteamID GetAppOwner();
Gets the Steam ID of the true owner of the current app. This is different from the current user if they are accessing this app via Family Sharing
Returns: CSteamIDThe original owner of the current app.
GetAvailableGameLanguages
const char * GetAvailableGameLanguages();
Gets a comma separated list of the languages the current app supports.
For the full list of languages that may be returned see
Localization and Languages.
Returns: const char *
Returns a comma separated list of languages.
See Also: GetCurrentGameLanguage,
ISteamUtils::GetSteamUILanguageGetCurrentBetaName
bool GetCurrentBetaName( char *pchName, int cchNameBufferSize );
Name | Type | Description |
pchName | char * | The buffer where the beta name will be copied in to. |
cchNameBufferSize | int | The total size of the pchName buffer. |
Checks if the user is running from a beta branch, and gets the name of the branch if they are.
Returns: bool
true if the user is on a beta branch; otherwise,
false.
GetNumBetas
int GetNumBetas( int *pnAvailable, int *pnPrivate );
Name | Type | Description |
pnAvailable | int* | Number of beta branches available to current user. |
pnPrivate | int* | How many of these are private betas. |
Returns total number of known app branches (including default "public" branch ) which can be iterated with GetBetaInfo()
Returns: int
Number of known app branches
GetBetaInfo
bool GetBetaInfo( int iBetaIndex, uint32 *punFlags, uint32 *punBuildID, char *pchBetaName, int cchBetaName, char *pchDescription, int cchDescription );
Name | Type | Description |
iBetaIndex | int | Branch index starting at 0 which is always the default branch. |
punFlags | uint32 * | Set of flags (EBetaBranchFlags) describing current branch state. |
punBuildID | uint32 * | Content BuildID set live on this branch. |
pchBetaName | char * | Beta branch name |
cchBetaName | int | Size of pchBetaName provided by caller |
pchDescription | char * | Beta branch description |
cchDescription | int | Size of pchDescription provided by caller |
Get details about an app beta branch like name, description and state.
Returns: bool
true if passed in branch index is valid; otherwise, false.
Example:int32 betaCount = SteamApps()->GetNumBetas( nullptr, nullptr );
for ( int betaIndex = 0; betaIndex < betaCount; ++betaIndex )
{
char name[128];
char description[1024];
uint32 flags = 0; // EBetaBranchFlags
uint32 buildID = 0;
SteamApps()->GetBetaInfo( betaIndex, &flags, &buildID, name, sizeof( name ), description, sizeof( description ) );
}
SetActiveBeta
bool SetActiveBeta( const char *pchBetaName );
Name | Type | Description |
pchBetaName | const char * | Beta name the game wants to switch to. |
Select an beta branch for this app as active, might need the game to restart so Steam can update its' content that branch.
Returns: bool
GetCurrentGameLanguage
const char * GetCurrentGameLanguage();
Gets the current language that the user has set.
This falls back to the Steam UI language if the user hasn't explicitly picked a language for the title.
For the full list of languages see
Supported Languages.
Returns: const char *
See Also: GetAvailableGameLanguages,
ISteamUtils::GetSteamUILanguageGetDLCCount
int GetDLCCount();
Gets the number of DLC pieces for the current app.
This is typically used to loop through each piece of DLC and get the info about each one with
BGetDLCDataByIndex.
Returns: int
The number of DLC pieces for the current app. Note that this value may max out at 64, depending on how much unowned DLC the user has. If your app has a large number of DLC, you should set your own internal list of known DLC to check against.
Example:int32 DLCCount = SteamApps()->GetDLCCount();
for ( int i = 0; i < DLCCount; ++i ) {
AppId_t appId;
bool available;
char name[128];
bool success = SteamApps()->BGetDLCDataByIndex( i, &appId, &available, name, 128 );
if ( success ) {
// Do something with the DLC Data
}
}
GetDlcDownloadProgress
bool GetDlcDownloadProgress( AppId_t nAppID, uint64 *punBytesDownloaded, uint64 *punBytesTotal );
Name | Type | Description |
nAppID | AppId_t | The App ID of the DLC to monitor |
punBytesDownloaded | uint64 * | Returns the number of bytes downloaded. |
punBytesTotal | uint64 * | Returns the total size of the download in bytes. |
Gets the download progress for optional DLC.
Returns: bool
true if the specified DLC exists and is currently downloading; otherwise,
false.
GetEarliestPurchaseUnixTime
uint32 GetEarliestPurchaseUnixTime( AppId_t nAppID );
Name | Type | Description |
nAppID | AppId_t | The App ID to get the purchase time for. |
Gets the time of purchase of the specified app in Unix epoch format (time since Jan 1st, 1970).
This is useful for rewarding users based on their initial purchase date.
Returns: uint32The earliest purchase time in Unix epoch format (seconds since Jan 1st, 1970).
GetFileDetails
SteamAPICall_t GetFileDetails( const char*pszFileName );
Name | Type | Description |
pszFileName | const char* | The absolute path and name to the file. |
Asynchronously retrieves metadata details about a specific file in the depot manifest.
Currently provides:
The file size in bytes.
The file's SHA1 hash.
The file's flags.
Returns: SteamAPICall_t to be used with a
FileDetailsResult_t call result.
GetInstalledDepots
uint32 GetInstalledDepots( AppId_t appID, DepotId_t *pvecDepots, uint32 cMaxDepots );
Name | Type | Description |
appID | AppId_t | The App to list the depots for. |
pvecDepots | DepotId_t * | A preallocated array that will be filled with the list of depots. |
cMaxDepots | uint32 | The maximum number of depots to obtain, typically the size of pvecDepots. |
Gets a list of all installed depots for a given App ID in mount order.
Returns: uint32The number of depots returned.
GetLaunchCommandLine
int GetLaunchCommandLine( char *pszCommandLine, int cubCommandLine );
Name | Type | Description |
pszCommandLine | char * | The string buffer that the command line will be copied into. |
cubCommandLine | int | The size in bytes of the pszCommandLine buffer. |
Gets the command line if the game was launched via Steam URL, e.g. steam://run/<appid>//<command line>/. This method is preferable to launching with a command line via the operating system, which can be a security risk. In order for rich presence joins to go through this and not be placed on the OS command line, you must enable "Use launch command line" from the Installation > General page on your app.
Returns: int
Returns the command line as a string into the buffer provided in pszCommandLine and returns the number of bytes that were copied into that buffer.
See Also: NewUrlLaunchParameters_tGetLaunchQueryParam
const char * GetLaunchQueryParam( const char *pchKey );
Name | Type | Description |
pchKey | const char * | The launch key to test for. Ex: param1 |
Gets the associated launch parameter if the game is run via steam://run/<appid>/?param1=value1;param2=value2;param3=value3 etc.
Parameter names starting with the character '@' are reserved for internal use and will always return an empty string.
Parameter names starting with an underscore '_' are reserved for steam features -- they can be queried by the game, but it is advised that you not param names beginning with an underscore for your own features.
Returns: const char *
The value associated with the key provided. Returns an empty string ("") if the specified key does not exist.
See Also: NewLaunchQueryParameters_tInstallDLC
void InstallDLC( AppId_t nAppID );
Name | Type | Description |
nAppID | AppId_t | The DLC you want to install. |
Allows you to install an optional DLC.
Returns: void
Triggers a
DlcInstalled_t callback.
MarkContentCorrupt
bool MarkContentCorrupt( bool bMissingFilesOnly );
Name | Type | Description |
bMissingFilesOnly | bool | Only scan for missing files, don't verify the checksum of each file. |
Allows you to force verify game content on next launch.
If you detect the game is out-of-date (for example, by having the client detect a version mismatch with a server),
you can call use MarkContentCorrupt to force a verify, show a message to the user, and then quit.
Returns: bool
RequestAllProofOfPurchaseKeys
void RequestAllProofOfPurchaseKeys();
Deprecated.
RequestAppProofOfPurchaseKey
void RequestAppProofOfPurchaseKey( AppId_t nAppID );
Deprecated.
UninstallDLC
void UninstallDLC( AppId_t nAppID );
Name | Type | Description |
nAppID | AppId_t | The DLC you want to uninstall. |
Allows you to uninstall an optional DLC.
Callbacks
These are callbacks which can be fired by calling
SteamAPI_RunCallbacks. Many of these will be fired directly in response to the member functions of
ISteamApps
.
AppProofOfPurchaseKeyResponse_t
Only used internally in Steam.
DlcInstalled_t
Triggered after the current user gains ownership of DLC and that DLC is installed.
Name | Type | Description |
m_nAppID | AppId_t | App ID of the DLC that was installed. |
Associated Functions: InstallDLCFileDetailsResult_t
Called after requesting the details of a specific file.
Name | Type | Description |
m_eResult | EResult | Was the call successful? k_EResultOK if it was; otherwise, k_EResultFileNotFound if the file was not found. None of the other fields are filled out if the call was not successful. |
m_ulFileSize | uint64 | The original file size in bytes. |
m_FileSHA | uint8[20] | The original file SHA1 hash. |
m_unFlags | uint32 | |
Associated Functions: GetFileDetailsNewUrlLaunchParameters_t
Posted after the user executes a steam url with command line or query parameters such as
steam://run/<appid>//?param1=value1;param2=value2;param3=value3;
while the game is already running. The new params can be queried with
GetLaunchCommandLine and
GetLaunchQueryParam.
This callback has no fields.
NewLaunchQueryParameters_t
Posted after the user executes a steam url with query parameters such as
steam://run/<appid>//?param1=value1;param2=value2;param3=value3;
while the game is already running. The new params can be queried with
GetLaunchQueryParam.
This callback has no fields.
RegisterActivationCodeResponse_t
Only used internally in Steam.
TimedTrialStatus_t
Sent every minute when a appID is owned via a timed trial.
Name | Type | Description |
m_unAppID | AppId_t | AppID that is in a timed trial. |
m_bIsOffline | bool | If true, the user is currently offline. Time allowed / played refers to offline time, not total time. |
m_unSecondsAllowed | uint32 | How many seconds the app can be played in total. |
m_unSecondsPlayed | uint32 | How many seconds the app was already played. |
See Also: BIsTimedTrialEnums
These are enums which are defined for use with ISteamApps.
ERegisterActivationCodeResult
Only used internally in Steam.
Name | Value | Description |
k_ERegisterActivationCodeResultOK | 0 | |
k_ERegisterActivationCodeResultFail | 1 | |
k_ERegisterActivationCodeResultAlreadyRegistered | 2 | |
k_ERegisterActivationCodeResultTimeout | 3 | |
k_ERegisterActivationCodeAlreadyOwned | 4 | |
Constants
These are constants which are defined for use with ISteamApps.
Name | Type | Value | Description |
k_cubAppProofOfPurchaseKeyMax | int | 240 | Only used internally in Steam. |
STEAMAPPS_INTERFACE_VERSION | const char * | "STEAMAPPS_INTERFACE_VERSION008" | |