Steamworks Documentation
ISteamApps Interface
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 );
NameTypeDescription
iDLCintIndex of the DLC to get between 0 and GetDLCCount.
pAppIDAppId_t *Returns the App ID of the DLC.
pbAvailablebool *Returns whether the DLC is currently available on the Steam store. Will be false if the DLC does not have a visible store page
pchNamechar *Returns the name of the DLC by copying it into this buffer.
cchNameBufferSizeintThe 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 );
NameTypeDescription
appIDAppId_tThe 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 );
NameTypeDescription
appIDAppId_tThe 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 Rules

BIsSubscribed

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 );
NameTypeDescription
appIDAppId_tThe 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);
NameTypeDescription
punSecondsAlloweduint32 *Returns the number of seconds the timed trial will list.
punSecondsPlayeduint32 *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_t

BIsVACBanned

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 );
NameTypeDescription
appIDAppId_tThe App ID to get the install dir for.
pchFolderchar *The string buffer that the folder path will be copied into.
cchFolderBufferSizeuint32The 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: uint32
Returns 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: CSteamID
The 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::GetSteamUILanguage

GetCurrentBetaName

bool GetCurrentBetaName( char *pchName, int cchNameBufferSize );
NameTypeDescription
pchNamechar *The buffer where the beta name will be copied in to.
cchNameBufferSizeintThe 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.

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::GetSteamUILanguage

GetDLCCount

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 );
NameTypeDescription
nAppIDAppId_tThe App ID of the DLC to monitor
punBytesDownloadeduint64 *Returns the number of bytes downloaded.
punBytesTotaluint64 *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 );
NameTypeDescription
nAppIDAppId_tThe 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: uint32
The earliest purchase time in Unix epoch format (seconds since Jan 1st, 1970).

GetFileDetails

SteamAPICall_t GetFileDetails( const char*pszFileName );
NameTypeDescription
pszFileNameconst 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 );
NameTypeDescription
appIDAppId_tThe App to list the depots for.
pvecDepotsDepotId_t *A preallocated array that will be filled with the list of depots.
cMaxDepotsuint32The 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: uint32
The number of depots returned.

GetLaunchCommandLine

int GetLaunchCommandLine( char *pszCommandLine, int cubCommandLine );
NameTypeDescription
pszCommandLinechar *The string buffer that the command line will be copied into.
cubCommandLine intThe 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_t

GetLaunchQueryParam

const char * GetLaunchQueryParam( const char *pchKey );
NameTypeDescription
pchKeyconst 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_t

InstallDLC

void InstallDLC( AppId_t nAppID );
NameTypeDescription
nAppIDAppId_tThe DLC you want to install.

Allows you to install an optional DLC.

Returns: void

Triggers a DlcInstalled_t callback.

MarkContentCorrupt

bool MarkContentCorrupt( bool bMissingFilesOnly );
NameTypeDescription
bMissingFilesOnlyboolOnly 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 );
NameTypeDescription
nAppIDAppId_t

Deprecated.

UninstallDLC

void UninstallDLC( AppId_t nAppID );
NameTypeDescription
nAppIDAppId_tThe 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.

NameTypeDescription
m_eResultEResult
m_nAppIDuint32
m_cchKeyLengthuint32
m_rgchKeychar[k_cubAppProofOfPurchaseKeyMax

DlcInstalled_t

Triggered after the current user gains ownership of DLC and that DLC is installed.

NameTypeDescription
m_nAppIDAppId_tApp ID of the DLC that was installed.

Associated Functions: InstallDLC

FileDetailsResult_t

Called after requesting the details of a specific file.

NameTypeDescription
m_eResultEResultWas 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_ulFileSizeuint64The original file size in bytes.
m_FileSHAuint8[20]The original file SHA1 hash.
m_unFlagsuint32

Associated Functions: GetFileDetails

NewUrlLaunchParameters_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.

NameTypeDescription
m_eResultERegisterActivationCodeResult
m_unPackageRegistereduint32

TimedTrialStatus_t

Sent every minute when a appID is owned via a timed trial.

NameTypeDescription
m_unAppIDAppId_tAppID that is in a timed trial.
m_bIsOfflineboolIf true, the user is currently offline. Time allowed / played refers to offline time, not total time.
m_unSecondsAlloweduint32How many seconds the app can be played in total.
m_unSecondsPlayeduint32How many seconds the app was already played.

See Also: BIsTimedTrial

Enums

These are enums which are defined for use with ISteamApps.

ERegisterActivationCodeResult

Only used internally in Steam.

NameValueDescription
k_ERegisterActivationCodeResultOK0
k_ERegisterActivationCodeResultFail1
k_ERegisterActivationCodeResultAlreadyRegistered2
k_ERegisterActivationCodeResultTimeout3
k_ERegisterActivationCodeAlreadyOwned4

Constants

These are constants which are defined for use with ISteamApps.

NameTypeValueDescription
k_cubAppProofOfPurchaseKeyMaxint240Only used internally in Steam.
STEAMAPPS_INTERFACE_VERSIONconst char *"STEAMAPPS_INTERFACE_VERSION008"