Steamworks-dokumentasjon
Grensesnitt – ISteamApps
Eksponerer et stort utvalg informasjon og handlinger for applikasjoner og Nedlastbart innhold (DLC).

Medlemsfunksjoner

Medlemsfunksjoner for ISteamApps kalles gjennom den globale tilgangsfunksjonen SteamApps().

BGetDLCDataByIndex

bool BGetDLCDataByIndex( int iDLC, AppId_t *pAppID, bool *pbAvailable, char *pchName, int cchNameBufferSize );
NavnTypeBeskrivelse
iDLCintIndeks for det nedlastbare innholdet som skale hentes, mellom 0 og GetDLCCount.
pAppIDAppId_t *Returnerer app-ID-en til det nedlastbare innholdet.
pbAvailablebool *Returnerer om det nedlastbare innholdet for øyeblikket er tilgjengelig i butikken på Steam. Usann hvis det nedlastbare innholdet ikke har en synlig butikkside.
pchNamechar *Returnerer navnet på det nedlastbare innholdet ved å kopiere det inn i dette mellomlageret.
cchNameBufferSizeintLengden på mellomlageret pchName.

Returnerer metadata for nedlastbart innhold etter indeks.

Resultat: bool
true hvis den aktuelle app-ID-en har tilknyttet nedlastbart innhold og iDLC faller innenfor 0 og GetDLCCount. Ellers er denne false.

Eksempel:
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 ) { // Gjør noe med dataen til det nedlastbare innholdet } }

BIsAppInstalled

bool BIsAppInstalled( AppId_t appID );
NavnTypeBeskrivelse
appIDAppId_tApp-ID-en til applikasjonen som skal sjekkes.

Sjekker om en spesifikk applikasjon er installert.

Det er mulig at nåværende bruker ikke eier applikasjonen. De kan ha den igjen etter en gratishelg eller lignende.

Dette fungerer kun for hovedapplikasjoner og ikke Nedlastbart innhold (DLC). Bruk BIsDlcInstalled for nedlastbart innhold.

Resultat: bool
true hvis den angitte app-ID-en er installert – false hvis ikke.

BIsCybercafe

bool BIsCybercafe();
Sjekker om gjeldende app-ID er for nettkaféer.

Resultat: bool
true hvis lisensen er for nettkaféer – false hvis ikke.
Foreldet – ikke lenger i bruk.

BIsDlcInstalled

bool BIsDlcInstalled( AppId_t appID );
NavnTypeBeskrivelse
appIDAppId_tApp-ID-en til det nedlastbare innholdet som skal sjekkes.

Sjekker om brukeren eier spesifikt nedlastbart innhold og om dette er installert.

Resultat: bool
true hvis brukeren eier det nedlastbare innholdet og det er installert for øyeblikket – false hvis ikke.

Merknad: Bør kun brukes for enkle sjekker på klientsiden – ikke ment for tildeling av gjenstander i et spill.

BIsLowViolence

bool BIsLowViolence();
Sjekker om lisensen som brukeren eier leverer depoter med lite vold.

Depoter med lite vold er nyttige for eksemplarer som selges i land som har begrensninger på innhold.

Resultat: bool
true hvis lisensen som eieren bruker leverer depoter med lite vold – false hvis ikke.

Se også: Regler for montering av depot

BIsSubscribed

bool BIsSubscribed();
Sjekker om den aktive brukeren har et abonnement på den aktuelle app-ID-en.

MERKNAD: Dette returnerer alltid true hvis du bruker Steams DRA eller kaller SteamAPI_RestartAppIfNecessary.

Resultat: bool
true hvis brukeren eier aktuell app-ID – false hvis ikke.

BIsSubscribedApp

bool BIsSubscribedApp( AppId_t appID );
NavnTypeBeskrivelse
appIDAppId_tApp-ID-en som skal sjekkes.

Sjekker om den aktive brukeren har abonnement på en angitt app-ID.

Bruk dette kun hvis du må sjekke eierskap av et annet spill som er tilknyttet ditt eget spill – for eksempel en demo.

Resultat: bool
true hvis den aktive brukeren har et abonnement på den angitte app-ID-en – false hvis ikke.

BIsSubscribedFromFamilySharing

bool BIsSubscribedFromFamilySharing();

Sjekker om den aktive brukeren får tilgang til aktuell app-ID gjennom en midlertidig lisens gjennom familiedeling som en annen bruker eier.

Hvis du må avgjøre Steam-ID-en til den som eier lisensen permanent, bruk GetAppOwner.

Resultat: 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);
NavnTypeBeskrivelse
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 );
NavnTypeBeskrivelse
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();
Henter Steam-ID-en til den virkelige eieren av den aktuelle applikasjonen. Dette er forskjellig fra aktuell bruker hvis applikasjonen brukes gjennom familiedeling.

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 Lokalisering og språk.

Returns: const char *
Returns a comma separated list of languages.

See Also: GetCurrentGameLanguage, ISteamUtils::GetSteamUILanguage

GetCurrentBetaName

bool GetCurrentBetaName( char *pchName, int cchNameBufferSize );
NavnTypeBeskrivelse
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.

Eksempel:
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 );
NavnTypeBeskrivelse
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 );
NavnTypeBeskrivelse
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 );
NavnTypeBeskrivelse
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 );
NavnTypeBeskrivelse
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 );
NavnTypeBeskrivelse
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 );
NavnTypeDescription
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"