ISteamApps 002-007 implemented.

This commit is contained in:
Mr_Goldberg 2020-01-31 14:32:28 -05:00
parent 9deef8c6f3
commit 6ccb8f6c0b
No known key found for this signature in database
GPG Key ID: 8597D87419DEF278
11 changed files with 372 additions and 2 deletions

View File

@ -191,6 +191,10 @@ uint32 Steam_Apps::GetInstalledDepots( AppId_t appID, DepotId_t *pvecDepots, uin
return count;
}
uint32 Steam_Apps::GetInstalledDepots( DepotId_t *pvecDepots, uint32 cMaxDepots )
{
PRINT_DEBUG("GetInstalledDepots old %u\n", appID);
return GetInstalledDepots( settings->get_local_game_id().AppID(), pvecDepots, cMaxDepots );
}
// returns current app install folder for AppID, returns folder name length

View File

@ -1,6 +1,13 @@
#include "base.h"
class Steam_Apps : public ISteamApps
class Steam_Apps :
public ISteamApps002,
public ISteamApps003,
public ISteamApps004,
public ISteamApps005,
public ISteamApps006,
public ISteamApps007,
public ISteamApps
{
Settings *settings;
class SteamCallResults *callback_results;
@ -49,6 +56,7 @@ public:
bool GetCurrentBetaName( char *pchName, int cchNameBufferSize ); // returns current beta branch name, 'public' is the default branch
bool MarkContentCorrupt( bool bMissingFilesOnly ); // signal Steam that game files seems corrupt or missing
uint32 GetInstalledDepots( AppId_t appID, DepotId_t *pvecDepots, uint32 cMaxDepots ); // return installed depots in mount order
uint32 GetInstalledDepots( DepotId_t *pvecDepots, uint32 cMaxDepots );
// returns current app install folder for AppID, returns folder name length
uint32 GetAppInstallDir( AppId_t appID, char *pchFolder, uint32 cchFolderBufferSize );

View File

@ -617,8 +617,30 @@ ISteamApps *Steam_Client::GetISteamApps( HSteamUser hSteamUser, HSteamPipe hStea
{
PRINT_DEBUG("GetISteamApps %s\n", pchVersion);
if (!steam_pipes.count(hSteamPipe) || !hSteamUser) return NULL;
Steam_Apps *steam_apps_temp;
if (hSteamUser == SERVER_HSTEAMUSER) {
return steam_gameserver_apps;
steam_apps_temp = steam_gameserver_apps;
} else {
steam_apps_temp = steam_apps;
}
if (strcmp(pchVersion, "STEAMAPPS_INTERFACE_VERSION002") == 0) {
return (ISteamApps *)(void *)(ISteamApps002 *)steam_apps_temp;
} else if (strcmp(pchVersion, "STEAMAPPS_INTERFACE_VERSION003") == 0) {
return (ISteamApps *)(void *)(ISteamApps003 *)steam_apps_temp;
} else if (strcmp(pchVersion, "STEAMAPPS_INTERFACE_VERSION004") == 0) {
return (ISteamApps *)(void *)(ISteamApps004 *)steam_apps_temp;
} else if (strcmp(pchVersion, "STEAMAPPS_INTERFACE_VERSION005") == 0) {
return (ISteamApps *)(void *)(ISteamApps005 *)steam_apps_temp;
} else if (strcmp(pchVersion, "STEAMAPPS_INTERFACE_VERSION006") == 0) {
return (ISteamApps *)(void *)(ISteamApps006 *)steam_apps_temp;
} else if (strcmp(pchVersion, "STEAMAPPS_INTERFACE_VERSION007") == 0) {
return (ISteamApps *)(void *)(ISteamApps007 *)steam_apps_temp;
} else if (strcmp(pchVersion, STEAMAPPS_INTERFACE_VERSION) == 0) {
return (ISteamApps *)(void *)(ISteamApps *)steam_apps_temp;
} else {
return (ISteamApps *)(void *)(ISteamApps *)steam_apps_temp;
}
return steam_apps;

View File

@ -0,0 +1,28 @@
#ifndef ISTEAMAPPS001_H
#define ISTEAMAPPS001_H
#ifdef STEAM_WIN32
#pragma once
#endif
class ISteamApps001
{
public:
// returns 0 if the key does not exist
// this may be true on first call, since the app data may not be cached locally yet
// If you expect it to exists wait for the AppDataChanged_t after the first failure and ask again
virtual int GetAppData( AppId_t nAppID, const char *pchKey, char *pchValue, int cchValueMax ) = 0;
};
//-----------------------------------------------------------------------------
// Purpose: called when new information about an app has arrived
//-----------------------------------------------------------------------------
struct AppDataChanged_t
{
enum { k_iCallback = k_iSteamAppsCallbacks + 1 };
uint32 m_nAppID; // appid that changed
bool m_bBySteamUI; // change came from SteamUI
bool m_bCDDBUpdate; // the cddb entry for this app changed
};
#endif //ISTEAMAPPS001_H

View File

@ -0,0 +1,22 @@
#ifndef ISTEAMAPPS002_H
#define ISTEAMAPPS002_H
#ifdef STEAM_WIN32
#pragma once
#endif
class ISteamApps002
{
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;
};
#endif //ISTEAMAPPS002_H

View File

@ -0,0 +1,25 @@
#ifndef ISTEAMAPPS003_H
#define ISTEAMAPPS003_H
#ifdef STEAM_WIN32
#pragma once
#endif
class ISteamApps003
{
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;
};
#endif //ISTEAMAPPS003_H

View File

@ -0,0 +1,48 @@
#ifndef ISTEAMAPPS004_H
#define ISTEAMAPPS004_H
#ifdef STEAM_WIN32
#pragma once
#endif
class ISteamApps004
{
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;
#ifdef _PS3
// Result returned in a RegisterActivationCodeResponse_t callresult
virtual SteamAPICall_t RegisterActivationCode( const char *pchActivationCode ) = 0;
#endif
};
#endif //ISTEAMAPPS004_H

View File

@ -0,0 +1,63 @@
#ifndef ISTEAMAPPS005_H
#define ISTEAMAPPS005_H
#ifdef STEAM_WIN32
#pragma once
#endif
class ISteamApps005
{
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 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( 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;
#ifdef _PS3
// Result returned in a RegisterActivationCodeResponse_t callresult
virtual SteamAPICall_t RegisterActivationCode( const char *pchActivationCode ) = 0;
#endif
};
#endif //ISTEAMAPPS005_H

View File

@ -0,0 +1,71 @@
#ifndef ISTEAMAPPS006_H
#define ISTEAMAPPS006_H
#ifdef STEAM_WIN32
#pragma once
#endif
class ISteamApps006
{
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 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)
virtual CSteamID GetAppOwner() = 0; // returns the SteamID of the original owner. If different from current user, it's borrowed
// Returns the associated launch param 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 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.
virtual const char *GetLaunchQueryParam( const char *pchKey ) = 0;
#ifdef _PS3
// Result returned in a RegisterActivationCodeResponse_t callresult
virtual SteamAPICall_t RegisterActivationCode( const char *pchActivationCode ) = 0;
#endif
};
#endif //ISTEAMAPPS006_H

View File

@ -0,0 +1,72 @@
#ifndef ISTEAMAPPS007_H
#define ISTEAMAPPS007_H
#ifdef STEAM_WIN32
#pragma once
#endif
class ISteamApps007
{
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 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)
virtual CSteamID GetAppOwner() = 0; // returns the SteamID of the original owner. If different from current user, it's borrowed
// Returns the associated launch param 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 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.
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;
};
#endif //ISTEAMAPPS007_H

View File

@ -83,6 +83,13 @@
#include "isteamuserstats004.h"
#include "isteamuserstats003.h"
#include "isteamapps.h"
#include "isteamapps007.h"
#include "isteamapps006.h"
#include "isteamapps005.h"
#include "isteamapps004.h"
#include "isteamapps003.h"
#include "isteamapps002.h"
#include "isteamapps001.h"
#include "isteamnetworking.h"
#include "isteamnetworking005.h"
#include "isteamnetworking004.h"