-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fd442d7
commit 55a8f7b
Showing
61 changed files
with
32,699 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
//====== Copyright © 1996-2008, Valve Corporation, All rights reserved. ======= | ||
// | ||
// Purpose: interface to app data in Steam | ||
// | ||
//============================================================================= | ||
|
||
#ifndef ISTEAMAPPLIST_H | ||
#define ISTEAMAPPLIST_H | ||
#ifdef _WIN32 | ||
#pragma once | ||
#endif | ||
|
||
#include "steam_api_common.h" | ||
|
||
//----------------------------------------------------------------------------- | ||
// Purpose: This is a restricted interface that can only be used by previously approved apps, | ||
// contact your Steam Account Manager if you believe you need access to this API. | ||
// This interface lets you detect installed apps for the local Steam client, useful for debugging tools | ||
// to offer lists of apps to debug via Steam. | ||
//----------------------------------------------------------------------------- | ||
class ISteamAppList | ||
{ | ||
public: | ||
virtual uint32 GetNumInstalledApps() = 0; | ||
virtual uint32 GetInstalledApps( AppId_t *pvecAppID, uint32 unMaxAppIDs ) = 0; | ||
|
||
virtual int GetAppName( AppId_t nAppID, STEAM_OUT_STRING() char *pchName, int cchNameMax ) = 0; // returns -1 if no name was found | ||
virtual int GetAppInstallDir( AppId_t nAppID, char *pchDirectory, int cchNameMax ) = 0; // returns -1 if no dir was found | ||
|
||
virtual int GetAppBuildId( AppId_t nAppID ) = 0; // return the buildid of this app, may change at any time based on backend updates to the game | ||
}; | ||
|
||
#define STEAMAPPLIST_INTERFACE_VERSION "STEAMAPPLIST_INTERFACE_VERSION001" | ||
|
||
// Global interface accessor | ||
inline ISteamAppList *SteamAppList(); | ||
STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamAppList *, SteamAppList, STEAMAPPLIST_INTERFACE_VERSION ); | ||
|
||
// callbacks | ||
#if defined( VALVE_CALLBACK_PACK_SMALL ) | ||
#pragma pack( push, 4 ) | ||
#elif defined( VALVE_CALLBACK_PACK_LARGE ) | ||
#pragma pack( push, 8 ) | ||
#else | ||
#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx | ||
#endif | ||
|
||
|
||
//--------------------------------------------------------------------------------- | ||
// Purpose: Sent when a new app is installed (not downloaded yet) | ||
//--------------------------------------------------------------------------------- | ||
STEAM_CALLBACK_BEGIN( SteamAppInstalled_t, k_iSteamAppListCallbacks + 1 ) | ||
STEAM_CALLBACK_MEMBER( 0, AppId_t, m_nAppID ) // ID of the app that installs | ||
STEAM_CALLBACK_MEMBER( 1, int, m_iInstallFolderIndex ) // library folder the app is installed | ||
STEAM_CALLBACK_END( 2 ) | ||
|
||
|
||
//--------------------------------------------------------------------------------- | ||
// Purpose: Sent when an app is uninstalled | ||
//--------------------------------------------------------------------------------- | ||
STEAM_CALLBACK_BEGIN( SteamAppUninstalled_t, k_iSteamAppListCallbacks + 2 ) | ||
STEAM_CALLBACK_MEMBER( 0, AppId_t, m_nAppID ) // ID of the app that installs | ||
STEAM_CALLBACK_MEMBER( 1, int, m_iInstallFolderIndex ) // library folder the app was installed | ||
STEAM_CALLBACK_END(2) | ||
|
||
|
||
#pragma pack( pop ) | ||
#endif // ISTEAMAPPLIST_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,192 @@ | ||
//====== Copyright © 1996-2008, Valve Corporation, All rights reserved. ======= | ||
// | ||
// Purpose: interface to app data in Steam | ||
// | ||
//============================================================================= | ||
|
||
#ifndef ISTEAMAPPS_H | ||
#define ISTEAMAPPS_H | ||
#ifdef _WIN32 | ||
#pragma once | ||
#endif | ||
|
||
#include "steam_api_common.h" | ||
|
||
const int k_cubAppProofOfPurchaseKeyMax = 240; // max supported length of a legacy cd key | ||
|
||
|
||
//----------------------------------------------------------------------------- | ||
// Purpose: interface to app data | ||
//----------------------------------------------------------------------------- | ||
class ISteamApps | ||
{ | ||
public: | ||
virtual bool BIsSubscribed() = 0; | ||
virtual bool BIsLowViolence() = 0; | ||
virtual bool BIsCybercafe() = 0; | ||
virtual bool BIsVACBanned() = 0; | ||
virtual const char *GetCurrentGameLanguage() = 0; | ||
virtual const char *GetAvailableGameLanguages() = 0; | ||
|
||
// only use this member if you need to check ownership of another game related to yours, a demo for example | ||
virtual bool BIsSubscribedApp( AppId_t appID ) = 0; | ||
|
||
// Takes AppID of DLC and checks if the user owns the DLC & if the DLC is installed | ||
virtual bool BIsDlcInstalled( AppId_t appID ) = 0; | ||
|
||
// returns the Unix time of the purchase of the app | ||
virtual uint32 GetEarliestPurchaseUnixTime( AppId_t nAppID ) = 0; | ||
|
||
// 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 weekened | ||
virtual bool BIsSubscribedFromFreeWeekend() = 0; | ||
|
||
// Returns the number of DLC pieces for the running app | ||
virtual int GetDLCCount() = 0; | ||
|
||
// Returns metadata for DLC by index, of range [0, GetDLCCount()] | ||
virtual bool BGetDLCDataByIndex( int iDLC, AppId_t *pAppID, bool *pbAvailable, char *pchName, int cchNameBufferSize ) = 0; | ||
|
||
// Install/Uninstall control for optional DLC | ||
virtual void InstallDLC( AppId_t nAppID ) = 0; | ||
virtual void UninstallDLC( AppId_t nAppID ) = 0; | ||
|
||
// 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). | ||
virtual void RequestAppProofOfPurchaseKey( AppId_t nAppID ) = 0; | ||
|
||
virtual bool GetCurrentBetaName( char *pchName, int cchNameBufferSize ) = 0; // returns current beta branch name, 'public' is the default branch | ||
virtual bool MarkContentCorrupt( bool bMissingFilesOnly ) = 0; // signal Steam that game files seems corrupt or missing | ||
virtual uint32 GetInstalledDepots( AppId_t appID, DepotId_t *pvecDepots, uint32 cMaxDepots ) = 0; // return installed depots in mount order | ||
|
||
// returns current app install folder for AppID, returns folder name length | ||
virtual uint32 GetAppInstallDir( AppId_t appID, char *pchFolder, uint32 cchFolderBufferSize ) = 0; | ||
virtual bool BIsAppInstalled( AppId_t appID ) = 0; // returns true if that app is installed (not necessarily owned) | ||
|
||
// 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 | ||
virtual CSteamID GetAppOwner() = 0; | ||
|
||
// 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 | ||
virtual const char *GetLaunchQueryParam( const char *pchKey ) = 0; | ||
|
||
// get download progress for optional DLC | ||
virtual bool GetDlcDownloadProgress( AppId_t nAppID, uint64 *punBytesDownloaded, uint64 *punBytesTotal ) = 0; | ||
|
||
// return the buildid of this app, may change at any time based on backend updates to the game | ||
virtual int GetAppBuildId() = 0; | ||
|
||
// Request all proof of purchase keys for the calling appid and asociated 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). | ||
virtual void RequestAllProofOfPurchaseKeys() = 0; | ||
|
||
STEAM_CALL_RESULT( FileDetailsResult_t ) | ||
virtual SteamAPICall_t GetFileDetails( const char* pszFileName ) = 0; | ||
|
||
// 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. | ||
virtual int GetLaunchCommandLine( char *pszCommandLine, int cubCommandLine ) = 0; | ||
|
||
// Check if user borrowed this game via Family Sharing, If true, call GetAppOwner() to get the lender SteamID | ||
virtual bool BIsSubscribedFromFamilySharing() = 0; | ||
|
||
// check if game is a timed trial with limited playtime | ||
virtual bool BIsTimedTrial( uint32* punSecondsAllowed, uint32* punSecondsPlayed ) = 0; | ||
|
||
// set current DLC AppID being played (or 0 if none). Allows Steam to track usage of major DLC extensions | ||
virtual bool SetDlcContext( AppId_t nAppID ) = 0; | ||
}; | ||
|
||
#define STEAMAPPS_INTERFACE_VERSION "STEAMAPPS_INTERFACE_VERSION008" | ||
|
||
// Global interface accessor | ||
inline ISteamApps *SteamApps(); | ||
STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamApps *, SteamApps, STEAMAPPS_INTERFACE_VERSION ); | ||
|
||
// callbacks | ||
#if defined( VALVE_CALLBACK_PACK_SMALL ) | ||
#pragma pack( push, 4 ) | ||
#elif defined( VALVE_CALLBACK_PACK_LARGE ) | ||
#pragma pack( push, 8 ) | ||
#else | ||
#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx | ||
#endif | ||
//----------------------------------------------------------------------------- | ||
// Purpose: posted after the user gains ownership of DLC & that DLC is installed | ||
//----------------------------------------------------------------------------- | ||
struct DlcInstalled_t | ||
{ | ||
enum { k_iCallback = k_iSteamAppsCallbacks + 5 }; | ||
AppId_t m_nAppID; // AppID of the DLC | ||
}; | ||
|
||
|
||
//--------------------------------------------------------------------------------- | ||
// Purpose: posted after the user gains executes a Steam URL with command line or query parameters | ||
// such as steam://run/<appid>//-commandline/?param1=value1¶m2=value2¶m3=value3 etc | ||
// while the game is already running. The new params can be queried | ||
// with GetLaunchQueryParam and GetLaunchCommandLine | ||
//--------------------------------------------------------------------------------- | ||
struct NewUrlLaunchParameters_t | ||
{ | ||
enum { k_iCallback = k_iSteamAppsCallbacks + 14 }; | ||
}; | ||
|
||
|
||
//----------------------------------------------------------------------------- | ||
// Purpose: response to RequestAppProofOfPurchaseKey/RequestAllProofOfPurchaseKeys | ||
// for supporting third-party CD keys, or other proof-of-purchase systems. | ||
//----------------------------------------------------------------------------- | ||
struct AppProofOfPurchaseKeyResponse_t | ||
{ | ||
enum { k_iCallback = k_iSteamAppsCallbacks + 21 }; | ||
EResult m_eResult; | ||
uint32 m_nAppID; | ||
uint32 m_cchKeyLength; | ||
char m_rgchKey[k_cubAppProofOfPurchaseKeyMax]; | ||
}; | ||
|
||
|
||
//----------------------------------------------------------------------------- | ||
// Purpose: response to GetFileDetails | ||
//----------------------------------------------------------------------------- | ||
struct FileDetailsResult_t | ||
{ | ||
enum { k_iCallback = k_iSteamAppsCallbacks + 23 }; | ||
EResult m_eResult; | ||
uint64 m_ulFileSize; // original file size in bytes | ||
uint8 m_FileSHA[20]; // original file SHA1 hash | ||
uint32 m_unFlags; // | ||
}; | ||
|
||
|
||
//----------------------------------------------------------------------------- | ||
// Purpose: called for games in Timed Trial mode | ||
//----------------------------------------------------------------------------- | ||
struct TimedTrialStatus_t | ||
{ | ||
enum { k_iCallback = k_iSteamAppsCallbacks + 30 }; | ||
AppId_t m_unAppID; // appID | ||
bool m_bIsOffline; // if true, time allowed / played refers to offline time, not total time | ||
uint32 m_unSecondsAllowed; // how many seconds the app can be played in total | ||
uint32 m_unSecondsPlayed; // how many seconds the app was already played | ||
}; | ||
|
||
#pragma pack( pop ) | ||
#endif // ISTEAMAPPS_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
//====== Copyright 1996-2008, Valve Corporation, All rights reserved. ======= | ||
// | ||
// Purpose: a private, but well versioned, interface to get at critical bits | ||
// of a steam3 appticket - consumed by the simple drm wrapper to let it | ||
// ask about ownership with greater confidence. | ||
// | ||
//============================================================================= | ||
|
||
#ifndef ISTEAMAPPTICKET_H | ||
#define ISTEAMAPPTICKET_H | ||
#pragma once | ||
|
||
//----------------------------------------------------------------------------- | ||
// Purpose: hand out a reasonable "future proof" view of an app ownership ticket | ||
// the raw (signed) buffer, and indices into that buffer where the appid and | ||
// steamid are located. the sizes of the appid and steamid are implicit in | ||
// (each version of) the interface - currently uin32 appid and uint64 steamid | ||
//----------------------------------------------------------------------------- | ||
class ISteamAppTicket | ||
{ | ||
public: | ||
virtual uint32 GetAppOwnershipTicketData( uint32 nAppID, void *pvBuffer, uint32 cbBufferLength, uint32 *piAppId, uint32 *piSteamId, uint32 *piSignature, uint32 *pcbSignature ) = 0; | ||
}; | ||
|
||
#define STEAMAPPTICKET_INTERFACE_VERSION "STEAMAPPTICKET_INTERFACE_VERSION001" | ||
|
||
|
||
#endif // ISTEAMAPPTICKET_H |
Oops, something went wrong.