Class SteamApps
Purpose: interface to app data
Inherited Members
Namespace: Unity.Steamworks.Interop
Assembly: Unity.Steamworks.Interop.dll
Syntax
public static class SteamApps
Methods
BGetDLCDataByIndex(int, out AppId_t, out bool, out string, int)
Returns metadata for DLC by index, of range [0, GetDLCCount()]
Declaration
public static bool BGetDLCDataByIndex(int iDLC, out AppId_t pAppID, out bool pbAvailable, out string pchName, int cchNameBufferSize)
Parameters
| Type | Name | Description |
|---|---|---|
| int | iDLC | Passed through to |
| AppId_t | pAppID | Passed through to |
| bool | pbAvailable | Passed through to |
| string | pchName | Receives the string |
| int | cchNameBufferSize | Passed through to |
Returns
| Type | Description |
|---|---|
| bool | The value |
BIsAppInstalled(AppId_t)
returns true if that app is installed (not necessarily owned)
Declaration
public static bool BIsAppInstalled(AppId_t appID)
Parameters
| Type | Name | Description |
|---|---|---|
| AppId_t | appID | Passed through to |
Returns
| Type | Description |
|---|---|
| bool | The value |
BIsCybercafe()
Calls the Steamworks ISteamApps::BIsCybercafe method.
Declaration
public static bool BIsCybercafe()
Returns
| Type | Description |
|---|---|
| bool | The value |
BIsDlcInstalled(AppId_t)
Takes AppID of DLC and checks if the user owns the DLC & if the DLC is installed
Declaration
public static bool BIsDlcInstalled(AppId_t appID)
Parameters
| Type | Name | Description |
|---|---|---|
| AppId_t | appID | Passed through to |
Returns
| Type | Description |
|---|---|
| bool | The value |
BIsLowViolence()
Calls the Steamworks ISteamApps::BIsLowViolence method.
Declaration
public static bool BIsLowViolence()
Returns
| Type | Description |
|---|---|
| bool | The value |
BIsSubscribed()
Calls the Steamworks ISteamApps::BIsSubscribed method.
Declaration
public static bool BIsSubscribed()
Returns
| Type | Description |
|---|---|
| bool | The value |
BIsSubscribedApp(AppId_t)
only use this member if you need to check ownership of another game related to yours, a demo for example
Declaration
public static bool BIsSubscribedApp(AppId_t appID)
Parameters
| Type | Name | Description |
|---|---|---|
| AppId_t | appID | Passed through to |
Returns
| Type | Description |
|---|---|
| bool | The value |
BIsSubscribedFromFamilySharing()
Check if user borrowed this game via Family Sharing, If true, call GetAppOwner() to get the lender SteamID
Declaration
public static bool BIsSubscribedFromFamilySharing()
Returns
| Type | Description |
|---|---|
| bool | The value |
BIsSubscribedFromFreeWeekend()
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 Before using, please ask your Valve technical contact how to package and secure your free weekend
Declaration
public static bool BIsSubscribedFromFreeWeekend()
Returns
| Type | Description |
|---|---|
| bool | The value |
BIsTimedTrial(out uint, out uint)
check if game is a timed trial with limited playtime
Declaration
public static bool BIsTimedTrial(out uint punSecondsAllowed, out uint punSecondsPlayed)
Parameters
| Type | Name | Description |
|---|---|---|
| uint | punSecondsAllowed | Passed through to |
| uint | punSecondsPlayed | Passed through to |
Returns
| Type | Description |
|---|---|
| bool | The value |
BIsVACBanned()
Calls the Steamworks ISteamApps::BIsVACBanned method.
Declaration
public static bool BIsVACBanned()
Returns
| Type | Description |
|---|---|
| bool | The value |
GetAppBuildId()
return the buildid of this app, may change at any time based on backend updates to the game
Declaration
public static int GetAppBuildId()
Returns
| Type | Description |
|---|---|
| int | The value |
GetAppInstallDir(AppId_t, out string, uint)
returns current app install folder for AppID, returns folder name length
Declaration
public static uint GetAppInstallDir(AppId_t appID, out string pchFolder, uint cchFolderBufferSize)
Parameters
| Type | Name | Description |
|---|---|---|
| AppId_t | appID | Passed through to |
| string | pchFolder | Receives the string |
| uint | cchFolderBufferSize | Passed through to |
Returns
| Type | Description |
|---|---|
| uint | The value |
GetAppOwner()
returns the SteamID of the original owner. If this CSteamID is different from ISteamUser::GetSteamID(), the user has a temporary license borrowed via Family Sharing
Declaration
public static CSteamID GetAppOwner()
Returns
| Type | Description |
|---|---|
| CSteamID | The value |
GetAvailableGameLanguages()
Calls the Steamworks ISteamApps::GetAvailableGameLanguages method.
Declaration
public static string GetAvailableGameLanguages()
Returns
| Type | Description |
|---|---|
| string | The value |
GetBetaInfo(int, out uint, out uint, out string, int, out string, int, out uint)
return beta branch details, name, description, current BuildID and state flags (EBetaBranchFlags) iterate through
Declaration
public static bool GetBetaInfo(int iBetaIndex, out uint punFlags, out uint punBuildID, out string pchBetaName, int cchBetaName, out string pchDescription, int cchDescription, out uint punLastUpdated)
Parameters
| Type | Name | Description |
|---|---|---|
| int | iBetaIndex | Passed through to |
| uint | punFlags | Passed through to |
| uint | punBuildID | Passed through to |
| string | pchBetaName | Receives the string |
| int | cchBetaName | Passed through to |
| string | pchDescription | Receives the string |
| int | cchDescription | Passed through to |
| uint | punLastUpdated | Passed through to |
Returns
| Type | Description |
|---|---|
| bool | The value |
GetCurrentBetaName(out string, int)
returns current beta branch name, 'public' is the default branch
Declaration
public static bool GetCurrentBetaName(out string pchName, int cchNameBufferSize)
Parameters
| Type | Name | Description |
|---|---|---|
| string | pchName | Receives the string |
| int | cchNameBufferSize | Passed through to |
Returns
| Type | Description |
|---|---|
| bool | The value |
GetCurrentGameLanguage()
Calls the Steamworks ISteamApps::GetCurrentGameLanguage method.
Declaration
public static string GetCurrentGameLanguage()
Returns
| Type | Description |
|---|---|
| string | The value |
GetDLCCount()
Returns the number of DLC pieces for the running app
Declaration
public static int GetDLCCount()
Returns
| Type | Description |
|---|---|
| int | The value |
GetDlcDownloadProgress(AppId_t, out ulong, out ulong)
get download progress for optional DLC
Declaration
public static bool GetDlcDownloadProgress(AppId_t nAppID, out ulong punBytesDownloaded, out ulong punBytesTotal)
Parameters
| Type | Name | Description |
|---|---|---|
| AppId_t | nAppID | Passed through to |
| ulong | punBytesDownloaded | Passed through to |
| ulong | punBytesTotal | Passed through to |
Returns
| Type | Description |
|---|---|
| bool | The value |
GetEarliestPurchaseUnixTime(AppId_t)
returns the Unix time of the purchase of the app
Declaration
public static uint GetEarliestPurchaseUnixTime(AppId_t nAppID)
Parameters
| Type | Name | Description |
|---|---|---|
| AppId_t | nAppID | Passed through to |
Returns
| Type | Description |
|---|---|
| uint | The value |
GetFileDetails(string)
Calls the Steamworks ISteamApps::GetFileDetails method.
Declaration
public static SteamAPICall_t GetFileDetails(string pszFileName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | pszFileName | Passed through to |
Returns
| Type | Description |
|---|---|
| SteamAPICall_t | The value |
GetFileDetailsAsync(string)
Async version of GetFileDetails(string).
Declaration
public static Task<FileDetailsResult_t> GetFileDetailsAsync(string pszFileName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | pszFileName | Passed through to |
Returns
| Type | Description |
|---|---|
| Task<FileDetailsResult_t> | The FileDetailsResult_t Steam reports once the call completes. |
GetInstalledDepots(AppId_t, DepotId_t[], uint)
return installed depots in mount order
Declaration
public static uint GetInstalledDepots(AppId_t appID, DepotId_t[] pvecDepots, uint cMaxDepots)
Parameters
| Type | Name | Description |
|---|---|---|
| AppId_t | appID | Passed through to |
| DepotId_t[] | pvecDepots | Passed through to |
| uint | cMaxDepots | Passed through to |
Returns
| Type | Description |
|---|---|
| uint | The value |
GetLaunchCommandLine(out string, int)
Get command line if game was launched via Steam URL, e.g. steam://run/<appid>//<command line>/. This method of passing a connect string (used when joining via rich presence, accepting an invite, etc) is preferable to passing the connect string on the operating system command line, which is a security risk. In order for rich presence joins to go through this path and not be placed on the OS command line, you must set a value in your app's configuration on Steam. Ask Valve for help with this. If game was already running and launched again, the NewUrlLaunchParameters_t will be fired.
Declaration
public static int GetLaunchCommandLine(out string pszCommandLine, int cubCommandLine)
Parameters
| Type | Name | Description |
|---|---|---|
| string | pszCommandLine | Receives the string |
| int | cubCommandLine | Passed through to |
Returns
| Type | Description |
|---|---|
| int | The value |
GetLaunchQueryParam(string)
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 and 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. Check for new launch parameters on callback NewUrlLaunchParameters_t
Declaration
public static string GetLaunchQueryParam(string pchKey)
Parameters
| Type | Name | Description |
|---|---|---|
| string | pchKey | Passed through to |
Returns
| Type | Description |
|---|---|
| string | The value |
GetNumBetas(out int, out int)
returns total number of known app branches (including default "public" branch ). nAvailable is number of available betas
Declaration
public static int GetNumBetas(out int pnAvailable, out int pnPrivate)
Parameters
| Type | Name | Description |
|---|---|---|
| int | pnAvailable | Passed through to |
| int | pnPrivate | Passed through to |
Returns
| Type | Description |
|---|---|
| int | The value |
InstallDLC(AppId_t)
Install/Uninstall control for optional DLC
Declaration
public static void InstallDLC(AppId_t nAppID)
Parameters
| Type | Name | Description |
|---|---|---|
| AppId_t | nAppID | Passed through to |
MarkContentCorrupt(bool)
signal Steam that game files seems corrupt or missing
Declaration
public static bool MarkContentCorrupt(bool bMissingFilesOnly)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | bMissingFilesOnly | Passed through to |
Returns
| Type | Description |
|---|---|
| bool | The value |
RequestAllProofOfPurchaseKeys()
Request all proof of purchase keys for the calling appid and associated DLC. A series of AppProofOfPurchaseKeyResponse_t callbacks will be sent with appropriate appid values, ending with a final callback where the m_nAppId member is k_uAppIdInvalid (zero).
Declaration
public static void RequestAllProofOfPurchaseKeys()
RequestAppProofOfPurchaseKey(AppId_t)
Request legacy cd-key for yourself or owned DLC. If you are interested in this data then make sure you provide us with a list of valid keys to be distributed to users when they purchase the game, before the game ships. You'll receive an AppProofOfPurchaseKeyResponse_t callback when the key is available (which may be immediately).
Declaration
public static void RequestAppProofOfPurchaseKey(AppId_t nAppID)
Parameters
| Type | Name | Description |
|---|---|---|
| AppId_t | nAppID | Passed through to |
SetActiveBeta(string)
select this beta branch for this app as active, might need the game to restart so Steam can update to that branch
Declaration
public static bool SetActiveBeta(string pchBetaName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | pchBetaName | Passed through to |
Returns
| Type | Description |
|---|---|
| bool | The value |
SetDlcContext(AppId_t)
set current DLC AppID being played (or 0 if none). Allows Steam to track usage of major DLC extensions
Declaration
public static bool SetDlcContext(AppId_t nAppID)
Parameters
| Type | Name | Description |
|---|---|---|
| AppId_t | nAppID | Passed through to |
Returns
| Type | Description |
|---|---|
| bool | The value |
SetGamePerformanceSetting(EGamePerformanceSetting)
game performance settings
Declaration
public static void SetGamePerformanceSetting(EGamePerformanceSetting setting)
Parameters
| Type | Name | Description |
|---|---|---|
| EGamePerformanceSetting | setting | Passed through to |
SetGameRenderResolution(uint, uint)
Calls the Steamworks ISteamApps::SetGameRenderResolution method.
Declaration
public static void SetGameRenderResolution(uint unWidth, uint unHeight)
Parameters
| Type | Name | Description |
|---|---|---|
| uint | unWidth | Passed through to |
| uint | unHeight | Passed through to |
UninstallDLC(AppId_t)
Calls the Steamworks ISteamApps::UninstallDLC method.
Declaration
public static void UninstallDLC(AppId_t nAppID)
Parameters
| Type | Name | Description |
|---|---|---|
| AppId_t | nAppID | Passed through to |