Apps
Exposes a wide range of information and actions for applications and Downloadable Content (DLC).
Only available in the main GodotSteam branches
Functions
getAppBuildId
getAppBuildId( )
Gets the build ID 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
getAppInstallDir( uint32_t
app_id )
Parameter | Type | Notes |
---|---|---|
app_id | uint32_t | The app ID to get the install directory for. |
Gets the install folder for a specific app ID. This works even if the application is not installed, based on where the game would be installed with the default Steam library location.
Returns: string
getAppOwner
getAppOwner( )
Gets the Steam ID of the original owner of the current app. If it's different from the current user then it is borrowed.
Returns: uint64_t
The original owner of the current app.
getAvailableGameLanguages
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: string
Returns a comma separated list of languages.
getBetaInfo
getBetaInfo( )
Get details about an app beta branch like name, description and state.
Returns: dictionary
Contains the following keys:
Key | Type | Notes |
---|---|---|
index | int | Branch index starting at 0 which is always the default branch. |
flags | uint32_t | Set of BetaBranchFlags flags describing current branch state. |
build_id | uint32_t | Content BuildID set live on this branch. |
name | string | Beta branch name. |
description | string | Beta branch description. |
getCurrentBetaName
getCurrentBetaName( )
Checks if the user is running from a beta branch, and gets the name of the branch if they are.
Returns: string
Empty if the user is not on a beta branch.
getCurrentGameLanguage
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: string
getDLCCount
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 getDLCDataByIndex.
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.
getDLCData
getDLCData( )
Returns an array of dictionaries containing information about all available DLC for the current game.
Returns: array
Contains dictionaries (dlc) which contain the following keys:
Key | Type | Notes |
---|---|---|
id | int | The app ID for the DLC. |
available | bool | Whether the DLC is available on the Steam store currently. |
name | string | The name of the DLC. |
Notes
This function is unique to GodotSteam.
getDLCDataByIndex
getDLCDataByIndex( uint32_t
this_dlc_index )
Parameter | Type | Notes |
---|---|---|
this_dlc_index | uint32_t | Index of the DLC to get between 0 and getDLCCount. |
Returns metadata for a DLC by index.
Returns: dictionary
Contains the following keys:
Key | Type | Notes |
---|---|---|
id | int | The app ID for the DLC. |
available | bool | Whether the DLC is available on the Steam store currently. |
name | string | The name of the DLC. |
getDLCDownloadProgress
getDLCDownloadProgress( uint32_t
dlc_id )
Parameter | Type | Notes |
---|---|---|
dlc_id | uint32_t | The App ID of the DLC to monitor. |
Gets the download progress for optional DLC.
Returns: dictionary
Contains the following keys:
Key | Type | Notes |
---|---|---|
ret | bool | Returns true if the specified DLC exists and is currently downloading; otherwise, false. |
downloaded | uint64_t | Returns the number of bytes downloaded. |
total | uint64_t | Returns the total size of the download in bytes |
getEarliestPurchaseUnixTime
getEarliestPurchaseUnixTime( uint32_t
app_id )
Parameter | Type | Notes |
---|---|---|
app_id | uint32_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).
Returns: uint32_t
getFileDetails
getFileDetails( string
filename )
Parameter | Type | Notes |
---|---|---|
filename | string | The absolute path and name to the file. |
Asynchronously retrieves metadata details about a specific file in the depot manifest.
Returns: void
Triggers
file_details_result callback
getInstalledDepots
getInstalledDepots( uint32_t
app_id )
Parameter | Type | Notes |
---|---|---|
app_id | uint32_t | The app to list the depots for. |
Gets a list of all installed depots for a given App ID.
Returns: array
Contains the installed depots, returned in mount order.
getLaunchCommandLine
getLaunchCommandLine( )
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.
If game was already running and launched again, the new_launch_url_parameters callback will be fired.
Returns: string
getLaunchQueryParam
getLaunchQueryParam( string
key )
Parameter | Type | Notes |
---|---|---|
key | string | The launch key to test for. Ex: param1 |
Returns the associated launch param if the game is run via steam://run/<appid>//?param1=value1¶m2=value2¶m3=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 use param names beginning with an underscore for your own features.
Check for new launch parameters on new_launch_url_parameters callbacks.
Returns: string
The value associated with the key provided. Returns an empty string if the specified key does not exist.
getNumBetas
getNumBetas( )
Returns total number of known app beta branches; including the default public branch.
Returns: dictionary
Contains the following keys:
Key | Type | Notes |
---|---|---|
available | int | Number of beta branches available to current user. |
private | int | How many of these are private betas. |
total | int | Number of known app branches. |
Read more in the official Steamworks SDK documentation Added SDK 1.60
installDLC
installDLC( uint32_t
dlc_id )
Parameter | Type | Notes |
---|---|---|
dlc_id | uint32_t | The DLC you want to install. |
Allows you to install an optional DLC.
Returns: void
Triggers
dlc_installed callback
isAppInstalled
isAppInstalled( uint32_t
app_id )
Parameter | Type | Notes |
---|---|---|
app_id | uint32_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 isDLCInstalled for DLC instead.
Returns: bool
True if the specified app ID is installed; otherwise, false.
isCyberCafe
isCyberCafe( )
Checks whether the current App ID is for Cyber Cafes.
Returns: bool
Returns true if the license if for cyber cafe's; otherwise, false.
Notes
Listed as deprecated in the Steam documentation but the SDK makes no mention of this.
isDLCInstalled
isDLCInstalled( uint32_t
dlc_id )
Parameter | Type | Notes |
---|---|---|
dlc_id | uint32_t | The DLC ID 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.
Notes
Should only be used for simple client side checks; not intended for granting in-game items.
isLowViolence
isLowViolence( )
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
Returns true if the license owned by the user provides low violence depots; otherwise, false.
isSubscribed
isSubscribed( )
Checks if the active user is subscribed to the current app ID.
Returns: bool
Returns true if the active user owns the current app ID; otherwise, false.
Notes
This will always return true if you're using Steam DRM or calling restartAppIfNecessary.
isSubscribedApp
isSubscribedApp( uint32_t
app_id )
Parameter | Type | Notes |
---|---|---|
app_id | uint32_t | The app ID to check. |
Checks if the active user is subscribed to a specified app ID. Only use this if you need to check ownership of another game related to yours, a demo for example.
Returns: bool
Returns true if the active user is subscribed to the specified app ID; otherwise, false.
isSubscribedFromFamilySharing
isSubscribedFromFamilySharing( )
Checks if the active user is accessing the current app ID via a temporary Family Shared license owned by another user.
If you need to determine the Steam ID of the permanent owner of the license, use getAppOwner.
Returns: bool
Returns true if the active user is accessing the current app ID via family sharing; otherwise, false.
isSubscribedFromFreeWeekend
isSubscribedFromFreeWeekend( )
Checks if the user is subscribed to the current app through a free weekend. This function will return false for users who have a retail or other type of license. Suggested you contact Valve on how to package and secure your free weekend properly.
Returns: bool
Returns true if the active user is subscribed to the current app ID via a free weekend; otherwise, false for any other type of license.
isTimedTrial
isTimedTrial( )
Checks if the user is subscribed to the current app ID through a timed trial. If so, it gives back the total time the timed trial is allowed to play, along with the current amount of time the user has played.
If the active user is not subscribed to the current app ID via a timed trial, the returned values will both be 0.
Returns: dictionary
Containing these keys:
Key | Type | Notes |
---|---|---|
seconds_allowed | uint32_t | Returns the number of seconds the timed trial will list. |
seconds_played | uint32_t | Returns the number of seconds that the user has played so far. |
isVACBanned
isVACBanned( )
Checks if the user has a VAC ban on their account.
Returns: bool
Returns true if the user has a VAC ban on their account; otherwise, false.
markContentCorrupt
markContentCorrupt( bool
missing_files_only )
Parameter | Type | Notes |
---|---|---|
missing_files_only | 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
setActiveBeta
setActiveBeta( string
beta_name )
Parameter | Type | Notes |
---|---|---|
beta_name | string | Beta name the game wants to switch to. |
Select this beta branch for this app as active, might need the game to restart so Steam can update to that branch.
Returns: bool
setDLCContext
setDLCContext( uint32_t
app_id )
Parameter | Type | Notes |
---|---|---|
app_id | uint32_t | The DLC app ID to track. |
Set current DLC app ID being played (or 0 if none). Allows Steam to track usage of major DLC extensions.
Returns: bool
uninstallDLC
uninstallDLC( uint32_t
dlc_id )
Parameter | Type | Notes |
---|---|---|
dlc_id | uint32_t | The DLC you want to uninstall. |
Allows you to uninstall an optional DLC.
Returns: void
Signals
These callbacks require you to setup one of the three callback methods to receive them.
dlc_installed
dlc_installed
Triggered after the current user gains ownership of DLC and that DLC is installed.
Returns
Key | Type | Notes |
---|---|---|
app_id | uint32_t | App ID of the DLC that was installed. |
file_details_result
file_details_result
Called after requesting the details of a specific file.
Returns
Key | Type | Notes |
---|---|---|
result | uint32_t | Was the call successful? RESULT_OK if it was; otherwise, RESULT_FILE_NOT_FOUND if the file was not found. None of the other fields are filled out if the call was not successful. |
file_size | uint64_t | The original file size in bytes. |
file_hash | uint8 | The original file SHA1 hash. |
flags | uint32_t | No notes about what these are. |
new_launch_url_parameters
new_launch_url_parameters
Triggered after the user executes a steam url with command line or query parameters such as steam://run/(app_id)//?param1=value1;param2=value2;param3=value3;
while the game is already running. The new params can be queried with getLaunchCommandLine and getLaunchQueryParam.
Returns
Nothing.
timed_trial_status
timed_trials_status
Sent every minute when a appID is owned via a timed trial.
Returns"
Key | Type | Notes |
---|---|---|
app_id | uint32_t | App ID that is in a timed trial. |
is_offline | bool | If true, the user is currently offline. Time allowed / played refers to offline time, not total time. |
seconds_allowed | uint32_t | How many seconds the app can be played in total. |
seconds_played | uint32_t | How many seconds the app was already played. |
Constants
Name | SDK Name | Value | Details |
---|---|---|---|
APP_PROOF_OF_PURCHASE_KEY_MAX | k_cubAppProofOfPurchaseKeyMax | 240 | Max supported length of a legacy cd key. |