Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

226 lines
17 KiB

  1. /************ (C) Copyright 2004 Valve Corporation, All rights reserved. ***********
  2. **
  3. ** The copyright to the contents herein is the property of Valve Corporation.
  4. ** The contents may be used and/or copied only with the written permission of
  5. ** Valve, or in accordance with the terms and conditions stipulated in
  6. ** the agreement/contract under which the contents have been supplied.
  7. **
  8. *******************************************************************************
  9. **
  10. ** Contents:
  11. **
  12. ** This file provides an obfuscated interface to the Steam service. This
  13. ** interface is described in the SDK documentation.
  14. **
  15. ******************************************************************************/
  16. #ifndef INCLUDED_STEAM_INTERFACE_H
  17. #define INCLUDED_STEAM_INTERFACE_H
  18. #if defined(_MSC_VER) && (_MSC_VER > 1000)
  19. #pragma once
  20. #endif
  21. #ifndef INCLUDED_STEAM2_USERID_STRUCTS
  22. #include "SteamCommon.h"
  23. #endif
  24. // IAppSystem interface. Returns an IAppSystem implementation; use QueryInterface on
  25. // that to get the ISteamInterface (same as the older _f function).
  26. #define STEAMDLL_APPSYSTEM_VERSION "SteamDLLAppsystem001"
  27. // extern "C" STEAM_API void * STEAM_CALL CreateInterface( const char *pName, int *pReturncode );
  28. // create interface
  29. #define STEAM_INTERFACE_VERSION "Steam006"
  30. extern "C" STEAM_API void * STEAM_CALL _f(const char *szInterfaceVersionRequested);
  31. // current abstract interface
  32. class ISteamInterface
  33. {
  34. public:
  35. virtual ~ISteamInterface() {};
  36. virtual SteamCallHandle_t ChangePassword( const char *cszCurrentPassphrase, const char *cszNewPassphrase, TSteamError *pError ) = 0;
  37. virtual int GetCurrentEmailAddress( char *szEmailAddress, unsigned int uBufSize, unsigned int *puEmailChars, TSteamError *pError ) = 0;
  38. virtual SteamCallHandle_t ChangePersonalQA( const char *cszCurrentPassphrase, const char *cszNewPersonalQuestion, const char *cszNewAnswerToQuestion, TSteamError *pError ) = 0;
  39. virtual SteamCallHandle_t ChangeEmailAddress( const char *cszNewEmailAddress, TSteamError *pError ) = 0;
  40. virtual SteamCallHandle_t VerifyEmailAddress( const char *cszEmailVerificationKey, TSteamError *pError ) = 0;
  41. virtual SteamCallHandle_t RequestEmailAddressVerificationEmail( TSteamError *pError ) = 0;
  42. virtual SteamCallHandle_t ChangeAccountName( const char *cszCurrentPassphrase, const char *cszNewAccountName, TSteamError *pError ) = 0;
  43. virtual int MountAppFilesystem( TSteamError *pError ) = 0;
  44. virtual int UnmountAppFilesystem( TSteamError *pError ) = 0;
  45. virtual SteamHandle_t MountFilesystem( unsigned int uAppId, const char *szMountPath, TSteamError *pError ) = 0;
  46. virtual int UnmountFilesystem( SteamHandle_t hFs, TSteamError *pError ) = 0;
  47. virtual int Stat( const char *cszName, TSteamElemInfo *pInfo, TSteamError *pError ) = 0;
  48. virtual int SetvBuf( SteamHandle_t hFile, void* pBuf, ESteamBufferMethod eMethod, unsigned int uBytes, TSteamError *pError ) = 0;
  49. virtual int FlushFile( SteamHandle_t hFile, TSteamError *pError ) = 0;
  50. virtual SteamHandle_t OpenFile( const char *cszName, const char *cszMode, TSteamError *pError ) = 0;
  51. virtual SteamHandle_t OpenFileEx( const char *cszName, const char *cszMode, int nFlags, unsigned int *puFileSize, int *pbLocal, TSteamError *pError ) = 0;
  52. virtual SteamHandle_t OpenTmpFile( TSteamError *pError ) = 0;
  53. virtual void ClearError( TSteamError *pError ) = 0;
  54. virtual int GetVersion( char *szVersion, unsigned int uVersionBufSize ) = 0;
  55. virtual int GetOfflineStatus( TSteamOfflineStatus *pStatus, TSteamError *pError ) = 0;
  56. virtual int ChangeOfflineStatus( TSteamOfflineStatus *pStatus, TSteamError *pError ) = 0;
  57. virtual int ProcessCall( SteamCallHandle_t handle, TSteamProgress *pProgress, TSteamError *pError ) = 0;
  58. virtual int AbortCall( SteamCallHandle_t handle, TSteamError *pError ) = 0;
  59. virtual int BlockingCall( SteamCallHandle_t handle, unsigned int uiProcessTickMS, TSteamError *pError ) = 0;
  60. virtual int SetMaxStallCount( unsigned int uNumStalls, TSteamError *pError ) = 0;
  61. virtual int CloseFile( SteamHandle_t hFile, TSteamError *pError ) = 0;
  62. virtual unsigned int ReadFile( void *pBuf, unsigned int uSize, unsigned int uCount, SteamHandle_t hFile, TSteamError *pError ) = 0;
  63. virtual unsigned int WriteFile( const void *pBuf, unsigned int uSize, unsigned int uCount, SteamHandle_t hFile, TSteamError *pError ) = 0;
  64. virtual int Getc( SteamHandle_t hFile, TSteamError *pError ) = 0;
  65. virtual int Putc( int cChar, SteamHandle_t hFile, TSteamError *pError ) = 0;
  66. //virtual int PrintFile( SteamHandle_t hFile, TSteamError *pError, const char *cszFormat, ... ) = 0;
  67. virtual int SeekFile( SteamHandle_t hFile, long lOffset, ESteamSeekMethod, TSteamError *pError ) = 0;
  68. virtual long TellFile( SteamHandle_t hFile, TSteamError *pError ) = 0;
  69. virtual long SizeFile( SteamHandle_t hFile, TSteamError *pError ) = 0;
  70. virtual SteamHandle_t FindFirst( const char *cszPattern, ESteamFindFilter eFilter, TSteamElemInfo *pFindInfo, TSteamError *pError ) = 0;
  71. virtual int FindNext( SteamHandle_t hDirectory, TSteamElemInfo *pFindInfo, TSteamError *pError ) = 0;
  72. #if !defined( _X360 ) // X360TBD: Macro defined in winbase.h
  73. virtual int FindClose( SteamHandle_t hDirectory, TSteamError *pError ) = 0;
  74. #endif
  75. virtual int GetLocalFileCopy( const char *cszName, TSteamError *pError ) = 0;
  76. virtual int IsFileImmediatelyAvailable( const char *cszName, TSteamError *pError ) = 0;
  77. virtual int HintResourceNeed( const char *cszMasterList, int bForgetEverything, TSteamError *pError ) = 0;
  78. virtual int ForgetAllHints( TSteamError *pError ) = 0;
  79. virtual int PauseCachePreloading( TSteamError *pError ) = 0;
  80. virtual int ResumeCachePreloading( TSteamError *pError ) = 0;
  81. virtual SteamCallHandle_t WaitForResources( const char *cszMasterList, TSteamError *pError ) = 0;
  82. virtual int StartEngine(TSteamError *pError) = 0;
  83. virtual int ShutdownEngine(TSteamError *pError) = 0;
  84. virtual int Startup( unsigned int uUsingMask, TSteamError *pError ) = 0;
  85. virtual int Cleanup( TSteamError *pError ) = 0;
  86. virtual unsigned int NumAppsRunning( TSteamError *pError ) = 0;
  87. virtual SteamCallHandle_t CreateAccount( const char *cszUser, const char *cszEmailAddress, const char *cszPassphrase, const char *cszCreationKey, const char *cszPersonalQuestion, const char *cszAnswerToQuestion, int *pbCreated, TSteamError *pError ) = 0;
  88. virtual SteamCallHandle_t GenerateSuggestedAccountNames( const char *cszAccountNameToSelectMasterAS, const char *cszGenerateNamesLikeAccountName, char *pSuggestedNamesBuf, unsigned int uBufSize, unsigned int *puNumSuggestedChars, TSteamError *pError) = 0;
  89. virtual int IsLoggedIn( int *pbIsLoggedIn, TSteamError *pError ) = 0;
  90. virtual SteamCallHandle_t Logout( TSteamError *pError ) = 0;
  91. virtual int IsSecureComputer( int *pbIsSecure, TSteamError *pError ) = 0;
  92. virtual SteamHandle_t CreateLogContext( const char *cszName ) = 0;
  93. virtual int Log( SteamHandle_t hContext, const char *cszMsg ) = 0;
  94. virtual void LogResourceLoadStarted( const char *cszMsg ) = 0;
  95. virtual void LogResourceLoadFinished( const char *cszMsg ) = 0;
  96. virtual SteamCallHandle_t RefreshLogin( const char *cszPassphrase, int bIsSecureComputer, TSteamError * pError ) = 0;
  97. virtual int VerifyPassword( const char *cszPassphrase, int *pbCorrect, TSteamError *pError ) = 0;
  98. virtual int GetUserType( unsigned int *puUserTypeFlags, TSteamError *pError ) = 0;
  99. virtual int GetAppStats( TSteamAppStats *pAppStats, TSteamError *pError ) = 0;
  100. virtual SteamCallHandle_t IsAccountNameInUse( const char *cszAccountName, int *pbIsUsed, TSteamError *pError) = 0;
  101. virtual int GetAppIds( unsigned int *puIds, unsigned int uMaxIds, TSteamError *pError ) = 0;
  102. virtual int GetSubscriptionStats( TSteamSubscriptionStats *pSubscriptionStats, TSteamError *pError ) = 0;
  103. virtual SteamCallHandle_t RefreshAccountInfo( int bContentDescriptionOnly, TSteamError *pError ) = 0;
  104. virtual SteamCallHandle_t Subscribe( unsigned int uSubscriptionId, const TSteamSubscriptionBillingInfo *pSubscriptionBillingInfo, TSteamError *pError ) = 0;
  105. virtual SteamCallHandle_t Unsubscribe( unsigned int uSubscriptionId, TSteamError *pError ) = 0;
  106. virtual int GetSubscriptionReceipt( unsigned int uSubscriptionId, TSteamSubscriptionReceipt *pSubscriptionReceipt, TSteamError *pError ) = 0;
  107. virtual int GetAccountStatus( unsigned int *puAccountStatusFlags, TSteamError *pError ) = 0;
  108. virtual SteamCallHandle_t SetUser( const char *cszUser, int *pbUserSet, TSteamError *pError ) = 0;
  109. virtual int GetUser( char *szUser, unsigned int uBufSize, unsigned int *puUserChars, TSteamGlobalUserID *pOptionalReceiveUserID, TSteamError *pError ) = 0;
  110. virtual SteamCallHandle_t Login( const char *cszUser, const char *cszPassphrase, int bIsSecureComputer, TSteamError *pError ) = 0;
  111. virtual SteamCallHandle_t AckSubscriptionReceipt( unsigned int uSubscriptionId, TSteamError *pError ) = 0;
  112. virtual int IsAppSubscribed( unsigned int uAppId, int *pbIsAppSubscribed, int *pbIsSubscriptionPending, TSteamError *pError ) = 0;
  113. virtual int GetSubscriptionIds( unsigned int *puIds, unsigned int uMaxIds, TSteamError *pError ) = 0;
  114. virtual int EnumerateSubscription( unsigned int uId, TSteamSubscription *pSubscription, TSteamError *pError ) = 0;
  115. virtual int EnumerateSubscriptionDiscount( unsigned int uSubscriptionId, unsigned int uDiscountIndex, TSteamSubscriptionDiscount *pDiscount, TSteamError *pError ) = 0;
  116. virtual int EnumerateSubscriptionDiscountQualifier( unsigned int uSubscriptionId, unsigned int uDiscountIndex, unsigned int uQualifierIndex, TSteamDiscountQualifier *pDiscountQualifier, TSteamError *pError ) = 0;
  117. virtual int EnumerateApp( unsigned int uId, TSteamApp *pApp, TSteamError *pError ) = 0;
  118. virtual int EnumerateAppLaunchOption( unsigned int uAppId, unsigned int uLaunchOptionIndex, TSteamAppLaunchOption *pLaunchOption, TSteamError *pError ) = 0;
  119. virtual SteamCallHandle_t DeleteAccount( TSteamError *pError ) = 0;
  120. virtual int EnumerateAppIcon( unsigned int uAppId, unsigned int uIconIndex, unsigned char *pIconData, unsigned int uIconDataBufSize, unsigned int *puSizeOfIconData, TSteamError *pError ) = 0;
  121. virtual SteamCallHandle_t LaunchApp( unsigned int uAppId, unsigned int uLaunchOption, const char *cszArgs, TSteamError *pError ) = 0;
  122. virtual int GetCacheFilePath( unsigned int uCacheId, char *szPathBuf, unsigned int uBufSize, unsigned int *puPathChars, TSteamError *pError ) = 0;
  123. virtual int EnumerateAppVersion( unsigned int uAppId, unsigned int uVersionIndex, TSteamAppVersion *pAppVersion, TSteamError *pError ) = 0;
  124. virtual int EnumerateAppDependency( unsigned int uAppId, unsigned int uIndex, TSteamAppDependencyInfo *pDependencyInfo, TSteamError *pError ) = 0;
  125. virtual SteamCallHandle_t StartLoadingCache( unsigned int uAppId, TSteamError *pError ) = 0;
  126. virtual int InsertAppDependency( unsigned int uAppId, unsigned int uIndex, TSteamAppDependencyInfo *pDependencyInfo, TSteamError *pError ) = 0;
  127. virtual int RemoveAppDependency( unsigned int uAppId, unsigned int uIndex, TSteamError *pError ) = 0;
  128. virtual int FindApp( const char *cszAppName, unsigned int *puAppId, TSteamError *pError ) = 0;
  129. virtual int GetAppDependencies( unsigned int uAppId, unsigned int *puCacheIds, unsigned int uMaxIds, TSteamError *pError ) = 0;
  130. virtual int IsSubscribed( unsigned int uSubscriptionId, int *pbIsSubscribed, int *pbIsSubscriptionPending, TSteamError *pError ) = 0;
  131. virtual int GetAppUserDefinedInfo( unsigned int uAppId, const char *cszKey, char *szValueBuf, unsigned int uValueBufLen, unsigned int *puValueLen, TSteamError *pError ) = 0;
  132. virtual SteamCallHandle_t WaitForAppReadyToLaunch( unsigned int uAppId, TSteamError *pError ) = 0;
  133. virtual int IsCacheLoadingEnabled( unsigned int uAppId, int *pbIsLoading, TSteamError *pError ) = 0;
  134. virtual SteamCallHandle_t StopLoadingCache( unsigned int uAppId, TSteamError *pError ) = 0;
  135. virtual ESteamError GetEncryptedUserIDTicket
  136. (
  137. const void * pEncryptionKey,
  138. unsigned int uKeyLength,
  139. void * pOutputBuffer,
  140. unsigned int uSizeOfOutputBuffer,
  141. unsigned int * pReceiveSizeOfEncryptedTicket,
  142. TSteamError * pReceiveErrorCode
  143. ) = 0;
  144. virtual SteamCallHandle_t FlushCache( unsigned int uCacheId, TSteamError *pError ) = 0;
  145. virtual SteamCallHandle_t RepairOrDecryptCaches( unsigned int uAppId, int bForceValidation, TSteamError *pError ) = 0;
  146. virtual SteamCallHandle_t LoadCacheFromDir( unsigned int uAppId, const char *szPath, TSteamError *pError ) = 0;
  147. virtual int GetCacheDefaultDirectory( char *szPath, TSteamError *pError ) = 0;
  148. virtual int SetCacheDefaultDirectory( const char *szPath, TSteamError *pError ) = 0;
  149. virtual int GetAppDir( unsigned int uAppId, char *szPath, TSteamError *pError ) = 0;
  150. virtual SteamCallHandle_t MoveApp( unsigned int uAppId, const char *szPath, TSteamError *pError ) = 0;
  151. virtual SteamCallHandle_t GetAppCacheSize( unsigned int uCacheId, unsigned int *pCacheSizeInMb, TSteamError *pError ) = 0;
  152. virtual SteamCallHandle_t SetAppCacheSize( unsigned int uCacheId, unsigned int nCacheSizeInMb, TSteamError *pError ) = 0;
  153. virtual SteamCallHandle_t SetAppVersion( unsigned int uAppId, unsigned int uAppVersionId, TSteamError *pError ) = 0;
  154. virtual SteamCallHandle_t Uninstall( TSteamError *pError ) = 0;
  155. virtual int SetNotificationCallback( SteamNotificationCallback_t pCallbackFunction, TSteamError *pError ) = 0;
  156. virtual SteamCallHandle_t ChangeForgottenPassword( const char *cszUser, const char *cszAnswerToQuestion, const char *cszEmailVerificationKey, const char *cszNewPassphrase, int *pbChanged, TSteamError *pError ) = 0;
  157. virtual SteamCallHandle_t RequestForgottenPasswordEmail( const char *cszUser, SteamPersonalQuestion_t ReceivePersonalQuestion, TSteamError *pError ) = 0;
  158. virtual SteamCallHandle_t RequestAccountsByEmailAddressEmail( const char *cszEmailAddress, TSteamError *pError ) = 0;
  159. virtual SteamCallHandle_t RequestAccountsByCdKeyEmail( const char *cszCdKey, TSteamError *pError ) = 0;
  160. virtual SteamCallHandle_t GetNumAccountsWithEmailAddress( const char *cszEmailAddress, unsigned int *puNumAccounts, TSteamError *pError ) = 0;
  161. virtual SteamCallHandle_t UpdateAccountBillingInfo( const TSteamPaymentCardInfo *pPaymentCardInfo, TSteamError *pError ) = 0;
  162. virtual SteamCallHandle_t UpdateSubscriptionBillingInfo( unsigned int uSubscriptionId, const TSteamSubscriptionBillingInfo *pSubscriptionBillingInfo, TSteamError *pError ) = 0;
  163. virtual int GetSponsorUrl( unsigned int uAppId, char *szUrl, unsigned int uBufSize, unsigned int *pUrlChars, TSteamError *pError ) = 0;
  164. virtual int GetContentServerInfo( unsigned int uAppId, unsigned int *puServerId, unsigned int *puServerIpAddress, TSteamError *pError ) = 0;
  165. virtual SteamCallHandle_t GetAppUpdateStats( unsigned int uAppOrCacheId, ESteamAppUpdateStatsQueryType eQueryType, TSteamUpdateStats *pUpdateStats, TSteamError *pError ) = 0;
  166. virtual int GetTotalUpdateStats( TSteamUpdateStats *pUpdateStats, TSteamError *pError ) = 0;
  167. virtual SteamCallHandle_t CreateCachePreloaders( TSteamError *pError ) = 0;
  168. virtual void Win32SetMiniDumpComment( const char *comment ) = 0;
  169. virtual void Win32SetMiniDumpSourceControlId( unsigned int SourcecontrolID ) = 0;
  170. virtual void Win32SetMiniDumpEnableFullMemory() = 0;
  171. virtual void Win32WriteMiniDump( const char * szErrorOrAssertType, const char * szDescriptionOrAssertName, const char * szAssertExpr, const char * szAssertFilename, unsigned int uAssertLineNumber ) = 0;
  172. virtual int GetCurrentAppId( unsigned int *puAppId, TSteamError *pError ) = 0;
  173. virtual int GetAppPurchaseCountry( unsigned int uAppId, char *szCountry, unsigned int uBufSize, int * pPurchaseTime, TSteamError *pError ) = 0;
  174. virtual int GetLocalClientVersion( unsigned int *puBootstrapperVersion, unsigned int *puClientVersion, TSteamError *pError ) = 0;
  175. virtual int IsFileNeededByCache( unsigned int uCacheId, const char *pchFileName, unsigned int uFileSize, TSteamError *pError ) = 0;
  176. virtual int LoadFileToCache( unsigned int uCacheId, const char *pchFileName, const void *pubDataChunk, unsigned int cubDataChunk, unsigned int cubDataOffset, TSteamError *pError ) = 0;
  177. virtual int GetCacheDecryptionKey( unsigned int uCacheId, char *pchKeyBuffer, unsigned int cubBuff, unsigned int *pcubKey, TSteamError *pError ) = 0;
  178. virtual int GetSubscriptionExtendedInfo( unsigned int uSubscriptionId, const char *cszKey, char *szValueBuf, unsigned int uValueBufLen, unsigned *puValueLen, TSteamError *pError ) = 0;
  179. virtual int GetSubscriptionPurchaseCountry( unsigned int uSubscriptionId, char *szCountry, unsigned int uBufSize, int * pPurchaseTime, TSteamError *pError ) = 0;
  180. virtual int GetAppUserDefinedRecord( unsigned int uAppid, KeyValueIteratorCallback_t pIterationCallback, void *pvParam, TSteamError *pError ) = 0;
  181. virtual int FindServersNumServers(ESteamServerType eServerType) = 0;
  182. // Get nth ipaddr:port for this server type
  183. // buffer needs to be 22 chars long: aaa.bbb.ccc.ddd:12345 plus null
  184. //
  185. // returns 0 if succsessful, negative is error
  186. virtual int FindServersIterateServer(ESteamServerType eServerType, unsigned int nServer, char *szIpAddrPort, int szIpAddrPortLen) = 0;
  187. virtual const char * FindServersGetErrorString() = 0;
  188. };
  189. #endif