From 0bf379a41be6c6afabfa50a13167880ef945015a Mon Sep 17 00:00:00 2001 From: Garry Newman Date: Thu, 11 Apr 2019 16:19:09 +0100 Subject: [PATCH] Steamworks 144 --- Generator/steam_sdk/isteamapplist.h | 22 +- Generator/steam_sdk/isteamapps.h | 44 +- Generator/steam_sdk/isteamclient.h | 402 +--- Generator/steam_sdk/isteamcontroller.h | 232 ++- Generator/steam_sdk/isteamfriends.h | 86 +- Generator/steam_sdk/isteamgamecoordinator.h | 5 +- Generator/steam_sdk/isteamgameserver.h | 14 +- Generator/steam_sdk/isteamgameserverstats.h | 14 +- Generator/steam_sdk/isteamhtmlsurface.h | 284 +-- Generator/steam_sdk/isteamhttp.h | 17 +- Generator/steam_sdk/isteaminput.h | 619 ++++++ Generator/steam_sdk/isteaminventory.h | 84 +- Generator/steam_sdk/isteammatchmaking.h | 367 +++- Generator/steam_sdk/isteammusic.h | 18 +- Generator/steam_sdk/isteammusicremote.h | 76 +- Generator/steam_sdk/isteamnetworking.h | 41 +- Generator/steam_sdk/isteamnetworkingsockets.h | 489 +++++ Generator/steam_sdk/isteamnetworkingutils.h | 302 +++ Generator/steam_sdk/isteamparentalsettings.h | 5 + Generator/steam_sdk/isteamremotestorage.h | 56 +- Generator/steam_sdk/isteamscreenshots.h | 8 +- Generator/steam_sdk/isteamugc.h | 66 +- Generator/steam_sdk/isteamuser.h | 32 +- Generator/steam_sdk/isteamuserstats.h | 40 +- Generator/steam_sdk/isteamutils.h | 13 +- Generator/steam_sdk/isteamvideo.h | 38 +- Generator/steam_sdk/steam_api.h | 421 ++-- Generator/steam_sdk/steam_api.json | 1441 +++++++++++-- Generator/steam_sdk/steam_api_common.h | 231 +++ Generator/steam_sdk/steam_api_flat.h | 111 +- Generator/steam_sdk/steam_api_internal.h | 471 +++-- Generator/steam_sdk/steam_api_interop.cs | 1816 +++++++++++++++-- Generator/steam_sdk/steam_gameserver.h | 183 +- Generator/steam_sdk/steamclientpublic.h | 155 +- Generator/steam_sdk/steamdatagram_ticketgen.h | 69 + Generator/steam_sdk/steamdatagram_tickets.h | 247 +++ Generator/steam_sdk/steamnetworkingtypes.h | 1114 ++++++++++ Generator/steam_sdk/steamtypes.h | 35 +- 38 files changed, 7780 insertions(+), 1888 deletions(-) create mode 100644 Generator/steam_sdk/isteaminput.h create mode 100644 Generator/steam_sdk/isteamnetworkingsockets.h create mode 100644 Generator/steam_sdk/isteamnetworkingutils.h create mode 100644 Generator/steam_sdk/steam_api_common.h create mode 100644 Generator/steam_sdk/steamdatagram_ticketgen.h create mode 100644 Generator/steam_sdk/steamdatagram_tickets.h create mode 100644 Generator/steam_sdk/steamnetworkingtypes.h diff --git a/Generator/steam_sdk/isteamapplist.h b/Generator/steam_sdk/isteamapplist.h index d678909..45441bb 100644 --- a/Generator/steam_sdk/isteamapplist.h +++ b/Generator/steam_sdk/isteamapplist.h @@ -10,7 +10,7 @@ #pragma once #endif -#include "isteamclient.h" +#include "steam_api_common.h" #include "steamtypes.h" //----------------------------------------------------------------------------- @@ -25,7 +25,7 @@ public: virtual uint32 GetNumInstalledApps() = 0; virtual uint32 GetInstalledApps( AppId_t *pvecAppID, uint32 unMaxAppIDs ) = 0; - virtual int GetAppName( AppId_t nAppID, OUT_STRING() char *pchName, int cchNameMax ) = 0; // returns -1 if no name was found + 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 @@ -33,30 +33,34 @@ public: #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 isteamclient.h must be included +#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx #endif //--------------------------------------------------------------------------------- // Purpose: Sent when a new app is installed //--------------------------------------------------------------------------------- -DEFINE_CALLBACK( SteamAppInstalled_t, k_iSteamAppListCallbacks + 1 ); - CALLBACK_MEMBER( 0, AppId_t, m_nAppID ) // ID of the app that installs -END_DEFINE_CALLBACK_1() +STEAM_CALLBACK_BEGIN( SteamAppInstalled_t, k_iSteamAppListCallbacks + 1 ); + STEAM_CALLBACK_MEMBER( 0, AppId_t, m_nAppID ) // ID of the app that installs +STEAM_CALLBACK_END(1) //--------------------------------------------------------------------------------- // Purpose: Sent when an app is uninstalled //--------------------------------------------------------------------------------- -DEFINE_CALLBACK( SteamAppUninstalled_t, k_iSteamAppListCallbacks + 2 ); - CALLBACK_MEMBER( 0, AppId_t, m_nAppID ) // ID of the app that installs -END_DEFINE_CALLBACK_1() +STEAM_CALLBACK_BEGIN( SteamAppUninstalled_t, k_iSteamAppListCallbacks + 2 ); + STEAM_CALLBACK_MEMBER( 0, AppId_t, m_nAppID ) // ID of the app that installs +STEAM_CALLBACK_END(1) #pragma pack( pop ) diff --git a/Generator/steam_sdk/isteamapps.h b/Generator/steam_sdk/isteamapps.h index 9a97b4a..550cb8f 100644 --- a/Generator/steam_sdk/isteamapps.h +++ b/Generator/steam_sdk/isteamapps.h @@ -10,6 +10,8 @@ #pragma once #endif +#include "steam_api_common.h" + const int k_cubAppProofOfPurchaseKeyMax = 240; // max supported length of a legacy cd key @@ -65,13 +67,16 @@ public: 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 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///?param1=value1;param2=value2;param3=value3 etc. + // Returns the associated launch param if the game is run via steam://run///?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. - virtual const char *GetLaunchQueryParam( const char *pchKey ) = 0; + // 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; @@ -85,19 +90,40 @@ public: // member is k_uAppIdInvalid (zero). virtual void RequestAllProofOfPurchaseKeys() = 0; - CALL_RESULT( FileDetailsResult_t ) + 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////. + // 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; }; #define STEAMAPPS_INTERFACE_VERSION "STEAMAPPS_INTERFACE_VERSION008" +// Global interface accessor +inline ISteamApps *SteamApps(); +STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamApps *, SteamApps, STEAMAPPS_INTERFACE_VERSION ); + +// Global accessor for the gameserver client +inline ISteamApps *SteamGameServerApps(); +STEAM_DEFINE_GAMESERVER_INTERFACE_ACCESSOR( ISteamApps *, SteamGameServerApps, 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 isteamclient.h must be included +#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 @@ -134,12 +160,12 @@ struct RegisterActivationCodeResponse_t //--------------------------------------------------------------------------------- -// Purpose: posted after the user gains executes a steam url with query parameters -// such as steam://run///?param1=value1;param2=value2;param3=value3; etc +// Purpose: posted after the user gains executes a Steam URL with command line or query parameters +// such as steam://run///-commandline/?param1=value1¶m2=value2¶m3=value3 etc // while the game is already running. The new params can be queried -// with GetLaunchQueryParam. +// with GetLaunchQueryParam and GetLaunchCommandLine //--------------------------------------------------------------------------------- -struct NewLaunchQueryParameters_t +struct NewUrlLaunchParameters_t { enum { k_iCallback = k_iSteamAppsCallbacks + 14 }; }; diff --git a/Generator/steam_sdk/isteamclient.h b/Generator/steam_sdk/isteamclient.h index af8828d..72115b9 100644 --- a/Generator/steam_sdk/isteamclient.h +++ b/Generator/steam_sdk/isteamclient.h @@ -1,8 +1,9 @@ -//====== Copyright � 1996-2008, Valve Corporation, All rights reserved. ======= +//====== Copyright Valve Corporation, All rights reserved. ==================== // -// Purpose: Main interface for loading and accessing Steamworks API's from the -// Steam client. -// For most uses, this code is wrapped inside of SteamAPI_Init() +// Internal low-level access to Steamworks interfaces. +// +// Most users of the Steamworks SDK do not need to include this file. +// You should only include this if you are doing something special. //============================================================================= #ifndef ISTEAMCLIENT_H @@ -11,102 +12,7 @@ #pragma once #endif -#include "steamtypes.h" -#include "steamclientpublic.h" - -// Define compile time assert macros to let us validate the structure sizes. -#define VALVE_COMPILE_TIME_ASSERT( pred ) typedef char compile_time_assert_type[(pred) ? 1 : -1]; - -#ifndef REFERENCE -#define REFERENCE(arg) ((void)arg) -#endif - -#if ( defined(STEAM_API_EXPORTS) || defined(STEAM_API_NODLL) ) && !defined(API_GEN) -#define STEAM_PRIVATE_API( ... ) __VA_ARGS__ -#elif defined(STEAM_API_EXPORTS) && defined(API_GEN) -#define STEAM_PRIVATE_API( ... ) -#else -#define STEAM_PRIVATE_API( ... ) protected: __VA_ARGS__ public: -#endif - -#if defined(__linux__) || defined(__APPLE__) -// The 32-bit version of gcc has the alignment requirement for uint64 and double set to -// 4 meaning that even with #pragma pack(8) these types will only be four-byte aligned. -// The 64-bit version of gcc has the alignment requirement for these types set to -// 8 meaning that unless we use #pragma pack(4) our structures will get bigger. -// The 64-bit structure packing has to match the 32-bit structure packing for each platform. -#define VALVE_CALLBACK_PACK_SMALL -#else -#define VALVE_CALLBACK_PACK_LARGE -#endif - -#if defined( VALVE_CALLBACK_PACK_SMALL ) -#pragma pack( push, 4 ) -#elif defined( VALVE_CALLBACK_PACK_LARGE ) -#pragma pack( push, 8 ) -#else -#error ??? -#endif - -typedef struct ValvePackingSentinel_t -{ - uint32 m_u32; - uint64 m_u64; - uint16 m_u16; - double m_d; -} ValvePackingSentinel_t; - -#pragma pack( pop ) - - -#if defined(VALVE_CALLBACK_PACK_SMALL) -VALVE_COMPILE_TIME_ASSERT( sizeof(ValvePackingSentinel_t) == 24 ) -#elif defined(VALVE_CALLBACK_PACK_LARGE) -VALVE_COMPILE_TIME_ASSERT( sizeof(ValvePackingSentinel_t) == 32 ) -#else -#error ??? -#endif - - -// handle to a communication pipe to the Steam client -typedef int32 HSteamPipe; -// handle to single instance of a steam user -typedef int32 HSteamUser; -// function prototype -#if defined( POSIX ) -#define __cdecl -#endif -extern "C" typedef void (__cdecl *SteamAPIWarningMessageHook_t)(int, const char *); -extern "C" typedef uint32 ( *SteamAPI_CheckCallbackRegistered_t )( int iCallbackNum ); -#if defined( __SNC__ ) - #pragma diag_suppress=1700 // warning 1700: class "%s" has virtual functions but non-virtual destructor -#endif - -// interface predec -class ISteamUser; -class ISteamGameServer; -class ISteamFriends; -class ISteamUtils; -class ISteamMatchmaking; -class ISteamContentServer; -class ISteamMatchmakingServers; -class ISteamUserStats; -class ISteamApps; -class ISteamNetworking; -class ISteamRemoteStorage; -class ISteamScreenshots; -class ISteamMusic; -class ISteamMusicRemote; -class ISteamGameServerStats; -class ISteamPS3OverlayRender; -class ISteamHTTP; -class ISteamController; -class ISteamUGC; -class ISteamAppList; -class ISteamHTMLSurface; -class ISteamInventory; -class ISteamVideo; -class ISteamParentalSettings; +#include "steam_api_common.h" //----------------------------------------------------------------------------- // Purpose: Interface to creating a new steam instance, or to @@ -185,6 +91,9 @@ public: // user screenshots virtual ISteamScreenshots *GetISteamScreenshots( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0; + // game search + virtual ISteamGameSearch *GetISteamGameSearch( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0; + // Deprecated. Applications should use SteamAPI_RunCallbacks() or SteamGameServer_RunCallbacks() instead. STEAM_PRIVATE_API( virtual void RunFrame() = 0; ) @@ -209,7 +118,7 @@ public: // Deprecated - the ISteamUnifiedMessages interface is no longer intended for public consumption. STEAM_PRIVATE_API( virtual void *DEPRECATED_GetISteamUnifiedMessages( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0 ; ) - // Exposes the ISteamController interface + // Exposes the ISteamController interface - deprecated in favor of Steam Input virtual ISteamController *GetISteamController( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0; // Exposes the ISteamUGC interface @@ -240,287 +149,26 @@ public: // Parental controls virtual ISteamParentalSettings *GetISteamParentalSettings( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0; + + // Exposes the Steam Input interface for controller support + virtual ISteamInput *GetISteamInput( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0; + + // Steam Parties interface + virtual ISteamParties *GetISteamParties( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0; + }; +#define STEAMCLIENT_INTERFACE_VERSION "SteamClient018" +#ifndef STEAM_API_EXPORTS -#define STEAMCLIENT_INTERFACE_VERSION "SteamClient017" +// Global ISteamClient interface accessor +inline ISteamClient *SteamClient(); +STEAM_DEFINE_INTERFACE_ACCESSOR( ISteamClient *, SteamClient, SteamInternal_CreateInterface( STEAMCLIENT_INTERFACE_VERSION ) ); -//----------------------------------------------------------------------------- -// Purpose: Base values for callback identifiers, each callback must -// have a unique ID. -//----------------------------------------------------------------------------- -enum { k_iSteamUserCallbacks = 100 }; -enum { k_iSteamGameServerCallbacks = 200 }; -enum { k_iSteamFriendsCallbacks = 300 }; -enum { k_iSteamBillingCallbacks = 400 }; -enum { k_iSteamMatchmakingCallbacks = 500 }; -enum { k_iSteamContentServerCallbacks = 600 }; -enum { k_iSteamUtilsCallbacks = 700 }; -enum { k_iClientFriendsCallbacks = 800 }; -enum { k_iClientUserCallbacks = 900 }; -enum { k_iSteamAppsCallbacks = 1000 }; -enum { k_iSteamUserStatsCallbacks = 1100 }; -enum { k_iSteamNetworkingCallbacks = 1200 }; -enum { k_iClientRemoteStorageCallbacks = 1300 }; -enum { k_iClientDepotBuilderCallbacks = 1400 }; -enum { k_iSteamGameServerItemsCallbacks = 1500 }; -enum { k_iClientUtilsCallbacks = 1600 }; -enum { k_iSteamGameCoordinatorCallbacks = 1700 }; -enum { k_iSteamGameServerStatsCallbacks = 1800 }; -enum { k_iSteam2AsyncCallbacks = 1900 }; -enum { k_iSteamGameStatsCallbacks = 2000 }; -enum { k_iClientHTTPCallbacks = 2100 }; -enum { k_iClientScreenshotsCallbacks = 2200 }; -enum { k_iSteamScreenshotsCallbacks = 2300 }; -enum { k_iClientAudioCallbacks = 2400 }; -enum { k_iClientUnifiedMessagesCallbacks = 2500 }; -enum { k_iSteamStreamLauncherCallbacks = 2600 }; -enum { k_iClientControllerCallbacks = 2700 }; -enum { k_iSteamControllerCallbacks = 2800 }; -enum { k_iClientParentalSettingsCallbacks = 2900 }; -enum { k_iClientDeviceAuthCallbacks = 3000 }; -enum { k_iClientNetworkDeviceManagerCallbacks = 3100 }; -enum { k_iClientMusicCallbacks = 3200 }; -enum { k_iClientRemoteClientManagerCallbacks = 3300 }; -enum { k_iClientUGCCallbacks = 3400 }; -enum { k_iSteamStreamClientCallbacks = 3500 }; -enum { k_IClientProductBuilderCallbacks = 3600 }; -enum { k_iClientShortcutsCallbacks = 3700 }; -enum { k_iClientRemoteControlManagerCallbacks = 3800 }; -enum { k_iSteamAppListCallbacks = 3900 }; -enum { k_iSteamMusicCallbacks = 4000 }; -enum { k_iSteamMusicRemoteCallbacks = 4100 }; -enum { k_iClientVRCallbacks = 4200 }; -enum { k_iClientGameNotificationCallbacks = 4300 }; -enum { k_iSteamGameNotificationCallbacks = 4400 }; -enum { k_iSteamHTMLSurfaceCallbacks = 4500 }; -enum { k_iClientVideoCallbacks = 4600 }; -enum { k_iClientInventoryCallbacks = 4700 }; -enum { k_iClientBluetoothManagerCallbacks = 4800 }; -enum { k_iClientSharedConnectionCallbacks = 4900 }; -enum { k_ISteamParentalSettingsCallbacks = 5000 }; -enum { k_iClientShaderCallbacks = 5100 }; - -//----------------------------------------------------------------------------- -// The CALLBACK macros are for client side callback logging enabled with -// log_callback -// Do not change any of these. -//----------------------------------------------------------------------------- - -#ifdef STEAM_CALLBACK_INSPECTION_ENABLED - -#define DEFINE_CALLBACK( callbackname, callbackid ) \ -struct callbackname { \ - typedef callbackname SteamCallback_t; \ - enum { k_iCallback = callbackid }; \ - static callbackname *GetNullPointer() { return 0; } \ - static const char *GetCallbackName() { return #callbackname; } \ - static uint32 GetCallbackID() { return callbackname::k_iCallback; } - -#define CALLBACK_MEMBER( varidx, vartype, varname ) \ - public: vartype varname ; \ - static void GetMemberVar_##varidx( unsigned int &varOffset, unsigned int &varSize, uint32 &varCount, const char **pszName, const char **pszType ) { \ - varOffset = (unsigned int)(size_t)&GetNullPointer()->varname; \ - varSize = sizeof( vartype ); \ - varCount = 1; \ - *pszName = #varname; *pszType = #vartype; } - -#define CALLBACK_ARRAY( varidx, vartype, varname, varcount ) \ - public: vartype varname [ varcount ]; \ - static void GetMemberVar_##varidx( unsigned int &varOffset, unsigned int &varSize, uint32 &varCount, const char **pszName, const char **pszType ) { \ - varOffset = (unsigned int)(size_t)&GetNullPointer()->varname[0]; \ - varSize = sizeof( vartype ); \ - varCount = varcount; \ - *pszName = #varname; *pszType = #vartype; } - - -#define END_CALLBACK_INTERNAL_BEGIN( numvars ) \ - static uint32 GetNumMemberVariables() { return numvars; } \ - static bool GetMemberVariable( uint32 index, uint32 &varOffset, uint32 &varSize, uint32 &varCount, const char **pszName, const char **pszType ) { \ - switch ( index ) { default : return false; - - -#define END_CALLBACK_INTERNAL_SWITCH( varidx ) case varidx : GetMemberVar_##varidx( varOffset, varSize, varCount, pszName, pszType ); return true; - -#define END_CALLBACK_INTERNAL_END() }; } }; - -#define END_DEFINE_CALLBACK_0() \ - static uint32 GetNumMemberVariables() { return 0; } \ - static bool GetMemberVariable( uint32 index, uint32 &varOffset, uint32 &varSize, uint32 &varCount, const char **pszName, const char **pszType ) { REFERENCE( pszType ); REFERENCE( pszName ); REFERENCE( varCount ); REFERENCE( varSize ); REFERENCE( varOffset ); REFERENCE( index ); return false; } \ - }; - -#else - -#define DEFINE_CALLBACK( callbackname, callbackid ) struct callbackname { typedef callbackname SteamCallback_t; enum { k_iCallback = callbackid }; -#define CALLBACK_MEMBER( varidx, vartype, varname ) public: vartype varname ; -#define CALLBACK_ARRAY( varidx, vartype, varname, varcount ) public: vartype varname [ varcount ]; -#define END_CALLBACK_INTERNAL_BEGIN( numvars ) -#define END_CALLBACK_INTERNAL_SWITCH( varidx ) -#define END_CALLBACK_INTERNAL_END() }; -#define END_DEFINE_CALLBACK_0() }; +// The internal ISteamClient used for the gameserver interface. +// (This is actually the same thing. You really shouldn't need to access any of this stuff directly.) +inline ISteamClient *SteamGameServerClient() { return SteamClient(); } #endif -#define END_DEFINE_CALLBACK_1() \ - END_CALLBACK_INTERNAL_BEGIN( 1 ) \ - END_CALLBACK_INTERNAL_SWITCH( 0 ) \ - END_CALLBACK_INTERNAL_END() - -#define END_DEFINE_CALLBACK_2() \ - END_CALLBACK_INTERNAL_BEGIN( 2 ) \ - END_CALLBACK_INTERNAL_SWITCH( 0 ) \ - END_CALLBACK_INTERNAL_SWITCH( 1 ) \ - END_CALLBACK_INTERNAL_END() - -#define END_DEFINE_CALLBACK_3() \ - END_CALLBACK_INTERNAL_BEGIN( 3 ) \ - END_CALLBACK_INTERNAL_SWITCH( 0 ) \ - END_CALLBACK_INTERNAL_SWITCH( 1 ) \ - END_CALLBACK_INTERNAL_SWITCH( 2 ) \ - END_CALLBACK_INTERNAL_END() - -#define END_DEFINE_CALLBACK_4() \ - END_CALLBACK_INTERNAL_BEGIN( 4 ) \ - END_CALLBACK_INTERNAL_SWITCH( 0 ) \ - END_CALLBACK_INTERNAL_SWITCH( 1 ) \ - END_CALLBACK_INTERNAL_SWITCH( 2 ) \ - END_CALLBACK_INTERNAL_SWITCH( 3 ) \ - END_CALLBACK_INTERNAL_END() - -#define END_DEFINE_CALLBACK_5() \ - END_CALLBACK_INTERNAL_BEGIN( 4 ) \ - END_CALLBACK_INTERNAL_SWITCH( 0 ) \ - END_CALLBACK_INTERNAL_SWITCH( 1 ) \ - END_CALLBACK_INTERNAL_SWITCH( 2 ) \ - END_CALLBACK_INTERNAL_SWITCH( 3 ) \ - END_CALLBACK_INTERNAL_SWITCH( 4 ) \ - END_CALLBACK_INTERNAL_END() - - -#define END_DEFINE_CALLBACK_6() \ - END_CALLBACK_INTERNAL_BEGIN( 6 ) \ - END_CALLBACK_INTERNAL_SWITCH( 0 ) \ - END_CALLBACK_INTERNAL_SWITCH( 1 ) \ - END_CALLBACK_INTERNAL_SWITCH( 2 ) \ - END_CALLBACK_INTERNAL_SWITCH( 3 ) \ - END_CALLBACK_INTERNAL_SWITCH( 4 ) \ - END_CALLBACK_INTERNAL_SWITCH( 5 ) \ - END_CALLBACK_INTERNAL_END() - -#define END_DEFINE_CALLBACK_7() \ - END_CALLBACK_INTERNAL_BEGIN( 7 ) \ - END_CALLBACK_INTERNAL_SWITCH( 0 ) \ - END_CALLBACK_INTERNAL_SWITCH( 1 ) \ - END_CALLBACK_INTERNAL_SWITCH( 2 ) \ - END_CALLBACK_INTERNAL_SWITCH( 3 ) \ - END_CALLBACK_INTERNAL_SWITCH( 4 ) \ - END_CALLBACK_INTERNAL_SWITCH( 5 ) \ - END_CALLBACK_INTERNAL_SWITCH( 6 ) \ - END_CALLBACK_INTERNAL_END() - -#define END_DEFINE_CALLBACK_8() \ - END_CALLBACK_INTERNAL_BEGIN( 8 ) \ - END_CALLBACK_INTERNAL_SWITCH( 0 ) \ - END_CALLBACK_INTERNAL_SWITCH( 1 ) \ - END_CALLBACK_INTERNAL_SWITCH( 2 ) \ - END_CALLBACK_INTERNAL_SWITCH( 3 ) \ - END_CALLBACK_INTERNAL_SWITCH( 4 ) \ - END_CALLBACK_INTERNAL_SWITCH( 5 ) \ - END_CALLBACK_INTERNAL_SWITCH( 6 ) \ - END_CALLBACK_INTERNAL_SWITCH( 7 ) \ - END_CALLBACK_INTERNAL_END() - -#define END_DEFINE_CALLBACK_9() \ - END_CALLBACK_INTERNAL_BEGIN( 9 ) \ - END_CALLBACK_INTERNAL_SWITCH( 0 ) \ - END_CALLBACK_INTERNAL_SWITCH( 1 ) \ - END_CALLBACK_INTERNAL_SWITCH( 2 ) \ - END_CALLBACK_INTERNAL_SWITCH( 3 ) \ - END_CALLBACK_INTERNAL_SWITCH( 4 ) \ - END_CALLBACK_INTERNAL_SWITCH( 5 ) \ - END_CALLBACK_INTERNAL_SWITCH( 6 ) \ - END_CALLBACK_INTERNAL_SWITCH( 7 ) \ - END_CALLBACK_INTERNAL_SWITCH( 8 ) \ - END_CALLBACK_INTERNAL_END() - -#define END_DEFINE_CALLBACK_10() \ - END_CALLBACK_INTERNAL_BEGIN( 10 ) \ - END_CALLBACK_INTERNAL_SWITCH( 0 ) \ - END_CALLBACK_INTERNAL_SWITCH( 1 ) \ - END_CALLBACK_INTERNAL_SWITCH( 2 ) \ - END_CALLBACK_INTERNAL_SWITCH( 3 ) \ - END_CALLBACK_INTERNAL_SWITCH( 4 ) \ - END_CALLBACK_INTERNAL_SWITCH( 5 ) \ - END_CALLBACK_INTERNAL_SWITCH( 6 ) \ - END_CALLBACK_INTERNAL_SWITCH( 7 ) \ - END_CALLBACK_INTERNAL_SWITCH( 8 ) \ - END_CALLBACK_INTERNAL_SWITCH( 9 ) \ - END_CALLBACK_INTERNAL_END() - -#define END_DEFINE_CALLBACK_11() \ - END_CALLBACK_INTERNAL_BEGIN( 11 ) \ - END_CALLBACK_INTERNAL_SWITCH( 0 ) \ - END_CALLBACK_INTERNAL_SWITCH( 1 ) \ - END_CALLBACK_INTERNAL_SWITCH( 2 ) \ - END_CALLBACK_INTERNAL_SWITCH( 3 ) \ - END_CALLBACK_INTERNAL_SWITCH( 4 ) \ - END_CALLBACK_INTERNAL_SWITCH( 5 ) \ - END_CALLBACK_INTERNAL_SWITCH( 6 ) \ - END_CALLBACK_INTERNAL_SWITCH( 7 ) \ - END_CALLBACK_INTERNAL_SWITCH( 8 ) \ - END_CALLBACK_INTERNAL_SWITCH( 9 ) \ - END_CALLBACK_INTERNAL_SWITCH( 10 ) \ - END_CALLBACK_INTERNAL_END() - -#define END_DEFINE_CALLBACK_12() \ - END_CALLBACK_INTERNAL_BEGIN( 12 ) \ - END_CALLBACK_INTERNAL_SWITCH( 0 ) \ - END_CALLBACK_INTERNAL_SWITCH( 1 ) \ - END_CALLBACK_INTERNAL_SWITCH( 2 ) \ - END_CALLBACK_INTERNAL_SWITCH( 3 ) \ - END_CALLBACK_INTERNAL_SWITCH( 4 ) \ - END_CALLBACK_INTERNAL_SWITCH( 5 ) \ - END_CALLBACK_INTERNAL_SWITCH( 6 ) \ - END_CALLBACK_INTERNAL_SWITCH( 7 ) \ - END_CALLBACK_INTERNAL_SWITCH( 8 ) \ - END_CALLBACK_INTERNAL_SWITCH( 9 ) \ - END_CALLBACK_INTERNAL_SWITCH( 10 ) \ - END_CALLBACK_INTERNAL_SWITCH( 11 ) \ - END_CALLBACK_INTERNAL_END() - -#define END_DEFINE_CALLBACK_13() \ - END_CALLBACK_INTERNAL_BEGIN( 13 ) \ - END_CALLBACK_INTERNAL_SWITCH( 0 ) \ - END_CALLBACK_INTERNAL_SWITCH( 1 ) \ - END_CALLBACK_INTERNAL_SWITCH( 2 ) \ - END_CALLBACK_INTERNAL_SWITCH( 3 ) \ - END_CALLBACK_INTERNAL_SWITCH( 4 ) \ - END_CALLBACK_INTERNAL_SWITCH( 5 ) \ - END_CALLBACK_INTERNAL_SWITCH( 6 ) \ - END_CALLBACK_INTERNAL_SWITCH( 7 ) \ - END_CALLBACK_INTERNAL_SWITCH( 8 ) \ - END_CALLBACK_INTERNAL_SWITCH( 9 ) \ - END_CALLBACK_INTERNAL_SWITCH( 10 ) \ - END_CALLBACK_INTERNAL_SWITCH( 11 ) \ - END_CALLBACK_INTERNAL_SWITCH( 12 ) \ - END_CALLBACK_INTERNAL_END() - -#define END_DEFINE_CALLBACK_14() \ - END_CALLBACK_INTERNAL_BEGIN( 14 ) \ - END_CALLBACK_INTERNAL_SWITCH( 0 ) \ - END_CALLBACK_INTERNAL_SWITCH( 1 ) \ - END_CALLBACK_INTERNAL_SWITCH( 2 ) \ - END_CALLBACK_INTERNAL_SWITCH( 3 ) \ - END_CALLBACK_INTERNAL_SWITCH( 4 ) \ - END_CALLBACK_INTERNAL_SWITCH( 5 ) \ - END_CALLBACK_INTERNAL_SWITCH( 6 ) \ - END_CALLBACK_INTERNAL_SWITCH( 7 ) \ - END_CALLBACK_INTERNAL_SWITCH( 8 ) \ - END_CALLBACK_INTERNAL_SWITCH( 9 ) \ - END_CALLBACK_INTERNAL_SWITCH( 10 ) \ - END_CALLBACK_INTERNAL_SWITCH( 11 ) \ - END_CALLBACK_INTERNAL_SWITCH( 12 ) \ - END_CALLBACK_INTERNAL_SWITCH( 13 ) \ - END_CALLBACK_INTERNAL_END() - #endif // ISTEAMCLIENT_H diff --git a/Generator/steam_sdk/isteamcontroller.h b/Generator/steam_sdk/isteamcontroller.h index 6f31b75..1b1ed78 100644 --- a/Generator/steam_sdk/isteamcontroller.h +++ b/Generator/steam_sdk/isteamcontroller.h @@ -1,6 +1,12 @@ -//====== Copyright 1996-2013, Valve Corporation, All rights reserved. ======= +//====== Copyright 1996-2018, Valve Corporation, All rights reserved. ======= +// Note: The older ISteamController interface has been deprecated in favor of ISteamInput - this interface +// was updated in this SDK but will be removed from future SDK's. The Steam Client will retain +// compatibility with the older interfaces so your any existing integrations should be unaffected. // -// Purpose: interface to valve controller +// Purpose: Steam Input is a flexible input API that supports over three hundred devices including all +// common variants of Xbox, Playstation, Nintendo Switch Pro, and Steam Controllers. +// For more info including a getting started guide for developers +// please visit: https://partner.steamgames.com/doc/features/steam_controller // //============================================================================= @@ -10,7 +16,8 @@ #pragma once #endif -#include "isteamclient.h" +#include "steam_api_common.h" +#include "isteaminput.h" #define STEAM_CONTROLLER_MAX_COUNT 16 @@ -26,11 +33,13 @@ #define STEAM_CONTROLLER_MIN_ANALOG_ACTION_DATA -1.0f #define STEAM_CONTROLLER_MAX_ANALOG_ACTION_DATA 1.0f +#ifndef ISTEAMINPUT_H enum ESteamControllerPad { k_ESteamControllerPad_Left, k_ESteamControllerPad_Right }; +#endif enum EControllerSource { @@ -42,12 +51,15 @@ enum EControllerSource k_EControllerSource_Switch, k_EControllerSource_LeftTrigger, k_EControllerSource_RightTrigger, + k_EControllerSource_LeftBumper, + k_EControllerSource_RightBumper, k_EControllerSource_Gyro, k_EControllerSource_CenterTrackpad, // PS4 k_EControllerSource_RightJoystick, // Traditional Controllers k_EControllerSource_DPad, // Traditional Controllers - k_EControllerSource_Key, // Keyboards with scan codes - k_EControllerSource_Mouse, // Traditional mouse + k_EControllerSource_Key, // Keyboards with scan codes - Unused + k_EControllerSource_Mouse, // Traditional mouse - Unused + k_EControllerSource_LeftGyro, // Secondary Gyro - Switch - Unused k_EControllerSource_Count }; @@ -72,6 +84,10 @@ enum EControllerSourceMode k_EControllerSourceMode_Switches }; +// Note: Please do not use action origins as a way to identify controller types. There is no +// guarantee that they will be added in a contiguous manner - use GetInputTypeForHandle instead +// Versions of Steam that add new controller types in the future will extend this enum if you're +// using a lookup table please check the bounds of any origins returned by Steam. enum EControllerActionOrigin { // Steam Controller @@ -237,9 +253,9 @@ enum EControllerActionOrigin k_EControllerActionOrigin_SteamV2_Y, k_EControllerActionOrigin_SteamV2_LeftBumper, k_EControllerActionOrigin_SteamV2_RightBumper, - k_EControllerActionOrigin_SteamV2_LeftGrip, - k_EControllerActionOrigin_SteamV2_RightGrip, + k_EControllerActionOrigin_SteamV2_LeftGrip_Lower, k_EControllerActionOrigin_SteamV2_LeftGrip_Upper, + k_EControllerActionOrigin_SteamV2_RightGrip_Lower, k_EControllerActionOrigin_SteamV2_RightGrip_Upper, k_EControllerActionOrigin_SteamV2_LeftBumper_Pressure, k_EControllerActionOrigin_SteamV2_RightBumper_Pressure, @@ -280,13 +296,90 @@ enum EControllerActionOrigin k_EControllerActionOrigin_SteamV2_Gyro_Yaw, k_EControllerActionOrigin_SteamV2_Gyro_Roll, - k_EControllerActionOrigin_Count + // Switch - Pro or Joycons used as a single input device. + // This does not apply to a single joycon + k_EControllerActionOrigin_Switch_A, + k_EControllerActionOrigin_Switch_B, + k_EControllerActionOrigin_Switch_X, + k_EControllerActionOrigin_Switch_Y, + k_EControllerActionOrigin_Switch_LeftBumper, + k_EControllerActionOrigin_Switch_RightBumper, + k_EControllerActionOrigin_Switch_Plus, //Start + k_EControllerActionOrigin_Switch_Minus, //Back + k_EControllerActionOrigin_Switch_Capture, + k_EControllerActionOrigin_Switch_LeftTrigger_Pull, + k_EControllerActionOrigin_Switch_LeftTrigger_Click, + k_EControllerActionOrigin_Switch_RightTrigger_Pull, + k_EControllerActionOrigin_Switch_RightTrigger_Click, + k_EControllerActionOrigin_Switch_LeftStick_Move, + k_EControllerActionOrigin_Switch_LeftStick_Click, + k_EControllerActionOrigin_Switch_LeftStick_DPadNorth, + k_EControllerActionOrigin_Switch_LeftStick_DPadSouth, + k_EControllerActionOrigin_Switch_LeftStick_DPadWest, + k_EControllerActionOrigin_Switch_LeftStick_DPadEast, + k_EControllerActionOrigin_Switch_RightStick_Move, + k_EControllerActionOrigin_Switch_RightStick_Click, + k_EControllerActionOrigin_Switch_RightStick_DPadNorth, + k_EControllerActionOrigin_Switch_RightStick_DPadSouth, + k_EControllerActionOrigin_Switch_RightStick_DPadWest, + k_EControllerActionOrigin_Switch_RightStick_DPadEast, + k_EControllerActionOrigin_Switch_DPad_North, + k_EControllerActionOrigin_Switch_DPad_South, + k_EControllerActionOrigin_Switch_DPad_West, + k_EControllerActionOrigin_Switch_DPad_East, + k_EControllerActionOrigin_Switch_ProGyro_Move, // Primary Gyro in Pro Controller, or Right JoyCon + k_EControllerActionOrigin_Switch_ProGyro_Pitch, // Primary Gyro in Pro Controller, or Right JoyCon + k_EControllerActionOrigin_Switch_ProGyro_Yaw, // Primary Gyro in Pro Controller, or Right JoyCon + k_EControllerActionOrigin_Switch_ProGyro_Roll, // Primary Gyro in Pro Controller, or Right JoyCon + // Switch JoyCon Specific + k_EControllerActionOrigin_Switch_RightGyro_Move, // Right JoyCon Gyro generally should correspond to Pro's single gyro + k_EControllerActionOrigin_Switch_RightGyro_Pitch, // Right JoyCon Gyro generally should correspond to Pro's single gyro + k_EControllerActionOrigin_Switch_RightGyro_Yaw, // Right JoyCon Gyro generally should correspond to Pro's single gyro + k_EControllerActionOrigin_Switch_RightGyro_Roll, // Right JoyCon Gyro generally should correspond to Pro's single gyro + k_EControllerActionOrigin_Switch_LeftGyro_Move, + k_EControllerActionOrigin_Switch_LeftGyro_Pitch, + k_EControllerActionOrigin_Switch_LeftGyro_Yaw, + k_EControllerActionOrigin_Switch_LeftGyro_Roll, + k_EControllerActionOrigin_Switch_LeftGrip_Lower, // Left JoyCon SR Button + k_EControllerActionOrigin_Switch_LeftGrip_Upper, // Left JoyCon SL Button + k_EControllerActionOrigin_Switch_RightGrip_Lower, // Right JoyCon SL Button + k_EControllerActionOrigin_Switch_RightGrip_Upper, // Right JoyCon SR Button + + k_EControllerActionOrigin_Count, // If Steam has added support for new controllers origins will go here. + k_EControllerActionOrigin_MaximumPossibleValue = 32767, // Origins are currently a maximum of 16 bits. }; -enum ESteamControllerLEDFlag +#ifndef ISTEAMINPUT_H +enum EXboxOrigin { - k_ESteamControllerLEDFlag_SetColor, - k_ESteamControllerLEDFlag_RestoreUserDefault + k_EXboxOrigin_A, + k_EXboxOrigin_B, + k_EXboxOrigin_X, + k_EXboxOrigin_Y, + k_EXboxOrigin_LeftBumper, + k_EXboxOrigin_RightBumper, + k_EXboxOrigin_Menu, //Start + k_EXboxOrigin_View, //Back + k_EXboxOrigin_LeftTrigger_Pull, + k_EXboxOrigin_LeftTrigger_Click, + k_EXboxOrigin_RightTrigger_Pull, + k_EXboxOrigin_RightTrigger_Click, + k_EXboxOrigin_LeftStick_Move, + k_EXboxOrigin_LeftStick_Click, + k_EXboxOrigin_LeftStick_DPadNorth, + k_EXboxOrigin_LeftStick_DPadSouth, + k_EXboxOrigin_LeftStick_DPadWest, + k_EXboxOrigin_LeftStick_DPadEast, + k_EXboxOrigin_RightStick_Move, + k_EXboxOrigin_RightStick_Click, + k_EXboxOrigin_RightStick_DPadNorth, + k_EXboxOrigin_RightStick_DPadSouth, + k_EXboxOrigin_RightStick_DPadWest, + k_EXboxOrigin_RightStick_DPadEast, + k_EXboxOrigin_DPad_North, + k_EXboxOrigin_DPad_South, + k_EXboxOrigin_DPad_West, + k_EXboxOrigin_DPad_East, }; enum ESteamInputType @@ -295,8 +388,24 @@ enum ESteamInputType k_ESteamInputType_SteamController, k_ESteamInputType_XBox360Controller, k_ESteamInputType_XBoxOneController, - k_ESteamInputType_GenericXInput, + k_ESteamInputType_GenericGamepad, // DirectInput controllers k_ESteamInputType_PS4Controller, + k_ESteamInputType_AppleMFiController, // Unused + k_ESteamInputType_AndroidController, // Unused + k_ESteamInputType_SwitchJoyConPair, // Unused + k_ESteamInputType_SwitchJoyConSingle, // Unused + k_ESteamInputType_SwitchProController, + k_ESteamInputType_MobileTouch, // Steam Link App On-screen Virtual Controller + k_ESteamInputType_PS3Controller, // Currently uses PS4 Origins + k_ESteamInputType_Count, + k_ESteamInputType_MaximumPossibleValue = 255, +}; +#endif + +enum ESteamControllerLEDFlag +{ + k_ESteamControllerLEDFlag_SetColor, + k_ESteamControllerLEDFlag_RestoreUserDefault }; // ControllerHandle_t is used to refer to a specific controller. @@ -312,6 +421,11 @@ typedef uint64 ControllerAnalogActionHandle_t; #pragma pack( push, 1 ) +#ifdef ISTEAMINPUT_H +#define ControllerAnalogActionData_t InputAnalogActionData_t +#define ControllerDigitalActionData_t InputDigitalActionData_t +#define ControllerMotionData_t InputMotionData_t +#else struct ControllerAnalogActionData_t { // Type of data coming from this action, this will match what got specified in the action set @@ -351,12 +465,12 @@ struct ControllerMotionData_t float rotVelY; float rotVelZ; }; - +#endif #pragma pack( pop ) //----------------------------------------------------------------------------- -// Purpose: Native Steam controller support API +// Purpose: Steam Input API //----------------------------------------------------------------------------- class ISteamController { @@ -368,7 +482,8 @@ public: // Synchronize API state with the latest Steam Controller inputs available. This // is performed automatically by SteamAPI_RunCallbacks, but for the absolute lowest - // possible latency, you call this directly before reading controller state. + // possible latency, you call this directly before reading controller state. This must + // be called from somewhere before GetConnectedControllers will return any handles virtual void RunFrame() = 0; // Enumerate currently connected controllers @@ -376,11 +491,10 @@ public: // Returns the number of handles written to handlesOut virtual int GetConnectedControllers( ControllerHandle_t *handlesOut ) = 0; - // Invokes the Steam overlay and brings up the binding screen - // Returns false is overlay is disabled / unavailable, or the user is not in Big Picture mode - virtual bool ShowBindingPanel( ControllerHandle_t controllerHandle ) = 0; - + //----------------------------------------------------------------------------- // ACTION SETS + //----------------------------------------------------------------------------- + // Lookup the handle for an Action Set. Best to do this once on startup, and store the handles for all future API calls. virtual ControllerActionSetHandle_t GetActionSetHandle( const char *pszActionSetName ) = 0; @@ -390,13 +504,16 @@ public: virtual void ActivateActionSet( ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetHandle ) = 0; virtual ControllerActionSetHandle_t GetCurrentActionSet( ControllerHandle_t controllerHandle ) = 0; + // ACTION SET LAYERS virtual void ActivateActionSetLayer( ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetLayerHandle ) = 0; virtual void DeactivateActionSetLayer( ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetLayerHandle ) = 0; virtual void DeactivateAllActionSetLayers( ControllerHandle_t controllerHandle ) = 0; virtual int GetActiveActionSetLayers( ControllerHandle_t controllerHandle, ControllerActionSetHandle_t *handlesOut ) = 0; - + //----------------------------------------------------------------------------- // ACTIONS + //----------------------------------------------------------------------------- + // Lookup the handle for a digital action. Best to do this once on startup, and store the handles for all future API calls. virtual ControllerDigitalActionHandle_t GetDigitalActionHandle( const char *pszActionName ) = 0; @@ -404,7 +521,8 @@ public: virtual ControllerDigitalActionData_t GetDigitalActionData( ControllerHandle_t controllerHandle, ControllerDigitalActionHandle_t digitalActionHandle ) = 0; // Get the origin(s) for a digital action within an action set. Returns the number of origins supplied in originsOut. Use this to display the appropriate on-screen prompt for the action. - // originsOut should point to a STEAM_CONTROLLER_MAX_ORIGINS sized array of EControllerActionOrigin handles + // originsOut should point to a STEAM_CONTROLLER_MAX_ORIGINS sized array of EControllerActionOrigin handles. The EControllerActionOrigin enum will get extended as support for new controller controllers gets added to + // the Steam client and will exceed the values from this header, please check bounds if you are using a look up table. virtual int GetDigitalActionOrigins( ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetHandle, ControllerDigitalActionHandle_t digitalActionHandle, EControllerActionOrigin *originsOut ) = 0; // Lookup the handle for an analog action. Best to do this once on startup, and store the handles for all future API calls. @@ -414,11 +532,25 @@ public: virtual ControllerAnalogActionData_t GetAnalogActionData( ControllerHandle_t controllerHandle, ControllerAnalogActionHandle_t analogActionHandle ) = 0; // Get the origin(s) for an analog action within an action set. Returns the number of origins supplied in originsOut. Use this to display the appropriate on-screen prompt for the action. - // originsOut should point to a STEAM_CONTROLLER_MAX_ORIGINS sized array of EControllerActionOrigin handles + // originsOut should point to a STEAM_CONTROLLER_MAX_ORIGINS sized array of EControllerActionOrigin handles. The EControllerActionOrigin enum will get extended as support for new controller controllers gets added to + // the Steam client and will exceed the values from this header, please check bounds if you are using a look up table. virtual int GetAnalogActionOrigins( ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetHandle, ControllerAnalogActionHandle_t analogActionHandle, EControllerActionOrigin *originsOut ) = 0; - - virtual void StopAnalogActionMomentum( ControllerHandle_t controllerHandle, ControllerAnalogActionHandle_t eAction ) = 0; + // Get a local path to art for on-screen glyph for a particular origin - this call is cheap + virtual const char *GetGlyphForActionOrigin( EControllerActionOrigin eOrigin ) = 0; + + // Returns a localized string (from Steam's language setting) for the specified origin - this call is serialized + virtual const char *GetStringForActionOrigin( EControllerActionOrigin eOrigin ) = 0; + + virtual void StopAnalogActionMomentum( ControllerHandle_t controllerHandle, ControllerAnalogActionHandle_t eAction ) = 0; + + // Returns raw motion data from the specified controller + virtual ControllerMotionData_t GetMotionData( ControllerHandle_t controllerHandle ) = 0; + + //----------------------------------------------------------------------------- + // OUTPUTS + //----------------------------------------------------------------------------- + // Trigger a haptic pulse on a controller virtual void TriggerHapticPulse( ControllerHandle_t controllerHandle, ESteamControllerPad eTargetPad, unsigned short usDurationMicroSec ) = 0; @@ -426,36 +558,48 @@ public: // nFlags is currently unused and reserved for future use. virtual void TriggerRepeatedHapticPulse( ControllerHandle_t controllerHandle, ESteamControllerPad eTargetPad, unsigned short usDurationMicroSec, unsigned short usOffMicroSec, unsigned short unRepeat, unsigned int nFlags ) = 0; - // Tigger a vibration event on supported controllers. + // Trigger a vibration event on supported controllers. virtual void TriggerVibration( ControllerHandle_t controllerHandle, unsigned short usLeftSpeed, unsigned short usRightSpeed ) = 0; // Set the controller LED color on supported controllers. virtual void SetLEDColor( ControllerHandle_t controllerHandle, uint8 nColorR, uint8 nColorG, uint8 nColorB, unsigned int nFlags ) = 0; - // Returns the associated gamepad index for the specified controller, if emulating a gamepad - virtual int GetGamepadIndexForController( ControllerHandle_t ulControllerHandle ) = 0; - - // Returns the associated controller handle for the specified emulated gamepad - virtual ControllerHandle_t GetControllerForGamepadIndex( int nIndex ) = 0; - - // Returns raw motion data from the specified controller - virtual ControllerMotionData_t GetMotionData( ControllerHandle_t controllerHandle ) = 0; - - // Attempt to display origins of given action in the controller HUD, for the currently active action set - // Returns false is overlay is disabled / unavailable, or the user is not in Big Picture mode - virtual bool ShowDigitalActionOrigins( ControllerHandle_t controllerHandle, ControllerDigitalActionHandle_t digitalActionHandle, float flScale, float flXPosition, float flYPosition ) = 0; - virtual bool ShowAnalogActionOrigins( ControllerHandle_t controllerHandle, ControllerAnalogActionHandle_t analogActionHandle, float flScale, float flXPosition, float flYPosition ) = 0; + //----------------------------------------------------------------------------- + // Utility functions availible without using the rest of Steam Input API + //----------------------------------------------------------------------------- - // Returns a localized string (from Steam's language setting) for the specified origin - virtual const char *GetStringForActionOrigin( EControllerActionOrigin eOrigin ) = 0; - - // Get a local path to art for on-screen glyph for a particular origin - virtual const char *GetGlyphForActionOrigin( EControllerActionOrigin eOrigin ) = 0; + // Invokes the Steam overlay and brings up the binding screen if the user is using Big Picture Mode + // If the user is not in Big Picture Mode it will open up the binding in a new window + virtual bool ShowBindingPanel( ControllerHandle_t controllerHandle ) = 0; // Returns the input type for a particular handle virtual ESteamInputType GetInputTypeForHandle( ControllerHandle_t controllerHandle ) = 0; + + // Returns the associated controller handle for the specified emulated gamepad - can be used with the above 2 functions + // to identify controllers presented to your game over Xinput. Returns 0 if the Xinput index isn't associated with Steam Input + virtual ControllerHandle_t GetControllerForGamepadIndex( int nIndex ) = 0; + + // Returns the associated gamepad index for the specified controller, if emulating a gamepad or -1 if not associated with an Xinput index + virtual int GetGamepadIndexForController( ControllerHandle_t ulControllerHandle ) = 0; + + // Returns a localized string (from Steam's language setting) for the specified Xbox controller origin. This function is cheap. + virtual const char *GetStringForXboxOrigin( EXboxOrigin eOrigin ) = 0; + + // Get a local path to art for on-screen glyph for a particular Xbox controller origin. This function is serialized. + virtual const char *GetGlyphForXboxOrigin( EXboxOrigin eOrigin ) = 0; + + // Get the equivalent ActionOrigin for a given Xbox controller origin this can be chained with GetGlyphForActionOrigin to provide future proof glyphs for + // non-Steam Input API action games. Note - this only translates the buttons directly and doesn't take into account any remapping a user has made in their configuration + virtual EControllerActionOrigin GetActionOriginFromXboxOrigin( ControllerHandle_t controllerHandle, EXboxOrigin eOrigin ) = 0; + + // Convert an origin to another controller type - for inputs not present on the other controller type this will return k_EControllerActionOrigin_None + virtual EControllerActionOrigin TranslateActionOrigin( ESteamInputType eDestinationInputType, EControllerActionOrigin eSourceOrigin ) = 0; }; -#define STEAMCONTROLLER_INTERFACE_VERSION "SteamController006" +#define STEAMCONTROLLER_INTERFACE_VERSION "SteamController007" + +// Global interface accessor +inline ISteamController *SteamController(); +STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamController *, SteamController, STEAMCONTROLLER_INTERFACE_VERSION ); #endif // ISTEAMCONTROLLER_H diff --git a/Generator/steam_sdk/isteamfriends.h b/Generator/steam_sdk/isteamfriends.h index c1754c2..8a280c3 100644 --- a/Generator/steam_sdk/isteamfriends.h +++ b/Generator/steam_sdk/isteamfriends.h @@ -1,4 +1,4 @@ -//====== Copyright (C) 1996-2008, Valve Corporation, All rights reserved. ===== +//====== Copyright Valve Corporation, All rights reserved. ==================== // // Purpose: interface to both friends list data and general information about users // @@ -10,9 +10,7 @@ #pragma once #endif -#include "isteamclient.h" -#include "steamclientpublic.h" - +#include "steam_api_common.h" //----------------------------------------------------------------------------- // Purpose: set of relationships to other users @@ -59,6 +57,7 @@ enum EPersonaState k_EPersonaStateSnooze = 4, // auto-away for a long time k_EPersonaStateLookingToTrade = 5, // Online, trading k_EPersonaStateLookingToPlay = 6, // Online, wanting to play + k_EPersonaStateInvisible = 7, // Online, but appears offline to friends. This status is never published to clients. k_EPersonaStateMax, }; @@ -92,7 +91,7 @@ enum EFriendFlags #elif defined( VALVE_CALLBACK_PACK_LARGE ) #pragma pack( push, 8 ) #else -#error isteamclient.h must be included +#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx #endif struct FriendGameInfo_t { @@ -143,7 +142,7 @@ struct FriendSessionStateInfo_t const uint32 k_cubChatMetadataMax = 8192; // size limits on Rich Presence data -enum { k_cchMaxRichPresenceKeys = 20 }; +enum { k_cchMaxRichPresenceKeys = 30 }; enum { k_cchMaxRichPresenceKeyLength = 64 }; enum { k_cchMaxRichPresenceValueLength = 256 }; @@ -155,6 +154,21 @@ enum EOverlayToStoreFlag k_EOverlayToStoreFlag_AddToCartAndShow = 2, }; + +//----------------------------------------------------------------------------- +// Purpose: Tells Steam where to place the browser window inside the overlay +//----------------------------------------------------------------------------- +enum EActivateGameOverlayToWebPageMode +{ + k_EActivateGameOverlayToWebPageMode_Default = 0, // Browser will open next to all other windows that the user has open in the overlay. + // The window will remain open, even if the user closes then re-opens the overlay. + + k_EActivateGameOverlayToWebPageMode_Modal = 1 // Browser will be opened in a special overlay configuration which hides all other windows + // that the user has open in the overlay. When the user closes the overlay, the browser window + // will also close. When the user closes the browser window, the overlay will automatically close. +}; + + //----------------------------------------------------------------------------- // Purpose: interface to accessing information about individual users, // that can be a friend, in a group, on a game server or in a lobby with the local user @@ -176,7 +190,7 @@ public: // // If the name change fails to happen on the server, then an additional global PersonaStateChange_t will be posted // to change the name back, in addition to the SetPersonaNameResponse_t callback. - CALL_RESULT( SetPersonaNameResponse_t ) + STEAM_CALL_RESULT( SetPersonaNameResponse_t ) virtual SteamAPICall_t SetPersonaName( const char *pchPersonaName ) = 0; // gets the status of the current user @@ -207,13 +221,14 @@ public: virtual const char *GetFriendPersonaName( CSteamID steamIDFriend ) = 0; // returns true if the friend is actually in a game, and fills in pFriendGameInfo with an extra details - virtual bool GetFriendGamePlayed( CSteamID steamIDFriend, OUT_STRUCT() FriendGameInfo_t *pFriendGameInfo ) = 0; + virtual bool GetFriendGamePlayed( CSteamID steamIDFriend, STEAM_OUT_STRUCT() FriendGameInfo_t *pFriendGameInfo ) = 0; // accesses old friends names - returns an empty string when their are no more items in the history virtual const char *GetFriendPersonaNameHistory( CSteamID steamIDFriend, int iPersonaName ) = 0; // friends steam level virtual int GetFriendSteamLevel( CSteamID steamIDFriend ) = 0; // Returns nickname the current user has set for the specified player. Returns NULL if the no nickname has been set for that player. + // DEPRECATED: GetPersonaName follows the Steam nickname preferences, so apps shouldn't need to care about nicknames explicitly. virtual const char *GetPlayerNickname( CSteamID steamIDPlayer ) = 0; // friend grouping (tag) apis @@ -226,7 +241,7 @@ public: // returns the number of members in a given friends group virtual int GetFriendsGroupMembersCount( FriendsGroupID_t friendsGroupID ) = 0; // gets up to nMembersCount members of the given friends group, if fewer exist than requested those positions' SteamIDs will be invalid - virtual void GetFriendsGroupMembersList( FriendsGroupID_t friendsGroupID, OUT_ARRAY_CALL(nMembersCount, GetFriendsGroupMembersCount, friendsGroupID ) CSteamID *pOutSteamIDMembers, int nMembersCount ) = 0; + virtual void GetFriendsGroupMembersList( FriendsGroupID_t friendsGroupID, STEAM_OUT_ARRAY_CALL(nMembersCount, GetFriendsGroupMembersCount, friendsGroupID ) CSteamID *pOutSteamIDMembers, int nMembersCount ) = 0; // returns true if the specified user meets any of the criteria specified in iFriendFlags // iFriendFlags can be the union (binary or, |) of one or more k_EFriendFlags values @@ -240,7 +255,7 @@ public: // returns the most recent information we have about what's happening in a clan virtual bool GetClanActivityCounts( CSteamID steamIDClan, int *pnOnline, int *pnInGame, int *pnChatting ) = 0; // for clans a user is a member of, they will have reasonably up-to-date information, but for others you'll have to download the info to have the latest - virtual SteamAPICall_t DownloadClanActivityCounts( ARRAY_COUNT(cClansToRequest) CSteamID *psteamIDClans, int cClansToRequest ) = 0; + virtual SteamAPICall_t DownloadClanActivityCounts( STEAM_ARRAY_COUNT(cClansToRequest) CSteamID *psteamIDClans, int cClansToRequest ) = 0; // iterators for getting users in a chat room, lobby, game server or clan // note that large clans that cannot be iterated by the local user @@ -256,7 +271,8 @@ public: virtual void SetInGameVoiceSpeaking( CSteamID steamIDUser, bool bSpeaking ) = 0; // activates the game overlay, with an optional dialog to open - // valid options are "Friends", "Community", "Players", "Settings", "OfficialGameGroup", "Stats", "Achievements" + // valid options include "Friends", "Community", "Players", "Settings", "OfficialGameGroup", "Stats", "Achievements", + // "chatroomgroup/nnnn" virtual void ActivateGameOverlay( const char *pchDialog ) = 0; // activates game overlay to a specific place @@ -274,7 +290,7 @@ public: // activates game overlay web browser directly to the specified URL // full address with protocol type is required, e.g. http://www.steamgames.com/ - virtual void ActivateGameOverlayToWebPage( const char *pchURL ) = 0; + virtual void ActivateGameOverlayToWebPage( const char *pchURL, EActivateGameOverlayToWebPageMode eMode = k_EActivateGameOverlayToWebPageMode_Default ) = 0; // activates game overlay to store page for app virtual void ActivateGameOverlayToStore( AppId_t nAppID, EOverlayToStoreFlag eFlag ) = 0; @@ -309,7 +325,7 @@ public: // you can only ask about clans that a user is a member of // note that this won't download avatars automatically; if you get an officer, // and no avatar image is available, call RequestUserInformation( steamID, false ) to download the avatar - CALL_RESULT( ClanOfficerListResponse_t ) + STEAM_CALL_RESULT( ClanOfficerListResponse_t ) virtual SteamAPICall_t RequestClanOfficerList( CSteamID steamIDClan ) = 0; // iteration of clan officers - can only be done when a RequestClanOfficerList() call has completed @@ -343,10 +359,10 @@ public: // Requests rich presence for a specific user. virtual void RequestFriendRichPresence( CSteamID steamIDFriend ) = 0; - // rich invite support - // if the target accepts the invite, the pchConnectString gets added to the command-line for launching the game - // if the game is already running, a GameRichPresenceJoinRequested_t callback is posted containing the connect string - // invites can only be sent to friends + // Rich invite support. + // If the target accepts the invite, a GameRichPresenceJoinRequested_t callback is posted containing the connect string. + // (Or you can configure yout game so that it is passed on the command line instead. This is a deprecated path; ask us if you really need this.) + // Invites can only be sent to friends. virtual bool InviteUserToGame( CSteamID steamIDFriend, const char *pchConnectString ) = 0; // recently-played-with friends iteration @@ -361,13 +377,13 @@ public: // this allows in-game access to group (clan) chats from in the game // the behavior is somewhat sophisticated, because the user may or may not be already in the group chat from outside the game or in the overlay // use ActivateGameOverlayToUser( "chat", steamIDClan ) to open the in-game overlay version of the chat - CALL_RESULT( JoinClanChatRoomCompletionResult_t ) + STEAM_CALL_RESULT( JoinClanChatRoomCompletionResult_t ) virtual SteamAPICall_t JoinClanChatRoom( CSteamID steamIDClan ) = 0; virtual bool LeaveClanChatRoom( CSteamID steamIDClan ) = 0; virtual int GetClanChatMemberCount( CSteamID steamIDClan ) = 0; virtual CSteamID GetChatMemberByIndex( CSteamID steamIDClan, int iUser ) = 0; virtual bool SendClanChatMessage( CSteamID steamIDClanChat, const char *pchText ) = 0; - virtual int GetClanChatMessage( CSteamID steamIDClanChat, int iMessage, void *prgchText, int cchTextMax, EChatEntryType *peChatEntryType, OUT_STRUCT() CSteamID *psteamidChatter ) = 0; + virtual int GetClanChatMessage( CSteamID steamIDClanChat, int iMessage, void *prgchText, int cchTextMax, EChatEntryType *peChatEntryType, STEAM_OUT_STRUCT() CSteamID *psteamidChatter ) = 0; virtual bool IsClanChatAdmin( CSteamID steamIDClanChat, CSteamID steamIDUser ) = 0; // interact with the Steam (game overlay / desktop) @@ -382,18 +398,30 @@ public: virtual int GetFriendMessage( CSteamID steamIDFriend, int iMessageID, void *pvData, int cubData, EChatEntryType *peChatEntryType ) = 0; // following apis - CALL_RESULT( FriendsGetFollowerCount_t ) + STEAM_CALL_RESULT( FriendsGetFollowerCount_t ) virtual SteamAPICall_t GetFollowerCount( CSteamID steamID ) = 0; - CALL_RESULT( FriendsIsFollowing_t ) + STEAM_CALL_RESULT( FriendsIsFollowing_t ) virtual SteamAPICall_t IsFollowing( CSteamID steamID ) = 0; - CALL_RESULT( FriendsEnumerateFollowingList_t ) + STEAM_CALL_RESULT( FriendsEnumerateFollowingList_t ) virtual SteamAPICall_t EnumerateFollowingList( uint32 unStartIndex ) = 0; virtual bool IsClanPublic( CSteamID steamIDClan ) = 0; virtual bool IsClanOfficialGameGroup( CSteamID steamIDClan ) = 0; + + /// Return the number of chats (friends or chat rooms) with unread messages. + /// A "priority" message is one that would generate some sort of toast or + /// notification, and depends on user settings. + /// + /// You can register for UnreadChatMessagesChanged_t callbacks to know when this + /// has potentially changed. + virtual int GetNumChatsWithUnreadPriorityMessages() = 0; }; -#define STEAMFRIENDS_INTERFACE_VERSION "SteamFriends015" +#define STEAMFRIENDS_INTERFACE_VERSION "SteamFriends017" + +// Global interface accessor +inline ISteamFriends *SteamFriends(); +STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamFriends *, SteamFriends, STEAMFRIENDS_INTERFACE_VERSION ); // callbacks #if defined( VALVE_CALLBACK_PACK_SMALL ) @@ -401,7 +429,7 @@ public: #elif defined( VALVE_CALLBACK_PACK_LARGE ) #pragma pack( push, 8 ) #else -#error isteamclient.h must be included +#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx #endif //----------------------------------------------------------------------------- @@ -431,9 +459,10 @@ enum EPersonaChange k_EPersonaChangeLeftSource = 0x0100, k_EPersonaChangeRelationshipChanged = 0x0200, k_EPersonaChangeNameFirstSet = 0x0400, - k_EPersonaChangeFacebookInfo = 0x0800, + k_EPersonaChangeBroadcast = 0x0800, k_EPersonaChangeNickname = 0x1000, k_EPersonaChangeSteamLevel = 0x2000, + k_EPersonaChangeRichPresence = 0x4000, }; @@ -633,6 +662,13 @@ struct SetPersonaNameResponse_t EResult m_result; // detailed result code }; +//----------------------------------------------------------------------------- +// Purpose: Invoked when the status of unread messages changes +//----------------------------------------------------------------------------- +struct UnreadChatMessagesChanged_t +{ + enum { k_iCallback = k_iSteamFriendsCallbacks + 48 }; +}; #pragma pack( pop ) diff --git a/Generator/steam_sdk/isteamgamecoordinator.h b/Generator/steam_sdk/isteamgamecoordinator.h index 5ab0637..89b740d 100644 --- a/Generator/steam_sdk/isteamgamecoordinator.h +++ b/Generator/steam_sdk/isteamgamecoordinator.h @@ -10,8 +10,7 @@ #pragma once #endif -#include "steamtypes.h" -#include "steamclientpublic.h" +#include "steam_api_common.h" // list of possible return values from the ISteamGameCoordinator API @@ -54,7 +53,7 @@ public: #elif defined( VALVE_CALLBACK_PACK_LARGE ) #pragma pack( push, 8 ) #else -#error isteamclient.h must be included +#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx #endif // callback notification - A new message is available for reading from the message queue diff --git a/Generator/steam_sdk/isteamgameserver.h b/Generator/steam_sdk/isteamgameserver.h index e19f1dd..6a0aada 100644 --- a/Generator/steam_sdk/isteamgameserver.h +++ b/Generator/steam_sdk/isteamgameserver.h @@ -10,7 +10,7 @@ #pragma once #endif -#include "isteamclient.h" +#include "steam_api_common.h" #define MASTERSERVERUPDATERPORT_USEGAMESOCKETSHARE ((uint16)-1) @@ -193,7 +193,7 @@ public: // these two functions s are deprecated, and will not return results // they will be removed in a future version of the SDK virtual void GetGameplayStats( ) = 0; - CALL_RESULT( GSReputation_t ) + STEAM_CALL_RESULT( GSReputation_t ) virtual SteamAPICall_t GetServerReputation() = 0; // Returns the public IP of the server according to Steam, useful when the server is @@ -241,17 +241,21 @@ public: virtual void ForceHeartbeat() = 0; // associate this game server with this clan for the purposes of computing player compat - CALL_RESULT( AssociateWithClanResult_t ) + STEAM_CALL_RESULT( AssociateWithClanResult_t ) virtual SteamAPICall_t AssociateWithClan( CSteamID steamIDClan ) = 0; // ask if any of the current players dont want to play with this new player - or vice versa - CALL_RESULT( ComputeNewPlayerCompatibilityResult_t ) + STEAM_CALL_RESULT( ComputeNewPlayerCompatibilityResult_t ) virtual SteamAPICall_t ComputeNewPlayerCompatibility( CSteamID steamIDNewPlayer ) = 0; }; #define STEAMGAMESERVER_INTERFACE_VERSION "SteamGameServer012" +// Global accessor +inline ISteamGameServer *SteamGameServer(); +STEAM_DEFINE_GAMESERVER_INTERFACE_ACCESSOR( ISteamGameServer *, SteamGameServer, STEAMGAMESERVER_INTERFACE_VERSION ); + // game server flags const uint32 k_unServerFlagNone = 0x00; const uint32 k_unServerFlagActive = 0x01; // server has users playing @@ -271,7 +275,7 @@ const uint32 k_unServerFlagPrivate = 0x20; // server shouldn't list on master #elif defined( VALVE_CALLBACK_PACK_LARGE ) #pragma pack( push, 8 ) #else -#error isteamclient.h must be included +#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx #endif diff --git a/Generator/steam_sdk/isteamgameserverstats.h b/Generator/steam_sdk/isteamgameserverstats.h index e7922c9..aacac4b 100644 --- a/Generator/steam_sdk/isteamgameserverstats.h +++ b/Generator/steam_sdk/isteamgameserverstats.h @@ -10,7 +10,7 @@ #pragma once #endif -#include "isteamclient.h" +#include "steam_api_common.h" //----------------------------------------------------------------------------- // Purpose: Functions for authenticating users via Steam to play on a game server @@ -23,7 +23,7 @@ public: // if the user has no stats, GSStatsReceived_t.m_eResult will be set to k_EResultFail // these stats will only be auto-updated for clients playing on the server. For other // users you'll need to call RequestUserStats() again to refresh any data - CALL_RESULT( GSStatsReceived_t ) + STEAM_CALL_RESULT( GSStatsReceived_t ) virtual SteamAPICall_t RequestUserStats( CSteamID steamIDUser ) = 0; // requests stat information for a user, usable after a successful call to RequestUserStats() @@ -48,19 +48,23 @@ public: // uploaded has been rejected, either because they broke constraints // or were out of date. In this case the server sends back updated values. // The stats should be re-iterated to keep in sync. - CALL_RESULT( GSStatsStored_t ) + STEAM_CALL_RESULT( GSStatsStored_t ) virtual SteamAPICall_t StoreUserStats( CSteamID steamIDUser ) = 0; }; - #define STEAMGAMESERVERSTATS_INTERFACE_VERSION "SteamGameServerStats001" +// Global accessor +inline ISteamGameServerStats *SteamGameServerStats(); +STEAM_DEFINE_GAMESERVER_INTERFACE_ACCESSOR( ISteamGameServerStats *, SteamGameServerStats, STEAMGAMESERVERSTATS_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 isteamclient.h must be included +#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx #endif //----------------------------------------------------------------------------- diff --git a/Generator/steam_sdk/isteamhtmlsurface.h b/Generator/steam_sdk/isteamhtmlsurface.h index 117599c..086a842 100644 --- a/Generator/steam_sdk/isteamhtmlsurface.h +++ b/Generator/steam_sdk/isteamhtmlsurface.h @@ -10,7 +10,7 @@ #pragma once #endif -#include "isteamclient.h" +#include "steam_api_common.h" typedef uint32 HHTMLBrowser; const uint32 INVALID_HTMLBROWSER = 0; @@ -40,7 +40,7 @@ public: // not implement these callback handlers, the browser may appear to hang instead of // navigating to new pages or triggering javascript popups. // - CALL_RESULT( HTML_BrowserReady_t ) + STEAM_CALL_RESULT( HTML_BrowserReady_t ) virtual SteamAPICall_t CreateBrowser( const char *pchUserAgent, const char *pchUserCSS ) = 0; // Call this when you are done with a html surface, this lets us free the resources being used by it @@ -137,8 +137,9 @@ public: k_eHTMLKeyModifier_ShiftDown = 1 << 2, }; - // keyboard interactions, native keycode is the virtual key code value from your OS - virtual void KeyDown( HHTMLBrowser unBrowserHandle, uint32 nNativeKeyCode, EHTMLKeyModifiers eHTMLKeyModifiers ) = 0; + // keyboard interactions, native keycode is the virtual key code value from your OS, system key flags the key to not + // be sent as a typed character as well as a key down + virtual void KeyDown( HHTMLBrowser unBrowserHandle, uint32 nNativeKeyCode, EHTMLKeyModifiers eHTMLKeyModifiers, bool bIsSystemKey = false ) = 0; virtual void KeyUp( HHTMLBrowser unBrowserHandle, uint32 nNativeKeyCode, EHTMLKeyModifiers eHTMLKeyModifiers ) = 0; // cUnicodeChar is the unicode character point for this keypress (and potentially multiple chars per press) virtual void KeyChar( HHTMLBrowser unBrowserHandle, uint32 cUnicodeChar, EHTMLKeyModifiers eHTMLKeyModifiers ) = 0; @@ -181,6 +182,9 @@ public: // Specifies the ratio between physical and logical pixels. virtual void SetDPIScalingFactor( HHTMLBrowser unBrowserHandle, float flDPIScaling ) = 0; + // Open HTML/JS developer tools + virtual void OpenDeveloperTools( HHTMLBrowser unBrowserHandle ) = 0; + // CALLBACKS // // These set of functions are used as responses to callback requests @@ -197,11 +201,15 @@ public: virtual void JSDialogResponse( HHTMLBrowser unBrowserHandle, bool bResult ) = 0; // You MUST call this in response to a HTML_FileOpenDialog_t callback - IGNOREATTR() + STEAM_IGNOREATTR() virtual void FileLoadDialogResponse( HHTMLBrowser unBrowserHandle, const char **pchSelectedFiles ) = 0; }; -#define STEAMHTMLSURFACE_INTERFACE_VERSION "STEAMHTMLSURFACE_INTERFACE_VERSION_004" +#define STEAMHTMLSURFACE_INTERFACE_VERSION "STEAMHTMLSURFACE_INTERFACE_VERSION_005" + +// Global interface accessor +inline ISteamHTMLSurface *SteamHTMLSurface(); +STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamHTMLSurface *, SteamHTMLSurface, STEAMHTMLSURFACE_INTERFACE_VERSION ); // callbacks #if defined( VALVE_CALLBACK_PACK_SMALL ) @@ -209,156 +217,156 @@ public: #elif defined( VALVE_CALLBACK_PACK_LARGE ) #pragma pack( push, 8 ) #else -#error isteamclient.h must be included +#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx #endif //----------------------------------------------------------------------------- // Purpose: The browser is ready for use //----------------------------------------------------------------------------- -DEFINE_CALLBACK( HTML_BrowserReady_t, k_iSteamHTMLSurfaceCallbacks + 1 ) -CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // this browser is now fully created and ready to navigate to pages -END_DEFINE_CALLBACK_1() +STEAM_CALLBACK_BEGIN( HTML_BrowserReady_t, k_iSteamHTMLSurfaceCallbacks + 1 ) +STEAM_CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // this browser is now fully created and ready to navigate to pages +STEAM_CALLBACK_END(1) //----------------------------------------------------------------------------- // Purpose: the browser has a pending paint //----------------------------------------------------------------------------- -DEFINE_CALLBACK(HTML_NeedsPaint_t, k_iSteamHTMLSurfaceCallbacks + 2) -CALLBACK_MEMBER(0, HHTMLBrowser, unBrowserHandle) // the browser that needs the paint -CALLBACK_MEMBER(1, const char *, pBGRA ) // a pointer to the B8G8R8A8 data for this surface, valid until SteamAPI_RunCallbacks is next called -CALLBACK_MEMBER(2, uint32, unWide) // the total width of the pBGRA texture -CALLBACK_MEMBER(3, uint32, unTall) // the total height of the pBGRA texture -CALLBACK_MEMBER(4, uint32, unUpdateX) // the offset in X for the damage rect for this update -CALLBACK_MEMBER(5, uint32, unUpdateY) // the offset in Y for the damage rect for this update -CALLBACK_MEMBER(6, uint32, unUpdateWide) // the width of the damage rect for this update -CALLBACK_MEMBER(7, uint32, unUpdateTall) // the height of the damage rect for this update -CALLBACK_MEMBER(8, uint32, unScrollX) // the page scroll the browser was at when this texture was rendered -CALLBACK_MEMBER(9, uint32, unScrollY) // the page scroll the browser was at when this texture was rendered -CALLBACK_MEMBER(10, float, flPageScale) // the page scale factor on this page when rendered -CALLBACK_MEMBER(11, uint32, unPageSerial) // incremented on each new page load, you can use this to reject draws while navigating to new pages -END_DEFINE_CALLBACK_12() +STEAM_CALLBACK_BEGIN(HTML_NeedsPaint_t, k_iSteamHTMLSurfaceCallbacks + 2) +STEAM_CALLBACK_MEMBER(0, HHTMLBrowser, unBrowserHandle) // the browser that needs the paint +STEAM_CALLBACK_MEMBER(1, const char *, pBGRA ) // a pointer to the B8G8R8A8 data for this surface, valid until SteamAPI_RunCallbacks is next called +STEAM_CALLBACK_MEMBER(2, uint32, unWide) // the total width of the pBGRA texture +STEAM_CALLBACK_MEMBER(3, uint32, unTall) // the total height of the pBGRA texture +STEAM_CALLBACK_MEMBER(4, uint32, unUpdateX) // the offset in X for the damage rect for this update +STEAM_CALLBACK_MEMBER(5, uint32, unUpdateY) // the offset in Y for the damage rect for this update +STEAM_CALLBACK_MEMBER(6, uint32, unUpdateWide) // the width of the damage rect for this update +STEAM_CALLBACK_MEMBER(7, uint32, unUpdateTall) // the height of the damage rect for this update +STEAM_CALLBACK_MEMBER(8, uint32, unScrollX) // the page scroll the browser was at when this texture was rendered +STEAM_CALLBACK_MEMBER(9, uint32, unScrollY) // the page scroll the browser was at when this texture was rendered +STEAM_CALLBACK_MEMBER(10, float, flPageScale) // the page scale factor on this page when rendered +STEAM_CALLBACK_MEMBER(11, uint32, unPageSerial) // incremented on each new page load, you can use this to reject draws while navigating to new pages +STEAM_CALLBACK_END(12) //----------------------------------------------------------------------------- // Purpose: The browser wanted to navigate to a new page // NOTE - you MUST call AllowStartRequest in response to this callback //----------------------------------------------------------------------------- -DEFINE_CALLBACK(HTML_StartRequest_t, k_iSteamHTMLSurfaceCallbacks + 3) -CALLBACK_MEMBER(0, HHTMLBrowser, unBrowserHandle) // the handle of the surface navigating -CALLBACK_MEMBER(1, const char *, pchURL) // the url they wish to navigate to -CALLBACK_MEMBER(2, const char *, pchTarget) // the html link target type (i.e _blank, _self, _parent, _top ) -CALLBACK_MEMBER(3, const char *, pchPostData ) // any posted data for the request -CALLBACK_MEMBER(4, bool, bIsRedirect) // true if this was a http/html redirect from the last load request -END_DEFINE_CALLBACK_5() +STEAM_CALLBACK_BEGIN(HTML_StartRequest_t, k_iSteamHTMLSurfaceCallbacks + 3) +STEAM_CALLBACK_MEMBER(0, HHTMLBrowser, unBrowserHandle) // the handle of the surface navigating +STEAM_CALLBACK_MEMBER(1, const char *, pchURL) // the url they wish to navigate to +STEAM_CALLBACK_MEMBER(2, const char *, pchTarget) // the html link target type (i.e _blank, _self, _parent, _top ) +STEAM_CALLBACK_MEMBER(3, const char *, pchPostData ) // any posted data for the request +STEAM_CALLBACK_MEMBER(4, bool, bIsRedirect) // true if this was a http/html redirect from the last load request +STEAM_CALLBACK_END(5) //----------------------------------------------------------------------------- // Purpose: The browser has been requested to close due to user interaction (usually from a javascript window.close() call) //----------------------------------------------------------------------------- -DEFINE_CALLBACK(HTML_CloseBrowser_t, k_iSteamHTMLSurfaceCallbacks + 4) -CALLBACK_MEMBER(0, HHTMLBrowser, unBrowserHandle) // the handle of the surface -END_DEFINE_CALLBACK_1() +STEAM_CALLBACK_BEGIN(HTML_CloseBrowser_t, k_iSteamHTMLSurfaceCallbacks + 4) +STEAM_CALLBACK_MEMBER(0, HHTMLBrowser, unBrowserHandle) // the handle of the surface +STEAM_CALLBACK_END(1) //----------------------------------------------------------------------------- // Purpose: the browser is navigating to a new url //----------------------------------------------------------------------------- -DEFINE_CALLBACK( HTML_URLChanged_t, k_iSteamHTMLSurfaceCallbacks + 5 ) -CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface navigating -CALLBACK_MEMBER( 1, const char *, pchURL ) // the url they wish to navigate to -CALLBACK_MEMBER( 2, const char *, pchPostData ) // any posted data for the request -CALLBACK_MEMBER( 3, bool, bIsRedirect ) // true if this was a http/html redirect from the last load request -CALLBACK_MEMBER( 4, const char *, pchPageTitle ) // the title of the page -CALLBACK_MEMBER( 5, bool, bNewNavigation ) // true if this was from a fresh tab and not a click on an existing page -END_DEFINE_CALLBACK_6() +STEAM_CALLBACK_BEGIN( HTML_URLChanged_t, k_iSteamHTMLSurfaceCallbacks + 5 ) +STEAM_CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface navigating +STEAM_CALLBACK_MEMBER( 1, const char *, pchURL ) // the url they wish to navigate to +STEAM_CALLBACK_MEMBER( 2, const char *, pchPostData ) // any posted data for the request +STEAM_CALLBACK_MEMBER( 3, bool, bIsRedirect ) // true if this was a http/html redirect from the last load request +STEAM_CALLBACK_MEMBER( 4, const char *, pchPageTitle ) // the title of the page +STEAM_CALLBACK_MEMBER( 5, bool, bNewNavigation ) // true if this was from a fresh tab and not a click on an existing page +STEAM_CALLBACK_END(6) //----------------------------------------------------------------------------- // Purpose: A page is finished loading //----------------------------------------------------------------------------- -DEFINE_CALLBACK( HTML_FinishedRequest_t, k_iSteamHTMLSurfaceCallbacks + 6 ) -CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface -CALLBACK_MEMBER( 1, const char *, pchURL ) // -CALLBACK_MEMBER( 2, const char *, pchPageTitle ) // -END_DEFINE_CALLBACK_3() +STEAM_CALLBACK_BEGIN( HTML_FinishedRequest_t, k_iSteamHTMLSurfaceCallbacks + 6 ) +STEAM_CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface +STEAM_CALLBACK_MEMBER( 1, const char *, pchURL ) // +STEAM_CALLBACK_MEMBER( 2, const char *, pchPageTitle ) // +STEAM_CALLBACK_END(3) //----------------------------------------------------------------------------- // Purpose: a request to load this url in a new tab //----------------------------------------------------------------------------- -DEFINE_CALLBACK( HTML_OpenLinkInNewTab_t, k_iSteamHTMLSurfaceCallbacks + 7 ) -CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface -CALLBACK_MEMBER( 1, const char *, pchURL ) // -END_DEFINE_CALLBACK_2() +STEAM_CALLBACK_BEGIN( HTML_OpenLinkInNewTab_t, k_iSteamHTMLSurfaceCallbacks + 7 ) +STEAM_CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface +STEAM_CALLBACK_MEMBER( 1, const char *, pchURL ) // +STEAM_CALLBACK_END(2) //----------------------------------------------------------------------------- // Purpose: the page has a new title now //----------------------------------------------------------------------------- -DEFINE_CALLBACK( HTML_ChangedTitle_t, k_iSteamHTMLSurfaceCallbacks + 8 ) -CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface -CALLBACK_MEMBER( 1, const char *, pchTitle ) // -END_DEFINE_CALLBACK_2() +STEAM_CALLBACK_BEGIN( HTML_ChangedTitle_t, k_iSteamHTMLSurfaceCallbacks + 8 ) +STEAM_CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface +STEAM_CALLBACK_MEMBER( 1, const char *, pchTitle ) // +STEAM_CALLBACK_END(2) //----------------------------------------------------------------------------- // Purpose: results from a search //----------------------------------------------------------------------------- -DEFINE_CALLBACK( HTML_SearchResults_t, k_iSteamHTMLSurfaceCallbacks + 9 ) -CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface -CALLBACK_MEMBER( 1, uint32, unResults ) // -CALLBACK_MEMBER( 2, uint32, unCurrentMatch ) // -END_DEFINE_CALLBACK_3() +STEAM_CALLBACK_BEGIN( HTML_SearchResults_t, k_iSteamHTMLSurfaceCallbacks + 9 ) +STEAM_CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface +STEAM_CALLBACK_MEMBER( 1, uint32, unResults ) // +STEAM_CALLBACK_MEMBER( 2, uint32, unCurrentMatch ) // +STEAM_CALLBACK_END(3) //----------------------------------------------------------------------------- // Purpose: page history status changed on the ability to go backwards and forward //----------------------------------------------------------------------------- -DEFINE_CALLBACK( HTML_CanGoBackAndForward_t, k_iSteamHTMLSurfaceCallbacks + 10 ) -CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface -CALLBACK_MEMBER( 1, bool, bCanGoBack ) // -CALLBACK_MEMBER( 2, bool, bCanGoForward ) // -END_DEFINE_CALLBACK_3() +STEAM_CALLBACK_BEGIN( HTML_CanGoBackAndForward_t, k_iSteamHTMLSurfaceCallbacks + 10 ) +STEAM_CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface +STEAM_CALLBACK_MEMBER( 1, bool, bCanGoBack ) // +STEAM_CALLBACK_MEMBER( 2, bool, bCanGoForward ) // +STEAM_CALLBACK_END(3) //----------------------------------------------------------------------------- // Purpose: details on the visibility and size of the horizontal scrollbar //----------------------------------------------------------------------------- -DEFINE_CALLBACK( HTML_HorizontalScroll_t, k_iSteamHTMLSurfaceCallbacks + 11 ) -CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface -CALLBACK_MEMBER( 1, uint32, unScrollMax ) // -CALLBACK_MEMBER( 2, uint32, unScrollCurrent ) // -CALLBACK_MEMBER( 3, float, flPageScale ) // -CALLBACK_MEMBER( 4, bool , bVisible ) // -CALLBACK_MEMBER( 5, uint32, unPageSize ) // -END_DEFINE_CALLBACK_6() +STEAM_CALLBACK_BEGIN( HTML_HorizontalScroll_t, k_iSteamHTMLSurfaceCallbacks + 11 ) +STEAM_CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface +STEAM_CALLBACK_MEMBER( 1, uint32, unScrollMax ) // +STEAM_CALLBACK_MEMBER( 2, uint32, unScrollCurrent ) // +STEAM_CALLBACK_MEMBER( 3, float, flPageScale ) // +STEAM_CALLBACK_MEMBER( 4, bool , bVisible ) // +STEAM_CALLBACK_MEMBER( 5, uint32, unPageSize ) // +STEAM_CALLBACK_END(6) //----------------------------------------------------------------------------- // Purpose: details on the visibility and size of the vertical scrollbar //----------------------------------------------------------------------------- -DEFINE_CALLBACK( HTML_VerticalScroll_t, k_iSteamHTMLSurfaceCallbacks + 12 ) -CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface -CALLBACK_MEMBER( 1, uint32, unScrollMax ) // -CALLBACK_MEMBER( 2, uint32, unScrollCurrent ) // -CALLBACK_MEMBER( 3, float, flPageScale ) // -CALLBACK_MEMBER( 4, bool, bVisible ) // -CALLBACK_MEMBER( 5, uint32, unPageSize ) // -END_DEFINE_CALLBACK_6() +STEAM_CALLBACK_BEGIN( HTML_VerticalScroll_t, k_iSteamHTMLSurfaceCallbacks + 12 ) +STEAM_CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface +STEAM_CALLBACK_MEMBER( 1, uint32, unScrollMax ) // +STEAM_CALLBACK_MEMBER( 2, uint32, unScrollCurrent ) // +STEAM_CALLBACK_MEMBER( 3, float, flPageScale ) // +STEAM_CALLBACK_MEMBER( 4, bool, bVisible ) // +STEAM_CALLBACK_MEMBER( 5, uint32, unPageSize ) // +STEAM_CALLBACK_END(6) //----------------------------------------------------------------------------- // Purpose: response to GetLinkAtPosition call //----------------------------------------------------------------------------- -DEFINE_CALLBACK( HTML_LinkAtPosition_t, k_iSteamHTMLSurfaceCallbacks + 13 ) -CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface -CALLBACK_MEMBER( 1, uint32, x ) // NOTE - Not currently set -CALLBACK_MEMBER( 2, uint32, y ) // NOTE - Not currently set -CALLBACK_MEMBER( 3, const char *, pchURL ) // -CALLBACK_MEMBER( 4, bool, bInput ) // -CALLBACK_MEMBER( 5, bool, bLiveLink ) // -END_DEFINE_CALLBACK_6() +STEAM_CALLBACK_BEGIN( HTML_LinkAtPosition_t, k_iSteamHTMLSurfaceCallbacks + 13 ) +STEAM_CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface +STEAM_CALLBACK_MEMBER( 1, uint32, x ) // NOTE - Not currently set +STEAM_CALLBACK_MEMBER( 2, uint32, y ) // NOTE - Not currently set +STEAM_CALLBACK_MEMBER( 3, const char *, pchURL ) // +STEAM_CALLBACK_MEMBER( 4, bool, bInput ) // +STEAM_CALLBACK_MEMBER( 5, bool, bLiveLink ) // +STEAM_CALLBACK_END(6) @@ -366,98 +374,104 @@ END_DEFINE_CALLBACK_6() // Purpose: show a Javascript alert dialog, call JSDialogResponse // when the user dismisses this dialog (or right away to ignore it) //----------------------------------------------------------------------------- -DEFINE_CALLBACK( HTML_JSAlert_t, k_iSteamHTMLSurfaceCallbacks + 14 ) -CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface -CALLBACK_MEMBER( 1, const char *, pchMessage ) // -END_DEFINE_CALLBACK_2() +STEAM_CALLBACK_BEGIN( HTML_JSAlert_t, k_iSteamHTMLSurfaceCallbacks + 14 ) +STEAM_CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface +STEAM_CALLBACK_MEMBER( 1, const char *, pchMessage ) // +STEAM_CALLBACK_END(2) //----------------------------------------------------------------------------- // Purpose: show a Javascript confirmation dialog, call JSDialogResponse // when the user dismisses this dialog (or right away to ignore it) //----------------------------------------------------------------------------- -DEFINE_CALLBACK( HTML_JSConfirm_t, k_iSteamHTMLSurfaceCallbacks + 15 ) -CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface -CALLBACK_MEMBER( 1, const char *, pchMessage ) // -END_DEFINE_CALLBACK_2() +STEAM_CALLBACK_BEGIN( HTML_JSConfirm_t, k_iSteamHTMLSurfaceCallbacks + 15 ) +STEAM_CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface +STEAM_CALLBACK_MEMBER( 1, const char *, pchMessage ) // +STEAM_CALLBACK_END(2) //----------------------------------------------------------------------------- // Purpose: when received show a file open dialog // then call FileLoadDialogResponse with the file(s) the user selected. //----------------------------------------------------------------------------- -DEFINE_CALLBACK( HTML_FileOpenDialog_t, k_iSteamHTMLSurfaceCallbacks + 16 ) -CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface -CALLBACK_MEMBER( 1, const char *, pchTitle ) // -CALLBACK_MEMBER( 2, const char *, pchInitialFile ) // -END_DEFINE_CALLBACK_3() +STEAM_CALLBACK_BEGIN( HTML_FileOpenDialog_t, k_iSteamHTMLSurfaceCallbacks + 16 ) +STEAM_CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface +STEAM_CALLBACK_MEMBER( 1, const char *, pchTitle ) // +STEAM_CALLBACK_MEMBER( 2, const char *, pchInitialFile ) // +STEAM_CALLBACK_END(3) //----------------------------------------------------------------------------- -// Purpose: a new html window has been created +// Purpose: a new html window is being created. +// +// IMPORTANT NOTE: at this time, the API does not allow you to acknowledge or +// render the contents of this new window, so the new window is always destroyed +// immediately. The URL and other parameters of the new window are passed here +// to give your application the opportunity to call CreateBrowser and set up +// a new browser in response to the attempted popup, if you wish to do so. //----------------------------------------------------------------------------- -DEFINE_CALLBACK( HTML_NewWindow_t, k_iSteamHTMLSurfaceCallbacks + 21 ) -CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the current surface -CALLBACK_MEMBER( 1, const char *, pchURL ) // the page to load -CALLBACK_MEMBER( 2, uint32, unX ) // the x pos into the page to display the popup -CALLBACK_MEMBER( 3, uint32, unY ) // the y pos into the page to display the popup -CALLBACK_MEMBER( 4, uint32, unWide ) // the total width of the pBGRA texture -CALLBACK_MEMBER( 5, uint32, unTall ) // the total height of the pBGRA texture -CALLBACK_MEMBER( 6, HHTMLBrowser, unNewWindow_BrowserHandle ) // the handle of the new window surface -END_DEFINE_CALLBACK_7() +STEAM_CALLBACK_BEGIN( HTML_NewWindow_t, k_iSteamHTMLSurfaceCallbacks + 21 ) +STEAM_CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the current surface +STEAM_CALLBACK_MEMBER( 1, const char *, pchURL ) // the page to load +STEAM_CALLBACK_MEMBER( 2, uint32, unX ) // the x pos into the page to display the popup +STEAM_CALLBACK_MEMBER( 3, uint32, unY ) // the y pos into the page to display the popup +STEAM_CALLBACK_MEMBER( 4, uint32, unWide ) // the total width of the pBGRA texture +STEAM_CALLBACK_MEMBER( 5, uint32, unTall ) // the total height of the pBGRA texture +STEAM_CALLBACK_MEMBER( 6, HHTMLBrowser, unNewWindow_BrowserHandle_IGNORE ) +STEAM_CALLBACK_END(7) //----------------------------------------------------------------------------- // Purpose: change the cursor to display //----------------------------------------------------------------------------- -DEFINE_CALLBACK( HTML_SetCursor_t, k_iSteamHTMLSurfaceCallbacks + 22 ) -CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface -CALLBACK_MEMBER( 1, uint32, eMouseCursor ) // the EMouseCursor to display -END_DEFINE_CALLBACK_2() +STEAM_CALLBACK_BEGIN( HTML_SetCursor_t, k_iSteamHTMLSurfaceCallbacks + 22 ) +STEAM_CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface +STEAM_CALLBACK_MEMBER( 1, uint32, eMouseCursor ) // the EMouseCursor to display +STEAM_CALLBACK_END(2) //----------------------------------------------------------------------------- // Purpose: informational message from the browser //----------------------------------------------------------------------------- -DEFINE_CALLBACK( HTML_StatusText_t, k_iSteamHTMLSurfaceCallbacks + 23 ) -CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface -CALLBACK_MEMBER( 1, const char *, pchMsg ) // the EMouseCursor to display -END_DEFINE_CALLBACK_2() +STEAM_CALLBACK_BEGIN( HTML_StatusText_t, k_iSteamHTMLSurfaceCallbacks + 23 ) +STEAM_CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface +STEAM_CALLBACK_MEMBER( 1, const char *, pchMsg ) // the EMouseCursor to display +STEAM_CALLBACK_END(2) //----------------------------------------------------------------------------- // Purpose: show a tooltip //----------------------------------------------------------------------------- -DEFINE_CALLBACK( HTML_ShowToolTip_t, k_iSteamHTMLSurfaceCallbacks + 24 ) -CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface -CALLBACK_MEMBER( 1, const char *, pchMsg ) // the EMouseCursor to display -END_DEFINE_CALLBACK_2() +STEAM_CALLBACK_BEGIN( HTML_ShowToolTip_t, k_iSteamHTMLSurfaceCallbacks + 24 ) +STEAM_CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface +STEAM_CALLBACK_MEMBER( 1, const char *, pchMsg ) // the EMouseCursor to display +STEAM_CALLBACK_END(2) //----------------------------------------------------------------------------- // Purpose: update the text of an existing tooltip //----------------------------------------------------------------------------- -DEFINE_CALLBACK( HTML_UpdateToolTip_t, k_iSteamHTMLSurfaceCallbacks + 25 ) -CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface -CALLBACK_MEMBER( 1, const char *, pchMsg ) // the EMouseCursor to display -END_DEFINE_CALLBACK_2() +STEAM_CALLBACK_BEGIN( HTML_UpdateToolTip_t, k_iSteamHTMLSurfaceCallbacks + 25 ) +STEAM_CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface +STEAM_CALLBACK_MEMBER( 1, const char *, pchMsg ) // the EMouseCursor to display +STEAM_CALLBACK_END(2) //----------------------------------------------------------------------------- // Purpose: hide the tooltip you are showing //----------------------------------------------------------------------------- -DEFINE_CALLBACK( HTML_HideToolTip_t, k_iSteamHTMLSurfaceCallbacks + 26 ) -CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface -END_DEFINE_CALLBACK_1() +STEAM_CALLBACK_BEGIN( HTML_HideToolTip_t, k_iSteamHTMLSurfaceCallbacks + 26 ) +STEAM_CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface +STEAM_CALLBACK_END(1) //----------------------------------------------------------------------------- // Purpose: The browser has restarted due to an internal failure, use this new handle value //----------------------------------------------------------------------------- -DEFINE_CALLBACK( HTML_BrowserRestarted_t, k_iSteamHTMLSurfaceCallbacks + 27 ) -CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // this is the new browser handle after the restart -CALLBACK_MEMBER( 1, HHTMLBrowser, unOldBrowserHandle ) // the handle for the browser before the restart, if your handle was this then switch to using unBrowserHandle for API calls -END_DEFINE_CALLBACK_2() +STEAM_CALLBACK_BEGIN( HTML_BrowserRestarted_t, k_iSteamHTMLSurfaceCallbacks + 27 ) +STEAM_CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // this is the new browser handle after the restart +STEAM_CALLBACK_MEMBER( 1, HHTMLBrowser, unOldBrowserHandle ) // the handle for the browser before the restart, if your handle was this then switch to using unBrowserHandle for API calls +STEAM_CALLBACK_END(2) #pragma pack( pop ) diff --git a/Generator/steam_sdk/isteamhttp.h b/Generator/steam_sdk/isteamhttp.h index 8fab537..26a02b3 100644 --- a/Generator/steam_sdk/isteamhttp.h +++ b/Generator/steam_sdk/isteamhttp.h @@ -10,7 +10,7 @@ #pragma once #endif -#include "isteamclient.h" +#include "steam_api_common.h" #include "steamhttpenums.h" // Handle to a HTTP Request handle @@ -128,7 +128,8 @@ public: // Set the extra user agent info for a request, this doesn't clobber the normal user agent, it just adds the extra info on the end virtual bool SetHTTPRequestUserAgentInfo( HTTPRequestHandle hRequest, const char *pchUserAgentInfo ) = 0; - // Set that https request should require verified SSL certificate via machines certificate trust store + // Disable or re-enable verification of SSL/TLS certificates. + // By default, certificates are checked for all HTTPS requests. virtual bool SetHTTPRequestRequiresVerifiedCertificate( HTTPRequestHandle hRequest, bool bRequireVerifiedCertificate ) = 0; // Set an absolute timeout on the HTTP request, this is just a total time timeout different than the network activity timeout @@ -139,7 +140,15 @@ public: virtual bool GetHTTPRequestWasTimedOut( HTTPRequestHandle hRequest, bool *pbWasTimedOut ) = 0; }; -#define STEAMHTTP_INTERFACE_VERSION "STEAMHTTP_INTERFACE_VERSION002" +#define STEAMHTTP_INTERFACE_VERSION "STEAMHTTP_INTERFACE_VERSION003" + +// Global interface accessor +inline ISteamHTTP *SteamHTTP(); +STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamHTTP *, SteamHTTP, STEAMHTTP_INTERFACE_VERSION ); + +// Global accessor for the gameserver client +inline ISteamHTTP *SteamGameServerHTTP(); +STEAM_DEFINE_GAMESERVER_INTERFACE_ACCESSOR( ISteamHTTP *, SteamGameServerHTTP, STEAMHTTP_INTERFACE_VERSION ); // callbacks #if defined( VALVE_CALLBACK_PACK_SMALL ) @@ -147,7 +156,7 @@ public: #elif defined( VALVE_CALLBACK_PACK_LARGE ) #pragma pack( push, 8 ) #else -#error isteamclient.h must be included +#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx #endif struct HTTPRequestCompleted_t diff --git a/Generator/steam_sdk/isteaminput.h b/Generator/steam_sdk/isteaminput.h new file mode 100644 index 0000000..dfd3980 --- /dev/null +++ b/Generator/steam_sdk/isteaminput.h @@ -0,0 +1,619 @@ +//====== Copyright 1996-2018, Valve Corporation, All rights reserved. ======= +// +// Purpose: Steam Input is a flexible input API that supports over three hundred devices including all +// common variants of Xbox, Playstation, Nintendo Switch Pro, and Steam Controllers. +// For more info including a getting started guide for developers +// please visit: https://partner.steamgames.com/doc/features/steam_controller +// +//============================================================================= + +#ifndef ISTEAMINPUT_H +#define ISTEAMINPUT_H +#ifdef _WIN32 +#pragma once +#endif + +#include "steam_api_common.h" + +#define STEAM_INPUT_MAX_COUNT 16 + +#define STEAM_INPUT_MAX_ANALOG_ACTIONS 16 + +#define STEAM_INPUT_MAX_DIGITAL_ACTIONS 128 + +#define STEAM_INPUT_MAX_ORIGINS 8 + +// When sending an option to a specific controller handle, you can send to all devices via this command +#define STEAM_INPUT_HANDLE_ALL_CONTROLLERS UINT64_MAX + +#define STEAM_INPUT_MIN_ANALOG_ACTION_DATA -1.0f +#define STEAM_INPUT_MAX_ANALOG_ACTION_DATA 1.0f + +enum EInputSource +{ + k_EInputSource_None, + k_EInputSource_LeftTrackpad, + k_EInputSource_RightTrackpad, + k_EInputSource_Joystick, + k_EInputSource_ABXY, + k_EInputSource_Switch, + k_EInputSource_LeftTrigger, + k_EInputSource_RightTrigger, + k_EInputSource_LeftBumper, + k_EInputSource_RightBumper, + k_EInputSource_Gyro, + k_EInputSource_CenterTrackpad, // PS4 + k_EInputSource_RightJoystick, // Traditional Controllers + k_EInputSource_DPad, // Traditional Controllers + k_EInputSource_Key, // Keyboards with scan codes - Unused + k_EInputSource_Mouse, // Traditional mouse - Unused + k_EInputSource_LeftGyro, // Secondary Gyro - Switch - Unused + k_EInputSource_Count +}; + +enum EInputSourceMode +{ + k_EInputSourceMode_None, + k_EInputSourceMode_Dpad, + k_EInputSourceMode_Buttons, + k_EInputSourceMode_FourButtons, + k_EInputSourceMode_AbsoluteMouse, + k_EInputSourceMode_RelativeMouse, + k_EInputSourceMode_JoystickMove, + k_EInputSourceMode_JoystickMouse, + k_EInputSourceMode_JoystickCamera, + k_EInputSourceMode_ScrollWheel, + k_EInputSourceMode_Trigger, + k_EInputSourceMode_TouchMenu, + k_EInputSourceMode_MouseJoystick, + k_EInputSourceMode_MouseRegion, + k_EInputSourceMode_RadialMenu, + k_EInputSourceMode_SingleButton, + k_EInputSourceMode_Switches +}; + +// Note: Please do not use action origins as a way to identify controller types. There is no +// guarantee that they will be added in a contiguous manner - use GetInputTypeForHandle instead. +// Versions of Steam that add new controller types in the future will extend this enum so if you're +// using a lookup table please check the bounds of any origins returned by Steam. +enum EInputActionOrigin +{ + // Steam Controller + k_EInputActionOrigin_None, + k_EInputActionOrigin_SteamController_A, + k_EInputActionOrigin_SteamController_B, + k_EInputActionOrigin_SteamController_X, + k_EInputActionOrigin_SteamController_Y, + k_EInputActionOrigin_SteamController_LeftBumper, + k_EInputActionOrigin_SteamController_RightBumper, + k_EInputActionOrigin_SteamController_LeftGrip, + k_EInputActionOrigin_SteamController_RightGrip, + k_EInputActionOrigin_SteamController_Start, + k_EInputActionOrigin_SteamController_Back, + k_EInputActionOrigin_SteamController_LeftPad_Touch, + k_EInputActionOrigin_SteamController_LeftPad_Swipe, + k_EInputActionOrigin_SteamController_LeftPad_Click, + k_EInputActionOrigin_SteamController_LeftPad_DPadNorth, + k_EInputActionOrigin_SteamController_LeftPad_DPadSouth, + k_EInputActionOrigin_SteamController_LeftPad_DPadWest, + k_EInputActionOrigin_SteamController_LeftPad_DPadEast, + k_EInputActionOrigin_SteamController_RightPad_Touch, + k_EInputActionOrigin_SteamController_RightPad_Swipe, + k_EInputActionOrigin_SteamController_RightPad_Click, + k_EInputActionOrigin_SteamController_RightPad_DPadNorth, + k_EInputActionOrigin_SteamController_RightPad_DPadSouth, + k_EInputActionOrigin_SteamController_RightPad_DPadWest, + k_EInputActionOrigin_SteamController_RightPad_DPadEast, + k_EInputActionOrigin_SteamController_LeftTrigger_Pull, + k_EInputActionOrigin_SteamController_LeftTrigger_Click, + k_EInputActionOrigin_SteamController_RightTrigger_Pull, + k_EInputActionOrigin_SteamController_RightTrigger_Click, + k_EInputActionOrigin_SteamController_LeftStick_Move, + k_EInputActionOrigin_SteamController_LeftStick_Click, + k_EInputActionOrigin_SteamController_LeftStick_DPadNorth, + k_EInputActionOrigin_SteamController_LeftStick_DPadSouth, + k_EInputActionOrigin_SteamController_LeftStick_DPadWest, + k_EInputActionOrigin_SteamController_LeftStick_DPadEast, + k_EInputActionOrigin_SteamController_Gyro_Move, + k_EInputActionOrigin_SteamController_Gyro_Pitch, + k_EInputActionOrigin_SteamController_Gyro_Yaw, + k_EInputActionOrigin_SteamController_Gyro_Roll, + k_EInputActionOrigin_SteamController_Reserved0, + k_EInputActionOrigin_SteamController_Reserved1, + k_EInputActionOrigin_SteamController_Reserved2, + k_EInputActionOrigin_SteamController_Reserved3, + k_EInputActionOrigin_SteamController_Reserved4, + k_EInputActionOrigin_SteamController_Reserved5, + k_EInputActionOrigin_SteamController_Reserved6, + k_EInputActionOrigin_SteamController_Reserved7, + k_EInputActionOrigin_SteamController_Reserved8, + k_EInputActionOrigin_SteamController_Reserved9, + k_EInputActionOrigin_SteamController_Reserved10, + + // PS4 Dual Shock + k_EInputActionOrigin_PS4_X, + k_EInputActionOrigin_PS4_Circle, + k_EInputActionOrigin_PS4_Triangle, + k_EInputActionOrigin_PS4_Square, + k_EInputActionOrigin_PS4_LeftBumper, + k_EInputActionOrigin_PS4_RightBumper, + k_EInputActionOrigin_PS4_Options, //Start + k_EInputActionOrigin_PS4_Share, //Back + k_EInputActionOrigin_PS4_LeftPad_Touch, + k_EInputActionOrigin_PS4_LeftPad_Swipe, + k_EInputActionOrigin_PS4_LeftPad_Click, + k_EInputActionOrigin_PS4_LeftPad_DPadNorth, + k_EInputActionOrigin_PS4_LeftPad_DPadSouth, + k_EInputActionOrigin_PS4_LeftPad_DPadWest, + k_EInputActionOrigin_PS4_LeftPad_DPadEast, + k_EInputActionOrigin_PS4_RightPad_Touch, + k_EInputActionOrigin_PS4_RightPad_Swipe, + k_EInputActionOrigin_PS4_RightPad_Click, + k_EInputActionOrigin_PS4_RightPad_DPadNorth, + k_EInputActionOrigin_PS4_RightPad_DPadSouth, + k_EInputActionOrigin_PS4_RightPad_DPadWest, + k_EInputActionOrigin_PS4_RightPad_DPadEast, + k_EInputActionOrigin_PS4_CenterPad_Touch, + k_EInputActionOrigin_PS4_CenterPad_Swipe, + k_EInputActionOrigin_PS4_CenterPad_Click, + k_EInputActionOrigin_PS4_CenterPad_DPadNorth, + k_EInputActionOrigin_PS4_CenterPad_DPadSouth, + k_EInputActionOrigin_PS4_CenterPad_DPadWest, + k_EInputActionOrigin_PS4_CenterPad_DPadEast, + k_EInputActionOrigin_PS4_LeftTrigger_Pull, + k_EInputActionOrigin_PS4_LeftTrigger_Click, + k_EInputActionOrigin_PS4_RightTrigger_Pull, + k_EInputActionOrigin_PS4_RightTrigger_Click, + k_EInputActionOrigin_PS4_LeftStick_Move, + k_EInputActionOrigin_PS4_LeftStick_Click, + k_EInputActionOrigin_PS4_LeftStick_DPadNorth, + k_EInputActionOrigin_PS4_LeftStick_DPadSouth, + k_EInputActionOrigin_PS4_LeftStick_DPadWest, + k_EInputActionOrigin_PS4_LeftStick_DPadEast, + k_EInputActionOrigin_PS4_RightStick_Move, + k_EInputActionOrigin_PS4_RightStick_Click, + k_EInputActionOrigin_PS4_RightStick_DPadNorth, + k_EInputActionOrigin_PS4_RightStick_DPadSouth, + k_EInputActionOrigin_PS4_RightStick_DPadWest, + k_EInputActionOrigin_PS4_RightStick_DPadEast, + k_EInputActionOrigin_PS4_DPad_North, + k_EInputActionOrigin_PS4_DPad_South, + k_EInputActionOrigin_PS4_DPad_West, + k_EInputActionOrigin_PS4_DPad_East, + k_EInputActionOrigin_PS4_Gyro_Move, + k_EInputActionOrigin_PS4_Gyro_Pitch, + k_EInputActionOrigin_PS4_Gyro_Yaw, + k_EInputActionOrigin_PS4_Gyro_Roll, + k_EInputActionOrigin_PS4_Reserved0, + k_EInputActionOrigin_PS4_Reserved1, + k_EInputActionOrigin_PS4_Reserved2, + k_EInputActionOrigin_PS4_Reserved3, + k_EInputActionOrigin_PS4_Reserved4, + k_EInputActionOrigin_PS4_Reserved5, + k_EInputActionOrigin_PS4_Reserved6, + k_EInputActionOrigin_PS4_Reserved7, + k_EInputActionOrigin_PS4_Reserved8, + k_EInputActionOrigin_PS4_Reserved9, + k_EInputActionOrigin_PS4_Reserved10, + + // XBox One + k_EInputActionOrigin_XBoxOne_A, + k_EInputActionOrigin_XBoxOne_B, + k_EInputActionOrigin_XBoxOne_X, + k_EInputActionOrigin_XBoxOne_Y, + k_EInputActionOrigin_XBoxOne_LeftBumper, + k_EInputActionOrigin_XBoxOne_RightBumper, + k_EInputActionOrigin_XBoxOne_Menu, //Start + k_EInputActionOrigin_XBoxOne_View, //Back + k_EInputActionOrigin_XBoxOne_LeftTrigger_Pull, + k_EInputActionOrigin_XBoxOne_LeftTrigger_Click, + k_EInputActionOrigin_XBoxOne_RightTrigger_Pull, + k_EInputActionOrigin_XBoxOne_RightTrigger_Click, + k_EInputActionOrigin_XBoxOne_LeftStick_Move, + k_EInputActionOrigin_XBoxOne_LeftStick_Click, + k_EInputActionOrigin_XBoxOne_LeftStick_DPadNorth, + k_EInputActionOrigin_XBoxOne_LeftStick_DPadSouth, + k_EInputActionOrigin_XBoxOne_LeftStick_DPadWest, + k_EInputActionOrigin_XBoxOne_LeftStick_DPadEast, + k_EInputActionOrigin_XBoxOne_RightStick_Move, + k_EInputActionOrigin_XBoxOne_RightStick_Click, + k_EInputActionOrigin_XBoxOne_RightStick_DPadNorth, + k_EInputActionOrigin_XBoxOne_RightStick_DPadSouth, + k_EInputActionOrigin_XBoxOne_RightStick_DPadWest, + k_EInputActionOrigin_XBoxOne_RightStick_DPadEast, + k_EInputActionOrigin_XBoxOne_DPad_North, + k_EInputActionOrigin_XBoxOne_DPad_South, + k_EInputActionOrigin_XBoxOne_DPad_West, + k_EInputActionOrigin_XBoxOne_DPad_East, + k_EInputActionOrigin_XBoxOne_Reserved0, + k_EInputActionOrigin_XBoxOne_Reserved1, + k_EInputActionOrigin_XBoxOne_Reserved2, + k_EInputActionOrigin_XBoxOne_Reserved3, + k_EInputActionOrigin_XBoxOne_Reserved4, + k_EInputActionOrigin_XBoxOne_Reserved5, + k_EInputActionOrigin_XBoxOne_Reserved6, + k_EInputActionOrigin_XBoxOne_Reserved7, + k_EInputActionOrigin_XBoxOne_Reserved8, + k_EInputActionOrigin_XBoxOne_Reserved9, + k_EInputActionOrigin_XBoxOne_Reserved10, + + // XBox 360 + k_EInputActionOrigin_XBox360_A, + k_EInputActionOrigin_XBox360_B, + k_EInputActionOrigin_XBox360_X, + k_EInputActionOrigin_XBox360_Y, + k_EInputActionOrigin_XBox360_LeftBumper, + k_EInputActionOrigin_XBox360_RightBumper, + k_EInputActionOrigin_XBox360_Start, //Start + k_EInputActionOrigin_XBox360_Back, //Back + k_EInputActionOrigin_XBox360_LeftTrigger_Pull, + k_EInputActionOrigin_XBox360_LeftTrigger_Click, + k_EInputActionOrigin_XBox360_RightTrigger_Pull, + k_EInputActionOrigin_XBox360_RightTrigger_Click, + k_EInputActionOrigin_XBox360_LeftStick_Move, + k_EInputActionOrigin_XBox360_LeftStick_Click, + k_EInputActionOrigin_XBox360_LeftStick_DPadNorth, + k_EInputActionOrigin_XBox360_LeftStick_DPadSouth, + k_EInputActionOrigin_XBox360_LeftStick_DPadWest, + k_EInputActionOrigin_XBox360_LeftStick_DPadEast, + k_EInputActionOrigin_XBox360_RightStick_Move, + k_EInputActionOrigin_XBox360_RightStick_Click, + k_EInputActionOrigin_XBox360_RightStick_DPadNorth, + k_EInputActionOrigin_XBox360_RightStick_DPadSouth, + k_EInputActionOrigin_XBox360_RightStick_DPadWest, + k_EInputActionOrigin_XBox360_RightStick_DPadEast, + k_EInputActionOrigin_XBox360_DPad_North, + k_EInputActionOrigin_XBox360_DPad_South, + k_EInputActionOrigin_XBox360_DPad_West, + k_EInputActionOrigin_XBox360_DPad_East, + k_EInputActionOrigin_XBox360_Reserved0, + k_EInputActionOrigin_XBox360_Reserved1, + k_EInputActionOrigin_XBox360_Reserved2, + k_EInputActionOrigin_XBox360_Reserved3, + k_EInputActionOrigin_XBox360_Reserved4, + k_EInputActionOrigin_XBox360_Reserved5, + k_EInputActionOrigin_XBox360_Reserved6, + k_EInputActionOrigin_XBox360_Reserved7, + k_EInputActionOrigin_XBox360_Reserved8, + k_EInputActionOrigin_XBox360_Reserved9, + k_EInputActionOrigin_XBox360_Reserved10, + + + // Switch - Pro or Joycons used as a single input device. + // This does not apply to a single joycon + k_EInputActionOrigin_Switch_A, + k_EInputActionOrigin_Switch_B, + k_EInputActionOrigin_Switch_X, + k_EInputActionOrigin_Switch_Y, + k_EInputActionOrigin_Switch_LeftBumper, + k_EInputActionOrigin_Switch_RightBumper, + k_EInputActionOrigin_Switch_Plus, //Start + k_EInputActionOrigin_Switch_Minus, //Back + k_EInputActionOrigin_Switch_Capture, + k_EInputActionOrigin_Switch_LeftTrigger_Pull, + k_EInputActionOrigin_Switch_LeftTrigger_Click, + k_EInputActionOrigin_Switch_RightTrigger_Pull, + k_EInputActionOrigin_Switch_RightTrigger_Click, + k_EInputActionOrigin_Switch_LeftStick_Move, + k_EInputActionOrigin_Switch_LeftStick_Click, + k_EInputActionOrigin_Switch_LeftStick_DPadNorth, + k_EInputActionOrigin_Switch_LeftStick_DPadSouth, + k_EInputActionOrigin_Switch_LeftStick_DPadWest, + k_EInputActionOrigin_Switch_LeftStick_DPadEast, + k_EInputActionOrigin_Switch_RightStick_Move, + k_EInputActionOrigin_Switch_RightStick_Click, + k_EInputActionOrigin_Switch_RightStick_DPadNorth, + k_EInputActionOrigin_Switch_RightStick_DPadSouth, + k_EInputActionOrigin_Switch_RightStick_DPadWest, + k_EInputActionOrigin_Switch_RightStick_DPadEast, + k_EInputActionOrigin_Switch_DPad_North, + k_EInputActionOrigin_Switch_DPad_South, + k_EInputActionOrigin_Switch_DPad_West, + k_EInputActionOrigin_Switch_DPad_East, + k_EInputActionOrigin_Switch_ProGyro_Move, // Primary Gyro in Pro Controller, or Right JoyCon + k_EInputActionOrigin_Switch_ProGyro_Pitch, // Primary Gyro in Pro Controller, or Right JoyCon + k_EInputActionOrigin_Switch_ProGyro_Yaw, // Primary Gyro in Pro Controller, or Right JoyCon + k_EInputActionOrigin_Switch_ProGyro_Roll, // Primary Gyro in Pro Controller, or Right JoyCon + k_EInputActionOrigin_Switch_Reserved0, + k_EInputActionOrigin_Switch_Reserved1, + k_EInputActionOrigin_Switch_Reserved2, + k_EInputActionOrigin_Switch_Reserved3, + k_EInputActionOrigin_Switch_Reserved4, + k_EInputActionOrigin_Switch_Reserved5, + k_EInputActionOrigin_Switch_Reserved6, + k_EInputActionOrigin_Switch_Reserved7, + k_EInputActionOrigin_Switch_Reserved8, + k_EInputActionOrigin_Switch_Reserved9, + k_EInputActionOrigin_Switch_Reserved10, + + // Switch JoyCon Specific + k_EInputActionOrigin_Switch_RightGyro_Move, // Right JoyCon Gyro generally should correspond to Pro's single gyro + k_EInputActionOrigin_Switch_RightGyro_Pitch, // Right JoyCon Gyro generally should correspond to Pro's single gyro + k_EInputActionOrigin_Switch_RightGyro_Yaw, // Right JoyCon Gyro generally should correspond to Pro's single gyro + k_EInputActionOrigin_Switch_RightGyro_Roll, // Right JoyCon Gyro generally should correspond to Pro's single gyro + k_EInputActionOrigin_Switch_LeftGyro_Move, + k_EInputActionOrigin_Switch_LeftGyro_Pitch, + k_EInputActionOrigin_Switch_LeftGyro_Yaw, + k_EInputActionOrigin_Switch_LeftGyro_Roll, + k_EInputActionOrigin_Switch_LeftGrip_Lower, // Left JoyCon SR Button + k_EInputActionOrigin_Switch_LeftGrip_Upper, // Left JoyCon SL Button + k_EInputActionOrigin_Switch_RightGrip_Lower, // Right JoyCon SL Button + k_EInputActionOrigin_Switch_RightGrip_Upper, // Right JoyCon SR Button + k_EInputActionOrigin_Switch_Reserved11, + k_EInputActionOrigin_Switch_Reserved12, + k_EInputActionOrigin_Switch_Reserved13, + k_EInputActionOrigin_Switch_Reserved14, + k_EInputActionOrigin_Switch_Reserved15, + k_EInputActionOrigin_Switch_Reserved16, + k_EInputActionOrigin_Switch_Reserved17, + k_EInputActionOrigin_Switch_Reserved18, + k_EInputActionOrigin_Switch_Reserved19, + k_EInputActionOrigin_Switch_Reserved20, + + k_EInputActionOrigin_Count, // If Steam has added support for new controllers origins will go here. + k_EInputActionOrigin_MaximumPossibleValue = 32767, // Origins are currently a maximum of 16 bits. +}; + +enum EXboxOrigin +{ + k_EXboxOrigin_A, + k_EXboxOrigin_B, + k_EXboxOrigin_X, + k_EXboxOrigin_Y, + k_EXboxOrigin_LeftBumper, + k_EXboxOrigin_RightBumper, + k_EXboxOrigin_Menu, //Start + k_EXboxOrigin_View, //Back + k_EXboxOrigin_LeftTrigger_Pull, + k_EXboxOrigin_LeftTrigger_Click, + k_EXboxOrigin_RightTrigger_Pull, + k_EXboxOrigin_RightTrigger_Click, + k_EXboxOrigin_LeftStick_Move, + k_EXboxOrigin_LeftStick_Click, + k_EXboxOrigin_LeftStick_DPadNorth, + k_EXboxOrigin_LeftStick_DPadSouth, + k_EXboxOrigin_LeftStick_DPadWest, + k_EXboxOrigin_LeftStick_DPadEast, + k_EXboxOrigin_RightStick_Move, + k_EXboxOrigin_RightStick_Click, + k_EXboxOrigin_RightStick_DPadNorth, + k_EXboxOrigin_RightStick_DPadSouth, + k_EXboxOrigin_RightStick_DPadWest, + k_EXboxOrigin_RightStick_DPadEast, + k_EXboxOrigin_DPad_North, + k_EXboxOrigin_DPad_South, + k_EXboxOrigin_DPad_West, + k_EXboxOrigin_DPad_East, + k_EXboxOrigin_Count, +}; + +enum ESteamControllerPad +{ + k_ESteamControllerPad_Left, + k_ESteamControllerPad_Right +}; + +enum ESteamInputType +{ + k_ESteamInputType_Unknown, + k_ESteamInputType_SteamController, + k_ESteamInputType_XBox360Controller, + k_ESteamInputType_XBoxOneController, + k_ESteamInputType_GenericGamepad, // DirectInput controllers + k_ESteamInputType_PS4Controller, + k_ESteamInputType_AppleMFiController, // Unused + k_ESteamInputType_AndroidController, // Unused + k_ESteamInputType_SwitchJoyConPair, // Unused + k_ESteamInputType_SwitchJoyConSingle, // Unused + k_ESteamInputType_SwitchProController, + k_ESteamInputType_MobileTouch, // Steam Link App On-screen Virtual Controller + k_ESteamInputType_PS3Controller, // Currently uses PS4 Origins + k_ESteamInputType_Count, + k_ESteamInputType_MaximumPossibleValue = 255, +}; + +// These values are passed into SetLEDColor +enum ESteamInputLEDFlag +{ + k_ESteamInputLEDFlag_SetColor, + // Restore the LED color to the user's preference setting as set in the controller personalization menu. + // This also happens automatically on exit of your game. + k_ESteamInputLEDFlag_RestoreUserDefault +}; + +// InputHandle_t is used to refer to a specific controller. +// This handle will consistently identify a controller, even if it is disconnected and re-connected +typedef uint64 InputHandle_t; + + +// These handles are used to refer to a specific in-game action or action set +// All action handles should be queried during initialization for performance reasons +typedef uint64 InputActionSetHandle_t; +typedef uint64 InputDigitalActionHandle_t; +typedef uint64 InputAnalogActionHandle_t; + +#pragma pack( push, 1 ) + +struct InputAnalogActionData_t +{ + // Type of data coming from this action, this will match what got specified in the action set + EInputSourceMode eMode; + + // The current state of this action; will be delta updates for mouse actions + float x, y; + + // Whether or not this action is currently available to be bound in the active action set + bool bActive; +}; + +struct InputDigitalActionData_t +{ + // The current state of this action; will be true if currently pressed + bool bState; + + // Whether or not this action is currently available to be bound in the active action set + bool bActive; +}; + +struct InputMotionData_t +{ + // Sensor-fused absolute rotation; will drift in heading + float rotQuatX; + float rotQuatY; + float rotQuatZ; + float rotQuatW; + + // Positional acceleration + float posAccelX; + float posAccelY; + float posAccelZ; + + // Angular velocity + float rotVelX; + float rotVelY; + float rotVelZ; +}; + +#pragma pack( pop ) + + +//----------------------------------------------------------------------------- +// Purpose: Steam Input API +//----------------------------------------------------------------------------- +class ISteamInput +{ +public: + + // Init and Shutdown must be called when starting/ending use of this interface + virtual bool Init() = 0; + virtual bool Shutdown() = 0; + + // Synchronize API state with the latest Steam Controller inputs available. This + // is performed automatically by SteamAPI_RunCallbacks, but for the absolute lowest + // possible latency, you call this directly before reading controller state. This must + // be called from somewhere before GetConnectedControllers will return any handles + virtual void RunFrame() = 0; + + // Enumerate currently connected Steam Input enabled devices - developers can opt in controller by type (ex: Xbox/Playstation/etc) via + // the Steam Input settings in the Steamworks site or users can opt-in in their controller settings in Steam. + // handlesOut should point to a STEAM_INPUT_MAX_COUNT sized array of InputHandle_t handles + // Returns the number of handles written to handlesOut + virtual int GetConnectedControllers( InputHandle_t *handlesOut ) = 0; + + //----------------------------------------------------------------------------- + // ACTION SETS + //----------------------------------------------------------------------------- + + // Lookup the handle for an Action Set. Best to do this once on startup, and store the handles for all future API calls. + virtual InputActionSetHandle_t GetActionSetHandle( const char *pszActionSetName ) = 0; + + // Reconfigure the controller to use the specified action set (ie 'Menu', 'Walk' or 'Drive') + // This is cheap, and can be safely called repeatedly. It's often easier to repeatedly call it in + // your state loops, instead of trying to place it in all of your state transitions. + virtual void ActivateActionSet( InputHandle_t inputHandle, InputActionSetHandle_t actionSetHandle ) = 0; + virtual InputActionSetHandle_t GetCurrentActionSet( InputHandle_t inputHandle ) = 0; + + // ACTION SET LAYERS + virtual void ActivateActionSetLayer( InputHandle_t inputHandle, InputActionSetHandle_t actionSetLayerHandle ) = 0; + virtual void DeactivateActionSetLayer( InputHandle_t inputHandle, InputActionSetHandle_t actionSetLayerHandle ) = 0; + virtual void DeactivateAllActionSetLayers( InputHandle_t inputHandle ) = 0; + virtual int GetActiveActionSetLayers( InputHandle_t inputHandle, InputActionSetHandle_t *handlesOut ) = 0; + + //----------------------------------------------------------------------------- + // ACTIONS + //----------------------------------------------------------------------------- + + // Lookup the handle for a digital action. Best to do this once on startup, and store the handles for all future API calls. + virtual InputDigitalActionHandle_t GetDigitalActionHandle( const char *pszActionName ) = 0; + + // Returns the current state of the supplied digital game action + virtual InputDigitalActionData_t GetDigitalActionData( InputHandle_t inputHandle, InputDigitalActionHandle_t digitalActionHandle ) = 0; + + // Get the origin(s) for a digital action within an action set. Returns the number of origins supplied in originsOut. Use this to display the appropriate on-screen prompt for the action. + // originsOut should point to a STEAM_INPUT_MAX_ORIGINS sized array of EInputActionOrigin handles. The EInputActionOrigin enum will get extended as support for new controller controllers gets added to + // the Steam client and will exceed the values from this header, please check bounds if you are using a look up table. + virtual int GetDigitalActionOrigins( InputHandle_t inputHandle, InputActionSetHandle_t actionSetHandle, InputDigitalActionHandle_t digitalActionHandle, EInputActionOrigin *originsOut ) = 0; + + // Lookup the handle for an analog action. Best to do this once on startup, and store the handles for all future API calls. + virtual InputAnalogActionHandle_t GetAnalogActionHandle( const char *pszActionName ) = 0; + + // Returns the current state of these supplied analog game action + virtual InputAnalogActionData_t GetAnalogActionData( InputHandle_t inputHandle, InputAnalogActionHandle_t analogActionHandle ) = 0; + + // Get the origin(s) for an analog action within an action set. Returns the number of origins supplied in originsOut. Use this to display the appropriate on-screen prompt for the action. + // originsOut should point to a STEAM_INPUT_MAX_ORIGINS sized array of EInputActionOrigin handles. The EInputActionOrigin enum will get extended as support for new controller controllers gets added to + // the Steam client and will exceed the values from this header, please check bounds if you are using a look up table. + virtual int GetAnalogActionOrigins( InputHandle_t inputHandle, InputActionSetHandle_t actionSetHandle, InputAnalogActionHandle_t analogActionHandle, EInputActionOrigin *originsOut ) = 0; + + // Get a local path to art for on-screen glyph for a particular origin - this call is cheap + virtual const char *GetGlyphForActionOrigin( EInputActionOrigin eOrigin ) = 0; + + // Returns a localized string (from Steam's language setting) for the specified origin - this call is serialized + virtual const char *GetStringForActionOrigin( EInputActionOrigin eOrigin ) = 0; + + // Stop analog momentum for the action if it is a mouse action in trackball mode + virtual void StopAnalogActionMomentum( InputHandle_t inputHandle, InputAnalogActionHandle_t eAction ) = 0; + + // Returns raw motion data from the specified device + virtual InputMotionData_t GetMotionData( InputHandle_t inputHandle ) = 0; + + //----------------------------------------------------------------------------- + // OUTPUTS + //----------------------------------------------------------------------------- + + // Trigger a vibration event on supported controllers - Steam will translate these commands into haptic pulses for Steam Controllers + virtual void TriggerVibration( InputHandle_t inputHandle, unsigned short usLeftSpeed, unsigned short usRightSpeed ) = 0; + + // Set the controller LED color on supported controllers. nFlags is a bitmask of values from ESteamInputLEDFlag - 0 will default to setting a color. Steam will handle + // the behavior on exit of your program so you don't need to try restore the default as you are shutting down + virtual void SetLEDColor( InputHandle_t inputHandle, uint8 nColorR, uint8 nColorG, uint8 nColorB, unsigned int nFlags ) = 0; + + // Trigger a haptic pulse on a Steam Controller - if you are approximating rumble you may want to use TriggerVibration instead. + // Good uses for Haptic pulses include chimes, noises, or directional gameplay feedback (taking damage, footstep locations, etc). + virtual void TriggerHapticPulse( InputHandle_t inputHandle, ESteamControllerPad eTargetPad, unsigned short usDurationMicroSec ) = 0; + + // Trigger a haptic pulse with a duty cycle of usDurationMicroSec / usOffMicroSec, unRepeat times. If you are approximating rumble you may want to use TriggerVibration instead. + // nFlags is currently unused and reserved for future use. + virtual void TriggerRepeatedHapticPulse( InputHandle_t inputHandle, ESteamControllerPad eTargetPad, unsigned short usDurationMicroSec, unsigned short usOffMicroSec, unsigned short unRepeat, unsigned int nFlags ) = 0; + + //----------------------------------------------------------------------------- + // Utility functions availible without using the rest of Steam Input API + //----------------------------------------------------------------------------- + + // Invokes the Steam overlay and brings up the binding screen if the user is using Big Picture Mode + // If the user is not in Big Picture Mode it will open up the binding in a new window + virtual bool ShowBindingPanel( InputHandle_t inputHandle ) = 0; + + // Returns the input type for a particular handle + virtual ESteamInputType GetInputTypeForHandle( InputHandle_t inputHandle ) = 0; + + // Returns the associated controller handle for the specified emulated gamepad - can be used with the above 2 functions + // to identify controllers presented to your game over Xinput. Returns 0 if the Xinput index isn't associated with Steam Input + virtual InputHandle_t GetControllerForGamepadIndex( int nIndex ) = 0; + + // Returns the associated gamepad index for the specified controller, if emulating a gamepad or -1 if not associated with an Xinput index + virtual int GetGamepadIndexForController( InputHandle_t ulinputHandle ) = 0; + + // Returns a localized string (from Steam's language setting) for the specified Xbox controller origin. This function is cheap. + virtual const char *GetStringForXboxOrigin( EXboxOrigin eOrigin ) = 0; + + // Get a local path to art for on-screen glyph for a particular Xbox controller origin. This function is serialized. + virtual const char *GetGlyphForXboxOrigin( EXboxOrigin eOrigin ) = 0; + + // Get the equivalent ActionOrigin for a given Xbox controller origin this can be chained with GetGlyphForActionOrigin to provide future proof glyphs for + // non-Steam Input API action games. Note - this only translates the buttons directly and doesn't take into account any remapping a user has made in their configuration + virtual EInputActionOrigin GetActionOriginFromXboxOrigin( InputHandle_t inputHandle, EXboxOrigin eOrigin ) = 0; + + // Convert an origin to another controller type - for inputs not present on the other controller type this will return k_EInputActionOrigin_None + // When a new input type is added you will be able to pass in k_ESteamInputType_Unknown amd the closest origin that your version of the SDK regonized will be returned + // ex: if a Playstation 5 controller was released this function would return Playstation 4 origins. + virtual EInputActionOrigin TranslateActionOrigin( ESteamInputType eDestinationInputType, EInputActionOrigin eSourceOrigin ) = 0; +}; + +#define STEAMINPUT_INTERFACE_VERSION "SteamInput001" + +// Global interface accessor +inline ISteamInput *SteamInput(); +STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamInput *, SteamInput, STEAMINPUT_INTERFACE_VERSION ); + +#endif // ISTEAMINPUT_H diff --git a/Generator/steam_sdk/isteaminventory.h b/Generator/steam_sdk/isteaminventory.h index 85090a2..1cd21b8 100644 --- a/Generator/steam_sdk/isteaminventory.h +++ b/Generator/steam_sdk/isteaminventory.h @@ -10,7 +10,7 @@ #pragma once #endif -#include "isteamclient.h" +#include "steam_api_common.h" // callbacks #if defined( VALVE_CALLBACK_PACK_SMALL ) @@ -18,7 +18,7 @@ #elif defined( VALVE_CALLBACK_PACK_LARGE ) #pragma pack( push, 8 ) #else -#error isteamclient.h must be included +#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx #endif @@ -86,14 +86,14 @@ public: // k_EResultServiceUnavailable - ERROR: service temporarily down, you may retry later // k_EResultLimitExceeded - ERROR: operation would exceed per-user inventory limits // k_EResultFail - ERROR: unknown / generic error - METHOD_DESC(Find out the status of an asynchronous inventory result handle.) + STEAM_METHOD_DESC(Find out the status of an asynchronous inventory result handle.) virtual EResult GetResultStatus( SteamInventoryResult_t resultHandle ) = 0; // Copies the contents of a result set into a flat array. The specific // contents of the result set depend on which query which was used. - METHOD_DESC(Copies the contents of a result set into a flat array. The specific contents of the result set depend on which query which was used.) + STEAM_METHOD_DESC(Copies the contents of a result set into a flat array. The specific contents of the result set depend on which query which was used.) virtual bool GetResultItems( SteamInventoryResult_t resultHandle, - OUT_ARRAY_COUNT( punOutItemsArraySize,Output array) SteamItemDetails_t *pOutItemsArray, + STEAM_OUT_ARRAY_COUNT( punOutItemsArraySize,Output array) SteamItemDetails_t *pOutItemsArray, uint32 *punOutItemsArraySize ) = 0; // In combination with GetResultItems, you can use GetResultItemProperty to retrieve @@ -111,21 +111,21 @@ public: virtual bool GetResultItemProperty( SteamInventoryResult_t resultHandle, uint32 unItemIndex, const char *pchPropertyName, - OUT_STRING_COUNT( punValueBufferSizeOut ) char *pchValueBuffer, uint32 *punValueBufferSizeOut ) = 0; + STEAM_OUT_STRING_COUNT( punValueBufferSizeOut ) char *pchValueBuffer, uint32 *punValueBufferSizeOut ) = 0; // Returns the server time at which the result was generated. Compare against // the value of IClientUtils::GetServerRealTime() to determine age. - METHOD_DESC(Returns the server time at which the result was generated. Compare against the value of IClientUtils::GetServerRealTime() to determine age.) + STEAM_METHOD_DESC(Returns the server time at which the result was generated. Compare against the value of IClientUtils::GetServerRealTime() to determine age.) virtual uint32 GetResultTimestamp( SteamInventoryResult_t resultHandle ) = 0; // Returns true if the result belongs to the target steam ID, false if the // result does not. This is important when using DeserializeResult, to verify // that a remote player is not pretending to have a different user's inventory. - METHOD_DESC(Returns true if the result belongs to the target steam ID or false if the result does not. This is important when using DeserializeResult to verify that a remote player is not pretending to have a different users inventory.) + STEAM_METHOD_DESC(Returns true if the result belongs to the target steam ID or false if the result does not. This is important when using DeserializeResult to verify that a remote player is not pretending to have a different users inventory.) virtual bool CheckResultSteamID( SteamInventoryResult_t resultHandle, CSteamID steamIDExpected ) = 0; // Destroys a result handle and frees all associated memory. - METHOD_DESC(Destroys a result handle and frees all associated memory.) + STEAM_METHOD_DESC(Destroys a result handle and frees all associated memory.) virtual void DestroyResult( SteamInventoryResult_t resultHandle ) = 0; @@ -139,7 +139,7 @@ public: // cached results if called too frequently. It is suggested that you call // this function only when you are about to display the user's full inventory, // or if you expect that the inventory may have changed. - METHOD_DESC(Captures the entire state of the current users Steam inventory.) + STEAM_METHOD_DESC(Captures the entire state of the current users Steam inventory.) virtual bool GetAllItems( SteamInventoryResult_t *pResultHandle ) = 0; @@ -150,8 +150,8 @@ public: // For example, you could call GetItemsByID with the IDs of the user's // currently equipped cosmetic items and serialize this to a buffer, and // then transmit this buffer to other players upon joining a game. - METHOD_DESC(Captures the state of a subset of the current users Steam inventory identified by an array of item instance IDs.) - virtual bool GetItemsByID( SteamInventoryResult_t *pResultHandle, ARRAY_COUNT( unCountInstanceIDs ) const SteamItemInstanceID_t *pInstanceIDs, uint32 unCountInstanceIDs ) = 0; + STEAM_METHOD_DESC(Captures the state of a subset of the current users Steam inventory identified by an array of item instance IDs.) + virtual bool GetItemsByID( SteamInventoryResult_t *pResultHandle, STEAM_ARRAY_COUNT( unCountInstanceIDs ) const SteamItemInstanceID_t *pInstanceIDs, uint32 unCountInstanceIDs ) = 0; // RESULT SERIALIZATION AND AUTHENTICATION @@ -169,7 +169,7 @@ public: // recommended to use "GetItemsByID" first to create a minimal result set. // Results have a built-in timestamp which will be considered "expired" after // an hour has elapsed. See DeserializeResult for expiration handling. - virtual bool SerializeResult( SteamInventoryResult_t resultHandle, OUT_BUFFER_COUNT(punOutBufferSize) void *pOutBuffer, uint32 *punOutBufferSize ) = 0; + virtual bool SerializeResult( SteamInventoryResult_t resultHandle, STEAM_OUT_BUFFER_COUNT(punOutBufferSize) void *pOutBuffer, uint32 *punOutBufferSize ) = 0; // Deserializes a result set and verifies the signature bytes. Returns false // if bRequireFullOnlineVerify is set but Steam is running in Offline mode. @@ -187,7 +187,7 @@ public: // ISteamUtils::GetServerRealTime() to determine how old the data is. You could // simply ignore the "expired" result code and continue as normal, or you // could challenge the player with expired data to send an updated result set. - virtual bool DeserializeResult( SteamInventoryResult_t *pOutResultHandle, BUFFER_COUNT(punOutBufferSize) const void *pBuffer, uint32 unBufferSize, bool bRESERVED_MUST_BE_FALSE = false ) = 0; + virtual bool DeserializeResult( SteamInventoryResult_t *pOutResultHandle, STEAM_BUFFER_COUNT(punOutBufferSize) const void *pBuffer, uint32 unBufferSize, bool bRESERVED_MUST_BE_FALSE = false ) = 0; // INVENTORY ASYNC MODIFICATION @@ -199,13 +199,13 @@ public: // for your game. // If punArrayQuantity is not NULL, it should be the same length as pArrayItems and should // describe the quantity of each item to generate. - virtual bool GenerateItems( SteamInventoryResult_t *pResultHandle, ARRAY_COUNT(unArrayLength) const SteamItemDef_t *pArrayItemDefs, ARRAY_COUNT(unArrayLength) const uint32 *punArrayQuantity, uint32 unArrayLength ) = 0; + virtual bool GenerateItems( SteamInventoryResult_t *pResultHandle, STEAM_ARRAY_COUNT(unArrayLength) const SteamItemDef_t *pArrayItemDefs, STEAM_ARRAY_COUNT(unArrayLength) const uint32 *punArrayQuantity, uint32 unArrayLength ) = 0; // GrantPromoItems() checks the list of promotional items for which the user may be eligible // and grants the items (one time only). On success, the result set will include items which // were granted, if any. If no items were granted because the user isn't eligible for any // promotions, this is still considered a success. - METHOD_DESC(GrantPromoItems() checks the list of promotional items for which the user may be eligible and grants the items (one time only).) + STEAM_METHOD_DESC(GrantPromoItems() checks the list of promotional items for which the user may be eligible and grants the items (one time only).) virtual bool GrantPromoItems( SteamInventoryResult_t *pResultHandle ) = 0; // AddPromoItem() / AddPromoItems() are restricted versions of GrantPromoItems(). Instead of @@ -213,12 +213,12 @@ public: // definition or set of item definitions. This can be useful if your game has custom UI for // showing a specific promo item to the user. virtual bool AddPromoItem( SteamInventoryResult_t *pResultHandle, SteamItemDef_t itemDef ) = 0; - virtual bool AddPromoItems( SteamInventoryResult_t *pResultHandle, ARRAY_COUNT(unArrayLength) const SteamItemDef_t *pArrayItemDefs, uint32 unArrayLength ) = 0; + virtual bool AddPromoItems( SteamInventoryResult_t *pResultHandle, STEAM_ARRAY_COUNT(unArrayLength) const SteamItemDef_t *pArrayItemDefs, uint32 unArrayLength ) = 0; // ConsumeItem() removes items from the inventory, permanently. They cannot be recovered. // Not for the faint of heart - if your game implements item removal at all, a high-friction // UI confirmation process is highly recommended. - METHOD_DESC(ConsumeItem() removes items from the inventory permanently.) + STEAM_METHOD_DESC(ConsumeItem() removes items from the inventory permanently.) virtual bool ConsumeItem( SteamInventoryResult_t *pResultHandle, SteamItemInstanceID_t itemConsume, uint32 unQuantity ) = 0; // ExchangeItems() is an atomic combination of item generation and consumption. @@ -230,8 +230,8 @@ public: // components do not match the recipe, or do not contain sufficient quantity, the // exchange will fail. virtual bool ExchangeItems( SteamInventoryResult_t *pResultHandle, - ARRAY_COUNT(unArrayGenerateLength) const SteamItemDef_t *pArrayGenerate, ARRAY_COUNT(unArrayGenerateLength) const uint32 *punArrayGenerateQuantity, uint32 unArrayGenerateLength, - ARRAY_COUNT(unArrayDestroyLength) const SteamItemInstanceID_t *pArrayDestroy, ARRAY_COUNT(unArrayDestroyLength) const uint32 *punArrayDestroyQuantity, uint32 unArrayDestroyLength ) = 0; + STEAM_ARRAY_COUNT(unArrayGenerateLength) const SteamItemDef_t *pArrayGenerate, STEAM_ARRAY_COUNT(unArrayGenerateLength) const uint32 *punArrayGenerateQuantity, uint32 unArrayGenerateLength, + STEAM_ARRAY_COUNT(unArrayDestroyLength) const SteamItemInstanceID_t *pArrayDestroy, STEAM_ARRAY_COUNT(unArrayDestroyLength) const uint32 *punArrayDestroyQuantity, uint32 unArrayDestroyLength ) = 0; // TransferItemQuantity() is intended for use with items which are "stackable" (can have @@ -245,7 +245,7 @@ public: // // Deprecated. Calling this method is not required for proper playtime accounting. - METHOD_DESC( Deprecated method. Playtime accounting is performed on the Steam servers. ) + STEAM_METHOD_DESC( Deprecated method. Playtime accounting is performed on the Steam servers. ) virtual void SendItemDropHeartbeat() = 0; // Playtime credit must be consumed and turned into item drops by your game. Only item @@ -257,14 +257,14 @@ public: // to directly control rarity. // See your Steamworks configuration to set playtime drop rates for individual itemdefs. // The client library will suppress too-frequent calls to this method. - METHOD_DESC(Playtime credit must be consumed and turned into item drops by your game.) + STEAM_METHOD_DESC(Playtime credit must be consumed and turned into item drops by your game.) virtual bool TriggerItemDrop( SteamInventoryResult_t *pResultHandle, SteamItemDef_t dropListDefinition ) = 0; // Deprecated. This method is not supported. virtual bool TradeItems( SteamInventoryResult_t *pResultHandle, CSteamID steamIDTradePartner, - ARRAY_COUNT(nArrayGiveLength) const SteamItemInstanceID_t *pArrayGive, ARRAY_COUNT(nArrayGiveLength) const uint32 *pArrayGiveQuantity, uint32 nArrayGiveLength, - ARRAY_COUNT(nArrayGetLength) const SteamItemInstanceID_t *pArrayGet, ARRAY_COUNT(nArrayGetLength) const uint32 *pArrayGetQuantity, uint32 nArrayGetLength ) = 0; + STEAM_ARRAY_COUNT(nArrayGiveLength) const SteamItemInstanceID_t *pArrayGive, STEAM_ARRAY_COUNT(nArrayGiveLength) const uint32 *pArrayGiveQuantity, uint32 nArrayGiveLength, + STEAM_ARRAY_COUNT(nArrayGetLength) const SteamItemInstanceID_t *pArrayGet, STEAM_ARRAY_COUNT(nArrayGetLength) const uint32 *pArrayGetQuantity, uint32 nArrayGetLength ) = 0; // ITEM DEFINITIONS @@ -281,7 +281,7 @@ public: // Every time new item definitions are available (eg, from the dynamic addition of new // item types while players are still in-game), a SteamInventoryDefinitionUpdate_t // callback will be fired. - METHOD_DESC(LoadItemDefinitions triggers the automatic load and refresh of item definitions.) + STEAM_METHOD_DESC(LoadItemDefinitions triggers the automatic load and refresh of item definitions.) virtual bool LoadItemDefinitions() = 0; // GetItemDefinitionIDs returns the set of all defined item definition IDs (which are @@ -290,8 +290,8 @@ public: // contain the total size necessary for a subsequent call. Otherwise, the call will // return false if and only if there is not enough space in the output array. virtual bool GetItemDefinitionIDs( - OUT_ARRAY_COUNT(punItemDefIDsArraySize,List of item definition IDs) SteamItemDef_t *pItemDefIDs, - DESC(Size of array is passed in and actual size used is returned in this param) uint32 *punItemDefIDsArraySize ) = 0; + STEAM_OUT_ARRAY_COUNT(punItemDefIDsArraySize,List of item definition IDs) SteamItemDef_t *pItemDefIDs, + STEAM_DESC(Size of array is passed in and actual size used is returned in this param) uint32 *punItemDefIDsArraySize ) = 0; // GetItemDefinitionProperty returns a string property from a given item definition. // Note that some properties (for example, "name") may be localized and will depend @@ -303,12 +303,12 @@ public: // to pchValueBuffer. If the results do not fit in the given buffer, partial // results may be copied. virtual bool GetItemDefinitionProperty( SteamItemDef_t iDefinition, const char *pchPropertyName, - OUT_STRING_COUNT(punValueBufferSizeOut) char *pchValueBuffer, uint32 *punValueBufferSizeOut ) = 0; + STEAM_OUT_STRING_COUNT(punValueBufferSizeOut) char *pchValueBuffer, uint32 *punValueBufferSizeOut ) = 0; // Request the list of "eligible" promo items that can be manually granted to the given // user. These are promo items of type "manual" that won't be granted automatically. // An example usage of this is an item that becomes available every week. - CALL_RESULT( SteamInventoryEligiblePromoItemDefIDs_t ) + STEAM_CALL_RESULT( SteamInventoryEligiblePromoItemDefIDs_t ) virtual SteamAPICall_t RequestEligiblePromoItemDefinitionsIDs( CSteamID steamID ) = 0; // After handling a SteamInventoryEligiblePromoItemDefIDs_t call result, use this @@ -316,19 +316,19 @@ public: // manually granted via the AddPromoItems() call. virtual bool GetEligiblePromoItemDefinitionIDs( CSteamID steamID, - OUT_ARRAY_COUNT(punItemDefIDsArraySize,List of item definition IDs) SteamItemDef_t *pItemDefIDs, - DESC(Size of array is passed in and actual size used is returned in this param) uint32 *punItemDefIDsArraySize ) = 0; + STEAM_OUT_ARRAY_COUNT(punItemDefIDsArraySize,List of item definition IDs) SteamItemDef_t *pItemDefIDs, + STEAM_DESC(Size of array is passed in and actual size used is returned in this param) uint32 *punItemDefIDsArraySize ) = 0; // Starts the purchase process for the given item definitions. The callback SteamInventoryStartPurchaseResult_t // will be posted if Steam was able to initialize the transaction. // // Once the purchase has been authorized and completed by the user, the callback SteamInventoryResultReady_t // will be posted. - CALL_RESULT( SteamInventoryStartPurchaseResult_t ) - virtual SteamAPICall_t StartPurchase( ARRAY_COUNT(unArrayLength) const SteamItemDef_t *pArrayItemDefs, ARRAY_COUNT(unArrayLength) const uint32 *punArrayQuantity, uint32 unArrayLength ) = 0; + STEAM_CALL_RESULT( SteamInventoryStartPurchaseResult_t ) + virtual SteamAPICall_t StartPurchase( STEAM_ARRAY_COUNT(unArrayLength) const SteamItemDef_t *pArrayItemDefs, STEAM_ARRAY_COUNT(unArrayLength) const uint32 *punArrayQuantity, uint32 unArrayLength ) = 0; // Request current prices for all applicable item definitions - CALL_RESULT( SteamInventoryRequestPricesResult_t ) + STEAM_CALL_RESULT( SteamInventoryRequestPricesResult_t ) virtual SteamAPICall_t RequestPrices() = 0; // Returns the number of items with prices. Need to call RequestPrices() first. @@ -336,13 +336,14 @@ public: // Returns item definition ids and their prices in the user's local currency. // Need to call RequestPrices() first. - virtual bool GetItemsWithPrices( ARRAY_COUNT(unArrayLength) OUT_ARRAY_COUNT(pArrayItemDefs, Items with prices) SteamItemDef_t *pArrayItemDefs, - ARRAY_COUNT(unArrayLength) OUT_ARRAY_COUNT(pPrices, List of prices for the given item defs) uint64 *pPrices, + virtual bool GetItemsWithPrices( STEAM_ARRAY_COUNT(unArrayLength) STEAM_OUT_ARRAY_COUNT(pArrayItemDefs, Items with prices) SteamItemDef_t *pArrayItemDefs, + STEAM_ARRAY_COUNT(unArrayLength) STEAM_OUT_ARRAY_COUNT(pPrices, List of prices for the given item defs) uint64 *pCurrentPrices, + STEAM_ARRAY_COUNT(unArrayLength) STEAM_OUT_ARRAY_COUNT(pPrices, List of prices for the given item defs) uint64 *pBasePrices, uint32 unArrayLength ) = 0; // Retrieves the price for the item definition id // Returns false if there is no price stored for the item definition. - virtual bool GetItemPrice( SteamItemDef_t iDefinition, uint64 *pPrice ) = 0; + virtual bool GetItemPrice( SteamItemDef_t iDefinition, uint64 *pCurrentPrice, uint64 *pBasePrice ) = 0; // Create a request to update properties on items virtual SteamInventoryUpdateHandle_t StartUpdateProperties() = 0; @@ -358,8 +359,15 @@ public: }; -#define STEAMINVENTORY_INTERFACE_VERSION "STEAMINVENTORY_INTERFACE_V002" +#define STEAMINVENTORY_INTERFACE_VERSION "STEAMINVENTORY_INTERFACE_V003" +// Global interface accessor +inline ISteamInventory *SteamInventory(); +STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamInventory *, SteamInventory, STEAMINVENTORY_INTERFACE_VERSION ); + +// Global accessor for the gameserver client +inline ISteamInventory *SteamGameServerInventory(); +STEAM_DEFINE_GAMESERVER_INTERFACE_ACCESSOR( ISteamInventory *, SteamGameServerInventory, STEAMINVENTORY_INTERFACE_VERSION ); // SteamInventoryResultReady_t callbacks are fired whenever asynchronous // results transition from "Pending" to "OK" or an error state. There will diff --git a/Generator/steam_sdk/isteammatchmaking.h b/Generator/steam_sdk/isteammatchmaking.h index 837d98b..d0c0cea 100644 --- a/Generator/steam_sdk/isteammatchmaking.h +++ b/Generator/steam_sdk/isteammatchmaking.h @@ -10,10 +10,8 @@ #pragma once #endif -#include "steamtypes.h" -#include "steamclientpublic.h" +#include "steam_api_common.h" #include "matchmakingtypes.h" -#include "isteamclient.h" #include "isteamfriends.h" // lobby type description @@ -103,7 +101,7 @@ public: } */ // - CALL_RESULT( LobbyMatchList_t ) + STEAM_CALL_RESULT( LobbyMatchList_t ) virtual SteamAPICall_t RequestLobbyList() = 0; // filters for lobbies // this needs to be called before RequestLobbyList() to take effect @@ -134,14 +132,14 @@ public: // this is an asynchronous request // results will be returned by LobbyCreated_t callback and call result; lobby is joined & ready to use at this point // a LobbyEnter_t callback will also be received (since the local user is joining their own lobby) - CALL_RESULT( LobbyCreated_t ) + STEAM_CALL_RESULT( LobbyCreated_t ) virtual SteamAPICall_t CreateLobby( ELobbyType eLobbyType, int cMaxMembers ) = 0; // Joins an existing lobby // this is an asynchronous request // results will be returned by LobbyEnter_t callback & call result, check m_EChatRoomEnterResponse to see if was successful // lobby metadata is available to use immediately on this call completing - CALL_RESULT( LobbyEnter_t ) + STEAM_CALL_RESULT( LobbyEnter_t ) virtual SteamAPICall_t JoinLobby( CSteamID steamIDLobby ) = 0; // Leave a lobby; this will take effect immediately on the client side @@ -204,7 +202,7 @@ public: // *pSteamIDUser is filled in with the CSteamID of the member // *pvData is filled in with the message itself // return value is the number of bytes written into the buffer - virtual int GetLobbyChatEntry( CSteamID steamIDLobby, int iChatID, OUT_STRUCT() CSteamID *pSteamIDUser, void *pvData, int cubData, EChatEntryType *peChatEntryType ) = 0; + virtual int GetLobbyChatEntry( CSteamID steamIDLobby, int iChatID, STEAM_OUT_STRUCT() CSteamID *pSteamIDUser, void *pvData, int cubData, EChatEntryType *peChatEntryType ) = 0; // Refreshes metadata for a lobby you're not necessarily in right now // you never do this for lobbies you're a member of, only if your @@ -220,7 +218,7 @@ public: // either the IP/Port or the steamID of the game server has to be valid, depending on how you want the clients to be able to connect virtual void SetLobbyGameServer( CSteamID steamIDLobby, uint32 unGameServerIP, uint16 unGameServerPort, CSteamID steamIDGameServer ) = 0; // returns the details of a game server set in a lobby - returns false if there is no game server set, or that lobby doesn't exist - virtual bool GetLobbyGameServer( CSteamID steamIDLobby, uint32 *punGameServerIP, uint16 *punGameServerPort, OUT_STRUCT() CSteamID *psteamIDGameServer ) = 0; + virtual bool GetLobbyGameServer( CSteamID steamIDLobby, uint32 *punGameServerIP, uint16 *punGameServerPort, STEAM_OUT_STRUCT() CSteamID *psteamIDGameServer ) = 0; // set the limit on the # of users who can join the lobby virtual bool SetLobbyMemberLimit( CSteamID steamIDLobby, int cMaxMembers ) = 0; @@ -256,10 +254,13 @@ public: // after completion, the local user will no longer be the owner virtual void CheckForPSNGameBootInvite( unsigned int iGameBootAttributes ) = 0; #endif - CALL_BACK( LobbyChatUpdate_t ) + STEAM_CALL_BACK( LobbyChatUpdate_t ) }; #define STEAMMATCHMAKING_INTERFACE_VERSION "SteamMatchMaking009" +// Global interface accessor +inline ISteamMatchmaking *SteamMatchmaking(); +STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamMatchmaking *, SteamMatchmaking, STEAMMATCHMAKING_INTERFACE_VERSION ); //----------------------------------------------------------------------------- // Callback interfaces for server list functions (see ISteamMatchmakingServers below) @@ -391,12 +392,12 @@ public: // Request a new list of servers of a particular type. These calls each correspond to one of the EMatchMakingType values. // Each call allocates a new asynchronous request object. // Request object must be released by calling ReleaseRequest( hServerListRequest ) - virtual HServerListRequest RequestInternetServerList( AppId_t iApp, ARRAY_COUNT(nFilters) MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0; + virtual HServerListRequest RequestInternetServerList( AppId_t iApp, STEAM_ARRAY_COUNT(nFilters) MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0; virtual HServerListRequest RequestLANServerList( AppId_t iApp, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0; - virtual HServerListRequest RequestFriendsServerList( AppId_t iApp, ARRAY_COUNT(nFilters) MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0; - virtual HServerListRequest RequestFavoritesServerList( AppId_t iApp, ARRAY_COUNT(nFilters) MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0; - virtual HServerListRequest RequestHistoryServerList( AppId_t iApp, ARRAY_COUNT(nFilters) MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0; - virtual HServerListRequest RequestSpectatorServerList( AppId_t iApp, ARRAY_COUNT(nFilters) MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0; + virtual HServerListRequest RequestFriendsServerList( AppId_t iApp, STEAM_ARRAY_COUNT(nFilters) MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0; + virtual HServerListRequest RequestFavoritesServerList( AppId_t iApp, STEAM_ARRAY_COUNT(nFilters) MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0; + virtual HServerListRequest RequestHistoryServerList( AppId_t iApp, STEAM_ARRAY_COUNT(nFilters) MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0; + virtual HServerListRequest RequestSpectatorServerList( AppId_t iApp, STEAM_ARRAY_COUNT(nFilters) MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0; // Releases the asynchronous request object and cancels any pending query on it if there's a pending query in progress. // RefreshComplete callback is not posted when request is released. @@ -522,6 +523,10 @@ public: }; #define STEAMMATCHMAKINGSERVERS_INTERFACE_VERSION "SteamMatchMakingServers002" +// Global interface accessor +inline ISteamMatchmakingServers *SteamMatchmakingServers(); +STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamMatchmakingServers *, SteamMatchmakingServers, STEAMMATCHMAKINGSERVERS_INTERFACE_VERSION ); + // game server flags const uint32 k_unFavoriteFlagNone = 0x00; const uint32 k_unFavoriteFlagFavorite = 0x01; // this game favorite entry is for the favorites list @@ -545,16 +550,181 @@ enum EChatMemberStateChange #define BChatMemberStateChangeRemoved( rgfChatMemberStateChangeFlags ) ( rgfChatMemberStateChangeFlags & ( k_EChatMemberStateChangeDisconnected | k_EChatMemberStateChangeLeft | k_EChatMemberStateChangeKicked | k_EChatMemberStateChangeBanned ) ) + //----------------------------------------------------------------------------- -// Callbacks for ISteamMatchmaking (which go through the regular Steam callback registration system) +// Purpose: Functions for match making services for clients to get to favorites +// and to operate on game lobbies. +//----------------------------------------------------------------------------- +class ISteamGameSearch +{ +public: + // ============================================================================================= + // Game Player APIs + + // a keyname and a list of comma separated values: one of which is must be found in order for the match to qualify + // fails if a search is currently in progress + virtual EGameSearchErrorCode_t AddGameSearchParams( const char *pchKeyToFind, const char *pchValuesToFind ) = 0; + + // all players in lobby enter the queue and await a SearchForGameNotificationCallback_t callback. fails if another search is currently in progress + // if not the owner of the lobby or search already in progress this call fails + // periodic callbacks will be sent as queue time estimates change + virtual EGameSearchErrorCode_t SearchForGameWithLobby( CSteamID steamIDLobby, int nPlayerMin, int nPlayerMax ) = 0; + + // user enter the queue and await a SearchForGameNotificationCallback_t callback. fails if another search is currently in progress + // periodic callbacks will be sent as queue time estimates change + virtual EGameSearchErrorCode_t SearchForGameSolo( int nPlayerMin, int nPlayerMax ) = 0; + + // after receiving SearchForGameResultCallback_t, accept or decline the game + // multiple SearchForGameResultCallback_t will follow as players accept game until the host starts or cancels the game + virtual EGameSearchErrorCode_t AcceptGame() = 0; + virtual EGameSearchErrorCode_t DeclineGame() = 0; + + // after receiving GameStartedByHostCallback_t get connection details to server + virtual EGameSearchErrorCode_t RetrieveConnectionDetails( CSteamID steamIDHost, char *pchConnectionDetails, int cubConnectionDetails ) = 0; + + // leaves queue if still waiting + virtual EGameSearchErrorCode_t EndGameSearch() = 0; + + // ============================================================================================= + // Game Host APIs + + // a keyname and a list of comma separated values: all the values you allow + virtual EGameSearchErrorCode_t SetGameHostParams( const char *pchKey, const char *pchValue ) = 0; + + // set connection details for players once game is found so they can connect to this server + virtual EGameSearchErrorCode_t SetConnectionDetails( const char *pchConnectionDetails, int cubConnectionDetails ) = 0; + + // mark server as available for more players with nPlayerMin,nPlayerMax desired + // accept no lobbies with playercount greater than nMaxTeamSize + // the set of lobbies returned must be partitionable into teams of no more than nMaxTeamSize + // RequestPlayersForGameNotificationCallback_t callback will be sent when the search has started + // multple RequestPlayersForGameResultCallback_t callbacks will follow when players are found + virtual EGameSearchErrorCode_t RequestPlayersForGame( int nPlayerMin, int nPlayerMax, int nMaxTeamSize ) = 0; + + // accept the player list and release connection details to players + // players will only be given connection details and host steamid when this is called + // ( allows host to accept after all players confirm, some confirm, or none confirm. decision is entirely up to the host ) + virtual EGameSearchErrorCode_t HostConfirmGameStart( uint64 ullUniqueGameID ) = 0; + + // cancel request and leave the pool of game hosts looking for players + // if a set of players has already been sent to host, all players will receive SearchForGameHostFailedToConfirm_t + virtual EGameSearchErrorCode_t CancelRequestPlayersForGame() = 0; + + // submit a result for one player. does not end the game. ullUniqueGameID continues to describe this game + virtual EGameSearchErrorCode_t SubmitPlayerResult( uint64 ullUniqueGameID, CSteamID steamIDPlayer, EPlayerResult_t EPlayerResult ) = 0; + + // ends the game. no further SubmitPlayerResults for ullUniqueGameID will be accepted + // any future requests will provide a new ullUniqueGameID + virtual EGameSearchErrorCode_t EndGame( uint64 ullUniqueGameID ) = 0; + +}; +#define STEAMGAMESEARCH_INTERFACE_VERSION "SteamMatchGameSearch001" + +// Global interface accessor +inline ISteamGameSearch *SteamGameSearch(); +STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamGameSearch *, SteamGameSearch, STEAMGAMESEARCH_INTERFACE_VERSION ); + + +//----------------------------------------------------------------------------- +// Purpose: Functions for quickly creating a Party with friends or acquaintances, +// EG from chat rooms. +//----------------------------------------------------------------------------- +enum ESteamPartyBeaconLocationType +{ + k_ESteamPartyBeaconLocationType_Invalid = 0, + k_ESteamPartyBeaconLocationType_ChatGroup = 1, + + k_ESteamPartyBeaconLocationType_Max, +}; + + #if defined( VALVE_CALLBACK_PACK_SMALL ) #pragma pack( push, 4 ) #elif defined( VALVE_CALLBACK_PACK_LARGE ) #pragma pack( push, 8 ) #else -#error isteamclient.h must be included +#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx #endif + +struct SteamPartyBeaconLocation_t +{ + ESteamPartyBeaconLocationType m_eType; + uint64 m_ulLocationID; +}; + +enum ESteamPartyBeaconLocationData +{ + k_ESteamPartyBeaconLocationDataInvalid = 0, + k_ESteamPartyBeaconLocationDataName = 1, + k_ESteamPartyBeaconLocationDataIconURLSmall = 2, + k_ESteamPartyBeaconLocationDataIconURLMedium = 3, + k_ESteamPartyBeaconLocationDataIconURLLarge = 4, +}; + +class ISteamParties +{ +public: + + // ============================================================================================= + // Party Client APIs + + // Enumerate any active beacons for parties you may wish to join + virtual uint32 GetNumActiveBeacons() = 0; + virtual PartyBeaconID_t GetBeaconByIndex( uint32 unIndex ) = 0; + virtual bool GetBeaconDetails( PartyBeaconID_t ulBeaconID, CSteamID *pSteamIDBeaconOwner, STEAM_OUT_STRUCT() SteamPartyBeaconLocation_t *pLocation, STEAM_OUT_STRING_COUNT(cchMetadata) char *pchMetadata, int cchMetadata ) = 0; + + // Join an open party. Steam will reserve one beacon slot for your SteamID, + // and return the necessary JoinGame string for you to use to connect + STEAM_CALL_RESULT( JoinPartyCallback_t ) + virtual SteamAPICall_t JoinParty( PartyBeaconID_t ulBeaconID ) = 0; + + // ============================================================================================= + // Party Host APIs + + // Get a list of possible beacon locations + virtual bool GetNumAvailableBeaconLocations( uint32 *puNumLocations ) = 0; + virtual bool GetAvailableBeaconLocations( SteamPartyBeaconLocation_t *pLocationList, uint32 uMaxNumLocations ) = 0; + + // Create a new party beacon and activate it in the selected location. + // unOpenSlots is the maximum number of users that Steam will send to you. + // When people begin responding to your beacon, Steam will send you + // PartyReservationCallback_t callbacks to let you know who is on the way. + STEAM_CALL_RESULT( CreateBeaconCallback_t ) + virtual SteamAPICall_t CreateBeacon( uint32 unOpenSlots, SteamPartyBeaconLocation_t *pBeaconLocation, const char *pchConnectString, const char *pchMetadata ) = 0; + + // Call this function when a user that had a reservation (see callback below) + // has successfully joined your party. + // Steam will manage the remaining open slots automatically. + virtual void OnReservationCompleted( PartyBeaconID_t ulBeacon, CSteamID steamIDUser ) = 0; + + // To cancel a reservation (due to timeout or user input), call this. + // Steam will open a new reservation slot. + // Note: The user may already be in-flight to your game, so it's possible they will still connect and try to join your party. + virtual void CancelReservation( PartyBeaconID_t ulBeacon, CSteamID steamIDUser ) = 0; + + // Change the number of open beacon reservation slots. + // Call this if, for example, someone without a reservation joins your party (eg a friend, or via your own matchmaking system). + STEAM_CALL_RESULT( ChangeNumOpenSlotsCallback_t ) + virtual SteamAPICall_t ChangeNumOpenSlots( PartyBeaconID_t ulBeacon, uint32 unOpenSlots ) = 0; + + // Turn off the beacon. + virtual bool DestroyBeacon( PartyBeaconID_t ulBeacon ) = 0; + + // Utils + virtual bool GetBeaconLocationData( SteamPartyBeaconLocation_t BeaconLocation, ESteamPartyBeaconLocationData eData, STEAM_OUT_STRING_COUNT(cchDataStringOut) char *pchDataStringOut, int cchDataStringOut ) = 0; + +}; +#define STEAMPARTIES_INTERFACE_VERSION "SteamParties002" + +// Global interface accessor +inline ISteamParties *SteamParties(); +STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamParties *, SteamParties, STEAMPARTIES_INTERFACE_VERSION ); + + +//----------------------------------------------------------------------------- +// Callbacks for ISteamMatchmaking (which go through the regular Steam callback registration system) + //----------------------------------------------------------------------------- // Purpose: a server was added/removed from the favorites list, you should refresh now //----------------------------------------------------------------------------- @@ -745,6 +915,171 @@ struct FavoritesListAccountsUpdated_t EResult m_eResult; }; + + +//----------------------------------------------------------------------------- +// Callbacks for ISteamGameSearch (which go through the regular Steam callback registration system) + +struct SearchForGameProgressCallback_t +{ + enum { k_iCallback = k_iSteamGameSearchCallbacks + 1 }; + + uint64 m_ullSearchID; // all future callbacks referencing this search will include this Search ID + + EResult m_eResult; // if search has started this result will be k_EResultOK, any other value indicates search has failed to start or has terminated + CSteamID m_lobbyID; // lobby ID if lobby search, invalid steamID otherwise + CSteamID m_steamIDEndedSearch; // if search was terminated, steamID that terminated search + + int32 m_nSecondsRemainingEstimate; + int32 m_cPlayersSearching; +}; + +// notification to all players searching that a game has been found +struct SearchForGameResultCallback_t +{ + enum { k_iCallback = k_iSteamGameSearchCallbacks + 2 }; + + uint64 m_ullSearchID; + + EResult m_eResult; // if game/host was lost this will be an error value + + // if m_bGameFound is true the following are non-zero + int32 m_nCountPlayersInGame; + int32 m_nCountAcceptedGame; + // if m_steamIDHost is valid the host has started the game + CSteamID m_steamIDHost; + bool m_bFinalCallback; +}; + + +//----------------------------------------------------------------------------- +// ISteamGameSearch : Game Host API callbacks + +// callback from RequestPlayersForGame when the matchmaking service has started or ended search +// callback will also follow a call from CancelRequestPlayersForGame - m_bSearchInProgress will be false +struct RequestPlayersForGameProgressCallback_t +{ + enum { k_iCallback = k_iSteamGameSearchCallbacks + 11 }; + + EResult m_eResult; // m_ullSearchID will be non-zero if this is k_EResultOK + uint64 m_ullSearchID; // all future callbacks referencing this search will include this Search ID +}; + +// callback from RequestPlayersForGame +// one of these will be sent per player +// followed by additional callbacks when players accept or decline the game +struct RequestPlayersForGameResultCallback_t +{ + enum { k_iCallback = k_iSteamGameSearchCallbacks + 12 }; + + EResult m_eResult; // m_ullSearchID will be non-zero if this is k_EResultOK + uint64 m_ullSearchID; + + CSteamID m_SteamIDPlayerFound; // player steamID + CSteamID m_SteamIDLobby; // if the player is in a lobby, the lobby ID + enum PlayerAcceptState_t + { + k_EStateUnknown = 0, + k_EStatePlayerAccepted = 1, + k_EStatePlayerDeclined = 2, + }; + PlayerAcceptState_t m_ePlayerAcceptState; + int32 m_nPlayerIndex; + int32 m_nTotalPlayersFound; // expect this many callbacks at minimum + int32 m_nTotalPlayersAcceptedGame; + int32 m_nSuggestedTeamIndex; + uint64 m_ullUniqueGameID; +}; + + +struct RequestPlayersForGameFinalResultCallback_t +{ + enum { k_iCallback = k_iSteamGameSearchCallbacks + 13 }; + + EResult m_eResult; + uint64 m_ullSearchID; + uint64 m_ullUniqueGameID; +}; + + + +// this callback confirms that results were received by the matchmaking service for this player +struct SubmitPlayerResultResultCallback_t +{ + enum { k_iCallback = k_iSteamGameSearchCallbacks + 14 }; + + EResult m_eResult; + uint64 ullUniqueGameID; + CSteamID steamIDPlayer; +}; + + +// this callback confirms that the game is recorded as complete on the matchmaking service +// the next call to RequestPlayersForGame will generate a new unique game ID +struct EndGameResultCallback_t +{ + enum { k_iCallback = k_iSteamGameSearchCallbacks + 15 }; + + EResult m_eResult; + uint64 ullUniqueGameID; +}; + + +// Steam has responded to the user request to join a party via the given Beacon ID. +// If successful, the connect string contains game-specific instructions to connect +// to the game with that party. +struct JoinPartyCallback_t +{ + enum { k_iCallback = k_iSteamPartiesCallbacks + 1 }; + + EResult m_eResult; + PartyBeaconID_t m_ulBeaconID; + CSteamID m_SteamIDBeaconOwner; + char m_rgchConnectString[256]; +}; + +// Response to CreateBeacon request. If successful, the beacon ID is provided. +struct CreateBeaconCallback_t +{ + enum { k_iCallback = k_iSteamPartiesCallbacks + 2 }; + + EResult m_eResult; + PartyBeaconID_t m_ulBeaconID; +}; + +// Someone has used the beacon to join your party - they are in-flight now +// and we've reserved one of the open slots for them. +// You should confirm when they join your party by calling OnReservationCompleted(). +// Otherwise, Steam may timeout their reservation eventually. +struct ReservationNotificationCallback_t +{ + enum { k_iCallback = k_iSteamPartiesCallbacks + 3 }; + + PartyBeaconID_t m_ulBeaconID; + CSteamID m_steamIDJoiner; +}; + +// Response to ChangeNumOpenSlots call +struct ChangeNumOpenSlotsCallback_t +{ + enum { k_iCallback = k_iSteamPartiesCallbacks + 4 }; + + EResult m_eResult; +}; + +// The list of possible Party beacon locations has changed +struct AvailableBeaconLocationsUpdated_t +{ + enum { k_iCallback = k_iSteamPartiesCallbacks + 5 }; +}; + +// The list of active beacons may have changed +struct ActiveBeaconsUpdated_t +{ + enum { k_iCallback = k_iSteamPartiesCallbacks + 6 }; +}; + + #pragma pack( pop ) diff --git a/Generator/steam_sdk/isteammusic.h b/Generator/steam_sdk/isteammusic.h index 779a4c2..ffa49a0 100644 --- a/Generator/steam_sdk/isteammusic.h +++ b/Generator/steam_sdk/isteammusic.h @@ -6,7 +6,7 @@ #pragma once #endif -#include "isteamclient.h" +#include "steam_api_common.h" //----------------------------------------------------------------------------- // Purpose: @@ -44,22 +44,26 @@ public: #define STEAMMUSIC_INTERFACE_VERSION "STEAMMUSIC_INTERFACE_VERSION001" +// Global interface accessor +inline ISteamMusic *SteamMusic(); +STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamMusic *, SteamMusic, STEAMMUSIC_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 isteamclient.h must be included +#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx #endif -DEFINE_CALLBACK( PlaybackStatusHasChanged_t, k_iSteamMusicCallbacks + 1 ) -END_DEFINE_CALLBACK_0() +STEAM_CALLBACK_BEGIN( PlaybackStatusHasChanged_t, k_iSteamMusicCallbacks + 1 ) +STEAM_CALLBACK_END(0) -DEFINE_CALLBACK( VolumeHasChanged_t, k_iSteamMusicCallbacks + 2 ) - CALLBACK_MEMBER( 0, float, m_flNewVolume ) -END_DEFINE_CALLBACK_1() +STEAM_CALLBACK_BEGIN( VolumeHasChanged_t, k_iSteamMusicCallbacks + 2 ) + STEAM_CALLBACK_MEMBER( 0, float, m_flNewVolume ) +STEAM_CALLBACK_END(1) #pragma pack( pop ) diff --git a/Generator/steam_sdk/isteammusicremote.h b/Generator/steam_sdk/isteammusicremote.h index ea29a7d..a36f4f8 100644 --- a/Generator/steam_sdk/isteammusicremote.h +++ b/Generator/steam_sdk/isteammusicremote.h @@ -6,7 +6,7 @@ #pragma once #endif -#include "isteamclient.h" +#include "steam_api_common.h" #include "isteammusic.h" #define k_SteamMusicNameMaxLength 255 @@ -64,63 +64,67 @@ public: #define STEAMMUSICREMOTE_INTERFACE_VERSION "STEAMMUSICREMOTE_INTERFACE_VERSION001" +// Global interface accessor +inline ISteamMusicRemote *SteamMusicRemote(); +STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamMusicRemote *, SteamMusicRemote, STEAMMUSICREMOTE_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 isteamclient.h must be included +#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx #endif -DEFINE_CALLBACK( MusicPlayerRemoteWillActivate_t, k_iSteamMusicRemoteCallbacks + 1) -END_DEFINE_CALLBACK_0() +STEAM_CALLBACK_BEGIN( MusicPlayerRemoteWillActivate_t, k_iSteamMusicRemoteCallbacks + 1) +STEAM_CALLBACK_END(0) -DEFINE_CALLBACK( MusicPlayerRemoteWillDeactivate_t, k_iSteamMusicRemoteCallbacks + 2 ) -END_DEFINE_CALLBACK_0() +STEAM_CALLBACK_BEGIN( MusicPlayerRemoteWillDeactivate_t, k_iSteamMusicRemoteCallbacks + 2 ) +STEAM_CALLBACK_END(0) -DEFINE_CALLBACK( MusicPlayerRemoteToFront_t, k_iSteamMusicRemoteCallbacks + 3 ) -END_DEFINE_CALLBACK_0() +STEAM_CALLBACK_BEGIN( MusicPlayerRemoteToFront_t, k_iSteamMusicRemoteCallbacks + 3 ) +STEAM_CALLBACK_END(0) -DEFINE_CALLBACK( MusicPlayerWillQuit_t, k_iSteamMusicRemoteCallbacks + 4 ) -END_DEFINE_CALLBACK_0() +STEAM_CALLBACK_BEGIN( MusicPlayerWillQuit_t, k_iSteamMusicRemoteCallbacks + 4 ) +STEAM_CALLBACK_END(0) -DEFINE_CALLBACK( MusicPlayerWantsPlay_t, k_iSteamMusicRemoteCallbacks + 5 ) -END_DEFINE_CALLBACK_0() +STEAM_CALLBACK_BEGIN( MusicPlayerWantsPlay_t, k_iSteamMusicRemoteCallbacks + 5 ) +STEAM_CALLBACK_END(0) -DEFINE_CALLBACK( MusicPlayerWantsPause_t, k_iSteamMusicRemoteCallbacks + 6 ) -END_DEFINE_CALLBACK_0() +STEAM_CALLBACK_BEGIN( MusicPlayerWantsPause_t, k_iSteamMusicRemoteCallbacks + 6 ) +STEAM_CALLBACK_END(0) -DEFINE_CALLBACK( MusicPlayerWantsPlayPrevious_t, k_iSteamMusicRemoteCallbacks + 7 ) -END_DEFINE_CALLBACK_0() +STEAM_CALLBACK_BEGIN( MusicPlayerWantsPlayPrevious_t, k_iSteamMusicRemoteCallbacks + 7 ) +STEAM_CALLBACK_END(0) -DEFINE_CALLBACK( MusicPlayerWantsPlayNext_t, k_iSteamMusicRemoteCallbacks + 8 ) -END_DEFINE_CALLBACK_0() +STEAM_CALLBACK_BEGIN( MusicPlayerWantsPlayNext_t, k_iSteamMusicRemoteCallbacks + 8 ) +STEAM_CALLBACK_END(0) -DEFINE_CALLBACK( MusicPlayerWantsShuffled_t, k_iSteamMusicRemoteCallbacks + 9 ) - CALLBACK_MEMBER( 0, bool, m_bShuffled ) -END_DEFINE_CALLBACK_1() +STEAM_CALLBACK_BEGIN( MusicPlayerWantsShuffled_t, k_iSteamMusicRemoteCallbacks + 9 ) + STEAM_CALLBACK_MEMBER( 0, bool, m_bShuffled ) +STEAM_CALLBACK_END(1) -DEFINE_CALLBACK( MusicPlayerWantsLooped_t, k_iSteamMusicRemoteCallbacks + 10 ) - CALLBACK_MEMBER(0, bool, m_bLooped ) -END_DEFINE_CALLBACK_1() +STEAM_CALLBACK_BEGIN( MusicPlayerWantsLooped_t, k_iSteamMusicRemoteCallbacks + 10 ) + STEAM_CALLBACK_MEMBER(0, bool, m_bLooped ) +STEAM_CALLBACK_END(1) -DEFINE_CALLBACK( MusicPlayerWantsVolume_t, k_iSteamMusicCallbacks + 11 ) - CALLBACK_MEMBER(0, float, m_flNewVolume) -END_DEFINE_CALLBACK_1() +STEAM_CALLBACK_BEGIN( MusicPlayerWantsVolume_t, k_iSteamMusicCallbacks + 11 ) + STEAM_CALLBACK_MEMBER(0, float, m_flNewVolume) +STEAM_CALLBACK_END(1) -DEFINE_CALLBACK( MusicPlayerSelectsQueueEntry_t, k_iSteamMusicCallbacks + 12 ) - CALLBACK_MEMBER(0, int, nID ) -END_DEFINE_CALLBACK_1() +STEAM_CALLBACK_BEGIN( MusicPlayerSelectsQueueEntry_t, k_iSteamMusicCallbacks + 12 ) + STEAM_CALLBACK_MEMBER(0, int, nID ) +STEAM_CALLBACK_END(1) -DEFINE_CALLBACK( MusicPlayerSelectsPlaylistEntry_t, k_iSteamMusicCallbacks + 13 ) - CALLBACK_MEMBER(0, int, nID ) -END_DEFINE_CALLBACK_1() +STEAM_CALLBACK_BEGIN( MusicPlayerSelectsPlaylistEntry_t, k_iSteamMusicCallbacks + 13 ) + STEAM_CALLBACK_MEMBER(0, int, nID ) +STEAM_CALLBACK_END(1) -DEFINE_CALLBACK( MusicPlayerWantsPlayingRepeatStatus_t, k_iSteamMusicRemoteCallbacks + 14 ) - CALLBACK_MEMBER(0, int, m_nPlayingRepeatStatus ) -END_DEFINE_CALLBACK_1() +STEAM_CALLBACK_BEGIN( MusicPlayerWantsPlayingRepeatStatus_t, k_iSteamMusicRemoteCallbacks + 14 ) + STEAM_CALLBACK_MEMBER(0, int, m_nPlayingRepeatStatus ) +STEAM_CALLBACK_END(1) #pragma pack( pop ) diff --git a/Generator/steam_sdk/isteamnetworking.h b/Generator/steam_sdk/isteamnetworking.h index 8f70819..b1bf5fa 100644 --- a/Generator/steam_sdk/isteamnetworking.h +++ b/Generator/steam_sdk/isteamnetworking.h @@ -10,9 +10,7 @@ #pragma once #endif -#include "steamtypes.h" -#include "steamclientpublic.h" - +#include "steam_api_common.h" // list of possible errors returned by SendP2PPacket() API // these will be posted in the P2PSessionConnectFail_t callback @@ -63,7 +61,7 @@ enum EP2PSend #elif defined( VALVE_CALLBACK_PACK_LARGE ) #pragma pack( push, 8 ) #else -#error isteamclient.h must be included +#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx #endif struct P2PSessionState_t { @@ -127,8 +125,14 @@ class ISteamNetworking { public: //////////////////////////////////////////////////////////////////////////////////////////// - // Session-less connection functions - // automatically establishes NAT-traversing or Relay server connections + // + // UDP-style (connectionless) networking interface. These functions send messages using + // an API organized around the destination. Reliable and unreliable messages are supported. + // + // For a more TCP-style interface (meaning you have a connection handle), see the functions below. + // Both interface styles can send both reliable and unreliable messages. + // + // Automatically establishes NAT-traversing or Relay server connections // Sends a P2P packet to the specified user // UDP-like, unreliable and a max packet size of 1200 bytes @@ -181,11 +185,18 @@ public: //////////////////////////////////////////////////////////////////////////////////////////// - // LISTEN / CONNECT style interface functions // - // This is an older set of functions designed around the Berkeley TCP sockets model - // it's preferential that you use the above P2P functions, they're more robust - // and these older functions will be removed eventually + // LISTEN / CONNECT connection-oriented interface functions + // + // These functions are more like a client-server TCP API. One side is the "server" + // and "listens" for incoming connections, which then must be "accepted." The "client" + // initiates a connection by "connecting." Sending and receiving is done through a + // connection handle. + // + // For a more UDP-style interface, where you do not track connection handles but + // simply send messages to a SteamID, use the UDP-style functions above. + // + // Both methods can send both reliable and unreliable methods. // //////////////////////////////////////////////////////////////////////////////////////////// @@ -261,13 +272,21 @@ public: }; #define STEAMNETWORKING_INTERFACE_VERSION "SteamNetworking005" +// Global interface accessor +inline ISteamNetworking *SteamNetworking(); +STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamNetworking *, SteamNetworking, STEAMNETWORKING_INTERFACE_VERSION ); + +// Global accessor for the gameserver client +inline ISteamNetworking *SteamGameServerNetworking(); +STEAM_DEFINE_GAMESERVER_INTERFACE_ACCESSOR( ISteamNetworking *, SteamGameServerNetworking, STEAMNETWORKING_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 isteamclient.h must be included +#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx #endif // callback notification - a user wants to talk to us over the P2P channel via the SendP2PPacket() API diff --git a/Generator/steam_sdk/isteamnetworkingsockets.h b/Generator/steam_sdk/isteamnetworkingsockets.h new file mode 100644 index 0000000..e12e5e7 --- /dev/null +++ b/Generator/steam_sdk/isteamnetworkingsockets.h @@ -0,0 +1,489 @@ +//====== Copyright Valve Corporation, All rights reserved. ==================== +// +// Networking API similar to Berkeley sockets, but for games. +// - connection-oriented API (like TCP, not UDP) +// - but unlike TCP, it's message-oriented, not stream-oriented +// - mix of reliable and unreliable messages +// - fragmentation and reassembly +// - Supports connectivity over plain UDPv4 +// - Also supports SDR ("Steam Datagram Relay") connections, which are +// addressed by SteamID. There is a "P2P" use case and also a "hosted +// dedicated server" use case. +// +//============================================================================= + +#ifndef ISTEAMNETWORKINGSOCKETS +#define ISTEAMNETWORKINGSOCKETS +#ifdef _WIN32 +#pragma once +#endif + +#include "steamnetworkingtypes.h" + +class ISteamNetworkingSocketsCallbacks; + +//----------------------------------------------------------------------------- +/// Lower level networking interface that more closely mirrors the standard +/// Berkeley sockets model. Sockets are hard! You should probably only use +/// this interface under the existing circumstances: +/// +/// - You have an existing socket-based codebase you want to port, or coexist with. +/// - You want to be able to connect based on IP address, rather than (just) Steam ID. +/// - You need low-level control of bandwidth utilization, when to drop packets, etc. +/// +/// Note that neither of the terms "connection" and "socket" will correspond +/// one-to-one with an underlying UDP socket. An attempt has been made to +/// keep the semantics as similar to the standard socket model when appropriate, +/// but some deviations do exist. +class ISteamNetworkingSockets +{ +public: + + /// Creates a "server" socket that listens for clients to connect to by + /// calling ConnectByIPAddress, over ordinary UDP (IPv4 or IPv6) + /// + /// You must select a specific local port to listen on and set it + /// the port field of the local address. + /// + /// Usually you wil set the IP portion of the address to zero, (SteamNetworkingIPAddr::Clear()). + /// This means that you will not bind to any particular local interface. In addition, + /// if possible the socket will be bound in "dual stack" mode, which means that it can + /// accept both IPv4 and IPv6 clients. If you wish to bind a particular interface, then + /// set the local address to the appropriate IPv4 or IPv6 IP. + /// + /// When a client attempts to connect, a SteamNetConnectionStatusChangedCallback_t + /// will be posted. The connection will be in the connecting state. + virtual HSteamListenSocket CreateListenSocketIP( const SteamNetworkingIPAddr &localAddress ) = 0; + + /// Creates a connection and begins talking to a "server" over UDP at the + /// given IPv4 or IPv6 address. The remote host must be listening with a + /// matching call to CreateListenSocketIP on the specified port. + /// + /// A SteamNetConnectionStatusChangedCallback_t callback will be triggered when we start + /// connecting, and then another one on either timeout or successful connection. + /// + /// If the server does not have any identity configured, then their network address + /// will be the only identity in use. Or, the network host may provide a platform-specific + /// identity with or without a valid certificate to authenticate that identity. (These + /// details will be contained in the SteamNetConnectionStatusChangedCallback_t.) It's + /// up to your application to decide whether to allow the connection. + /// + /// By default, all connections will get basic encryption sufficient to prevent + /// casual eavesdropping. But note that without certificates (or a shared secret + /// distributed through some other out-of-band mechanism), you don't have any + /// way of knowing who is actually on the other end, and thus are vulnerable to + /// man-in-the-middle attacks. + virtual HSteamNetConnection ConnectByIPAddress( const SteamNetworkingIPAddr &address ) = 0; + +#ifdef STEAMNETWORKINGSOCKETS_ENABLE_SDR + /// Like CreateListenSocketIP, but clients will connect using ConnectP2P + /// + /// nVirtualPort specifies how clients can connect to this socket using + /// ConnectP2P. It's very common for applications to only have one listening socket; + /// in that case, use zero. If you need to open multiple listen sockets and have clients + /// be able to connect to one or the other, then nVirtualPort should be a small integer (<1000) + /// unique to each listen socket you create. + /// + /// If you use this, you probably want to call ISteamNetworkingUtils::InitializeRelayNetworkAccess() + /// when your app initializes + virtual HSteamListenSocket CreateListenSocketP2P( int nVirtualPort ) = 0; + + /// Begin connecting to a server that is identified using a platform-specific identifier. + /// This requires some sort of third party rendezvous service, and will depend on the + /// platform and what other libraries and services you are integrating with. + /// + /// At the time of this writing, there is only one supported rendezvous service: Steam. + /// Set the SteamID (whether "user" or "gameserver") and Steam will determine if the + /// client is online and facilitate a relay connection. Note that all P2P connections on + /// Steam are currently relayed. + /// + /// If you use this, you probably want to call ISteamNetworkingUtils::InitializeRelayNetworkAccess() + /// when your app initializes + virtual HSteamNetConnection ConnectP2P( const SteamNetworkingIdentity &identityRemote, int nVirtualPort ) = 0; +#endif + + /// Accept an incoming connection that has been received on a listen socket. + /// + /// When a connection attempt is received (perhaps after a few basic handshake + /// packets have been exchanged to prevent trivial spoofing), a connection interface + /// object is created in the k_ESteamNetworkingConnectionState_Connecting state + /// and a SteamNetConnectionStatusChangedCallback_t is posted. At this point, your + /// application MUST either accept or close the connection. (It may not ignore it.) + /// Accepting the connection will transition it either into the connected state, + /// or the finding route state, depending on the connection type. + /// + /// You should take action within a second or two, because accepting the connection is + /// what actually sends the reply notifying the client that they are connected. If you + /// delay taking action, from the client's perspective it is the same as the network + /// being unresponsive, and the client may timeout the connection attempt. In other + /// words, the client cannot distinguish between a delay caused by network problems + /// and a delay caused by the application. + /// + /// This means that if your application goes for more than a few seconds without + /// processing callbacks (for example, while loading a map), then there is a chance + /// that a client may attempt to connect in that interval and fail due to timeout. + /// + /// If the application does not respond to the connection attempt in a timely manner, + /// and we stop receiving communication from the client, the connection attempt will + /// be timed out locally, transitioning the connection to the + /// k_ESteamNetworkingConnectionState_ProblemDetectedLocally state. The client may also + /// close the connection before it is accepted, and a transition to the + /// k_ESteamNetworkingConnectionState_ClosedByPeer is also possible depending the exact + /// sequence of events. + /// + /// Returns k_EResultInvalidParam if the handle is invalid. + /// Returns k_EResultInvalidState if the connection is not in the appropriate state. + /// (Remember that the connection state could change in between the time that the + /// notification being posted to the queue and when it is received by the application.) + virtual EResult AcceptConnection( HSteamNetConnection hConn ) = 0; + + /// Disconnects from the remote host and invalidates the connection handle. + /// Any unread data on the connection is discarded. + /// + /// nReason is an application defined code that will be received on the other + /// end and recorded (when possible) in backend analytics. The value should + /// come from a restricted range. (See ESteamNetConnectionEnd.) If you don't need + /// to communicate any information to the remote host, and do not want analytics to + /// be able to distinguish "normal" connection terminations from "exceptional" ones, + /// You may pass zero, in which case the generic value of + /// k_ESteamNetConnectionEnd_App_Generic will be used. + /// + /// pszDebug is an optional human-readable diagnostic string that will be received + /// by the remote host and recorded (when possible) in backend analytics. + /// + /// If you wish to put the socket into a "linger" state, where an attempt is made to + /// flush any remaining sent data, use bEnableLinger=true. Otherwise reliable data + /// is not flushed. + /// + /// If the connection has already ended and you are just freeing up the + /// connection interface, the reason code, debug string, and linger flag are + /// ignored. + virtual bool CloseConnection( HSteamNetConnection hPeer, int nReason, const char *pszDebug, bool bEnableLinger ) = 0; + + /// Destroy a listen socket. All the connections that were accepting on the listen + /// socket are closed ungracefully. + virtual bool CloseListenSocket( HSteamListenSocket hSocket ) = 0; + + /// Set connection user data. the data is returned in the following places + /// - You can query it using GetConnectionUserData. + /// - The SteamNetworkingmessage_t structure. + /// - The SteamNetConnectionInfo_t structure. (Which is a member of SteamNetConnectionStatusChangedCallback_t.) + /// + /// Returns false if the handle is invalid. + virtual bool SetConnectionUserData( HSteamNetConnection hPeer, int64 nUserData ) = 0; + + /// Fetch connection user data. Returns -1 if handle is invalid + /// or if you haven't set any userdata on the connection. + virtual int64 GetConnectionUserData( HSteamNetConnection hPeer ) = 0; + + /// Set a name for the connection, used mostly for debugging + virtual void SetConnectionName( HSteamNetConnection hPeer, const char *pszName ) = 0; + + /// Fetch connection name. Returns false if handle is invalid + virtual bool GetConnectionName( HSteamNetConnection hPeer, char *pszName, int nMaxLen ) = 0; + + /// Send a message to the remote host on the specified connection. + /// + /// nSendFlags determines the delivery guarantees that will be provided, + /// when data should be buffered, etc. E.g. k_nSteamNetworkingSend_Unreliable + /// + /// Note that the semantics we use for messages are not precisely + /// the same as the semantics of a standard "stream" socket. + /// (SOCK_STREAM) For an ordinary stream socket, the boundaries + /// between chunks are not considered relevant, and the sizes of + /// the chunks of data written will not necessarily match up to + /// the sizes of the chunks that are returned by the reads on + /// the other end. The remote host might read a partial chunk, + /// or chunks might be coalesced. For the message semantics + /// used here, however, the sizes WILL match. Each send call + /// will match a successful read call on the remote host + /// one-for-one. If you are porting existing stream-oriented + /// code to the semantics of reliable messages, your code should + /// work the same, since reliable message semantics are more + /// strict than stream semantics. The only caveat is related to + /// performance: there is per-message overhead to retain the + /// message sizes, and so if your code sends many small chunks + /// of data, performance will suffer. Any code based on stream + /// sockets that does not write excessively small chunks will + /// work without any changes. + /// + /// Returns: + /// - k_EResultInvalidParam: invalid connection handle, or the individual message is too big. + /// (See k_cbMaxSteamNetworkingSocketsMessageSizeSend) + /// - k_EResultInvalidState: connection is in an invalid state + /// - k_EResultNoConnection: connection has ended + /// - k_EResultIgnored: You used k_nSteamNetworkingSend_NoDelay, and the message was dropped because + /// we were not ready to send it. + /// - k_EResultLimitExceeded: there was already too much data queued to be sent. + /// (See k_ESteamNetworkingConfig_SendBufferSize) + virtual EResult SendMessageToConnection( HSteamNetConnection hConn, const void *pData, uint32 cbData, int nSendFlags ) = 0; + + /// Flush any messages waiting on the Nagle timer and send them + /// at the next transmission opportunity (often that means right now). + /// + /// If Nagle is enabled (it's on by default) then when calling + /// SendMessageToConnection the message will be buffered, up to the Nagle time + /// before being sent, to merge small messages into the same packet. + /// (See k_ESteamNetworkingConfig_NagleTime) + /// + /// Returns: + /// k_EResultInvalidParam: invalid connection handle + /// k_EResultInvalidState: connection is in an invalid state + /// k_EResultNoConnection: connection has ended + /// k_EResultIgnored: We weren't (yet) connected, so this operation has no effect. + virtual EResult FlushMessagesOnConnection( HSteamNetConnection hConn ) = 0; + + /// Fetch the next available message(s) from the connection, if any. + /// Returns the number of messages returned into your array, up to nMaxMessages. + /// If the connection handle is invalid, -1 is returned. + /// + /// The order of the messages returned in the array is relevant. + /// Reliable messages will be received in the order they were sent (and with the + /// same sizes --- see SendMessageToConnection for on this subtle difference from a stream socket). + /// + /// Unreliable messages may be dropped, or delivered out of order withrespect to + /// each other or with respect to reliable messages. The same unreliable message + /// may be received multiple times. + /// + /// If any messages are returned, you MUST call SteamNetworkingMessage_t::Release() on each + /// of them free up resources after you are done. It is safe to keep the object alive for + /// a little while (put it into some queue, etc), and you may call Release() from any thread. + virtual int ReceiveMessagesOnConnection( HSteamNetConnection hConn, SteamNetworkingMessage_t **ppOutMessages, int nMaxMessages ) = 0; + + /// Same as ReceiveMessagesOnConnection, but will return the next message available + /// on any connection that was accepted through the specified listen socket. Examine + /// SteamNetworkingMessage_t::m_conn to know which client connection. + /// + /// Delivery order of messages among different clients is not defined. They may + /// be returned in an order different from what they were actually received. (Delivery + /// order of messages from the same client is well defined, and thus the order of the + /// messages is relevant!) + virtual int ReceiveMessagesOnListenSocket( HSteamListenSocket hSocket, SteamNetworkingMessage_t **ppOutMessages, int nMaxMessages ) = 0; + + /// Returns basic information about the high-level state of the connection. + virtual bool GetConnectionInfo( HSteamNetConnection hConn, SteamNetConnectionInfo_t *pInfo ) = 0; + + /// Returns a small set of information about the real-time state of the connection + /// Returns false if the connection handle is invalid, or the connection has ended. + virtual bool GetQuickConnectionStatus( HSteamNetConnection hConn, SteamNetworkingQuickConnectionStatus *pStats ) = 0; + + /// Returns detailed connection stats in text format. Useful + /// for dumping to a log, etc. + /// + /// Returns: + /// -1 failure (bad connection handle) + /// 0 OK, your buffer was filled in and '\0'-terminated + /// >0 Your buffer was either nullptr, or it was too small and the text got truncated. + /// Try again with a buffer of at least N bytes. + virtual int GetDetailedConnectionStatus( HSteamNetConnection hConn, char *pszBuf, int cbBuf ) = 0; + + /// Returns local IP and port that a listen socket created using CreateListenSocketIP is bound to. + /// + /// An IPv6 address of ::0 means "any IPv4 or IPv6" + /// An IPv6 address of ::ffff:0000:0000 means "any IPv4" + virtual bool GetListenSocketAddress( HSteamListenSocket hSocket, SteamNetworkingIPAddr *address ) = 0; + + /// Create a pair of connections that are talking to each other, e.g. a loopback connection. + /// This is very useful for testing, or so that your client/server code can work the same + /// even when you are running a local "server". + /// + /// The two connections will immediately be placed into the connected state, and no callbacks + /// will be posted immediately. After this, if you close either connection, the other connection + /// will receive a callback, exactly as if they were communicating over the network. You must + /// close *both* sides in order to fully clean up the resources! + /// + /// By default, internal buffers are used, completely bypassing the network, the chopping up of + /// messages into packets, encryption, copying the payload, etc. This means that loopback + /// packets, by default, will not simulate lag or loss. Passing true for bUseNetworkLoopback will + /// cause the socket pair to send packets through the local network loopback device (127.0.0.1) + /// on ephemeral ports. Fake lag and loss are supported in this case, and CPU time is expended + /// to encrypt and decrypt. + /// + /// If you wish to assign a specific identity to either connection, you may pass a particular + /// identity. Otherwise, if you pass nullptr, the respective connection will assume a generic + /// "localhost" identity. If you use real network loopback, this might be translated to the + /// actual bound loopback port. Otherwise, the port will be zero. + virtual bool CreateSocketPair( HSteamNetConnection *pOutConnection1, HSteamNetConnection *pOutConnection2, bool bUseNetworkLoopback, const SteamNetworkingIdentity *pIdentity1, const SteamNetworkingIdentity *pIdentity2 ) = 0; + + /// Get the identity assigned to this interface. + /// E.g. on Steam, this is the user's SteamID, or for the gameserver interface, the SteamID assigned + /// to the gameserver. Returns false and sets the result to an invalid identity if we don't know + /// our identity yet. (E.g. GameServer has not logged in. On Steam, the user will know their SteamID + /// even if they are not signed into Steam.) + virtual bool GetIdentity( SteamNetworkingIdentity *pIdentity ) = 0; + +#ifdef STEAMNETWORKINGSOCKETS_ENABLE_SDR + + // + // Clients connecting to dedicated servers hosted in a data center, + // using central-authority-granted tickets. + // + + /// Call this when you receive a ticket from your backend / matchmaking system. Puts the + /// ticket into a persistent cache, and optionally returns the parsed ticket. + /// + /// See stamdatagram_ticketgen.h for more details. + virtual bool ReceivedRelayAuthTicket( const void *pvTicket, int cbTicket, SteamDatagramRelayAuthTicket *pOutParsedTicket ) = 0; + + /// Search cache for a ticket to talk to the server on the specified virtual port. + /// If found, returns the number of seconds until the ticket expires, and optionally + /// the complete cracked ticket. Returns 0 if we don't have a ticket. + /// + /// Typically this is useful just to confirm that you have a ticket, before you + /// call ConnectToHostedDedicatedServer to connect to the server. + virtual int FindRelayAuthTicketForServer( const SteamNetworkingIdentity &identityGameServer, int nVirtualPort, SteamDatagramRelayAuthTicket *pOutParsedTicket ) = 0; + + /// Client call to connect to a server hosted in a Valve data center, on the specified virtual + /// port. You must have placed a ticket for this server into the cache, or else this connect attempt will fail! + /// + /// You may wonder why tickets are stored in a cache, instead of simply being passed as an argument + /// here. The reason is to make reconnection to a gameserver robust, even if the client computer loses + /// connection to Steam or the central backend, or the app is restarted or crashes, etc. + /// + /// If you use this, you probably want to call ISteamNetworkingUtils::InitializeRelayNetworkAccess() + /// when your app initializes + virtual HSteamNetConnection ConnectToHostedDedicatedServer( const SteamNetworkingIdentity &identityTarget, int nVirtualPort ) = 0; + + // + // Servers hosted in Valve data centers + // + + /// Returns the value of the SDR_LISTEN_PORT environment variable. This + /// is the UDP server your server will be listening on. This will + /// configured automatically for you in production environments. (You + /// should set it yourself for testing.) + virtual uint16 GetHostedDedicatedServerPort() = 0; + + /// If you are running in a production data center, this will return the data + /// center code. Returns 0 otherwise. + virtual SteamNetworkingPOPID GetHostedDedicatedServerPOPID() = 0; + + /// Return info about the hosted server. You will need to send this information to your + /// backend, and put it in tickets, so that the relays will know how to forward traffic from + /// clients to your server. See SteamDatagramRelayAuthTicket for more info. + /// + /// NOTE ABOUT DEVELOPMENT ENVIRONMENTS: + /// In production in our data centers, these parameters are configured via environment variables. + /// In development, the only one you need to set is SDR_LISTEN_PORT, which is the local port you + /// want to listen on. Furthermore, if you are running your server behind a corporate firewall, + /// you probably will not be able to put the routing information returned by this function into + /// tickets. Instead, it should be a public internet address that the relays can use to send + /// data to your server. So you might just end up hardcoding a public address and setup port + /// forwarding on your corporate firewall. In that case, the port you put into the ticket + /// needs to be the public-facing port opened on your firewall, if it is different from the + /// actual server port. + /// + /// This function will fail if SteamDatagramServer_Init has not been called. + /// + /// Returns false if the SDR_LISTEN_PORT environment variable is not set. + virtual bool GetHostedDedicatedServerAddress( SteamDatagramHostedAddress *pRouting ) = 0; + + /// Create a listen socket on the specified virtual port. The physical UDP port to use + /// will be determined by the SDR_LISTEN_PORT environment variable. If a UDP port is not + /// configured, this call will fail. + /// + /// Note that this call MUST be made through the SteamGameServerNetworkingSockets() interface + virtual HSteamListenSocket CreateHostedDedicatedServerListenSocket( int nVirtualPort ) = 0; + +#endif // #ifndef STEAMNETWORKINGSOCKETS_ENABLE_SDR + + // Invoke all callbacks queued for this interface. + // On Steam, callbacks are dispatched via the ordinary Steamworks callbacks mechanism. + // So if you have code that is also targeting Steam, you should call this at about the + // same time you would call SteamAPI_RunCallbacks and SteamGameServer_RunCallbacks. +#ifdef STEAMNETWORKINGSOCKETS_STANDALONELIB + virtual void RunCallbacks( ISteamNetworkingSocketsCallbacks *pCallbacks ) = 0; +#endif +protected: + ~ISteamNetworkingSockets(); // Silence some warnings +}; +#define STEAMNETWORKINGSOCKETS_INTERFACE_VERSION "SteamNetworkingSockets002" + +extern "C" { + +// Global accessor. +#if defined( STEAMNETWORKINGSOCKETS_PARTNER ) + + // Standalone lib. Use different symbol name, so that we can dynamically switch between steamclient.dll + // and the standalone lib + STEAMNETWORKINGSOCKETS_INTERFACE ISteamNetworkingSockets *SteamNetworkingSockets_Lib(); + STEAMNETWORKINGSOCKETS_INTERFACE ISteamNetworkingSockets *SteamGameServerNetworkingSockets_Lib(); + inline ISteamNetworkingSockets *SteamNetworkingSockets() { return SteamNetworkingSockets_Lib(); } + inline ISteamNetworkingSockets *SteamGameServerNetworkingSockets() { return SteamGameServerNetworkingSockets_Lib(); } + +#elif defined( STEAMNETWORKINGSOCKETS_OPENSOURCE ) + + // Opensource GameNetworkingSockets + STEAMNETWORKINGSOCKETS_INTERFACE ISteamNetworkingSockets *SteamNetworkingSockets(); + +#else + + // Steamworks SDK + inline ISteamNetworkingSockets *SteamNetworkingSockets(); + STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamNetworkingSockets *, SteamNetworkingSockets, STEAMNETWORKINGSOCKETS_INTERFACE_VERSION ); + inline ISteamNetworkingSockets *SteamGameServerNetworkingSockets(); + STEAM_DEFINE_GAMESERVER_INTERFACE_ACCESSOR( ISteamNetworkingSockets *, SteamGameServerNetworkingSockets, STEAMNETWORKINGSOCKETS_INTERFACE_VERSION ); +#endif + +/// Callback struct used to notify when a connection has changed state +#if defined( VALVE_CALLBACK_PACK_SMALL ) +#pragma pack( push, 4 ) +#elif defined( VALVE_CALLBACK_PACK_LARGE ) +#pragma pack( push, 8 ) +#else +#error "Must define VALVE_CALLBACK_PACK_SMALL or VALVE_CALLBACK_PACK_LARGE" +#endif + +/// This callback is posted whenever a connection is created, destroyed, or changes state. +/// The m_info field will contain a complete description of the connection at the time the +/// change occurred and the callback was posted. In particular, m_eState will have the +/// new connection state. +/// +/// You will usually need to listen for this callback to know when: +/// - A new connection arrives on a listen socket. +/// m_info.m_hListenSocket will be set, m_eOldState = k_ESteamNetworkingConnectionState_None, +/// and m_info.m_eState = k_ESteamNetworkingConnectionState_Connecting. +/// See ISteamNetworkigSockets::AcceptConnection. +/// - A connection you initiated has been accepted by the remote host. +/// m_eOldState = k_ESteamNetworkingConnectionState_Connecting, and +/// m_info.m_eState = k_ESteamNetworkingConnectionState_Connected. +/// Some connections might transition to k_ESteamNetworkingConnectionState_FindingRoute first. +/// - A connection has been actively rejected or closed by the remote host. +/// m_eOldState = k_ESteamNetworkingConnectionState_Connecting or k_ESteamNetworkingConnectionState_Connected, +/// and m_info.m_eState = k_ESteamNetworkingConnectionState_ClosedByPeer. m_info.m_eEndReason +/// and m_info.m_szEndDebug will have for more details. +/// NOTE: upon receiving this callback, you must still destroy the connection using +/// ISteamNetworkingSockets::CloseConnection to free up local resources. (The details +/// passed to the function are not used in this case, since the connection is already closed.) +/// - A problem was detected with the connection, and it has been closed by the local host. +/// The most common failure is timeout, but other configuration or authentication failures +/// can cause this. m_eOldState = k_ESteamNetworkingConnectionState_Connecting or +/// k_ESteamNetworkingConnectionState_Connected, and m_info.m_eState = k_ESteamNetworkingConnectionState_ProblemDetectedLocally. +/// m_info.m_eEndReason and m_info.m_szEndDebug will have for more details. +/// NOTE: upon receiving this callback, you must still destroy the connection using +/// ISteamNetworkingSockets::CloseConnection to free up local resources. (The details +/// passed to the function are not used in this case, since the connection is already closed.) +/// +/// Remember that callbacks are posted to a queue, and networking connections can +/// change at any time. It is possible that the connection has already changed +/// state by the time you process this callback. +/// +/// Also note that callbacks will be posted when connections are created and destroyed by your own API calls. +struct SteamNetConnectionStatusChangedCallback_t +{ + enum { k_iCallback = k_iSteamNetworkingSocketsCallbacks + 1 }; + + /// Connection handle + HSteamNetConnection m_hConn; + + /// Full connection info + SteamNetConnectionInfo_t m_info; + + /// Previous state. (Current state is in m_info.m_eState) + ESteamNetworkingConnectionState m_eOldState; +}; +#pragma pack( pop ) + +} + +#endif // ISTEAMNETWORKINGSOCKETS diff --git a/Generator/steam_sdk/isteamnetworkingutils.h b/Generator/steam_sdk/isteamnetworkingutils.h new file mode 100644 index 0000000..5597be2 --- /dev/null +++ b/Generator/steam_sdk/isteamnetworkingutils.h @@ -0,0 +1,302 @@ +//====== Copyright Valve Corporation, All rights reserved. ==================== +// +// Purpose: misc networking utilities +// +//============================================================================= + +#ifndef ISTEAMNETWORKINGUTILS +#define ISTEAMNETWORKINGUTILS +#ifdef _WIN32 +#pragma once +#endif + +#include + +#include "steamnetworkingtypes.h" +struct SteamDatagramRelayAuthTicket; + +//----------------------------------------------------------------------------- +/// Misc networking utilities for checking the local networking environment +/// and estimating pings. +class ISteamNetworkingUtils +{ +public: +#ifdef STEAMNETWORKINGSOCKETS_ENABLE_SDR + + // + // Initialization + // + + /// If you know that you are going to be using the relay network, call + /// this to initialize the relay network or check if that initialization + /// has completed. If you do not call this, the initialization will + /// happen the first time you use a feature that requires access to the + /// relay network, and that use will be delayed. + /// + /// Returns true if initialization has completed successfully. + /// (It will probably return false on the first call.) + /// + /// Typically initialization completes in a few seconds. + /// + /// Note: dedicated servers hosted with Valve do *not* need to call + /// this, since they do not make routing decisions. However, if the + /// dedicated server will be using P2P functionality, it will act as + /// a "client" and this should be called. + inline bool InitializeRelayNetworkAccess(); + + // + // "Ping location" functions + // + // We use the ping times to the valve relays deployed worldwide to + // generate a "marker" that describes the location of an Internet host. + // Given two such markers, we can estimate the network latency between + // two hosts, without sending any packets. The estimate is based on the + // optimal route that is found through the Valve network. If you are + // using the Valve network to carry the traffic, then this is precisely + // the ping you want. If you are not, then the ping time will probably + // still be a reasonable estimate. + // + // This is extremely useful to select peers for matchmaking! + // + // The markers can also be converted to a string, so they can be transmitted. + // We have a separate library you can use on your backend to manipulate + // these objects. (See steamdatagram_ticketgen.h) + + /// Return location info for the current host. Returns the approximate + /// age of the data, in seconds, or -1 if no data is available. + /// + /// It takes a few seconds to initialize access to the relay network. If + /// you call this very soon after calling InitializeRelayNetworkAccess, + /// the data may not be available yet. + /// + /// This always return the most up-to-date information we have available + /// right now, even if we are in the middle of re-calculating ping times. + virtual float GetLocalPingLocation( SteamNetworkPingLocation_t &result ) = 0; + + /// Estimate the round-trip latency between two arbitrary locations, in + /// milliseconds. This is a conservative estimate, based on routing through + /// the relay network. For most basic relayed connections, this ping time + /// will be pretty accurate, since it will be based on the route likely to + /// be actually used. + /// + /// If a direct IP route is used (perhaps via NAT traversal), then the route + /// will be different, and the ping time might be better. Or it might actually + /// be a bit worse! Standard IP routing is frequently suboptimal! + /// + /// But even in this case, the estimate obtained using this method is a + /// reasonable upper bound on the ping time. (Also it has the advantage + /// of returning immediately and not sending any packets.) + /// + /// In a few cases we might not able to estimate the route. In this case + /// a negative value is returned. k_nSteamNetworkingPing_Failed means + /// the reason was because of some networking difficulty. (Failure to + /// ping, etc) k_nSteamNetworkingPing_Unknown is returned if we cannot + /// currently answer the question for some other reason. + /// + /// Do you need to be able to do this from a backend/matchmaking server? + /// You are looking for the "ticketgen" library. + virtual int EstimatePingTimeBetweenTwoLocations( const SteamNetworkPingLocation_t &location1, const SteamNetworkPingLocation_t &location2 ) = 0; + + /// Same as EstimatePingTime, but assumes that one location is the local host. + /// This is a bit faster, especially if you need to calculate a bunch of + /// these in a loop to find the fastest one. + /// + /// In rare cases this might return a slightly different estimate than combining + /// GetLocalPingLocation with EstimatePingTimeBetweenTwoLocations. That's because + /// this function uses a slightly more complete set of information about what + /// route would be taken. + virtual int EstimatePingTimeFromLocalHost( const SteamNetworkPingLocation_t &remoteLocation ) = 0; + + /// Convert a ping location into a text format suitable for sending over the wire. + /// The format is a compact and human readable. However, it is subject to change + /// so please do not parse it yourself. Your buffer must be at least + /// k_cchMaxSteamNetworkingPingLocationString bytes. + virtual void ConvertPingLocationToString( const SteamNetworkPingLocation_t &location, char *pszBuf, int cchBufSize ) = 0; + + /// Parse back SteamNetworkPingLocation_t string. Returns false if we couldn't understand + /// the string. + virtual bool ParsePingLocationString( const char *pszString, SteamNetworkPingLocation_t &result ) = 0; + + // + // Initialization / ping measurement status + // + + /// Check if the ping data of sufficient recency is available, and if + /// it's too old, start refreshing it. + /// + /// Please only call this function when you *really* do need to force an + /// immediate refresh of the data. (For example, in response to a specific + /// user input to refresh this information.) Don't call it "just in case", + /// before every connection, etc. That will cause extra traffic to be sent + /// for no benefit. The library will automatically refresh the information + /// as needed. + /// + /// Returns true if sufficiently recent data is already available. + /// + /// Returns false if sufficiently recent data is not available. In this + /// case, ping measurement is initiated, if it is not already active. + /// (You cannot restart a measurement already in progress.) + virtual bool CheckPingDataUpToDate( float flMaxAgeSeconds ) = 0; + + /// Return true if we are taking ping measurements to update our ping + /// location or select optimal routing. Ping measurement typically takes + /// a few seconds, perhaps up to 10 seconds. + virtual bool IsPingMeasurementInProgress() = 0; + + // + // List of Valve data centers, and ping times to them. This might + // be useful to you if you are use our hosting, or just need to measure + // latency to a cloud data center where we are running relays. + // + + /// Fetch ping time of best available relayed route from this host to + /// the specified data center. + virtual int GetPingToDataCenter( SteamNetworkingPOPID popID, SteamNetworkingPOPID *pViaRelayPoP ) = 0; + + /// Get *direct* ping time to the relays at the data center. + virtual int GetDirectPingToPOP( SteamNetworkingPOPID popID ) = 0; + + /// Get number of network points of presence in the config + virtual int GetPOPCount() = 0; + + /// Get list of all POP IDs. Returns the number of entries that were filled into + /// your list. + virtual int GetPOPList( SteamNetworkingPOPID *list, int nListSz ) = 0; +#endif // #ifdef STEAMNETWORKINGSOCKETS_ENABLE_SDR + + // + // Misc + // + + /// Fetch current timestamp. This timer has the following properties: + /// + /// - Monotonicity is guaranteed. + /// - The initial value will be at least 24*3600*30*1e6, i.e. about + /// 30 days worth of microseconds. In this way, the timestamp value of + /// 0 will always be at least "30 days ago". Also, negative numbers + /// will never be returned. + /// - Wraparound / overflow is not a practical concern. + /// + /// If you are running under the debugger and stop the process, the clock + /// might not advance the full wall clock time that has elapsed between + /// calls. If the process is not blocked from normal operation, the + /// timestamp values will track wall clock time, even if you don't call + /// the function frequently. + /// + /// The value is only meaningful for this run of the process. Don't compare + /// it to values obtained on another computer, or other runs of the same process. + virtual SteamNetworkingMicroseconds GetLocalTimestamp() = 0; + + /// Set a function to receive network-related information that is useful for debugging. + /// This can be very useful during development, but it can also be useful for troubleshooting + /// problems with tech savvy end users. If you have a console or other log that customers + /// can examine, these log messages can often be helpful to troubleshoot network issues. + /// (Especially any warning/error messages.) + /// + /// The detail level indicates what message to invoke your callback on. Lower numeric + /// value means more important, and the value you pass is the lowest priority (highest + /// numeric value) you wish to receive callbacks for. + /// + /// Except when debugging, you should only use k_ESteamNetworkingSocketsDebugOutputType_Msg + /// or k_ESteamNetworkingSocketsDebugOutputType_Warning. For best performance, do NOT + /// request a high detail level and then filter out messages in your callback. Instead, + /// call function function to adjust the desired level of detail. + /// + /// IMPORTANT: This may be called from a service thread, while we own a mutex, etc. + /// Your output function must be threadsafe and fast! Do not make any other + /// Steamworks calls from within the handler. + virtual void SetDebugOutputFunction( ESteamNetworkingSocketsDebugOutputType eDetailLevel, FSteamNetworkingSocketsDebugOutput pfnFunc ) = 0; + + // + // Set and get configuration values, see ESteamNetworkingConfigValue for individual descriptions. + // + + // Shortcuts for common cases. (Implemented as inline functions below) + bool SetGlobalConfigValueInt32( ESteamNetworkingConfigValue eValue, int32 val ); + bool SetGlobalConfigValueFloat( ESteamNetworkingConfigValue eValue, float val ); + bool SetGlobalConfigValueString( ESteamNetworkingConfigValue eValue, const char *val ); + bool SetConnectionConfigValueInt32( HSteamNetConnection hConn, ESteamNetworkingConfigValue eValue, int32 val ); + bool SetConnectionConfigValueFloat( HSteamNetConnection hConn, ESteamNetworkingConfigValue eValue, float val ); + bool SetConnectionConfigValueString( HSteamNetConnection hConn, ESteamNetworkingConfigValue eValue, const char *val ); + + /// Set a configuration value. + /// - eValue: which value is being set + /// - eScope: Onto what type of object are you applying the setting? + /// - scopeArg: Which object you want to change? (Ignored for global scope). E.g. connection handle, listen socket handle, interface pointer, etc. + /// - eDataType: What type of data is in the buffer at pValue? This must match the type of the variable exactly! + /// - pArg: Value to set it to. You can pass NULL to remove a non-global sett at this scope, + /// causing the value for that object to use global defaults. Or at global scope, passing NULL + /// will reset any custom value and restore it to the system default. + /// NOTE: When setting callback functions, do not pass the function pointer directly. + /// Your argument should be a pointer to a function pointer. + virtual bool SetConfigValue( ESteamNetworkingConfigValue eValue, ESteamNetworkingConfigScope eScopeType, intptr_t scopeObj, + ESteamNetworkingConfigDataType eDataType, const void *pArg ) = 0; + + /// Get a configuration value. + /// - eValue: which value to fetch + /// - eScopeType: query setting on what type of object + /// - eScopeArg: the object to query the setting for + /// - pOutDataType: If non-NULL, the data type of the value is returned. + /// - pResult: Where to put the result. Pass NULL to query the required buffer size. (k_ESteamNetworkingGetConfigValue_BufferTooSmall will be returned.) + /// - cbResult: IN: the size of your buffer. OUT: the number of bytes filled in or required. + virtual ESteamNetworkingGetConfigValueResult GetConfigValue( ESteamNetworkingConfigValue eValue, ESteamNetworkingConfigScope eScopeType, intptr_t scopeObj, + ESteamNetworkingConfigDataType *pOutDataType, void *pResult, size_t *cbResult ) = 0; + + /// Returns info about a configuration value. Returns false if the value does not exist. + /// pOutNextValue can be used to iterate through all of the known configuration values. + /// (Use GetFirstConfigValue() to begin the iteration, will be k_ESteamNetworkingConfig_Invalid on the last value) + /// Any of the output parameters can be NULL if you do not need that information. + virtual bool GetConfigValueInfo( ESteamNetworkingConfigValue eValue, const char **pOutName, ESteamNetworkingConfigDataType *pOutDataType, ESteamNetworkingConfigScope *pOutScope, ESteamNetworkingConfigValue *pOutNextValue ) = 0; + + /// Return the lowest numbered configuration value available in the current environment. + virtual ESteamNetworkingConfigValue GetFirstConfigValue() = 0; + + // String conversions. You'll usually access these using the respective + // inline methods. + virtual void SteamNetworkingIPAddr_ToString( const SteamNetworkingIPAddr &addr, char *buf, size_t cbBuf, bool bWithPort ) = 0; + virtual bool SteamNetworkingIPAddr_ParseString( SteamNetworkingIPAddr *pAddr, const char *pszStr ) = 0; + virtual void SteamNetworkingIdentity_ToString( const SteamNetworkingIdentity &identity, char *buf, size_t cbBuf ) = 0; + virtual bool SteamNetworkingIdentity_ParseString( SteamNetworkingIdentity *pIdentity, const char *pszStr ) = 0; + +protected: + ~ISteamNetworkingUtils(); // Silence some warnings +}; +#define STEAMNETWORKINGUTILS_INTERFACE_VERSION "SteamNetworkingUtils001" + +// Global accessor. +#ifdef STEAMNETWORKINGSOCKETS_STANDALONELIB + + // Standalone lib + STEAMNETWORKINGSOCKETS_INTERFACE ISteamNetworkingUtils *SteamNetworkingUtils_Lib(); + inline ISteamNetworkingUtils *SteamNetworkingUtils() { return SteamNetworkingUtils_Lib(); } + +#else + + // Steamworks SDK + inline ISteamNetworkingUtils *SteamNetworkingUtils(); + STEAM_DEFINE_INTERFACE_ACCESSOR( ISteamNetworkingUtils *, SteamNetworkingUtils, SteamInternal_FindOrCreateUserInterface( 0, STEAMNETWORKINGUTILS_INTERFACE_VERSION ) ); +#endif + +/////////////////////////////////////////////////////////////////////////////// +// +// Internal stuff + +#ifdef STEAMNETWORKINGSOCKETS_ENABLE_SDR +inline bool ISteamNetworkingUtils::InitializeRelayNetworkAccess() { return CheckPingDataUpToDate( 1e10f ); } +#endif + +inline bool ISteamNetworkingUtils::SetGlobalConfigValueInt32( ESteamNetworkingConfigValue eValue, int32 val ) { return SetConfigValue( eValue, k_ESteamNetworkingConfig_Global, 0, k_ESteamNetworkingConfig_Int32, &val ); } +inline bool ISteamNetworkingUtils::SetGlobalConfigValueFloat( ESteamNetworkingConfigValue eValue, float val ) { return SetConfigValue( eValue, k_ESteamNetworkingConfig_Global, 0, k_ESteamNetworkingConfig_Float, &val ); } +inline bool ISteamNetworkingUtils::SetGlobalConfigValueString( ESteamNetworkingConfigValue eValue, const char *val ) { return SetConfigValue( eValue, k_ESteamNetworkingConfig_Global, 0, k_ESteamNetworkingConfig_String, val ); } +inline bool ISteamNetworkingUtils::SetConnectionConfigValueInt32( HSteamNetConnection hConn, ESteamNetworkingConfigValue eValue, int32 val ) { return SetConfigValue( eValue, k_ESteamNetworkingConfig_Connection, hConn, k_ESteamNetworkingConfig_Int32, &val ); } +inline bool ISteamNetworkingUtils::SetConnectionConfigValueFloat( HSteamNetConnection hConn, ESteamNetworkingConfigValue eValue, float val ) { return SetConfigValue( eValue, k_ESteamNetworkingConfig_Connection, hConn, k_ESteamNetworkingConfig_Float, &val ); } +inline bool ISteamNetworkingUtils::SetConnectionConfigValueString( HSteamNetConnection hConn, ESteamNetworkingConfigValue eValue, const char *val ) { return SetConfigValue( eValue, k_ESteamNetworkingConfig_Connection, hConn, k_ESteamNetworkingConfig_String, val ); } + +#if !defined( STEAMNETWORKINGSOCKETS_STATIC_LINK ) && defined( STEAMNETWORKINGSOCKETS_STEAM ) +inline void SteamNetworkingIPAddr::ToString( char *buf, size_t cbBuf, bool bWithPort ) const { SteamNetworkingUtils()->SteamNetworkingIPAddr_ToString( *this, buf, cbBuf, bWithPort ); } +inline bool SteamNetworkingIPAddr::ParseString( const char *pszStr ) { return SteamNetworkingUtils()->SteamNetworkingIPAddr_ParseString( this, pszStr ); } +inline void SteamNetworkingIdentity::ToString( char *buf, size_t cbBuf ) const { SteamNetworkingUtils()->SteamNetworkingIdentity_ToString( *this, buf, cbBuf ); } +inline bool SteamNetworkingIdentity::ParseString( const char *pszStr ) { return SteamNetworkingUtils()->SteamNetworkingIdentity_ParseString( this, pszStr ); } +#endif + +#endif // ISTEAMNETWORKINGUTILS diff --git a/Generator/steam_sdk/isteamparentalsettings.h b/Generator/steam_sdk/isteamparentalsettings.h index 1b6ba9f..c965e32 100644 --- a/Generator/steam_sdk/isteamparentalsettings.h +++ b/Generator/steam_sdk/isteamparentalsettings.h @@ -10,6 +10,8 @@ #pragma once #endif +#include "steam_api_common.h" + // Feature types for parental settings enum EParentalFeature { @@ -44,6 +46,9 @@ public: #define STEAMPARENTALSETTINGS_INTERFACE_VERSION "STEAMPARENTALSETTINGS_INTERFACE_VERSION001" +// Global interface accessor +inline ISteamParentalSettings *SteamParentalSettings(); +STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamParentalSettings *, SteamParentalSettings, STEAMPARENTALSETTINGS_INTERFACE_VERSION ); //----------------------------------------------------------------------------- // Purpose: Callback for querying UGC diff --git a/Generator/steam_sdk/isteamremotestorage.h b/Generator/steam_sdk/isteamremotestorage.h index 3ac2871..0fed2af 100644 --- a/Generator/steam_sdk/isteamremotestorage.h +++ b/Generator/steam_sdk/isteamremotestorage.h @@ -10,7 +10,7 @@ #pragma once #endif -#include "isteamclient.h" +#include "steam_api_common.h" //----------------------------------------------------------------------------- @@ -28,7 +28,7 @@ const uint32 k_unMaxCloudFileChunkSize = 100 * 1024 * 1024; #elif defined( VALVE_CALLBACK_PACK_LARGE ) #pragma pack( push, 8 ) #else -#error isteamclient.h must be included +#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx #endif struct SteamParamStringArray_t { @@ -66,6 +66,7 @@ enum ERemoteStoragePlatform k_ERemoteStoragePlatformPS3 = (1 << 2), k_ERemoteStoragePlatformLinux = (1 << 3), k_ERemoteStoragePlatformReserved2 = (1 << 4), + k_ERemoteStoragePlatformAndroid = (1 << 5), k_ERemoteStoragePlatformAll = 0xffffffff }; @@ -171,16 +172,16 @@ class ISteamRemoteStorage virtual bool FileWrite( const char *pchFile, const void *pvData, int32 cubData ) = 0; virtual int32 FileRead( const char *pchFile, void *pvData, int32 cubDataToRead ) = 0; - CALL_RESULT( RemoteStorageFileWriteAsyncComplete_t ) + STEAM_CALL_RESULT( RemoteStorageFileWriteAsyncComplete_t ) virtual SteamAPICall_t FileWriteAsync( const char *pchFile, const void *pvData, uint32 cubData ) = 0; - CALL_RESULT( RemoteStorageFileReadAsyncComplete_t ) + STEAM_CALL_RESULT( RemoteStorageFileReadAsyncComplete_t ) virtual SteamAPICall_t FileReadAsync( const char *pchFile, uint32 nOffset, uint32 cubToRead ) = 0; virtual bool FileReadAsyncComplete( SteamAPICall_t hReadCall, void *pvBuffer, uint32 cubToRead ) = 0; virtual bool FileForget( const char *pchFile ) = 0; virtual bool FileDelete( const char *pchFile ) = 0; - CALL_RESULT( RemoteStorageFileShareResult_t ) + STEAM_CALL_RESULT( RemoteStorageFileShareResult_t ) virtual SteamAPICall_t FileShare( const char *pchFile ) = 0; virtual bool SetSyncPlatforms( const char *pchFile, ERemoteStoragePlatform eRemoteStoragePlatform ) = 0; @@ -212,7 +213,7 @@ class ISteamRemoteStorage // Downloads a UGC file. A priority value of 0 will download the file immediately, // otherwise it will wait to download the file until all downloads with a lower priority // value are completed. Downloads with equal priority will occur simultaneously. - CALL_RESULT( RemoteStorageDownloadUGCResult_t ) + STEAM_CALL_RESULT( RemoteStorageDownloadUGCResult_t ) virtual SteamAPICall_t UGCDownload( UGCHandle_t hContent, uint32 unPriority ) = 0; // Gets the amount of data downloaded so far for a piece of content. pnBytesExpected can be 0 if function returns false @@ -220,7 +221,7 @@ class ISteamRemoteStorage virtual bool GetUGCDownloadProgress( UGCHandle_t hContent, int32 *pnBytesDownloaded, int32 *pnBytesExpected ) = 0; // Gets metadata for a file after it has been downloaded. This is the same metadata given in the RemoteStorageDownloadUGCResult_t call result - virtual bool GetUGCDetails( UGCHandle_t hContent, AppId_t *pnAppID, OUT_STRING() char **ppchName, int32 *pnFileSizeInBytes, OUT_STRUCT() CSteamID *pSteamIDOwner ) = 0; + virtual bool GetUGCDetails( UGCHandle_t hContent, AppId_t *pnAppID, STEAM_OUT_STRING() char **ppchName, int32 *pnFileSizeInBytes, STEAM_OUT_STRUCT() CSteamID *pSteamIDOwner ) = 0; // After download, gets the content of the file. // Small files can be read all at once by calling this function with an offset of 0 and cubDataToRead equal to the size of the file. @@ -253,7 +254,7 @@ class ISteamRemoteStorage #endif // publishing UGC - CALL_RESULT( RemoteStoragePublishFileProgress_t ) + STEAM_CALL_RESULT( RemoteStoragePublishFileProgress_t ) virtual SteamAPICall_t PublishWorkshopFile( const char *pchFile, const char *pchPreviewFile, AppId_t nConsumerAppId, const char *pchTitle, const char *pchDescription, ERemoteStoragePublishedFileVisibility eVisibility, SteamParamStringArray_t *pTags, EWorkshopFileType eWorkshopFileType ) = 0; virtual PublishedFileUpdateHandle_t CreatePublishedFileUpdateRequest( PublishedFileId_t unPublishedFileId ) = 0; virtual bool UpdatePublishedFileFile( PublishedFileUpdateHandle_t updateHandle, const char *pchFile ) = 0; @@ -262,49 +263,52 @@ class ISteamRemoteStorage virtual bool UpdatePublishedFileDescription( PublishedFileUpdateHandle_t updateHandle, const char *pchDescription ) = 0; virtual bool UpdatePublishedFileVisibility( PublishedFileUpdateHandle_t updateHandle, ERemoteStoragePublishedFileVisibility eVisibility ) = 0; virtual bool UpdatePublishedFileTags( PublishedFileUpdateHandle_t updateHandle, SteamParamStringArray_t *pTags ) = 0; - CALL_RESULT( RemoteStorageUpdatePublishedFileResult_t ) + STEAM_CALL_RESULT( RemoteStorageUpdatePublishedFileResult_t ) virtual SteamAPICall_t CommitPublishedFileUpdate( PublishedFileUpdateHandle_t updateHandle ) = 0; // Gets published file details for the given publishedfileid. If unMaxSecondsOld is greater than 0, // cached data may be returned, depending on how long ago it was cached. A value of 0 will force a refresh. // A value of k_WorkshopForceLoadPublishedFileDetailsFromCache will use cached data if it exists, no matter how old it is. - CALL_RESULT( RemoteStorageGetPublishedFileDetailsResult_t ) + STEAM_CALL_RESULT( RemoteStorageGetPublishedFileDetailsResult_t ) virtual SteamAPICall_t GetPublishedFileDetails( PublishedFileId_t unPublishedFileId, uint32 unMaxSecondsOld ) = 0; - CALL_RESULT( RemoteStorageDeletePublishedFileResult_t ) + STEAM_CALL_RESULT( RemoteStorageDeletePublishedFileResult_t ) virtual SteamAPICall_t DeletePublishedFile( PublishedFileId_t unPublishedFileId ) = 0; // enumerate the files that the current user published with this app - CALL_RESULT( RemoteStorageEnumerateUserPublishedFilesResult_t ) + STEAM_CALL_RESULT( RemoteStorageEnumerateUserPublishedFilesResult_t ) virtual SteamAPICall_t EnumerateUserPublishedFiles( uint32 unStartIndex ) = 0; - CALL_RESULT( RemoteStorageSubscribePublishedFileResult_t ) + STEAM_CALL_RESULT( RemoteStorageSubscribePublishedFileResult_t ) virtual SteamAPICall_t SubscribePublishedFile( PublishedFileId_t unPublishedFileId ) = 0; - CALL_RESULT( RemoteStorageEnumerateUserSubscribedFilesResult_t ) + STEAM_CALL_RESULT( RemoteStorageEnumerateUserSubscribedFilesResult_t ) virtual SteamAPICall_t EnumerateUserSubscribedFiles( uint32 unStartIndex ) = 0; - CALL_RESULT( RemoteStorageUnsubscribePublishedFileResult_t ) + STEAM_CALL_RESULT( RemoteStorageUnsubscribePublishedFileResult_t ) virtual SteamAPICall_t UnsubscribePublishedFile( PublishedFileId_t unPublishedFileId ) = 0; virtual bool UpdatePublishedFileSetChangeDescription( PublishedFileUpdateHandle_t updateHandle, const char *pchChangeDescription ) = 0; - CALL_RESULT( RemoteStorageGetPublishedItemVoteDetailsResult_t ) + STEAM_CALL_RESULT( RemoteStorageGetPublishedItemVoteDetailsResult_t ) virtual SteamAPICall_t GetPublishedItemVoteDetails( PublishedFileId_t unPublishedFileId ) = 0; - CALL_RESULT( RemoteStorageUpdateUserPublishedItemVoteResult_t ) + STEAM_CALL_RESULT( RemoteStorageUpdateUserPublishedItemVoteResult_t ) virtual SteamAPICall_t UpdateUserPublishedItemVote( PublishedFileId_t unPublishedFileId, bool bVoteUp ) = 0; - CALL_RESULT( RemoteStorageGetPublishedItemVoteDetailsResult_t ) + STEAM_CALL_RESULT( RemoteStorageGetPublishedItemVoteDetailsResult_t ) virtual SteamAPICall_t GetUserPublishedItemVoteDetails( PublishedFileId_t unPublishedFileId ) = 0; - CALL_RESULT( RemoteStorageEnumerateUserPublishedFilesResult_t ) + STEAM_CALL_RESULT( RemoteStorageEnumerateUserPublishedFilesResult_t ) virtual SteamAPICall_t EnumerateUserSharedWorkshopFiles( CSteamID steamId, uint32 unStartIndex, SteamParamStringArray_t *pRequiredTags, SteamParamStringArray_t *pExcludedTags ) = 0; - CALL_RESULT( RemoteStoragePublishFileProgress_t ) + STEAM_CALL_RESULT( RemoteStoragePublishFileProgress_t ) virtual SteamAPICall_t PublishVideo( EWorkshopVideoProvider eVideoProvider, const char *pchVideoAccount, const char *pchVideoIdentifier, const char *pchPreviewFile, AppId_t nConsumerAppId, const char *pchTitle, const char *pchDescription, ERemoteStoragePublishedFileVisibility eVisibility, SteamParamStringArray_t *pTags ) = 0; - CALL_RESULT( RemoteStorageSetUserPublishedFileActionResult_t ) + STEAM_CALL_RESULT( RemoteStorageSetUserPublishedFileActionResult_t ) virtual SteamAPICall_t SetUserPublishedFileAction( PublishedFileId_t unPublishedFileId, EWorkshopFileAction eAction ) = 0; - CALL_RESULT( RemoteStorageEnumeratePublishedFilesByUserActionResult_t ) + STEAM_CALL_RESULT( RemoteStorageEnumeratePublishedFilesByUserActionResult_t ) virtual SteamAPICall_t EnumeratePublishedFilesByUserAction( EWorkshopFileAction eAction, uint32 unStartIndex ) = 0; // this method enumerates the public view of workshop files - CALL_RESULT( RemoteStorageEnumerateWorkshopFilesResult_t ) + STEAM_CALL_RESULT( RemoteStorageEnumerateWorkshopFilesResult_t ) virtual SteamAPICall_t EnumeratePublishedWorkshopFiles( EWorkshopEnumerationType eEnumerationType, uint32 unStartIndex, uint32 unCount, uint32 unDays, SteamParamStringArray_t *pTags, SteamParamStringArray_t *pUserTags ) = 0; - CALL_RESULT( RemoteStorageDownloadUGCResult_t ) + STEAM_CALL_RESULT( RemoteStorageDownloadUGCResult_t ) virtual SteamAPICall_t UGCDownloadToLocation( UGCHandle_t hContent, const char *pchLocation, uint32 unPriority ) = 0; }; #define STEAMREMOTESTORAGE_INTERFACE_VERSION "STEAMREMOTESTORAGE_INTERFACE_VERSION014" +// Global interface accessor +inline ISteamRemoteStorage *SteamRemoteStorage(); +STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamRemoteStorage *, SteamRemoteStorage, STEAMREMOTESTORAGE_INTERFACE_VERSION ); // callbacks #if defined( VALVE_CALLBACK_PACK_SMALL ) @@ -312,7 +316,7 @@ class ISteamRemoteStorage #elif defined( VALVE_CALLBACK_PACK_LARGE ) #pragma pack( push, 8 ) #else -#error isteamclient.h must be included +#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx #endif //----------------------------------------------------------------------------- @@ -450,7 +454,7 @@ struct RemoteStorageEnumerateUserSubscribedFilesResult_t #elif defined(VALVE_CALLBACK_PACK_LARGE) VALVE_COMPILE_TIME_ASSERT( sizeof( RemoteStorageEnumerateUserSubscribedFilesResult_t ) == (1 + 1 + 1 + 50 + 100) * 4 + 4 ); #else -#warning You must first include isteamclient.h +#warning You must first include steam_api_common.h #endif //----------------------------------------------------------------------------- diff --git a/Generator/steam_sdk/isteamscreenshots.h b/Generator/steam_sdk/isteamscreenshots.h index 6095705..1824268 100644 --- a/Generator/steam_sdk/isteamscreenshots.h +++ b/Generator/steam_sdk/isteamscreenshots.h @@ -10,7 +10,7 @@ #pragma once #endif -#include "isteamclient.h" +#include "steam_api_common.h" const uint32 k_nScreenshotMaxTaggedUsers = 32; const uint32 k_nScreenshotMaxTaggedPublishedFiles = 32; @@ -81,13 +81,17 @@ public: #define STEAMSCREENSHOTS_INTERFACE_VERSION "STEAMSCREENSHOTS_INTERFACE_VERSION003" +// Global interface accessor +inline ISteamScreenshots *SteamScreenshots(); +STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamScreenshots *, SteamScreenshots, STEAMSCREENSHOTS_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 isteamclient.h must be included +#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx #endif //----------------------------------------------------------------------------- // Purpose: Screenshot successfully written or otherwise added to the library diff --git a/Generator/steam_sdk/isteamugc.h b/Generator/steam_sdk/isteamugc.h index 4a7d296..750706d 100644 --- a/Generator/steam_sdk/isteamugc.h +++ b/Generator/steam_sdk/isteamugc.h @@ -10,7 +10,8 @@ #pragma once #endif -#include "isteamclient.h" +#include "steam_api_common.h" +#include "isteamremotestorage.h" // callbacks #if defined( VALVE_CALLBACK_PACK_SMALL ) @@ -18,7 +19,7 @@ #elif defined( VALVE_CALLBACK_PACK_LARGE ) #pragma pack( push, 8 ) #else -#error isteamclient.h must be included +#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx #endif @@ -205,23 +206,26 @@ public: // Query for all matching UGC. Creator app id or consumer app id must be valid and be set to the current running app. unPage should start at 1. virtual UGCQueryHandle_t CreateQueryAllUGCRequest( EUGCQuery eQueryType, EUGCMatchingUGCType eMatchingeMatchingUGCTypeFileType, AppId_t nCreatorAppID, AppId_t nConsumerAppID, uint32 unPage ) = 0; + // Query for all matching UGC using the new deep paging interface. Creator app id or consumer app id must be valid and be set to the current running app. pchCursor should be set to NULL or "*" to get the first result set. + virtual UGCQueryHandle_t CreateQueryAllUGCRequest( EUGCQuery eQueryType, EUGCMatchingUGCType eMatchingeMatchingUGCTypeFileType, AppId_t nCreatorAppID, AppId_t nConsumerAppID, const char *pchCursor = NULL ) = 0; + // Query for the details of the given published file ids (the RequestUGCDetails call is deprecated and replaced with this) virtual UGCQueryHandle_t CreateQueryUGCDetailsRequest( PublishedFileId_t *pvecPublishedFileID, uint32 unNumPublishedFileIDs ) = 0; // Send the query to Steam - CALL_RESULT( SteamUGCQueryCompleted_t ) + STEAM_CALL_RESULT( SteamUGCQueryCompleted_t ) virtual SteamAPICall_t SendQueryUGCRequest( UGCQueryHandle_t handle ) = 0; // Retrieve an individual result after receiving the callback for querying UGC virtual bool GetQueryUGCResult( UGCQueryHandle_t handle, uint32 index, SteamUGCDetails_t *pDetails ) = 0; - virtual bool GetQueryUGCPreviewURL( UGCQueryHandle_t handle, uint32 index, OUT_STRING_COUNT(cchURLSize) char *pchURL, uint32 cchURLSize ) = 0; - virtual bool GetQueryUGCMetadata( UGCQueryHandle_t handle, uint32 index, OUT_STRING_COUNT(cchMetadatasize) char *pchMetadata, uint32 cchMetadatasize ) = 0; + virtual bool GetQueryUGCPreviewURL( UGCQueryHandle_t handle, uint32 index, STEAM_OUT_STRING_COUNT(cchURLSize) char *pchURL, uint32 cchURLSize ) = 0; + virtual bool GetQueryUGCMetadata( UGCQueryHandle_t handle, uint32 index, STEAM_OUT_STRING_COUNT(cchMetadatasize) char *pchMetadata, uint32 cchMetadatasize ) = 0; virtual bool GetQueryUGCChildren( UGCQueryHandle_t handle, uint32 index, PublishedFileId_t* pvecPublishedFileID, uint32 cMaxEntries ) = 0; virtual bool GetQueryUGCStatistic( UGCQueryHandle_t handle, uint32 index, EItemStatistic eStatType, uint64 *pStatValue ) = 0; virtual uint32 GetQueryUGCNumAdditionalPreviews( UGCQueryHandle_t handle, uint32 index ) = 0; - virtual bool GetQueryUGCAdditionalPreview( UGCQueryHandle_t handle, uint32 index, uint32 previewIndex, OUT_STRING_COUNT(cchURLSize) char *pchURLOrVideoID, uint32 cchURLSize, OUT_STRING_COUNT(cchURLSize) char *pchOriginalFileName, uint32 cchOriginalFileNameSize, EItemPreviewType *pPreviewType ) = 0; + virtual bool GetQueryUGCAdditionalPreview( UGCQueryHandle_t handle, uint32 index, uint32 previewIndex, STEAM_OUT_STRING_COUNT(cchURLSize) char *pchURLOrVideoID, uint32 cchURLSize, STEAM_OUT_STRING_COUNT(cchURLSize) char *pchOriginalFileName, uint32 cchOriginalFileNameSize, EItemPreviewType *pPreviewType ) = 0; virtual uint32 GetQueryUGCNumKeyValueTags( UGCQueryHandle_t handle, uint32 index ) = 0; - virtual bool GetQueryUGCKeyValueTag( UGCQueryHandle_t handle, uint32 index, uint32 keyValueTagIndex, OUT_STRING_COUNT(cchKeySize) char *pchKey, uint32 cchKeySize, OUT_STRING_COUNT(cchValueSize) char *pchValue, uint32 cchValueSize ) = 0; + virtual bool GetQueryUGCKeyValueTag( UGCQueryHandle_t handle, uint32 index, uint32 keyValueTagIndex, STEAM_OUT_STRING_COUNT(cchKeySize) char *pchKey, uint32 cchKeySize, STEAM_OUT_STRING_COUNT(cchValueSize) char *pchValue, uint32 cchValueSize ) = 0; // Release the request to free up memory, after retrieving results virtual bool ReleaseQueryUGCRequest( UGCQueryHandle_t handle ) = 0; @@ -253,7 +257,7 @@ public: virtual SteamAPICall_t RequestUGCDetails( PublishedFileId_t nPublishedFileID, uint32 unMaxAgeSeconds ) = 0; // Steam Workshop Creator API - CALL_RESULT( CreateItemResult_t ) + STEAM_CALL_RESULT( CreateItemResult_t ) virtual SteamAPICall_t CreateItem( AppId_t nConsumerAppId, EWorkshopFileType eFileType ) = 0; // create new item for this app with no content attached yet virtual UGCUpdateHandle_t StartItemUpdate( AppId_t nConsumerAppId, PublishedFileId_t nPublishedFileID ) = 0; // start an UGC item update. Set changed properties before commiting update with CommitItemUpdate() @@ -266,6 +270,7 @@ public: virtual bool SetItemTags( UGCUpdateHandle_t updateHandle, const SteamParamStringArray_t *pTags ) = 0; // change the tags of an UGC item virtual bool SetItemContent( UGCUpdateHandle_t handle, const char *pszContentFolder ) = 0; // update item content from this local folder virtual bool SetItemPreview( UGCUpdateHandle_t handle, const char *pszPreviewFile ) = 0; // change preview image file for this item. pszPreviewFile points to local image file, which must be under 1MB in size + virtual bool SetAllowLegacyUpload( UGCUpdateHandle_t handle, bool bAllowLegacyUpload ) = 0; // use legacy upload for a single small file. The parameter to SetItemContent() should either be a directory with one file or the full path to the file. The file must also be less than 10MB in size. virtual bool RemoveItemKeyValueTags( UGCUpdateHandle_t handle, const char *pchKey ) = 0; // remove any existing key-value tags with the specified key virtual bool AddItemKeyValueTag( UGCUpdateHandle_t handle, const char *pchKey, const char *pchValue ) = 0; // add new key-value tags for the item. Note that there can be multiple values for a tag. virtual bool AddItemPreviewFile( UGCUpdateHandle_t handle, const char *pszPreviewFile, EItemPreviewType type ) = 0; // add preview file for this item. pszPreviewFile points to local file, which must be under 1MB in size @@ -274,22 +279,22 @@ public: virtual bool UpdateItemPreviewVideo( UGCUpdateHandle_t handle, uint32 index, const char *pszVideoID ) = 0; // updates an existing preview video for this item virtual bool RemoveItemPreview( UGCUpdateHandle_t handle, uint32 index ) = 0; // remove a preview by index starting at 0 (previews are sorted) - CALL_RESULT( SubmitItemUpdateResult_t ) + STEAM_CALL_RESULT( SubmitItemUpdateResult_t ) virtual SteamAPICall_t SubmitItemUpdate( UGCUpdateHandle_t handle, const char *pchChangeNote ) = 0; // commit update process started with StartItemUpdate() virtual EItemUpdateStatus GetItemUpdateProgress( UGCUpdateHandle_t handle, uint64 *punBytesProcessed, uint64* punBytesTotal ) = 0; // Steam Workshop Consumer API - CALL_RESULT( SetUserItemVoteResult_t ) + STEAM_CALL_RESULT( SetUserItemVoteResult_t ) virtual SteamAPICall_t SetUserItemVote( PublishedFileId_t nPublishedFileID, bool bVoteUp ) = 0; - CALL_RESULT( GetUserItemVoteResult_t ) + STEAM_CALL_RESULT( GetUserItemVoteResult_t ) virtual SteamAPICall_t GetUserItemVote( PublishedFileId_t nPublishedFileID ) = 0; - CALL_RESULT( UserFavoriteItemsListChanged_t ) + STEAM_CALL_RESULT( UserFavoriteItemsListChanged_t ) virtual SteamAPICall_t AddItemToFavorites( AppId_t nAppId, PublishedFileId_t nPublishedFileID ) = 0; - CALL_RESULT( UserFavoriteItemsListChanged_t ) + STEAM_CALL_RESULT( UserFavoriteItemsListChanged_t ) virtual SteamAPICall_t RemoveItemFromFavorites( AppId_t nAppId, PublishedFileId_t nPublishedFileID ) = 0; - CALL_RESULT( RemoteStorageSubscribePublishedFileResult_t ) + STEAM_CALL_RESULT( RemoteStorageSubscribePublishedFileResult_t ) virtual SteamAPICall_t SubscribeItem( PublishedFileId_t nPublishedFileID ) = 0; // subscribe to this item, will be installed ASAP - CALL_RESULT( RemoteStorageUnsubscribePublishedFileResult_t ) + STEAM_CALL_RESULT( RemoteStorageUnsubscribePublishedFileResult_t ) virtual SteamAPICall_t UnsubscribeItem( PublishedFileId_t nPublishedFileID ) = 0; // unsubscribe from this item, will be uninstalled after game quits virtual uint32 GetNumSubscribedItems() = 0; // number of subscribed items virtual uint32 GetSubscribedItems( PublishedFileId_t* pvecPublishedFileID, uint32 cMaxEntries ) = 0; // all subscribed item PublishFileIDs @@ -299,7 +304,7 @@ public: // get info about currently installed content on disc for items that have k_EItemStateInstalled set // if k_EItemStateLegacyItem is set, pchFolder contains the path to the legacy file itself (not a folder) - virtual bool GetItemInstallInfo( PublishedFileId_t nPublishedFileID, uint64 *punSizeOnDisk, OUT_STRING_COUNT( cchFolderSize ) char *pchFolder, uint32 cchFolderSize, uint32 *punTimeStamp ) = 0; + virtual bool GetItemInstallInfo( PublishedFileId_t nPublishedFileID, uint64 *punSizeOnDisk, STEAM_OUT_STRING_COUNT( cchFolderSize ) char *pchFolder, uint32 cchFolderSize, uint32 *punTimeStamp ) = 0; // get info about pending update for items that have k_EItemStateNeedsUpdate set. punBytesTotal will be valid after download started once virtual bool GetItemDownloadInfo( PublishedFileId_t nPublishedFileID, uint64 *punBytesDownloaded, uint64 *punBytesTotal ) = 0; @@ -317,35 +322,43 @@ public: virtual void SuspendDownloads( bool bSuspend ) = 0; // usage tracking - CALL_RESULT( StartPlaytimeTrackingResult_t ) + STEAM_CALL_RESULT( StartPlaytimeTrackingResult_t ) virtual SteamAPICall_t StartPlaytimeTracking( PublishedFileId_t *pvecPublishedFileID, uint32 unNumPublishedFileIDs ) = 0; - CALL_RESULT( StopPlaytimeTrackingResult_t ) + STEAM_CALL_RESULT( StopPlaytimeTrackingResult_t ) virtual SteamAPICall_t StopPlaytimeTracking( PublishedFileId_t *pvecPublishedFileID, uint32 unNumPublishedFileIDs ) = 0; - CALL_RESULT( StopPlaytimeTrackingResult_t ) + STEAM_CALL_RESULT( StopPlaytimeTrackingResult_t ) virtual SteamAPICall_t StopPlaytimeTrackingForAllItems() = 0; // parent-child relationship or dependency management - CALL_RESULT( AddUGCDependencyResult_t ) + STEAM_CALL_RESULT( AddUGCDependencyResult_t ) virtual SteamAPICall_t AddDependency( PublishedFileId_t nParentPublishedFileID, PublishedFileId_t nChildPublishedFileID ) = 0; - CALL_RESULT( RemoveUGCDependencyResult_t ) + STEAM_CALL_RESULT( RemoveUGCDependencyResult_t ) virtual SteamAPICall_t RemoveDependency( PublishedFileId_t nParentPublishedFileID, PublishedFileId_t nChildPublishedFileID ) = 0; // add/remove app dependence/requirements (usually DLC) - CALL_RESULT( AddAppDependencyResult_t ) + STEAM_CALL_RESULT( AddAppDependencyResult_t ) virtual SteamAPICall_t AddAppDependency( PublishedFileId_t nPublishedFileID, AppId_t nAppID ) = 0; - CALL_RESULT( RemoveAppDependencyResult_t ) + STEAM_CALL_RESULT( RemoveAppDependencyResult_t ) virtual SteamAPICall_t RemoveAppDependency( PublishedFileId_t nPublishedFileID, AppId_t nAppID ) = 0; // request app dependencies. note that whatever callback you register for GetAppDependenciesResult_t may be called multiple times // until all app dependencies have been returned - CALL_RESULT( GetAppDependenciesResult_t ) + STEAM_CALL_RESULT( GetAppDependenciesResult_t ) virtual SteamAPICall_t GetAppDependencies( PublishedFileId_t nPublishedFileID ) = 0; // delete the item without prompting the user - CALL_RESULT( DeleteItemResult_t ) + STEAM_CALL_RESULT( DeleteItemResult_t ) virtual SteamAPICall_t DeleteItem( PublishedFileId_t nPublishedFileID ) = 0; }; -#define STEAMUGC_INTERFACE_VERSION "STEAMUGC_INTERFACE_VERSION010" +#define STEAMUGC_INTERFACE_VERSION "STEAMUGC_INTERFACE_VERSION012" + +// Global interface accessor +inline ISteamUGC *SteamUGC(); +STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamUGC *, SteamUGC, STEAMUGC_INTERFACE_VERSION ); + +// Global accessor for the gameserver client +inline ISteamUGC *SteamGameServerUGC(); +STEAM_DEFINE_GAMESERVER_INTERFACE_ACCESSOR( ISteamUGC *, SteamGameServerUGC, STEAMUGC_INTERFACE_VERSION ); //----------------------------------------------------------------------------- // Purpose: Callback for querying UGC @@ -358,6 +371,7 @@ struct SteamUGCQueryCompleted_t uint32 m_unNumResultsReturned; uint32 m_unTotalMatchingResults; bool m_bCachedData; // indicates whether this data was retrieved from the local on-disk cache + char m_rgchNextCursor[k_cchPublishedFileURLMax]; // If a paging cursor was used, then this will be the next cursor to get the next result set. }; diff --git a/Generator/steam_sdk/isteamuser.h b/Generator/steam_sdk/isteamuser.h index 0ea2bb8..7ed0fac 100644 --- a/Generator/steam_sdk/isteamuser.h +++ b/Generator/steam_sdk/isteamuser.h @@ -10,7 +10,7 @@ #pragma once #endif -#include "isteamclient.h" +#include "steam_api_common.h" // structure that contains client callback data // see callbacks documentation for more details @@ -19,7 +19,7 @@ #elif defined( VALVE_CALLBACK_PACK_LARGE ) #pragma pack( push, 8 ) #else -#error isteamclient.h must be included +#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx #endif struct CallbackMsg_t { @@ -165,7 +165,7 @@ public: // Requests a ticket encrypted with an app specific shared key // pDataToInclude, cbDataToInclude will be encrypted into the ticket // ( This is asynchronous, you must wait for the ticket to be completed by the server ) - CALL_RESULT( EncryptedAppTicketResponse_t ) + STEAM_CALL_RESULT( EncryptedAppTicketResponse_t ) virtual SteamAPICall_t RequestEncryptedAppTicket( void *pDataToInclude, int cbDataToInclude ) = 0; // retrieve a finished ticket @@ -189,7 +189,7 @@ public: // or else immediately navigate to the result URL using a hidden browser window. // NOTE 2: The resulting authorization cookie has an expiration time of one day, // so it would be a good idea to request and visit a new auth URL every 12 hours. - CALL_RESULT( StoreAuthURLResponse_t ) + STEAM_CALL_RESULT( StoreAuthURLResponse_t ) virtual SteamAPICall_t RequestStoreAuthURL( const char *pchRedirectURL ) = 0; // gets whether the users phone number is verified @@ -204,10 +204,15 @@ public: // gets whether the users phone number is awaiting (re)verification virtual bool BIsPhoneRequiringVerification() = 0; + STEAM_CALL_RESULT( MarketEligibilityResponse_t ) + virtual SteamAPICall_t GetMarketEligibility() = 0; }; -#define STEAMUSER_INTERFACE_VERSION "SteamUser019" +#define STEAMUSER_INTERFACE_VERSION "SteamUser020" +// Global interface accessor +inline ISteamUser *SteamUser(); +STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamUser *, SteamUser, STEAMUSER_INTERFACE_VERSION ); // callbacks #if defined( VALVE_CALLBACK_PACK_SMALL ) @@ -215,7 +220,7 @@ public: #elif defined( VALVE_CALLBACK_PACK_LARGE ) #pragma pack( push, 8 ) #else -#error isteamclient.h must be included +#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx #endif //----------------------------------------------------------------------------- @@ -363,6 +368,21 @@ struct StoreAuthURLResponse_t }; +//----------------------------------------------------------------------------- +// Purpose: sent in response to ISteamUser::GetMarketEligibility +//----------------------------------------------------------------------------- +struct MarketEligibilityResponse_t +{ + enum { k_iCallback = k_iSteamUserCallbacks + 66 }; + bool m_bAllowed; + EMarketNotAllowedReasonFlags m_eNotAllowedReason; + RTime32 m_rtAllowedAtTime; + + int m_cdaySteamGuardRequiredDays; // The number of days any user is required to have had Steam Guard before they can use the market + int m_cdayNewDeviceCooldown; // The number of days after initial device authorization a user must wait before using the market on that device +}; + + #pragma pack( pop ) diff --git a/Generator/steam_sdk/isteamuserstats.h b/Generator/steam_sdk/isteamuserstats.h index 29ae38b..d8daa04 100644 --- a/Generator/steam_sdk/isteamuserstats.h +++ b/Generator/steam_sdk/isteamuserstats.h @@ -10,7 +10,7 @@ #pragma once #endif -#include "isteamclient.h" +#include "steam_api_common.h" #include "isteamremotestorage.h" // size limit on stat or achievement name (UTF-8 encoded) @@ -67,7 +67,7 @@ enum ELeaderboardUploadScoreMethod #elif defined( VALVE_CALLBACK_PACK_LARGE ) #pragma pack( push, 8 ) #else -#error isteamclient.h must be included +#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx #endif struct LeaderboardEntry_t @@ -89,7 +89,7 @@ class ISteamUserStats { public: // Ask the server to send down this user's data and achievements for this game - CALL_BACK( UserStatsReceived_t ) + STEAM_CALL_BACK( UserStatsReceived_t ) virtual bool RequestCurrentStats() = 0; // Data accessors @@ -149,7 +149,7 @@ public: // returns a UserStatsReceived_t received when completed // if the other user has no stats, UserStatsReceived_t.m_eResult will be set to k_EResultFail // these stats won't be auto-updated; you'll need to call RequestUserStats() again to refresh any data - CALL_RESULT( UserStatsReceived_t ) + STEAM_CALL_RESULT( UserStatsReceived_t ) virtual SteamAPICall_t RequestUserStats( CSteamID steamIDUser ) = 0; // requests stat information for a user, usable after a successful call to RequestUserStats() @@ -166,12 +166,12 @@ public: // asks the Steam back-end for a leaderboard by name, and will create it if it's not yet // This call is asynchronous, with the result returned in LeaderboardFindResult_t - CALL_RESULT(LeaderboardFindResult_t) + STEAM_CALL_RESULT(LeaderboardFindResult_t) virtual SteamAPICall_t FindOrCreateLeaderboard( const char *pchLeaderboardName, ELeaderboardSortMethod eLeaderboardSortMethod, ELeaderboardDisplayType eLeaderboardDisplayType ) = 0; // as above, but won't create the leaderboard if it's not found // This call is asynchronous, with the result returned in LeaderboardFindResult_t - CALL_RESULT( LeaderboardFindResult_t ) + STEAM_CALL_RESULT( LeaderboardFindResult_t ) virtual SteamAPICall_t FindLeaderboard( const char *pchLeaderboardName ) = 0; // returns the name of a leaderboard @@ -194,15 +194,15 @@ public: // k_ELeaderboardDataRequestGlobalAroundUser requests rows around the current user, nRangeStart being negate // e.g. DownloadLeaderboardEntries( hLeaderboard, k_ELeaderboardDataRequestGlobalAroundUser, -3, 3 ) will return 7 rows, 3 before the user, 3 after // k_ELeaderboardDataRequestFriends requests all the rows for friends of the current user - CALL_RESULT( LeaderboardScoresDownloaded_t ) + STEAM_CALL_RESULT( LeaderboardScoresDownloaded_t ) virtual SteamAPICall_t DownloadLeaderboardEntries( SteamLeaderboard_t hSteamLeaderboard, ELeaderboardDataRequest eLeaderboardDataRequest, int nRangeStart, int nRangeEnd ) = 0; // as above, but downloads leaderboard entries for an arbitrary set of users - ELeaderboardDataRequest is k_ELeaderboardDataRequestUsers // if a user doesn't have a leaderboard entry, they won't be included in the result // a max of 100 users can be downloaded at a time, with only one outstanding call at a time - METHOD_DESC(Downloads leaderboard entries for an arbitrary set of users - ELeaderboardDataRequest is k_ELeaderboardDataRequestUsers) - CALL_RESULT( LeaderboardScoresDownloaded_t ) + STEAM_METHOD_DESC(Downloads leaderboard entries for an arbitrary set of users - ELeaderboardDataRequest is k_ELeaderboardDataRequestUsers) + STEAM_CALL_RESULT( LeaderboardScoresDownloaded_t ) virtual SteamAPICall_t DownloadLeaderboardEntriesForUsers( SteamLeaderboard_t hSteamLeaderboard, - ARRAY_COUNT_D(cUsers, Array of users to retrieve) CSteamID *prgUsers, int cUsers ) = 0; + STEAM_ARRAY_COUNT_D(cUsers, Array of users to retrieve) CSteamID *prgUsers, int cUsers ) = 0; // Returns data about a single leaderboard entry // use a for loop from 0 to LeaderboardScoresDownloaded_t::m_cEntryCount to get all the downloaded entries @@ -224,24 +224,24 @@ public: // This call is asynchronous, with the result returned in LeaderboardScoreUploaded_t // Details are extra game-defined information regarding how the user got that score // pScoreDetails points to an array of int32's, cScoreDetailsCount is the number of int32's in the list - CALL_RESULT( LeaderboardScoreUploaded_t ) + STEAM_CALL_RESULT( LeaderboardScoreUploaded_t ) virtual SteamAPICall_t UploadLeaderboardScore( SteamLeaderboard_t hSteamLeaderboard, ELeaderboardUploadScoreMethod eLeaderboardUploadScoreMethod, int32 nScore, const int32 *pScoreDetails, int cScoreDetailsCount ) = 0; // Attaches a piece of user generated content the user's entry on a leaderboard. // hContent is a handle to a piece of user generated content that was shared using ISteamUserRemoteStorage::FileShare(). // This call is asynchronous, with the result returned in LeaderboardUGCSet_t. - CALL_RESULT( LeaderboardUGCSet_t ) + STEAM_CALL_RESULT( LeaderboardUGCSet_t ) virtual SteamAPICall_t AttachLeaderboardUGC( SteamLeaderboard_t hSteamLeaderboard, UGCHandle_t hUGC ) = 0; // Retrieves the number of players currently playing your game (online + offline) // This call is asynchronous, with the result returned in NumberOfCurrentPlayers_t - CALL_RESULT( NumberOfCurrentPlayers_t ) + STEAM_CALL_RESULT( NumberOfCurrentPlayers_t ) virtual SteamAPICall_t GetNumberOfCurrentPlayers() = 0; // Requests that Steam fetch data on the percentage of players who have received each achievement // for the game globally. // This call is asynchronous, with the result returned in GlobalAchievementPercentagesReady_t. - CALL_RESULT( GlobalAchievementPercentagesReady_t ) + STEAM_CALL_RESULT( GlobalAchievementPercentagesReady_t ) virtual SteamAPICall_t RequestGlobalAchievementPercentages() = 0; // Get the info on the most achieved achievement for the game, returns an iterator index you can use to fetch @@ -261,7 +261,7 @@ public: // This call is asynchronous, with the results returned in GlobalStatsReceived_t. // nHistoryDays specifies how many days of day-by-day history to retrieve in addition // to the overall totals. The limit is 60. - CALL_RESULT( GlobalStatsReceived_t ) + STEAM_CALL_RESULT( GlobalStatsReceived_t ) virtual SteamAPICall_t RequestGlobalStats( int nHistoryDays ) = 0; // Gets the lifetime totals for an aggregated stat @@ -272,8 +272,8 @@ public: // So when called, pData[0] will be today, pData[1] will be yesterday, and pData[2] will be two days ago, // etc. cubData is the size in bytes of the pubData buffer. Returns the number of // elements actually set. - virtual int32 GetGlobalStatHistory( const char *pchStatName, ARRAY_COUNT(cubData) int64 *pData, uint32 cubData ) = 0; - virtual int32 GetGlobalStatHistory( const char *pchStatName, ARRAY_COUNT(cubData) double *pData, uint32 cubData ) = 0; + virtual int32 GetGlobalStatHistory( const char *pchStatName, STEAM_ARRAY_COUNT(cubData) int64 *pData, uint32 cubData ) = 0; + virtual int32 GetGlobalStatHistory( const char *pchStatName, STEAM_ARRAY_COUNT(cubData) double *pData, uint32 cubData ) = 0; #ifdef _PS3 // Call to kick off installation of the PS3 trophies. This call is asynchronous, and the results will be returned in a PS3TrophiesInstalled_t @@ -298,13 +298,17 @@ public: #define STEAMUSERSTATS_INTERFACE_VERSION "STEAMUSERSTATS_INTERFACE_VERSION011" +// Global interface accessor +inline ISteamUserStats *SteamUserStats(); +STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamUserStats *, SteamUserStats, STEAMUSERSTATS_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 isteamclient.h must be included +#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx #endif //----------------------------------------------------------------------------- diff --git a/Generator/steam_sdk/isteamutils.h b/Generator/steam_sdk/isteamutils.h index e331fa6..809682b 100644 --- a/Generator/steam_sdk/isteamutils.h +++ b/Generator/steam_sdk/isteamutils.h @@ -10,7 +10,7 @@ #pragma once #endif -#include "isteamclient.h" +#include "steam_api_common.h" // Steam API call failure results @@ -133,7 +133,7 @@ public: // k_ECheckFileSignatureFileNotFound - The file does not exist on disk. // k_ECheckFileSignatureInvalidSignature - The file exists, and the signing tab has been set for this file, but the file is either not signed or the signature does not match. // k_ECheckFileSignatureValidSignature - The file is signed and the signature is valid. - CALL_RESULT( CheckFileSignature_t ) + STEAM_CALL_RESULT( CheckFileSignature_t ) virtual SteamAPICall_t CheckFileSignature( const char *szFileName ) = 0; // Activates the Big Picture text input dialog which only supports gamepad input @@ -173,6 +173,13 @@ public: #define STEAMUTILS_INTERFACE_VERSION "SteamUtils009" +// Global interface accessor +inline ISteamUtils *SteamUtils(); +STEAM_DEFINE_INTERFACE_ACCESSOR( ISteamUtils *, SteamUtils, SteamInternal_FindOrCreateUserInterface( 0, STEAMUTILS_INTERFACE_VERSION ) ); + +// Global accessor for the gameserver client +inline ISteamUtils *SteamGameServerUtils(); +STEAM_DEFINE_INTERFACE_ACCESSOR( ISteamUtils *, SteamGameServerUtils, SteamInternal_FindOrCreateGameServerInterface( 0, STEAMUTILS_INTERFACE_VERSION ) ); // callbacks #if defined( VALVE_CALLBACK_PACK_SMALL ) @@ -180,7 +187,7 @@ public: #elif defined( VALVE_CALLBACK_PACK_LARGE ) #pragma pack( push, 8 ) #else -#error isteamclient.h must be included +#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx #endif //----------------------------------------------------------------------------- diff --git a/Generator/steam_sdk/isteamvideo.h b/Generator/steam_sdk/isteamvideo.h index 32eeb59..efd7740 100644 --- a/Generator/steam_sdk/isteamvideo.h +++ b/Generator/steam_sdk/isteamvideo.h @@ -10,7 +10,7 @@ #pragma once #endif -#include "isteamclient.h" +#include "steam_api_common.h" // callbacks #if defined( VALVE_CALLBACK_PACK_SMALL ) @@ -18,7 +18,7 @@ #elif defined( VALVE_CALLBACK_PACK_LARGE ) #pragma pack( push, 8 ) #else -#error isteamclient.h must be included +#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx #endif @@ -38,31 +38,35 @@ public: virtual bool IsBroadcasting( int *pnNumViewers ) = 0; // Get the OPF Details for 360 Video Playback - CALL_BACK( GetOPFSettingsResult_t ) + STEAM_CALL_BACK( GetOPFSettingsResult_t ) virtual void GetOPFSettings( AppId_t unVideoAppID ) = 0; virtual bool GetOPFStringForApp( AppId_t unVideoAppID, char *pchBuffer, int32 *pnBufferSize ) = 0; }; #define STEAMVIDEO_INTERFACE_VERSION "STEAMVIDEO_INTERFACE_V002" -DEFINE_CALLBACK( BroadcastUploadStart_t, k_iClientVideoCallbacks + 4 ) -END_DEFINE_CALLBACK_0() +// Global interface accessor +inline ISteamVideo *SteamVideo(); +STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamVideo *, SteamVideo, STEAMVIDEO_INTERFACE_VERSION ); -DEFINE_CALLBACK( BroadcastUploadStop_t, k_iClientVideoCallbacks + 5 ) - CALLBACK_MEMBER( 0, EBroadcastUploadResult, m_eResult ) -END_DEFINE_CALLBACK_1() +STEAM_CALLBACK_BEGIN( BroadcastUploadStart_t, k_iClientVideoCallbacks + 4 ) +STEAM_CALLBACK_END(0) -DEFINE_CALLBACK( GetVideoURLResult_t, k_iClientVideoCallbacks + 11 ) - CALLBACK_MEMBER( 0, EResult, m_eResult ) - CALLBACK_MEMBER( 1, AppId_t, m_unVideoAppID ) - CALLBACK_MEMBER( 2, char, m_rgchURL[256] ) -END_DEFINE_CALLBACK_3() +STEAM_CALLBACK_BEGIN( BroadcastUploadStop_t, k_iClientVideoCallbacks + 5 ) + STEAM_CALLBACK_MEMBER( 0, EBroadcastUploadResult, m_eResult ) +STEAM_CALLBACK_END(1) + +STEAM_CALLBACK_BEGIN( GetVideoURLResult_t, k_iClientVideoCallbacks + 11 ) + STEAM_CALLBACK_MEMBER( 0, EResult, m_eResult ) + STEAM_CALLBACK_MEMBER( 1, AppId_t, m_unVideoAppID ) + STEAM_CALLBACK_MEMBER( 2, char, m_rgchURL[256] ) +STEAM_CALLBACK_END(3) -DEFINE_CALLBACK( GetOPFSettingsResult_t, k_iClientVideoCallbacks + 24 ) - CALLBACK_MEMBER( 0, EResult, m_eResult ) - CALLBACK_MEMBER( 1, AppId_t, m_unVideoAppID ) -END_DEFINE_CALLBACK_2() +STEAM_CALLBACK_BEGIN( GetOPFSettingsResult_t, k_iClientVideoCallbacks + 24 ) + STEAM_CALLBACK_MEMBER( 0, EResult, m_eResult ) + STEAM_CALLBACK_MEMBER( 1, AppId_t, m_unVideoAppID ) +STEAM_CALLBACK_END(2) #pragma pack( pop ) diff --git a/Generator/steam_sdk/steam_api.h b/Generator/steam_sdk/steam_api.h index 010a548..cb7e5dc 100644 --- a/Generator/steam_sdk/steam_api.h +++ b/Generator/steam_sdk/steam_api.h @@ -1,6 +1,13 @@ -//====== Copyright 1996-2008, Valve Corporation, All rights reserved. ======= +//====== Copyright Valve Corporation, All rights reserved. ==================== // -// Purpose: +// This header includes *all* of the interfaces and callback structures +// in the Steamworks SDK, and some high level functions to control the SDK +// (init, shutdown, etc) that you probably only need in one or two files. +// +// To save your compile times, we recommend that you not include this file +// in header files. Instead, include the specific headers for the interfaces +// and callback structures you need. The one file you might consider including +// in your precompiled header (e.g. stdafx.h) is steam_api_common.h // //============================================================================= @@ -10,6 +17,10 @@ #pragma once #endif +// Basic stuff +#include "steam_api_common.h" + +// All of the interfaces #include "isteamclient.h" #include "isteamuser.h" #include "isteamfriends.h" @@ -30,31 +41,9 @@ #include "isteaminventory.h" #include "isteamvideo.h" #include "isteamparentalsettings.h" +#include "isteaminput.h" -// Steam API export macro -#if defined( _WIN32 ) && !defined( _X360 ) - #if defined( STEAM_API_EXPORTS ) - #define S_API extern "C" __declspec( dllexport ) - #elif defined( STEAM_API_NODLL ) - #define S_API extern "C" - #else - #define S_API extern "C" __declspec( dllimport ) - #endif // STEAM_API_EXPORTS -#elif defined( GNUC ) - #if defined( STEAM_API_EXPORTS ) - #define S_API extern "C" __attribute__ ((visibility("default"))) - #else - #define S_API extern "C" - #endif // STEAM_API_EXPORTS -#else // !WIN32 - #if defined( STEAM_API_EXPORTS ) - #define S_API extern "C" - #else - #define S_API extern "C" - #endif // STEAM_API_EXPORTS -#endif - //----------------------------------------------------------------------------------------------------------------------------------------------------------// // Steam API setup & shutdown // @@ -93,263 +82,6 @@ S_API void S_CALLTYPE SteamAPI_ReleaseCurrentThreadMemory(); S_API void S_CALLTYPE SteamAPI_WriteMiniDump( uint32 uStructuredExceptionCode, void* pvExceptionInfo, uint32 uBuildID ); S_API void S_CALLTYPE SteamAPI_SetMiniDumpComment( const char *pchMsg ); - -//----------------------------------------------------------------------------------------------------------------------------------------------------------// -// Global accessors for Steamworks C++ APIs. See individual isteam*.h files for details. -// You should not cache the results of these accessors or pass the result pointers across -// modules! Different modules may be compiled against different SDK header versions, and -// the interface pointers could therefore be different across modules. Every line of code -// which calls into a Steamworks API should retrieve the interface from a global accessor. -//----------------------------------------------------------------------------------------------------------------------------------------------------------// -#if !defined( STEAM_API_EXPORTS ) -inline ISteamClient *SteamClient(); -inline ISteamUser *SteamUser(); -inline ISteamFriends *SteamFriends(); -inline ISteamUtils *SteamUtils(); -inline ISteamMatchmaking *SteamMatchmaking(); -inline ISteamUserStats *SteamUserStats(); -inline ISteamApps *SteamApps(); -inline ISteamNetworking *SteamNetworking(); -inline ISteamMatchmakingServers *SteamMatchmakingServers(); -inline ISteamRemoteStorage *SteamRemoteStorage(); -inline ISteamScreenshots *SteamScreenshots(); -inline ISteamHTTP *SteamHTTP(); -inline ISteamController *SteamController(); -inline ISteamUGC *SteamUGC(); -inline ISteamAppList *SteamAppList(); -inline ISteamMusic *SteamMusic(); -inline ISteamMusicRemote *SteamMusicRemote(); -inline ISteamHTMLSurface *SteamHTMLSurface(); -inline ISteamInventory *SteamInventory(); -inline ISteamVideo *SteamVideo(); -inline ISteamParentalSettings *SteamParentalSettings(); -#endif // VERSION_SAFE_STEAM_API_INTERFACES - - -// CSteamAPIContext encapsulates the Steamworks API global accessors into -// a single object. This is DEPRECATED and only remains for compatibility. -class CSteamAPIContext -{ -public: - // DEPRECATED - there is no benefit to using this over the global accessors - CSteamAPIContext() { Clear(); } - void Clear(); - bool Init(); - ISteamClient* SteamClient() const { return m_pSteamClient; } - ISteamUser* SteamUser() const { return m_pSteamUser; } - ISteamFriends* SteamFriends() const { return m_pSteamFriends; } - ISteamUtils* SteamUtils() const { return m_pSteamUtils; } - ISteamMatchmaking* SteamMatchmaking() const { return m_pSteamMatchmaking; } - ISteamUserStats* SteamUserStats() const { return m_pSteamUserStats; } - ISteamApps* SteamApps() const { return m_pSteamApps; } - ISteamMatchmakingServers* SteamMatchmakingServers() const { return m_pSteamMatchmakingServers; } - ISteamNetworking* SteamNetworking() const { return m_pSteamNetworking; } - ISteamRemoteStorage* SteamRemoteStorage() const { return m_pSteamRemoteStorage; } - ISteamScreenshots* SteamScreenshots() const { return m_pSteamScreenshots; } - ISteamHTTP* SteamHTTP() const { return m_pSteamHTTP; } - ISteamController* SteamController() const { return m_pController; } - ISteamUGC* SteamUGC() const { return m_pSteamUGC; } - ISteamAppList* SteamAppList() const { return m_pSteamAppList; } - ISteamMusic* SteamMusic() const { return m_pSteamMusic; } - ISteamMusicRemote* SteamMusicRemote() const { return m_pSteamMusicRemote; } - ISteamHTMLSurface* SteamHTMLSurface() const { return m_pSteamHTMLSurface; } - ISteamInventory* SteamInventory() const { return m_pSteamInventory; } - ISteamVideo* SteamVideo() const { return m_pSteamVideo; } - ISteamParentalSettings* SteamParentalSettings() const { return m_pSteamParentalSettings; } - // DEPRECATED - there is no benefit to using this over the global accessors -private: - ISteamClient *m_pSteamClient; - ISteamUser *m_pSteamUser; - ISteamFriends *m_pSteamFriends; - ISteamUtils *m_pSteamUtils; - ISteamMatchmaking *m_pSteamMatchmaking; - ISteamUserStats *m_pSteamUserStats; - ISteamApps *m_pSteamApps; - ISteamMatchmakingServers *m_pSteamMatchmakingServers; - ISteamNetworking *m_pSteamNetworking; - ISteamRemoteStorage *m_pSteamRemoteStorage; - ISteamScreenshots *m_pSteamScreenshots; - ISteamHTTP *m_pSteamHTTP; - ISteamController *m_pController; - ISteamUGC *m_pSteamUGC; - ISteamAppList *m_pSteamAppList; - ISteamMusic *m_pSteamMusic; - ISteamMusicRemote *m_pSteamMusicRemote; - ISteamHTMLSurface *m_pSteamHTMLSurface; - ISteamInventory *m_pSteamInventory; - ISteamVideo *m_pSteamVideo; - ISteamParentalSettings *m_pSteamParentalSettings; -}; - - -//----------------------------------------------------------------------------------------------------------------------------------------------------------// -// steam callback and call-result helpers -// -// The following macros and classes are used to register your application for -// callbacks and call-results, which are delivered in a predictable manner. -// -// STEAM_CALLBACK macros are meant for use inside of a C++ class definition. -// They map a Steam notification callback directly to a class member function -// which is automatically prototyped as "void func( callback_type *pParam )". -// -// CCallResult is used with specific Steam APIs that return "result handles". -// The handle can be passed to a CCallResult object's Set function, along with -// an object pointer and member-function pointer. The member function will -// be executed once the results of the Steam API call are available. -// -// CCallback and CCallbackManual classes can be used instead of STEAM_CALLBACK -// macros if you require finer control over registration and unregistration. -// -// Callbacks and call-results are queued automatically and are only -// delivered/executed when your application calls SteamAPI_RunCallbacks(). -//----------------------------------------------------------------------------------------------------------------------------------------------------------// - -// SteamAPI_RunCallbacks is safe to call from multiple threads simultaneously, -// but if you choose to do this, callback code could be executed on any thread. -// One alternative is to call SteamAPI_RunCallbacks from the main thread only, -// and call SteamAPI_ReleaseCurrentThreadMemory regularly on other threads. -S_API void S_CALLTYPE SteamAPI_RunCallbacks(); - - -// Declares a callback member function plus a helper member variable which -// registers the callback on object creation and unregisters on destruction. -// The optional fourth 'var' param exists only for backwards-compatibility -// and can be ignored. -#define STEAM_CALLBACK( thisclass, func, .../*callback_type, [deprecated] var*/ ) \ - _STEAM_CALLBACK_SELECT( ( __VA_ARGS__, 4, 3 ), ( /**/, thisclass, func, __VA_ARGS__ ) ) - -// Declares a callback function and a named CCallbackManual variable which -// has Register and Unregister functions instead of automatic registration. -#define STEAM_CALLBACK_MANUAL( thisclass, func, callback_type, var ) \ - CCallbackManual< thisclass, callback_type > var; void func( callback_type *pParam ) - - -// Internal functions used by the utility CCallback objects to receive callbacks -S_API void S_CALLTYPE SteamAPI_RegisterCallback( class CCallbackBase *pCallback, int iCallback ); -S_API void S_CALLTYPE SteamAPI_UnregisterCallback( class CCallbackBase *pCallback ); -// Internal functions used by the utility CCallResult objects to receive async call results -S_API void S_CALLTYPE SteamAPI_RegisterCallResult( class CCallbackBase *pCallback, SteamAPICall_t hAPICall ); -S_API void S_CALLTYPE SteamAPI_UnregisterCallResult( class CCallbackBase *pCallback, SteamAPICall_t hAPICall ); - - -//----------------------------------------------------------------------------- -// Purpose: base for callbacks and call results - internal implementation detail -//----------------------------------------------------------------------------- -class CCallbackBase -{ -public: - CCallbackBase() { m_nCallbackFlags = 0; m_iCallback = 0; } - // don't add a virtual destructor because we export this binary interface across dll's - virtual void Run( void *pvParam ) = 0; - virtual void Run( void *pvParam, bool bIOFailure, SteamAPICall_t hSteamAPICall ) = 0; - int GetICallback() { return m_iCallback; } - virtual int GetCallbackSizeBytes() = 0; - -protected: - enum { k_ECallbackFlagsRegistered = 0x01, k_ECallbackFlagsGameServer = 0x02 }; - uint8 m_nCallbackFlags; - int m_iCallback; - friend class CCallbackMgr; - -private: - CCallbackBase( const CCallbackBase& ); - CCallbackBase& operator=( const CCallbackBase& ); -}; - -//----------------------------------------------------------------------------- -// Purpose: templated base for callbacks - internal implementation detail -//----------------------------------------------------------------------------- -template< int sizeof_P > -class CCallbackImpl : protected CCallbackBase -{ -public: - ~CCallbackImpl() { if ( m_nCallbackFlags & k_ECallbackFlagsRegistered ) SteamAPI_UnregisterCallback( this ); } - void SetGameserverFlag() { m_nCallbackFlags |= k_ECallbackFlagsGameServer; } - -protected: - virtual void Run( void *pvParam ) = 0; - virtual void Run( void *pvParam, bool /*bIOFailure*/, SteamAPICall_t /*hSteamAPICall*/ ) { Run( pvParam ); } - virtual int GetCallbackSizeBytes() { return sizeof_P; } -}; - - -//----------------------------------------------------------------------------- -// Purpose: maps a steam async call result to a class member function -// template params: T = local class, P = parameter struct -//----------------------------------------------------------------------------- -template< class T, class P > -class CCallResult : private CCallbackBase -{ -public: - typedef void (T::*func_t)( P*, bool ); - - CCallResult(); - ~CCallResult(); - - void Set( SteamAPICall_t hAPICall, T *p, func_t func ); - bool IsActive() const; - void Cancel(); - - void SetGameserverFlag() { m_nCallbackFlags |= k_ECallbackFlagsGameServer; } -private: - virtual void Run( void *pvParam ); - virtual void Run( void *pvParam, bool bIOFailure, SteamAPICall_t hSteamAPICall ); - virtual int GetCallbackSizeBytes() { return sizeof( P ); } - - SteamAPICall_t m_hAPICall; - T *m_pObj; - func_t m_Func; -}; - - - -//----------------------------------------------------------------------------- -// Purpose: maps a steam callback to a class member function -// template params: T = local class, P = parameter struct, -// bGameserver = listen for gameserver callbacks instead of client callbacks -//----------------------------------------------------------------------------- -template< class T, class P, bool bGameserver = false > -class CCallback : public CCallbackImpl< sizeof( P ) > -{ -public: - typedef void (T::*func_t)(P*); - - // NOTE: If you can't provide the correct parameters at construction time, you should - // use the CCallbackManual callback object (STEAM_CALLBACK_MANUAL macro) instead. - CCallback( T *pObj, func_t func ); - - void Register( T *pObj, func_t func ); - void Unregister(); - -protected: - virtual void Run( void *pvParam ); - - T *m_pObj; - func_t m_Func; -}; - - -//----------------------------------------------------------------------------- -// Purpose: subclass of CCallback which allows default-construction in -// an unregistered state; you must call Register manually -//----------------------------------------------------------------------------- -template< class T, class P, bool bGameServer = false > -class CCallbackManual : public CCallback< T, P, bGameServer > -{ -public: - CCallbackManual() : CCallback< T, P, bGameServer >( NULL, NULL ) {} - - // Inherits public Register and Unregister functions from base class -}; - - - -#ifdef _WIN32 -// disable this warning; this pattern need for steam callback registration -#pragma warning( disable: 4355 ) // 'this' : used in base member initializer list -#endif - - //----------------------------------------------------------------------------------------------------------------------------------------------------------// // steamclient.dll private wrapper functions // @@ -373,9 +105,6 @@ S_API HSteamUser Steam_GetHSteamUserCurrent(); // DEPRECATED - implementation is Windows only, and the path returned is a UTF-8 string which must be converted to UTF-16 for use with Win32 APIs S_API const char *SteamAPI_GetSteamInstallPath(); -// returns the pipe we are communicating to Steam with -S_API HSteamPipe SteamAPI_GetHSteamPipe(); - // sets whether or not Steam_RunCallbacks() should do a try {} catch (...) {} around calls to issuing callbacks S_API void SteamAPI_SetTryCatchCallbacks( bool bTryCatchCallbacks ); @@ -389,6 +118,126 @@ S_API HSteamUser GetHSteamUser(); S_API bool S_CALLTYPE SteamAPI_InitSafe(); #endif -#include "steam_api_internal.h" +#if defined(USE_BREAKPAD_HANDLER) || defined(STEAM_API_EXPORTS) +// this should be called before the game initialized the steam APIs +// pchDate should be of the format "Mmm dd yyyy" (such as from the __ DATE __ macro ) +// pchTime should be of the format "hh:mm:ss" (such as from the __ TIME __ macro ) +// bFullMemoryDumps (Win32 only) -- writes out a uuid-full.dmp in the client/dumps folder +// pvContext-- can be NULL, will be the void * context passed into m_pfnPreMinidumpCallback +// PFNPreMinidumpCallback m_pfnPreMinidumpCallback -- optional callback which occurs just before a .dmp file is written during a crash. Applications can hook this to allow adding additional information into the .dmp comment stream. +S_API void S_CALLTYPE SteamAPI_UseBreakpadCrashHandler( char const *pchVersion, char const *pchDate, char const *pchTime, bool bFullMemoryDumps, void *pvContext, PFNPreMinidumpCallback m_pfnPreMinidumpCallback ); +S_API void S_CALLTYPE SteamAPI_SetBreakpadAppID( uint32 unAppID ); +#endif + + +//----------------------------------------------------------------------------------------------------------------------------------------------------------// +// +// CSteamAPIContext +// +//----------------------------------------------------------------------------------------------------------------------------------------------------------// + +#ifndef STEAM_API_EXPORTS + +// Deprecated! Use the global accessors directly +inline bool CSteamAPIContext::Init() +{ + m_pSteamClient = ::SteamClient(); + if ( !m_pSteamClient ) + return false; + + m_pSteamUser = ::SteamUser(); + if ( !m_pSteamUser ) + return false; + + m_pSteamFriends = ::SteamFriends(); + if ( !m_pSteamFriends ) + return false; + + m_pSteamUtils = ::SteamUtils(); + if ( !m_pSteamUtils ) + return false; + + m_pSteamMatchmaking = ::SteamMatchmaking(); + if ( !m_pSteamMatchmaking ) + return false; + + m_pSteamGameSearch = ::SteamGameSearch(); + if ( !m_pSteamGameSearch ) + return false; + + m_pSteamMatchmakingServers = ::SteamMatchmakingServers(); + if ( !m_pSteamMatchmakingServers ) + return false; + + m_pSteamUserStats = ::SteamUserStats(); + if ( !m_pSteamUserStats ) + return false; + + m_pSteamApps = ::SteamApps(); + if ( !m_pSteamApps ) + return false; + + m_pSteamNetworking = ::SteamNetworking(); + if ( !m_pSteamNetworking ) + return false; + + m_pSteamRemoteStorage = ::SteamRemoteStorage(); + if ( !m_pSteamRemoteStorage ) + return false; + + m_pSteamScreenshots = ::SteamScreenshots(); + if ( !m_pSteamScreenshots ) + return false; + + m_pSteamHTTP = ::SteamHTTP(); + if ( !m_pSteamHTTP ) + return false; + + m_pController = ::SteamController(); + if ( !m_pController ) + return false; + + m_pSteamUGC = ::SteamUGC(); + if ( !m_pSteamUGC ) + return false; + + m_pSteamAppList = ::SteamAppList(); + if ( !m_pSteamAppList ) + return false; + + m_pSteamMusic = ::SteamMusic(); + if ( !m_pSteamMusic ) + return false; + + m_pSteamMusicRemote = ::SteamMusicRemote(); + if ( !m_pSteamMusicRemote ) + return false; + +#ifndef ANDROID // Not yet supported on Android + m_pSteamHTMLSurface = ::SteamHTMLSurface(); + if ( !m_pSteamHTMLSurface ) + return false; +#endif + + m_pSteamInventory = ::SteamInventory(); + if ( !m_pSteamInventory ) + return false; + + m_pSteamVideo = ::SteamVideo(); + if ( !m_pSteamVideo ) + return false; + + m_pSteamParentalSettings = ::SteamParentalSettings(); + if ( !m_pSteamParentalSettings ) + return false; + + m_pSteamInput = ::SteamInput(); + if ( !m_pSteamInput ) + return false; + + return true; +} + +#endif #endif // STEAM_API_H diff --git a/Generator/steam_sdk/steam_api.json b/Generator/steam_sdk/steam_api.json index 02bc811..43de069 100644 --- a/Generator/steam_sdk/steam_api.json +++ b/Generator/steam_sdk/steam_api.json @@ -28,6 +28,7 @@ ,{"typedef": "PartnerId_t","type": "uint32"} ,{"typedef": "ManifestId_t","type": "uint64"} ,{"typedef": "SiteId_t","type": "uint64"} +,{"typedef": "PartyBeaconID_t","type": "uint64"} ,{"typedef": "HAuthTicket","type": "uint32"} ,{"typedef": "PFNLegacyKeyRegistration","type": "void (*)(const char *, const char *)"} ,{"typedef": "PFNLegacyKeyInstalled","type": "_Bool (*)(void)"} @@ -39,6 +40,8 @@ ,{"typedef": "HSteamUser","type": "int32"} ,{"typedef": "SteamAPIWarningMessageHook_t","type": "void (*)(int, const char *) __attribute__((cdecl))"} ,{"typedef": "SteamAPI_CheckCallbackRegistered_t","type": "uint32 (*)(int)"} +,{"typedef": "CCallResult::func_t","type": "void (T::*)(P *, _Bool)"} +,{"typedef": "CCallback::func_t","type": "void (T::*)(P *)"} ,{"typedef": "FriendsGroupID_t","type": "int16"} ,{"typedef": "SteamAPIWarningMessageHook_t","type": "void (*)(int, const char *) __attribute__((cdecl))"} ,{"typedef": "HServerListRequest","type": "void *"} @@ -53,66 +56,23 @@ ,{"typedef": "SNetSocket_t","type": "uint32"} ,{"typedef": "SNetListenSocket_t","type": "uint32"} ,{"typedef": "ScreenshotHandle","type": "uint32"} -,{"typedef": "PlaybackStatusHasChanged_t::SteamCallback_t","type": "struct PlaybackStatusHasChanged_t"} -,{"typedef": "VolumeHasChanged_t::SteamCallback_t","type": "struct VolumeHasChanged_t"} -,{"typedef": "MusicPlayerRemoteWillActivate_t::SteamCallback_t","type": "struct MusicPlayerRemoteWillActivate_t"} -,{"typedef": "MusicPlayerRemoteWillDeactivate_t::SteamCallback_t","type": "struct MusicPlayerRemoteWillDeactivate_t"} -,{"typedef": "MusicPlayerRemoteToFront_t::SteamCallback_t","type": "struct MusicPlayerRemoteToFront_t"} -,{"typedef": "MusicPlayerWillQuit_t::SteamCallback_t","type": "struct MusicPlayerWillQuit_t"} -,{"typedef": "MusicPlayerWantsPlay_t::SteamCallback_t","type": "struct MusicPlayerWantsPlay_t"} -,{"typedef": "MusicPlayerWantsPause_t::SteamCallback_t","type": "struct MusicPlayerWantsPause_t"} -,{"typedef": "MusicPlayerWantsPlayPrevious_t::SteamCallback_t","type": "struct MusicPlayerWantsPlayPrevious_t"} -,{"typedef": "MusicPlayerWantsPlayNext_t::SteamCallback_t","type": "struct MusicPlayerWantsPlayNext_t"} -,{"typedef": "MusicPlayerWantsShuffled_t::SteamCallback_t","type": "struct MusicPlayerWantsShuffled_t"} -,{"typedef": "MusicPlayerWantsLooped_t::SteamCallback_t","type": "struct MusicPlayerWantsLooped_t"} -,{"typedef": "MusicPlayerWantsVolume_t::SteamCallback_t","type": "struct MusicPlayerWantsVolume_t"} -,{"typedef": "MusicPlayerSelectsQueueEntry_t::SteamCallback_t","type": "struct MusicPlayerSelectsQueueEntry_t"} -,{"typedef": "MusicPlayerSelectsPlaylistEntry_t::SteamCallback_t","type": "struct MusicPlayerSelectsPlaylistEntry_t"} -,{"typedef": "MusicPlayerWantsPlayingRepeatStatus_t::SteamCallback_t","type": "struct MusicPlayerWantsPlayingRepeatStatus_t"} ,{"typedef": "HTTPRequestHandle","type": "uint32"} ,{"typedef": "HTTPCookieContainerHandle","type": "uint32"} +,{"typedef": "InputHandle_t","type": "uint64"} +,{"typedef": "InputActionSetHandle_t","type": "uint64"} +,{"typedef": "InputDigitalActionHandle_t","type": "uint64"} +,{"typedef": "InputAnalogActionHandle_t","type": "uint64"} ,{"typedef": "ControllerHandle_t","type": "uint64"} ,{"typedef": "ControllerActionSetHandle_t","type": "uint64"} ,{"typedef": "ControllerDigitalActionHandle_t","type": "uint64"} ,{"typedef": "ControllerAnalogActionHandle_t","type": "uint64"} ,{"typedef": "UGCQueryHandle_t","type": "uint64"} ,{"typedef": "UGCUpdateHandle_t","type": "uint64"} -,{"typedef": "SteamAppInstalled_t::SteamCallback_t","type": "struct SteamAppInstalled_t"} -,{"typedef": "SteamAppUninstalled_t::SteamCallback_t","type": "struct SteamAppUninstalled_t"} ,{"typedef": "HHTMLBrowser","type": "uint32"} -,{"typedef": "HTML_BrowserReady_t::SteamCallback_t","type": "struct HTML_BrowserReady_t"} -,{"typedef": "HTML_NeedsPaint_t::SteamCallback_t","type": "struct HTML_NeedsPaint_t"} -,{"typedef": "HTML_StartRequest_t::SteamCallback_t","type": "struct HTML_StartRequest_t"} -,{"typedef": "HTML_CloseBrowser_t::SteamCallback_t","type": "struct HTML_CloseBrowser_t"} -,{"typedef": "HTML_URLChanged_t::SteamCallback_t","type": "struct HTML_URLChanged_t"} -,{"typedef": "HTML_FinishedRequest_t::SteamCallback_t","type": "struct HTML_FinishedRequest_t"} -,{"typedef": "HTML_OpenLinkInNewTab_t::SteamCallback_t","type": "struct HTML_OpenLinkInNewTab_t"} -,{"typedef": "HTML_ChangedTitle_t::SteamCallback_t","type": "struct HTML_ChangedTitle_t"} -,{"typedef": "HTML_SearchResults_t::SteamCallback_t","type": "struct HTML_SearchResults_t"} -,{"typedef": "HTML_CanGoBackAndForward_t::SteamCallback_t","type": "struct HTML_CanGoBackAndForward_t"} -,{"typedef": "HTML_HorizontalScroll_t::SteamCallback_t","type": "struct HTML_HorizontalScroll_t"} -,{"typedef": "HTML_VerticalScroll_t::SteamCallback_t","type": "struct HTML_VerticalScroll_t"} -,{"typedef": "HTML_LinkAtPosition_t::SteamCallback_t","type": "struct HTML_LinkAtPosition_t"} -,{"typedef": "HTML_JSAlert_t::SteamCallback_t","type": "struct HTML_JSAlert_t"} -,{"typedef": "HTML_JSConfirm_t::SteamCallback_t","type": "struct HTML_JSConfirm_t"} -,{"typedef": "HTML_FileOpenDialog_t::SteamCallback_t","type": "struct HTML_FileOpenDialog_t"} -,{"typedef": "HTML_NewWindow_t::SteamCallback_t","type": "struct HTML_NewWindow_t"} -,{"typedef": "HTML_SetCursor_t::SteamCallback_t","type": "struct HTML_SetCursor_t"} -,{"typedef": "HTML_StatusText_t::SteamCallback_t","type": "struct HTML_StatusText_t"} -,{"typedef": "HTML_ShowToolTip_t::SteamCallback_t","type": "struct HTML_ShowToolTip_t"} -,{"typedef": "HTML_UpdateToolTip_t::SteamCallback_t","type": "struct HTML_UpdateToolTip_t"} -,{"typedef": "HTML_HideToolTip_t::SteamCallback_t","type": "struct HTML_HideToolTip_t"} -,{"typedef": "HTML_BrowserRestarted_t::SteamCallback_t","type": "struct HTML_BrowserRestarted_t"} ,{"typedef": "SteamItemInstanceID_t","type": "uint64"} ,{"typedef": "SteamItemDef_t","type": "int32"} ,{"typedef": "SteamInventoryResult_t","type": "int32"} ,{"typedef": "SteamInventoryUpdateHandle_t","type": "uint64"} -,{"typedef": "BroadcastUploadStart_t::SteamCallback_t","type": "struct BroadcastUploadStart_t"} -,{"typedef": "BroadcastUploadStop_t::SteamCallback_t","type": "struct BroadcastUploadStop_t"} -,{"typedef": "GetVideoURLResult_t::SteamCallback_t","type": "struct GetVideoURLResult_t"} -,{"typedef": "GetOPFSettingsResult_t::SteamCallback_t","type": "struct GetOPFSettingsResult_t"} -,{"typedef": "CCallResult::func_t","type": "void (T::*)(P *, _Bool)"} -,{"typedef": "CCallback::func_t","type": "void (T::*)(P *)"} ], "enums":[ {"enumname": "EUniverse","values": [ @@ -235,6 +195,7 @@ ,{"name": "k_EResultWGNetworkSendExceeded","value": "110"} ,{"name": "k_EResultAccountNotFriends","value": "111"} ,{"name": "k_EResultLimitedUserAccount","value": "112"} + ,{"name": "k_EResultCantRemoveItem","value": "113"} ]} , {"enumname": "EVoiceResult","values": [ {"name": "k_EVoiceResultOK","value": "0"} @@ -427,6 +388,16 @@ ,{"name": "k_EBroadcastUploadResultMissingAudio","value": "11"} ,{"name": "k_EBroadcastUploadResultTooFarBehind","value": "12"} ,{"name": "k_EBroadcastUploadResultTranscodeBehind","value": "13"} + ,{"name": "k_EBroadcastUploadResultNotAllowedToPlay","value": "14"} + ,{"name": "k_EBroadcastUploadResultBusy","value": "15"} + ,{"name": "k_EBroadcastUploadResultBanned","value": "16"} + ,{"name": "k_EBroadcastUploadResultAlreadyActive","value": "17"} + ,{"name": "k_EBroadcastUploadResultForcedOff","value": "18"} + ,{"name": "k_EBroadcastUploadResultAudioBehind","value": "19"} + ,{"name": "k_EBroadcastUploadResultShutdown","value": "20"} + ,{"name": "k_EBroadcastUploadResultDisconnect","value": "21"} + ,{"name": "k_EBroadcastUploadResultVideoInitFailed","value": "22"} + ,{"name": "k_EBroadcastUploadResultAudioInitFailed","value": "23"} ]} , {"enumname": "ELaunchOptionType","values": [ {"name": "k_ELaunchOptionType_None","value": "0"} @@ -453,6 +424,7 @@ ,{"name": "k_eEVRHMDType_HTC_Dev","value": "1"} ,{"name": "k_eEVRHMDType_HTC_VivePre","value": "2"} ,{"name": "k_eEVRHMDType_HTC_Vive","value": "3"} + ,{"name": "k_eEVRHMDType_HTC_VivePro","value": "4"} ,{"name": "k_eEVRHMDType_HTC_Unknown","value": "20"} ,{"name": "k_eEVRHMDType_Oculus_DK1","value": "21"} ,{"name": "k_eEVRHMDType_Oculus_DK2","value": "22"} @@ -470,6 +442,29 @@ ,{"name": "k_eEVRHMDType_Samsung_Odyssey","value": "91"} ,{"name": "k_eEVRHMDType_Unannounced_Unknown","value": "100"} ,{"name": "k_eEVRHMDType_Unannounced_WindowsMR","value": "101"} + ,{"name": "k_eEVRHMDType_vridge","value": "110"} + ,{"name": "k_eEVRHMDType_Huawei_Unknown","value": "120"} + ,{"name": "k_eEVRHMDType_Huawei_VR2","value": "121"} + ,{"name": "k_eEVRHMDType_Huawei_Unannounced","value": "129"} +]} +, {"enumname": "EMarketNotAllowedReasonFlags","values": [ + {"name": "k_EMarketNotAllowedReason_None","value": "0"} + ,{"name": "k_EMarketNotAllowedReason_TemporaryFailure","value": "1"} + ,{"name": "k_EMarketNotAllowedReason_AccountDisabled","value": "2"} + ,{"name": "k_EMarketNotAllowedReason_AccountLockedDown","value": "4"} + ,{"name": "k_EMarketNotAllowedReason_AccountLimited","value": "8"} + ,{"name": "k_EMarketNotAllowedReason_TradeBanned","value": "16"} + ,{"name": "k_EMarketNotAllowedReason_AccountNotTrusted","value": "32"} + ,{"name": "k_EMarketNotAllowedReason_SteamGuardNotEnabled","value": "64"} + ,{"name": "k_EMarketNotAllowedReason_SteamGuardOnlyRecentlyEnabled","value": "128"} + ,{"name": "k_EMarketNotAllowedReason_RecentPasswordReset","value": "256"} + ,{"name": "k_EMarketNotAllowedReason_NewPaymentMethod","value": "512"} + ,{"name": "k_EMarketNotAllowedReason_InvalidCookie","value": "1024"} + ,{"name": "k_EMarketNotAllowedReason_UsingNewDevice","value": "2048"} + ,{"name": "k_EMarketNotAllowedReason_RecentSelfRefund","value": "4096"} + ,{"name": "k_EMarketNotAllowedReason_NewPaymentMethodCannotBeVerified","value": "8192"} + ,{"name": "k_EMarketNotAllowedReason_NoRecentPurchases","value": "16384"} + ,{"name": "k_EMarketNotAllowedReason_AcceptedWalletGift","value": "32768"} ]} , {"enumname": "CGameID::EGameIDType","values": [ {"name": "k_EGameIDTypeApp","value": "0"} @@ -477,6 +472,24 @@ ,{"name": "k_EGameIDTypeShortcut","value": "2"} ,{"name": "k_EGameIDTypeP2P","value": "3"} ]} +, {"enumname": "EGameSearchErrorCode_t","values": [ + {"name": "k_EGameSearchErrorCode_OK","value": "1"} + ,{"name": "k_EGameSearchErrorCode_Failed_Search_Already_In_Progress","value": "2"} + ,{"name": "k_EGameSearchErrorCode_Failed_No_Search_In_Progress","value": "3"} + ,{"name": "k_EGameSearchErrorCode_Failed_Not_Lobby_Leader","value": "4"} + ,{"name": "k_EGameSearchErrorCode_Failed_No_Host_Available","value": "5"} + ,{"name": "k_EGameSearchErrorCode_Failed_Search_Params_Invalid","value": "6"} + ,{"name": "k_EGameSearchErrorCode_Failed_Offline","value": "7"} + ,{"name": "k_EGameSearchErrorCode_Failed_NotAuthorized","value": "8"} + ,{"name": "k_EGameSearchErrorCode_Failed_Unknown_Error","value": "9"} +]} +, {"enumname": "EPlayerResult_t","values": [ + {"name": "k_EPlayerResultFailedToConnect","value": "1"} + ,{"name": "k_EPlayerResultAbandoned","value": "2"} + ,{"name": "k_EPlayerResultKicked","value": "3"} + ,{"name": "k_EPlayerResultIncomplete","value": "4"} + ,{"name": "k_EPlayerResultCompleted","value": "5"} +]} , {"enumname": "IPCFailure_t::EFailureType","values": [ {"name": "k_EFailureFlushedCallbackQueue","value": "0"} ,{"name": "k_EFailurePipeFail","value": "1"} @@ -500,7 +513,8 @@ ,{"name": "k_EPersonaStateSnooze","value": "4"} ,{"name": "k_EPersonaStateLookingToTrade","value": "5"} ,{"name": "k_EPersonaStateLookingToPlay","value": "6"} - ,{"name": "k_EPersonaStateMax","value": "7"} + ,{"name": "k_EPersonaStateInvisible","value": "7"} + ,{"name": "k_EPersonaStateMax","value": "8"} ]} , {"enumname": "EFriendFlags","values": [ {"name": "k_EFriendFlagNone","value": "0"} @@ -531,6 +545,10 @@ ,{"name": "k_EOverlayToStoreFlag_AddToCart","value": "1"} ,{"name": "k_EOverlayToStoreFlag_AddToCartAndShow","value": "2"} ]} +, {"enumname": "EActivateGameOverlayToWebPageMode","values": [ + {"name": "k_EActivateGameOverlayToWebPageMode_Default","value": "0"} + ,{"name": "k_EActivateGameOverlayToWebPageMode_Modal","value": "1"} +]} , {"enumname": "EPersonaChange","values": [ {"name": "k_EPersonaChangeName","value": "1"} ,{"name": "k_EPersonaChangeStatus","value": "2"} @@ -543,9 +561,10 @@ ,{"name": "k_EPersonaChangeLeftSource","value": "256"} ,{"name": "k_EPersonaChangeRelationshipChanged","value": "512"} ,{"name": "k_EPersonaChangeNameFirstSet","value": "1024"} - ,{"name": "k_EPersonaChangeFacebookInfo","value": "2048"} + ,{"name": "k_EPersonaChangeBroadcast","value": "2048"} ,{"name": "k_EPersonaChangeNickname","value": "4096"} ,{"name": "k_EPersonaChangeSteamLevel","value": "8192"} + ,{"name": "k_EPersonaChangeRichPresence","value": "16384"} ]} , {"enumname": "ESteamAPICallFailure","values": [ {"name": "k_ESteamAPICallFailureNone","value": "-1"} @@ -601,6 +620,23 @@ ,{"name": "k_EChatMemberStateChangeKicked","value": "8"} ,{"name": "k_EChatMemberStateChangeBanned","value": "16"} ]} +, {"enumname": "ESteamPartyBeaconLocationType","values": [ + {"name": "k_ESteamPartyBeaconLocationType_Invalid","value": "0"} + ,{"name": "k_ESteamPartyBeaconLocationType_ChatGroup","value": "1"} + ,{"name": "k_ESteamPartyBeaconLocationType_Max","value": "2"} +]} +, {"enumname": "ESteamPartyBeaconLocationData","values": [ + {"name": "k_ESteamPartyBeaconLocationDataInvalid","value": "0"} + ,{"name": "k_ESteamPartyBeaconLocationDataName","value": "1"} + ,{"name": "k_ESteamPartyBeaconLocationDataIconURLSmall","value": "2"} + ,{"name": "k_ESteamPartyBeaconLocationDataIconURLMedium","value": "3"} + ,{"name": "k_ESteamPartyBeaconLocationDataIconURLLarge","value": "4"} +]} +, {"enumname": "RequestPlayersForGameResultCallback_t::PlayerAcceptState_t","values": [ + {"name": "k_EStateUnknown","value": "0"} + ,{"name": "k_EStatePlayerAccepted","value": "1"} + ,{"name": "k_EStatePlayerDeclined","value": "2"} +]} , {"enumname": "ERemoteStoragePlatform","values": [ {"name": "k_ERemoteStoragePlatformNone","value": "0"} ,{"name": "k_ERemoteStoragePlatformWindows","value": "1"} @@ -608,6 +644,7 @@ ,{"name": "k_ERemoteStoragePlatformPS3","value": "4"} ,{"name": "k_ERemoteStoragePlatformLinux","value": "8"} ,{"name": "k_ERemoteStoragePlatformReserved2","value": "16"} + ,{"name": "k_ERemoteStoragePlatformAndroid","value": "32"} ,{"name": "k_ERemoteStoragePlatformAll","value": "-1"} ]} , {"enumname": "ERemoteStoragePublishedFileVisibility","values": [ @@ -794,10 +831,363 @@ ,{"name": "k_EHTTPStatusCode505HTTPVersionNotSupported","value": "505"} ,{"name": "k_EHTTPStatusCode5xxUnknown","value": "599"} ]} +, {"enumname": "EInputSource","values": [ + {"name": "k_EInputSource_None","value": "0"} + ,{"name": "k_EInputSource_LeftTrackpad","value": "1"} + ,{"name": "k_EInputSource_RightTrackpad","value": "2"} + ,{"name": "k_EInputSource_Joystick","value": "3"} + ,{"name": "k_EInputSource_ABXY","value": "4"} + ,{"name": "k_EInputSource_Switch","value": "5"} + ,{"name": "k_EInputSource_LeftTrigger","value": "6"} + ,{"name": "k_EInputSource_RightTrigger","value": "7"} + ,{"name": "k_EInputSource_LeftBumper","value": "8"} + ,{"name": "k_EInputSource_RightBumper","value": "9"} + ,{"name": "k_EInputSource_Gyro","value": "10"} + ,{"name": "k_EInputSource_CenterTrackpad","value": "11"} + ,{"name": "k_EInputSource_RightJoystick","value": "12"} + ,{"name": "k_EInputSource_DPad","value": "13"} + ,{"name": "k_EInputSource_Key","value": "14"} + ,{"name": "k_EInputSource_Mouse","value": "15"} + ,{"name": "k_EInputSource_LeftGyro","value": "16"} + ,{"name": "k_EInputSource_Count","value": "17"} +]} +, {"enumname": "EInputSourceMode","values": [ + {"name": "k_EInputSourceMode_None","value": "0"} + ,{"name": "k_EInputSourceMode_Dpad","value": "1"} + ,{"name": "k_EInputSourceMode_Buttons","value": "2"} + ,{"name": "k_EInputSourceMode_FourButtons","value": "3"} + ,{"name": "k_EInputSourceMode_AbsoluteMouse","value": "4"} + ,{"name": "k_EInputSourceMode_RelativeMouse","value": "5"} + ,{"name": "k_EInputSourceMode_JoystickMove","value": "6"} + ,{"name": "k_EInputSourceMode_JoystickMouse","value": "7"} + ,{"name": "k_EInputSourceMode_JoystickCamera","value": "8"} + ,{"name": "k_EInputSourceMode_ScrollWheel","value": "9"} + ,{"name": "k_EInputSourceMode_Trigger","value": "10"} + ,{"name": "k_EInputSourceMode_TouchMenu","value": "11"} + ,{"name": "k_EInputSourceMode_MouseJoystick","value": "12"} + ,{"name": "k_EInputSourceMode_MouseRegion","value": "13"} + ,{"name": "k_EInputSourceMode_RadialMenu","value": "14"} + ,{"name": "k_EInputSourceMode_SingleButton","value": "15"} + ,{"name": "k_EInputSourceMode_Switches","value": "16"} +]} +, {"enumname": "EInputActionOrigin","values": [ + {"name": "k_EInputActionOrigin_None","value": "0"} + ,{"name": "k_EInputActionOrigin_SteamController_A","value": "1"} + ,{"name": "k_EInputActionOrigin_SteamController_B","value": "2"} + ,{"name": "k_EInputActionOrigin_SteamController_X","value": "3"} + ,{"name": "k_EInputActionOrigin_SteamController_Y","value": "4"} + ,{"name": "k_EInputActionOrigin_SteamController_LeftBumper","value": "5"} + ,{"name": "k_EInputActionOrigin_SteamController_RightBumper","value": "6"} + ,{"name": "k_EInputActionOrigin_SteamController_LeftGrip","value": "7"} + ,{"name": "k_EInputActionOrigin_SteamController_RightGrip","value": "8"} + ,{"name": "k_EInputActionOrigin_SteamController_Start","value": "9"} + ,{"name": "k_EInputActionOrigin_SteamController_Back","value": "10"} + ,{"name": "k_EInputActionOrigin_SteamController_LeftPad_Touch","value": "11"} + ,{"name": "k_EInputActionOrigin_SteamController_LeftPad_Swipe","value": "12"} + ,{"name": "k_EInputActionOrigin_SteamController_LeftPad_Click","value": "13"} + ,{"name": "k_EInputActionOrigin_SteamController_LeftPad_DPadNorth","value": "14"} + ,{"name": "k_EInputActionOrigin_SteamController_LeftPad_DPadSouth","value": "15"} + ,{"name": "k_EInputActionOrigin_SteamController_LeftPad_DPadWest","value": "16"} + ,{"name": "k_EInputActionOrigin_SteamController_LeftPad_DPadEast","value": "17"} + ,{"name": "k_EInputActionOrigin_SteamController_RightPad_Touch","value": "18"} + ,{"name": "k_EInputActionOrigin_SteamController_RightPad_Swipe","value": "19"} + ,{"name": "k_EInputActionOrigin_SteamController_RightPad_Click","value": "20"} + ,{"name": "k_EInputActionOrigin_SteamController_RightPad_DPadNorth","value": "21"} + ,{"name": "k_EInputActionOrigin_SteamController_RightPad_DPadSouth","value": "22"} + ,{"name": "k_EInputActionOrigin_SteamController_RightPad_DPadWest","value": "23"} + ,{"name": "k_EInputActionOrigin_SteamController_RightPad_DPadEast","value": "24"} + ,{"name": "k_EInputActionOrigin_SteamController_LeftTrigger_Pull","value": "25"} + ,{"name": "k_EInputActionOrigin_SteamController_LeftTrigger_Click","value": "26"} + ,{"name": "k_EInputActionOrigin_SteamController_RightTrigger_Pull","value": "27"} + ,{"name": "k_EInputActionOrigin_SteamController_RightTrigger_Click","value": "28"} + ,{"name": "k_EInputActionOrigin_SteamController_LeftStick_Move","value": "29"} + ,{"name": "k_EInputActionOrigin_SteamController_LeftStick_Click","value": "30"} + ,{"name": "k_EInputActionOrigin_SteamController_LeftStick_DPadNorth","value": "31"} + ,{"name": "k_EInputActionOrigin_SteamController_LeftStick_DPadSouth","value": "32"} + ,{"name": "k_EInputActionOrigin_SteamController_LeftStick_DPadWest","value": "33"} + ,{"name": "k_EInputActionOrigin_SteamController_LeftStick_DPadEast","value": "34"} + ,{"name": "k_EInputActionOrigin_SteamController_Gyro_Move","value": "35"} + ,{"name": "k_EInputActionOrigin_SteamController_Gyro_Pitch","value": "36"} + ,{"name": "k_EInputActionOrigin_SteamController_Gyro_Yaw","value": "37"} + ,{"name": "k_EInputActionOrigin_SteamController_Gyro_Roll","value": "38"} + ,{"name": "k_EInputActionOrigin_SteamController_Reserved0","value": "39"} + ,{"name": "k_EInputActionOrigin_SteamController_Reserved1","value": "40"} + ,{"name": "k_EInputActionOrigin_SteamController_Reserved2","value": "41"} + ,{"name": "k_EInputActionOrigin_SteamController_Reserved3","value": "42"} + ,{"name": "k_EInputActionOrigin_SteamController_Reserved4","value": "43"} + ,{"name": "k_EInputActionOrigin_SteamController_Reserved5","value": "44"} + ,{"name": "k_EInputActionOrigin_SteamController_Reserved6","value": "45"} + ,{"name": "k_EInputActionOrigin_SteamController_Reserved7","value": "46"} + ,{"name": "k_EInputActionOrigin_SteamController_Reserved8","value": "47"} + ,{"name": "k_EInputActionOrigin_SteamController_Reserved9","value": "48"} + ,{"name": "k_EInputActionOrigin_SteamController_Reserved10","value": "49"} + ,{"name": "k_EInputActionOrigin_PS4_X","value": "50"} + ,{"name": "k_EInputActionOrigin_PS4_Circle","value": "51"} + ,{"name": "k_EInputActionOrigin_PS4_Triangle","value": "52"} + ,{"name": "k_EInputActionOrigin_PS4_Square","value": "53"} + ,{"name": "k_EInputActionOrigin_PS4_LeftBumper","value": "54"} + ,{"name": "k_EInputActionOrigin_PS4_RightBumper","value": "55"} + ,{"name": "k_EInputActionOrigin_PS4_Options","value": "56"} + ,{"name": "k_EInputActionOrigin_PS4_Share","value": "57"} + ,{"name": "k_EInputActionOrigin_PS4_LeftPad_Touch","value": "58"} + ,{"name": "k_EInputActionOrigin_PS4_LeftPad_Swipe","value": "59"} + ,{"name": "k_EInputActionOrigin_PS4_LeftPad_Click","value": "60"} + ,{"name": "k_EInputActionOrigin_PS4_LeftPad_DPadNorth","value": "61"} + ,{"name": "k_EInputActionOrigin_PS4_LeftPad_DPadSouth","value": "62"} + ,{"name": "k_EInputActionOrigin_PS4_LeftPad_DPadWest","value": "63"} + ,{"name": "k_EInputActionOrigin_PS4_LeftPad_DPadEast","value": "64"} + ,{"name": "k_EInputActionOrigin_PS4_RightPad_Touch","value": "65"} + ,{"name": "k_EInputActionOrigin_PS4_RightPad_Swipe","value": "66"} + ,{"name": "k_EInputActionOrigin_PS4_RightPad_Click","value": "67"} + ,{"name": "k_EInputActionOrigin_PS4_RightPad_DPadNorth","value": "68"} + ,{"name": "k_EInputActionOrigin_PS4_RightPad_DPadSouth","value": "69"} + ,{"name": "k_EInputActionOrigin_PS4_RightPad_DPadWest","value": "70"} + ,{"name": "k_EInputActionOrigin_PS4_RightPad_DPadEast","value": "71"} + ,{"name": "k_EInputActionOrigin_PS4_CenterPad_Touch","value": "72"} + ,{"name": "k_EInputActionOrigin_PS4_CenterPad_Swipe","value": "73"} + ,{"name": "k_EInputActionOrigin_PS4_CenterPad_Click","value": "74"} + ,{"name": "k_EInputActionOrigin_PS4_CenterPad_DPadNorth","value": "75"} + ,{"name": "k_EInputActionOrigin_PS4_CenterPad_DPadSouth","value": "76"} + ,{"name": "k_EInputActionOrigin_PS4_CenterPad_DPadWest","value": "77"} + ,{"name": "k_EInputActionOrigin_PS4_CenterPad_DPadEast","value": "78"} + ,{"name": "k_EInputActionOrigin_PS4_LeftTrigger_Pull","value": "79"} + ,{"name": "k_EInputActionOrigin_PS4_LeftTrigger_Click","value": "80"} + ,{"name": "k_EInputActionOrigin_PS4_RightTrigger_Pull","value": "81"} + ,{"name": "k_EInputActionOrigin_PS4_RightTrigger_Click","value": "82"} + ,{"name": "k_EInputActionOrigin_PS4_LeftStick_Move","value": "83"} + ,{"name": "k_EInputActionOrigin_PS4_LeftStick_Click","value": "84"} + ,{"name": "k_EInputActionOrigin_PS4_LeftStick_DPadNorth","value": "85"} + ,{"name": "k_EInputActionOrigin_PS4_LeftStick_DPadSouth","value": "86"} + ,{"name": "k_EInputActionOrigin_PS4_LeftStick_DPadWest","value": "87"} + ,{"name": "k_EInputActionOrigin_PS4_LeftStick_DPadEast","value": "88"} + ,{"name": "k_EInputActionOrigin_PS4_RightStick_Move","value": "89"} + ,{"name": "k_EInputActionOrigin_PS4_RightStick_Click","value": "90"} + ,{"name": "k_EInputActionOrigin_PS4_RightStick_DPadNorth","value": "91"} + ,{"name": "k_EInputActionOrigin_PS4_RightStick_DPadSouth","value": "92"} + ,{"name": "k_EInputActionOrigin_PS4_RightStick_DPadWest","value": "93"} + ,{"name": "k_EInputActionOrigin_PS4_RightStick_DPadEast","value": "94"} + ,{"name": "k_EInputActionOrigin_PS4_DPad_North","value": "95"} + ,{"name": "k_EInputActionOrigin_PS4_DPad_South","value": "96"} + ,{"name": "k_EInputActionOrigin_PS4_DPad_West","value": "97"} + ,{"name": "k_EInputActionOrigin_PS4_DPad_East","value": "98"} + ,{"name": "k_EInputActionOrigin_PS4_Gyro_Move","value": "99"} + ,{"name": "k_EInputActionOrigin_PS4_Gyro_Pitch","value": "100"} + ,{"name": "k_EInputActionOrigin_PS4_Gyro_Yaw","value": "101"} + ,{"name": "k_EInputActionOrigin_PS4_Gyro_Roll","value": "102"} + ,{"name": "k_EInputActionOrigin_PS4_Reserved0","value": "103"} + ,{"name": "k_EInputActionOrigin_PS4_Reserved1","value": "104"} + ,{"name": "k_EInputActionOrigin_PS4_Reserved2","value": "105"} + ,{"name": "k_EInputActionOrigin_PS4_Reserved3","value": "106"} + ,{"name": "k_EInputActionOrigin_PS4_Reserved4","value": "107"} + ,{"name": "k_EInputActionOrigin_PS4_Reserved5","value": "108"} + ,{"name": "k_EInputActionOrigin_PS4_Reserved6","value": "109"} + ,{"name": "k_EInputActionOrigin_PS4_Reserved7","value": "110"} + ,{"name": "k_EInputActionOrigin_PS4_Reserved8","value": "111"} + ,{"name": "k_EInputActionOrigin_PS4_Reserved9","value": "112"} + ,{"name": "k_EInputActionOrigin_PS4_Reserved10","value": "113"} + ,{"name": "k_EInputActionOrigin_XBoxOne_A","value": "114"} + ,{"name": "k_EInputActionOrigin_XBoxOne_B","value": "115"} + ,{"name": "k_EInputActionOrigin_XBoxOne_X","value": "116"} + ,{"name": "k_EInputActionOrigin_XBoxOne_Y","value": "117"} + ,{"name": "k_EInputActionOrigin_XBoxOne_LeftBumper","value": "118"} + ,{"name": "k_EInputActionOrigin_XBoxOne_RightBumper","value": "119"} + ,{"name": "k_EInputActionOrigin_XBoxOne_Menu","value": "120"} + ,{"name": "k_EInputActionOrigin_XBoxOne_View","value": "121"} + ,{"name": "k_EInputActionOrigin_XBoxOne_LeftTrigger_Pull","value": "122"} + ,{"name": "k_EInputActionOrigin_XBoxOne_LeftTrigger_Click","value": "123"} + ,{"name": "k_EInputActionOrigin_XBoxOne_RightTrigger_Pull","value": "124"} + ,{"name": "k_EInputActionOrigin_XBoxOne_RightTrigger_Click","value": "125"} + ,{"name": "k_EInputActionOrigin_XBoxOne_LeftStick_Move","value": "126"} + ,{"name": "k_EInputActionOrigin_XBoxOne_LeftStick_Click","value": "127"} + ,{"name": "k_EInputActionOrigin_XBoxOne_LeftStick_DPadNorth","value": "128"} + ,{"name": "k_EInputActionOrigin_XBoxOne_LeftStick_DPadSouth","value": "129"} + ,{"name": "k_EInputActionOrigin_XBoxOne_LeftStick_DPadWest","value": "130"} + ,{"name": "k_EInputActionOrigin_XBoxOne_LeftStick_DPadEast","value": "131"} + ,{"name": "k_EInputActionOrigin_XBoxOne_RightStick_Move","value": "132"} + ,{"name": "k_EInputActionOrigin_XBoxOne_RightStick_Click","value": "133"} + ,{"name": "k_EInputActionOrigin_XBoxOne_RightStick_DPadNorth","value": "134"} + ,{"name": "k_EInputActionOrigin_XBoxOne_RightStick_DPadSouth","value": "135"} + ,{"name": "k_EInputActionOrigin_XBoxOne_RightStick_DPadWest","value": "136"} + ,{"name": "k_EInputActionOrigin_XBoxOne_RightStick_DPadEast","value": "137"} + ,{"name": "k_EInputActionOrigin_XBoxOne_DPad_North","value": "138"} + ,{"name": "k_EInputActionOrigin_XBoxOne_DPad_South","value": "139"} + ,{"name": "k_EInputActionOrigin_XBoxOne_DPad_West","value": "140"} + ,{"name": "k_EInputActionOrigin_XBoxOne_DPad_East","value": "141"} + ,{"name": "k_EInputActionOrigin_XBoxOne_Reserved0","value": "142"} + ,{"name": "k_EInputActionOrigin_XBoxOne_Reserved1","value": "143"} + ,{"name": "k_EInputActionOrigin_XBoxOne_Reserved2","value": "144"} + ,{"name": "k_EInputActionOrigin_XBoxOne_Reserved3","value": "145"} + ,{"name": "k_EInputActionOrigin_XBoxOne_Reserved4","value": "146"} + ,{"name": "k_EInputActionOrigin_XBoxOne_Reserved5","value": "147"} + ,{"name": "k_EInputActionOrigin_XBoxOne_Reserved6","value": "148"} + ,{"name": "k_EInputActionOrigin_XBoxOne_Reserved7","value": "149"} + ,{"name": "k_EInputActionOrigin_XBoxOne_Reserved8","value": "150"} + ,{"name": "k_EInputActionOrigin_XBoxOne_Reserved9","value": "151"} + ,{"name": "k_EInputActionOrigin_XBoxOne_Reserved10","value": "152"} + ,{"name": "k_EInputActionOrigin_XBox360_A","value": "153"} + ,{"name": "k_EInputActionOrigin_XBox360_B","value": "154"} + ,{"name": "k_EInputActionOrigin_XBox360_X","value": "155"} + ,{"name": "k_EInputActionOrigin_XBox360_Y","value": "156"} + ,{"name": "k_EInputActionOrigin_XBox360_LeftBumper","value": "157"} + ,{"name": "k_EInputActionOrigin_XBox360_RightBumper","value": "158"} + ,{"name": "k_EInputActionOrigin_XBox360_Start","value": "159"} + ,{"name": "k_EInputActionOrigin_XBox360_Back","value": "160"} + ,{"name": "k_EInputActionOrigin_XBox360_LeftTrigger_Pull","value": "161"} + ,{"name": "k_EInputActionOrigin_XBox360_LeftTrigger_Click","value": "162"} + ,{"name": "k_EInputActionOrigin_XBox360_RightTrigger_Pull","value": "163"} + ,{"name": "k_EInputActionOrigin_XBox360_RightTrigger_Click","value": "164"} + ,{"name": "k_EInputActionOrigin_XBox360_LeftStick_Move","value": "165"} + ,{"name": "k_EInputActionOrigin_XBox360_LeftStick_Click","value": "166"} + ,{"name": "k_EInputActionOrigin_XBox360_LeftStick_DPadNorth","value": "167"} + ,{"name": "k_EInputActionOrigin_XBox360_LeftStick_DPadSouth","value": "168"} + ,{"name": "k_EInputActionOrigin_XBox360_LeftStick_DPadWest","value": "169"} + ,{"name": "k_EInputActionOrigin_XBox360_LeftStick_DPadEast","value": "170"} + ,{"name": "k_EInputActionOrigin_XBox360_RightStick_Move","value": "171"} + ,{"name": "k_EInputActionOrigin_XBox360_RightStick_Click","value": "172"} + ,{"name": "k_EInputActionOrigin_XBox360_RightStick_DPadNorth","value": "173"} + ,{"name": "k_EInputActionOrigin_XBox360_RightStick_DPadSouth","value": "174"} + ,{"name": "k_EInputActionOrigin_XBox360_RightStick_DPadWest","value": "175"} + ,{"name": "k_EInputActionOrigin_XBox360_RightStick_DPadEast","value": "176"} + ,{"name": "k_EInputActionOrigin_XBox360_DPad_North","value": "177"} + ,{"name": "k_EInputActionOrigin_XBox360_DPad_South","value": "178"} + ,{"name": "k_EInputActionOrigin_XBox360_DPad_West","value": "179"} + ,{"name": "k_EInputActionOrigin_XBox360_DPad_East","value": "180"} + ,{"name": "k_EInputActionOrigin_XBox360_Reserved0","value": "181"} + ,{"name": "k_EInputActionOrigin_XBox360_Reserved1","value": "182"} + ,{"name": "k_EInputActionOrigin_XBox360_Reserved2","value": "183"} + ,{"name": "k_EInputActionOrigin_XBox360_Reserved3","value": "184"} + ,{"name": "k_EInputActionOrigin_XBox360_Reserved4","value": "185"} + ,{"name": "k_EInputActionOrigin_XBox360_Reserved5","value": "186"} + ,{"name": "k_EInputActionOrigin_XBox360_Reserved6","value": "187"} + ,{"name": "k_EInputActionOrigin_XBox360_Reserved7","value": "188"} + ,{"name": "k_EInputActionOrigin_XBox360_Reserved8","value": "189"} + ,{"name": "k_EInputActionOrigin_XBox360_Reserved9","value": "190"} + ,{"name": "k_EInputActionOrigin_XBox360_Reserved10","value": "191"} + ,{"name": "k_EInputActionOrigin_Switch_A","value": "192"} + ,{"name": "k_EInputActionOrigin_Switch_B","value": "193"} + ,{"name": "k_EInputActionOrigin_Switch_X","value": "194"} + ,{"name": "k_EInputActionOrigin_Switch_Y","value": "195"} + ,{"name": "k_EInputActionOrigin_Switch_LeftBumper","value": "196"} + ,{"name": "k_EInputActionOrigin_Switch_RightBumper","value": "197"} + ,{"name": "k_EInputActionOrigin_Switch_Plus","value": "198"} + ,{"name": "k_EInputActionOrigin_Switch_Minus","value": "199"} + ,{"name": "k_EInputActionOrigin_Switch_Capture","value": "200"} + ,{"name": "k_EInputActionOrigin_Switch_LeftTrigger_Pull","value": "201"} + ,{"name": "k_EInputActionOrigin_Switch_LeftTrigger_Click","value": "202"} + ,{"name": "k_EInputActionOrigin_Switch_RightTrigger_Pull","value": "203"} + ,{"name": "k_EInputActionOrigin_Switch_RightTrigger_Click","value": "204"} + ,{"name": "k_EInputActionOrigin_Switch_LeftStick_Move","value": "205"} + ,{"name": "k_EInputActionOrigin_Switch_LeftStick_Click","value": "206"} + ,{"name": "k_EInputActionOrigin_Switch_LeftStick_DPadNorth","value": "207"} + ,{"name": "k_EInputActionOrigin_Switch_LeftStick_DPadSouth","value": "208"} + ,{"name": "k_EInputActionOrigin_Switch_LeftStick_DPadWest","value": "209"} + ,{"name": "k_EInputActionOrigin_Switch_LeftStick_DPadEast","value": "210"} + ,{"name": "k_EInputActionOrigin_Switch_RightStick_Move","value": "211"} + ,{"name": "k_EInputActionOrigin_Switch_RightStick_Click","value": "212"} + ,{"name": "k_EInputActionOrigin_Switch_RightStick_DPadNorth","value": "213"} + ,{"name": "k_EInputActionOrigin_Switch_RightStick_DPadSouth","value": "214"} + ,{"name": "k_EInputActionOrigin_Switch_RightStick_DPadWest","value": "215"} + ,{"name": "k_EInputActionOrigin_Switch_RightStick_DPadEast","value": "216"} + ,{"name": "k_EInputActionOrigin_Switch_DPad_North","value": "217"} + ,{"name": "k_EInputActionOrigin_Switch_DPad_South","value": "218"} + ,{"name": "k_EInputActionOrigin_Switch_DPad_West","value": "219"} + ,{"name": "k_EInputActionOrigin_Switch_DPad_East","value": "220"} + ,{"name": "k_EInputActionOrigin_Switch_ProGyro_Move","value": "221"} + ,{"name": "k_EInputActionOrigin_Switch_ProGyro_Pitch","value": "222"} + ,{"name": "k_EInputActionOrigin_Switch_ProGyro_Yaw","value": "223"} + ,{"name": "k_EInputActionOrigin_Switch_ProGyro_Roll","value": "224"} + ,{"name": "k_EInputActionOrigin_Switch_Reserved0","value": "225"} + ,{"name": "k_EInputActionOrigin_Switch_Reserved1","value": "226"} + ,{"name": "k_EInputActionOrigin_Switch_Reserved2","value": "227"} + ,{"name": "k_EInputActionOrigin_Switch_Reserved3","value": "228"} + ,{"name": "k_EInputActionOrigin_Switch_Reserved4","value": "229"} + ,{"name": "k_EInputActionOrigin_Switch_Reserved5","value": "230"} + ,{"name": "k_EInputActionOrigin_Switch_Reserved6","value": "231"} + ,{"name": "k_EInputActionOrigin_Switch_Reserved7","value": "232"} + ,{"name": "k_EInputActionOrigin_Switch_Reserved8","value": "233"} + ,{"name": "k_EInputActionOrigin_Switch_Reserved9","value": "234"} + ,{"name": "k_EInputActionOrigin_Switch_Reserved10","value": "235"} + ,{"name": "k_EInputActionOrigin_Switch_RightGyro_Move","value": "236"} + ,{"name": "k_EInputActionOrigin_Switch_RightGyro_Pitch","value": "237"} + ,{"name": "k_EInputActionOrigin_Switch_RightGyro_Yaw","value": "238"} + ,{"name": "k_EInputActionOrigin_Switch_RightGyro_Roll","value": "239"} + ,{"name": "k_EInputActionOrigin_Switch_LeftGyro_Move","value": "240"} + ,{"name": "k_EInputActionOrigin_Switch_LeftGyro_Pitch","value": "241"} + ,{"name": "k_EInputActionOrigin_Switch_LeftGyro_Yaw","value": "242"} + ,{"name": "k_EInputActionOrigin_Switch_LeftGyro_Roll","value": "243"} + ,{"name": "k_EInputActionOrigin_Switch_LeftGrip_Lower","value": "244"} + ,{"name": "k_EInputActionOrigin_Switch_LeftGrip_Upper","value": "245"} + ,{"name": "k_EInputActionOrigin_Switch_RightGrip_Lower","value": "246"} + ,{"name": "k_EInputActionOrigin_Switch_RightGrip_Upper","value": "247"} + ,{"name": "k_EInputActionOrigin_Switch_Reserved11","value": "248"} + ,{"name": "k_EInputActionOrigin_Switch_Reserved12","value": "249"} + ,{"name": "k_EInputActionOrigin_Switch_Reserved13","value": "250"} + ,{"name": "k_EInputActionOrigin_Switch_Reserved14","value": "251"} + ,{"name": "k_EInputActionOrigin_Switch_Reserved15","value": "252"} + ,{"name": "k_EInputActionOrigin_Switch_Reserved16","value": "253"} + ,{"name": "k_EInputActionOrigin_Switch_Reserved17","value": "254"} + ,{"name": "k_EInputActionOrigin_Switch_Reserved18","value": "255"} + ,{"name": "k_EInputActionOrigin_Switch_Reserved19","value": "256"} + ,{"name": "k_EInputActionOrigin_Switch_Reserved20","value": "257"} + ,{"name": "k_EInputActionOrigin_Count","value": "258"} + ,{"name": "k_EInputActionOrigin_MaximumPossibleValue","value": "32767"} +]} +, {"enumname": "EXboxOrigin","values": [ + {"name": "k_EXboxOrigin_A","value": "0"} + ,{"name": "k_EXboxOrigin_B","value": "1"} + ,{"name": "k_EXboxOrigin_X","value": "2"} + ,{"name": "k_EXboxOrigin_Y","value": "3"} + ,{"name": "k_EXboxOrigin_LeftBumper","value": "4"} + ,{"name": "k_EXboxOrigin_RightBumper","value": "5"} + ,{"name": "k_EXboxOrigin_Menu","value": "6"} + ,{"name": "k_EXboxOrigin_View","value": "7"} + ,{"name": "k_EXboxOrigin_LeftTrigger_Pull","value": "8"} + ,{"name": "k_EXboxOrigin_LeftTrigger_Click","value": "9"} + ,{"name": "k_EXboxOrigin_RightTrigger_Pull","value": "10"} + ,{"name": "k_EXboxOrigin_RightTrigger_Click","value": "11"} + ,{"name": "k_EXboxOrigin_LeftStick_Move","value": "12"} + ,{"name": "k_EXboxOrigin_LeftStick_Click","value": "13"} + ,{"name": "k_EXboxOrigin_LeftStick_DPadNorth","value": "14"} + ,{"name": "k_EXboxOrigin_LeftStick_DPadSouth","value": "15"} + ,{"name": "k_EXboxOrigin_LeftStick_DPadWest","value": "16"} + ,{"name": "k_EXboxOrigin_LeftStick_DPadEast","value": "17"} + ,{"name": "k_EXboxOrigin_RightStick_Move","value": "18"} + ,{"name": "k_EXboxOrigin_RightStick_Click","value": "19"} + ,{"name": "k_EXboxOrigin_RightStick_DPadNorth","value": "20"} + ,{"name": "k_EXboxOrigin_RightStick_DPadSouth","value": "21"} + ,{"name": "k_EXboxOrigin_RightStick_DPadWest","value": "22"} + ,{"name": "k_EXboxOrigin_RightStick_DPadEast","value": "23"} + ,{"name": "k_EXboxOrigin_DPad_North","value": "24"} + ,{"name": "k_EXboxOrigin_DPad_South","value": "25"} + ,{"name": "k_EXboxOrigin_DPad_West","value": "26"} + ,{"name": "k_EXboxOrigin_DPad_East","value": "27"} + ,{"name": "k_EXboxOrigin_Count","value": "28"} +]} , {"enumname": "ESteamControllerPad","values": [ {"name": "k_ESteamControllerPad_Left","value": "0"} ,{"name": "k_ESteamControllerPad_Right","value": "1"} ]} +, {"enumname": "ESteamInputType","values": [ + {"name": "k_ESteamInputType_Unknown","value": "0"} + ,{"name": "k_ESteamInputType_SteamController","value": "1"} + ,{"name": "k_ESteamInputType_XBox360Controller","value": "2"} + ,{"name": "k_ESteamInputType_XBoxOneController","value": "3"} + ,{"name": "k_ESteamInputType_GenericGamepad","value": "4"} + ,{"name": "k_ESteamInputType_PS4Controller","value": "5"} + ,{"name": "k_ESteamInputType_AppleMFiController","value": "6"} + ,{"name": "k_ESteamInputType_AndroidController","value": "7"} + ,{"name": "k_ESteamInputType_SwitchJoyConPair","value": "8"} + ,{"name": "k_ESteamInputType_SwitchJoyConSingle","value": "9"} + ,{"name": "k_ESteamInputType_SwitchProController","value": "10"} + ,{"name": "k_ESteamInputType_MobileTouch","value": "11"} + ,{"name": "k_ESteamInputType_PS3Controller","value": "12"} + ,{"name": "k_ESteamInputType_Count","value": "13"} + ,{"name": "k_ESteamInputType_MaximumPossibleValue","value": "255"} +]} +, {"enumname": "ESteamInputLEDFlag","values": [ + {"name": "k_ESteamInputLEDFlag_SetColor","value": "0"} + ,{"name": "k_ESteamInputLEDFlag_RestoreUserDefault","value": "1"} +]} , {"enumname": "EControllerSource","values": [ {"name": "k_EControllerSource_None","value": "0"} ,{"name": "k_EControllerSource_LeftTrackpad","value": "1"} @@ -807,13 +1197,16 @@ ,{"name": "k_EControllerSource_Switch","value": "5"} ,{"name": "k_EControllerSource_LeftTrigger","value": "6"} ,{"name": "k_EControllerSource_RightTrigger","value": "7"} - ,{"name": "k_EControllerSource_Gyro","value": "8"} - ,{"name": "k_EControllerSource_CenterTrackpad","value": "9"} - ,{"name": "k_EControllerSource_RightJoystick","value": "10"} - ,{"name": "k_EControllerSource_DPad","value": "11"} - ,{"name": "k_EControllerSource_Key","value": "12"} - ,{"name": "k_EControllerSource_Mouse","value": "13"} - ,{"name": "k_EControllerSource_Count","value": "14"} + ,{"name": "k_EControllerSource_LeftBumper","value": "8"} + ,{"name": "k_EControllerSource_RightBumper","value": "9"} + ,{"name": "k_EControllerSource_Gyro","value": "10"} + ,{"name": "k_EControllerSource_CenterTrackpad","value": "11"} + ,{"name": "k_EControllerSource_RightJoystick","value": "12"} + ,{"name": "k_EControllerSource_DPad","value": "13"} + ,{"name": "k_EControllerSource_Key","value": "14"} + ,{"name": "k_EControllerSource_Mouse","value": "15"} + ,{"name": "k_EControllerSource_LeftGyro","value": "16"} + ,{"name": "k_EControllerSource_Count","value": "17"} ]} , {"enumname": "EControllerSourceMode","values": [ {"name": "k_EControllerSourceMode_None","value": "0"} @@ -989,9 +1382,9 @@ ,{"name": "k_EControllerActionOrigin_SteamV2_Y","value": "151"} ,{"name": "k_EControllerActionOrigin_SteamV2_LeftBumper","value": "152"} ,{"name": "k_EControllerActionOrigin_SteamV2_RightBumper","value": "153"} - ,{"name": "k_EControllerActionOrigin_SteamV2_LeftGrip","value": "154"} - ,{"name": "k_EControllerActionOrigin_SteamV2_RightGrip","value": "155"} - ,{"name": "k_EControllerActionOrigin_SteamV2_LeftGrip_Upper","value": "156"} + ,{"name": "k_EControllerActionOrigin_SteamV2_LeftGrip_Lower","value": "154"} + ,{"name": "k_EControllerActionOrigin_SteamV2_LeftGrip_Upper","value": "155"} + ,{"name": "k_EControllerActionOrigin_SteamV2_RightGrip_Lower","value": "156"} ,{"name": "k_EControllerActionOrigin_SteamV2_RightGrip_Upper","value": "157"} ,{"name": "k_EControllerActionOrigin_SteamV2_LeftBumper_Pressure","value": "158"} ,{"name": "k_EControllerActionOrigin_SteamV2_RightBumper_Pressure","value": "159"} @@ -1031,20 +1424,58 @@ ,{"name": "k_EControllerActionOrigin_SteamV2_Gyro_Pitch","value": "193"} ,{"name": "k_EControllerActionOrigin_SteamV2_Gyro_Yaw","value": "194"} ,{"name": "k_EControllerActionOrigin_SteamV2_Gyro_Roll","value": "195"} - ,{"name": "k_EControllerActionOrigin_Count","value": "196"} + ,{"name": "k_EControllerActionOrigin_Switch_A","value": "196"} + ,{"name": "k_EControllerActionOrigin_Switch_B","value": "197"} + ,{"name": "k_EControllerActionOrigin_Switch_X","value": "198"} + ,{"name": "k_EControllerActionOrigin_Switch_Y","value": "199"} + ,{"name": "k_EControllerActionOrigin_Switch_LeftBumper","value": "200"} + ,{"name": "k_EControllerActionOrigin_Switch_RightBumper","value": "201"} + ,{"name": "k_EControllerActionOrigin_Switch_Plus","value": "202"} + ,{"name": "k_EControllerActionOrigin_Switch_Minus","value": "203"} + ,{"name": "k_EControllerActionOrigin_Switch_Capture","value": "204"} + ,{"name": "k_EControllerActionOrigin_Switch_LeftTrigger_Pull","value": "205"} + ,{"name": "k_EControllerActionOrigin_Switch_LeftTrigger_Click","value": "206"} + ,{"name": "k_EControllerActionOrigin_Switch_RightTrigger_Pull","value": "207"} + ,{"name": "k_EControllerActionOrigin_Switch_RightTrigger_Click","value": "208"} + ,{"name": "k_EControllerActionOrigin_Switch_LeftStick_Move","value": "209"} + ,{"name": "k_EControllerActionOrigin_Switch_LeftStick_Click","value": "210"} + ,{"name": "k_EControllerActionOrigin_Switch_LeftStick_DPadNorth","value": "211"} + ,{"name": "k_EControllerActionOrigin_Switch_LeftStick_DPadSouth","value": "212"} + ,{"name": "k_EControllerActionOrigin_Switch_LeftStick_DPadWest","value": "213"} + ,{"name": "k_EControllerActionOrigin_Switch_LeftStick_DPadEast","value": "214"} + ,{"name": "k_EControllerActionOrigin_Switch_RightStick_Move","value": "215"} + ,{"name": "k_EControllerActionOrigin_Switch_RightStick_Click","value": "216"} + ,{"name": "k_EControllerActionOrigin_Switch_RightStick_DPadNorth","value": "217"} + ,{"name": "k_EControllerActionOrigin_Switch_RightStick_DPadSouth","value": "218"} + ,{"name": "k_EControllerActionOrigin_Switch_RightStick_DPadWest","value": "219"} + ,{"name": "k_EControllerActionOrigin_Switch_RightStick_DPadEast","value": "220"} + ,{"name": "k_EControllerActionOrigin_Switch_DPad_North","value": "221"} + ,{"name": "k_EControllerActionOrigin_Switch_DPad_South","value": "222"} + ,{"name": "k_EControllerActionOrigin_Switch_DPad_West","value": "223"} + ,{"name": "k_EControllerActionOrigin_Switch_DPad_East","value": "224"} + ,{"name": "k_EControllerActionOrigin_Switch_ProGyro_Move","value": "225"} + ,{"name": "k_EControllerActionOrigin_Switch_ProGyro_Pitch","value": "226"} + ,{"name": "k_EControllerActionOrigin_Switch_ProGyro_Yaw","value": "227"} + ,{"name": "k_EControllerActionOrigin_Switch_ProGyro_Roll","value": "228"} + ,{"name": "k_EControllerActionOrigin_Switch_RightGyro_Move","value": "229"} + ,{"name": "k_EControllerActionOrigin_Switch_RightGyro_Pitch","value": "230"} + ,{"name": "k_EControllerActionOrigin_Switch_RightGyro_Yaw","value": "231"} + ,{"name": "k_EControllerActionOrigin_Switch_RightGyro_Roll","value": "232"} + ,{"name": "k_EControllerActionOrigin_Switch_LeftGyro_Move","value": "233"} + ,{"name": "k_EControllerActionOrigin_Switch_LeftGyro_Pitch","value": "234"} + ,{"name": "k_EControllerActionOrigin_Switch_LeftGyro_Yaw","value": "235"} + ,{"name": "k_EControllerActionOrigin_Switch_LeftGyro_Roll","value": "236"} + ,{"name": "k_EControllerActionOrigin_Switch_LeftGrip_Lower","value": "237"} + ,{"name": "k_EControllerActionOrigin_Switch_LeftGrip_Upper","value": "238"} + ,{"name": "k_EControllerActionOrigin_Switch_RightGrip_Lower","value": "239"} + ,{"name": "k_EControllerActionOrigin_Switch_RightGrip_Upper","value": "240"} + ,{"name": "k_EControllerActionOrigin_Count","value": "241"} + ,{"name": "k_EControllerActionOrigin_MaximumPossibleValue","value": "32767"} ]} , {"enumname": "ESteamControllerLEDFlag","values": [ {"name": "k_ESteamControllerLEDFlag_SetColor","value": "0"} ,{"name": "k_ESteamControllerLEDFlag_RestoreUserDefault","value": "1"} ]} -, {"enumname": "ESteamInputType","values": [ - {"name": "k_ESteamInputType_Unknown","value": "0"} - ,{"name": "k_ESteamInputType_SteamController","value": "1"} - ,{"name": "k_ESteamInputType_XBox360Controller","value": "2"} - ,{"name": "k_ESteamInputType_XBoxOneController","value": "3"} - ,{"name": "k_ESteamInputType_GenericXInput","value": "4"} - ,{"name": "k_ESteamInputType_PS4Controller","value": "5"} -]} , {"enumname": "EUGCMatchingUGCType","values": [ {"name": "k_EUGCMatchingUGCType_Items","value": "0"} ,{"name": "k_EUGCMatchingUGCType_Items_Mtx","value": "1"} @@ -1243,6 +1674,10 @@ "constname": "k_iSteamUserStatsCallbacks","consttype": "int", "constval": "1100"} ,{ "constname": "k_iSteamNetworkingCallbacks","consttype": "int", "constval": "1200"} +,{ + "constname": "k_iSteamNetworkingSocketsCallbacks","consttype": "int", "constval": "1220"} +,{ + "constname": "k_iSteamNetworkingMessagesCallbacks","consttype": "int", "constval": "1250"} ,{ "constname": "k_iClientRemoteStorageCallbacks","consttype": "int", "constval": "1300"} ,{ @@ -1321,12 +1756,18 @@ "constname": "k_ISteamParentalSettingsCallbacks","consttype": "int", "constval": "5000"} ,{ "constname": "k_iClientShaderCallbacks","consttype": "int", "constval": "5100"} +,{ + "constname": "k_iSteamGameSearchCallbacks","consttype": "int", "constval": "5200"} +,{ + "constname": "k_iSteamPartiesCallbacks","consttype": "int", "constval": "5300"} +,{ + "constname": "k_iClientPartiesCallbacks","consttype": "int", "constval": "5400"} ,{ "constname": "k_cchPersonaNameMax","consttype": "int", "constval": "128"} ,{ "constname": "k_cwchPersonaNameMax","consttype": "int", "constval": "32"} ,{ - "constname": "k_cchMaxRichPresenceKeys","consttype": "int", "constval": "20"} + "constname": "k_cchMaxRichPresenceKeys","consttype": "int", "constval": "30"} ,{ "constname": "k_cchMaxRichPresenceKeyLength","consttype": "int", "constval": "64"} ,{ @@ -1364,6 +1805,50 @@ { "fieldname": "m_u64", "fieldtype": "uint64"}, { "fieldname": "m_u16", "fieldtype": "uint16"}, { "fieldname": "m_d", "fieldtype": "double"}]} +,{"struct": "CCallbackBase","fields": [ +{ "fieldname": "m_nCallbackFlags", "fieldtype": "uint8"}, +{ "fieldname": "m_iCallback", "fieldtype": "int"}]} +,{"struct": "CCallResult","fields": [ +{ "fieldname": "m_hAPICall", "fieldtype": "SteamAPICall_t"}, +{ "fieldname": "m_pObj", "fieldtype": "T *"}, +{ "fieldname": "m_Func", "fieldtype": "func_t"}]} +,{"struct": "CCallback","fields": [ +{ "fieldname": "m_pObj", "fieldtype": "T *"}, +{ "fieldname": "m_Func", "fieldtype": "func_t"}]} +,{"struct": "CSteamAPIContext","fields": [ +{ "fieldname": "m_pSteamClient", "fieldtype": "class ISteamClient *"}, +{ "fieldname": "m_pSteamUser", "fieldtype": "class ISteamUser *"}, +{ "fieldname": "m_pSteamFriends", "fieldtype": "class ISteamFriends *"}, +{ "fieldname": "m_pSteamUtils", "fieldtype": "class ISteamUtils *"}, +{ "fieldname": "m_pSteamMatchmaking", "fieldtype": "class ISteamMatchmaking *"}, +{ "fieldname": "m_pSteamGameSearch", "fieldtype": "class ISteamGameSearch *"}, +{ "fieldname": "m_pSteamUserStats", "fieldtype": "class ISteamUserStats *"}, +{ "fieldname": "m_pSteamApps", "fieldtype": "class ISteamApps *"}, +{ "fieldname": "m_pSteamMatchmakingServers", "fieldtype": "class ISteamMatchmakingServers *"}, +{ "fieldname": "m_pSteamNetworking", "fieldtype": "class ISteamNetworking *"}, +{ "fieldname": "m_pSteamRemoteStorage", "fieldtype": "class ISteamRemoteStorage *"}, +{ "fieldname": "m_pSteamScreenshots", "fieldtype": "class ISteamScreenshots *"}, +{ "fieldname": "m_pSteamHTTP", "fieldtype": "class ISteamHTTP *"}, +{ "fieldname": "m_pController", "fieldtype": "class ISteamController *"}, +{ "fieldname": "m_pSteamUGC", "fieldtype": "class ISteamUGC *"}, +{ "fieldname": "m_pSteamAppList", "fieldtype": "class ISteamAppList *"}, +{ "fieldname": "m_pSteamMusic", "fieldtype": "class ISteamMusic *"}, +{ "fieldname": "m_pSteamMusicRemote", "fieldtype": "class ISteamMusicRemote *"}, +{ "fieldname": "m_pSteamHTMLSurface", "fieldtype": "class ISteamHTMLSurface *"}, +{ "fieldname": "m_pSteamInventory", "fieldtype": "class ISteamInventory *"}, +{ "fieldname": "m_pSteamVideo", "fieldtype": "class ISteamVideo *"}, +{ "fieldname": "m_pSteamParentalSettings", "fieldtype": "class ISteamParentalSettings *"}, +{ "fieldname": "m_pSteamInput", "fieldtype": "class ISteamInput *"}]} +,{"struct": "CSteamGameServerAPIContext","fields": [ +{ "fieldname": "m_pSteamClient", "fieldtype": "class ISteamClient *"}, +{ "fieldname": "m_pSteamGameServer", "fieldtype": "class ISteamGameServer *"}, +{ "fieldname": "m_pSteamGameServerUtils", "fieldtype": "class ISteamUtils *"}, +{ "fieldname": "m_pSteamGameServerNetworking", "fieldtype": "class ISteamNetworking *"}, +{ "fieldname": "m_pSteamGameServerStats", "fieldtype": "class ISteamGameServerStats *"}, +{ "fieldname": "m_pSteamHTTP", "fieldtype": "class ISteamHTTP *"}, +{ "fieldname": "m_pSteamInventory", "fieldtype": "class ISteamInventory *"}, +{ "fieldname": "m_pSteamUGC", "fieldtype": "class ISteamUGC *"}, +{ "fieldname": "m_pSteamApps", "fieldtype": "class ISteamApps *"}]} ,{"struct": "CallbackMsg_t","fields": [ { "fieldname": "m_hSteamUser", "fieldtype": "HSteamUser"}, { "fieldname": "m_iCallback", "fieldtype": "int"}, @@ -1397,6 +1882,12 @@ { "fieldname": "m_szURL", "fieldtype": "char [256]"}]} ,{"struct": "StoreAuthURLResponse_t","fields": [ { "fieldname": "m_szURL", "fieldtype": "char [512]"}]} +,{"struct": "MarketEligibilityResponse_t","fields": [ +{ "fieldname": "m_bAllowed", "fieldtype": "_Bool"}, +{ "fieldname": "m_eNotAllowedReason", "fieldtype": "enum EMarketNotAllowedReasonFlags"}, +{ "fieldname": "m_rtAllowedAtTime", "fieldtype": "RTime32"}, +{ "fieldname": "m_cdaySteamGuardRequiredDays", "fieldtype": "int"}, +{ "fieldname": "m_cdayNewDeviceCooldown", "fieldtype": "int"}]} ,{"struct": "FriendGameInfo_t","fields": [ { "fieldname": "m_gameID", "fieldtype": "class CGameID"}, { "fieldname": "m_unGameIP", "fieldtype": "uint32"}, @@ -1506,6 +1997,9 @@ { "fieldname": "m_szServerName", "fieldtype": "char [64]"}, { "fieldname": "m_szGameTags", "fieldtype": "char [128]"}, { "fieldname": "m_steamID", "fieldtype": "class CSteamID"}]} +,{"struct": "SteamPartyBeaconLocation_t","fields": [ +{ "fieldname": "m_eType", "fieldtype": "enum ESteamPartyBeaconLocationType"}, +{ "fieldname": "m_ulLocationID", "fieldtype": "uint64"}]} ,{"struct": "FavoritesListChanged_t","fields": [ { "fieldname": "m_nIP", "fieldtype": "uint32"}, { "fieldname": "m_nQueryPort", "fieldtype": "uint32"}, @@ -1556,6 +2050,58 @@ { "fieldname": "m_steamIDLobby", "fieldtype": "class CSteamID"}]} ,{"struct": "FavoritesListAccountsUpdated_t","fields": [ { "fieldname": "m_eResult", "fieldtype": "enum EResult"}]} +,{"struct": "SearchForGameProgressCallback_t","fields": [ +{ "fieldname": "m_ullSearchID", "fieldtype": "uint64"}, +{ "fieldname": "m_eResult", "fieldtype": "enum EResult"}, +{ "fieldname": "m_lobbyID", "fieldtype": "class CSteamID"}, +{ "fieldname": "m_steamIDEndedSearch", "fieldtype": "class CSteamID"}, +{ "fieldname": "m_nSecondsRemainingEstimate", "fieldtype": "int32"}, +{ "fieldname": "m_cPlayersSearching", "fieldtype": "int32"}]} +,{"struct": "SearchForGameResultCallback_t","fields": [ +{ "fieldname": "m_ullSearchID", "fieldtype": "uint64"}, +{ "fieldname": "m_eResult", "fieldtype": "enum EResult"}, +{ "fieldname": "m_nCountPlayersInGame", "fieldtype": "int32"}, +{ "fieldname": "m_nCountAcceptedGame", "fieldtype": "int32"}, +{ "fieldname": "m_steamIDHost", "fieldtype": "class CSteamID"}, +{ "fieldname": "m_bFinalCallback", "fieldtype": "_Bool"}]} +,{"struct": "RequestPlayersForGameProgressCallback_t","fields": [ +{ "fieldname": "m_eResult", "fieldtype": "enum EResult"}, +{ "fieldname": "m_ullSearchID", "fieldtype": "uint64"}]} +,{"struct": "RequestPlayersForGameResultCallback_t","fields": [ +{ "fieldname": "m_eResult", "fieldtype": "enum EResult"}, +{ "fieldname": "m_ullSearchID", "fieldtype": "uint64"}, +{ "fieldname": "m_SteamIDPlayerFound", "fieldtype": "class CSteamID"}, +{ "fieldname": "m_SteamIDLobby", "fieldtype": "class CSteamID"}, +{ "fieldname": "m_ePlayerAcceptState", "fieldtype": "enum RequestPlayersForGameResultCallback_t::PlayerAcceptState_t"}, +{ "fieldname": "m_nPlayerIndex", "fieldtype": "int32"}, +{ "fieldname": "m_nTotalPlayersFound", "fieldtype": "int32"}, +{ "fieldname": "m_nTotalPlayersAcceptedGame", "fieldtype": "int32"}, +{ "fieldname": "m_nSuggestedTeamIndex", "fieldtype": "int32"}, +{ "fieldname": "m_ullUniqueGameID", "fieldtype": "uint64"}]} +,{"struct": "RequestPlayersForGameFinalResultCallback_t","fields": [ +{ "fieldname": "m_eResult", "fieldtype": "enum EResult"}, +{ "fieldname": "m_ullSearchID", "fieldtype": "uint64"}, +{ "fieldname": "m_ullUniqueGameID", "fieldtype": "uint64"}]} +,{"struct": "SubmitPlayerResultResultCallback_t","fields": [ +{ "fieldname": "m_eResult", "fieldtype": "enum EResult"}, +{ "fieldname": "ullUniqueGameID", "fieldtype": "uint64"}, +{ "fieldname": "steamIDPlayer", "fieldtype": "class CSteamID"}]} +,{"struct": "EndGameResultCallback_t","fields": [ +{ "fieldname": "m_eResult", "fieldtype": "enum EResult"}, +{ "fieldname": "ullUniqueGameID", "fieldtype": "uint64"}]} +,{"struct": "JoinPartyCallback_t","fields": [ +{ "fieldname": "m_eResult", "fieldtype": "enum EResult"}, +{ "fieldname": "m_ulBeaconID", "fieldtype": "PartyBeaconID_t"}, +{ "fieldname": "m_SteamIDBeaconOwner", "fieldtype": "class CSteamID"}, +{ "fieldname": "m_rgchConnectString", "fieldtype": "char [256]"}]} +,{"struct": "CreateBeaconCallback_t","fields": [ +{ "fieldname": "m_eResult", "fieldtype": "enum EResult"}, +{ "fieldname": "m_ulBeaconID", "fieldtype": "PartyBeaconID_t"}]} +,{"struct": "ReservationNotificationCallback_t","fields": [ +{ "fieldname": "m_ulBeaconID", "fieldtype": "PartyBeaconID_t"}, +{ "fieldname": "m_steamIDJoiner", "fieldtype": "class CSteamID"}]} +,{"struct": "ChangeNumOpenSlotsCallback_t","fields": [ +{ "fieldname": "m_eResult", "fieldtype": "enum EResult"}]} ,{"struct": "SteamParamStringArray_t","fields": [ { "fieldname": "m_ppStrings", "fieldtype": "const char **"}, { "fieldname": "m_nNumStrings", "fieldtype": "int32"}]} @@ -1819,25 +2365,6 @@ { "fieldname": "m_ulContextValue", "fieldtype": "uint64"}, { "fieldname": "m_cOffset", "fieldtype": "uint32"}, { "fieldname": "m_cBytesReceived", "fieldtype": "uint32"}]} -,{"struct": "ControllerAnalogActionData_t","fields": [ -{ "fieldname": "eMode", "fieldtype": "enum EControllerSourceMode"}, -{ "fieldname": "x", "fieldtype": "float"}, -{ "fieldname": "y", "fieldtype": "float"}, -{ "fieldname": "bActive", "fieldtype": "_Bool"}]} -,{"struct": "ControllerDigitalActionData_t","fields": [ -{ "fieldname": "bState", "fieldtype": "_Bool"}, -{ "fieldname": "bActive", "fieldtype": "_Bool"}]} -,{"struct": "ControllerMotionData_t","fields": [ -{ "fieldname": "rotQuatX", "fieldtype": "float"}, -{ "fieldname": "rotQuatY", "fieldtype": "float"}, -{ "fieldname": "rotQuatZ", "fieldtype": "float"}, -{ "fieldname": "rotQuatW", "fieldtype": "float"}, -{ "fieldname": "posAccelX", "fieldtype": "float"}, -{ "fieldname": "posAccelY", "fieldtype": "float"}, -{ "fieldname": "posAccelZ", "fieldtype": "float"}, -{ "fieldname": "rotVelX", "fieldtype": "float"}, -{ "fieldname": "rotVelY", "fieldtype": "float"}, -{ "fieldname": "rotVelZ", "fieldtype": "float"}]} ,{"struct": "SteamUGCDetails_t","fields": [ { "fieldname": "m_nPublishedFileId", "fieldtype": "PublishedFileId_t"}, { "fieldname": "m_eResult", "fieldtype": "enum EResult"}, @@ -1870,7 +2397,8 @@ { "fieldname": "m_eResult", "fieldtype": "enum EResult"}, { "fieldname": "m_unNumResultsReturned", "fieldtype": "uint32"}, { "fieldname": "m_unTotalMatchingResults", "fieldtype": "uint32"}, -{ "fieldname": "m_bCachedData", "fieldtype": "_Bool"}]} +{ "fieldname": "m_bCachedData", "fieldtype": "_Bool"}, +{ "fieldname": "m_rgchNextCursor", "fieldtype": "char [256]"}]} ,{"struct": "SteamUGCRequestUGCDetailsResult_t","fields": [ { "fieldname": "m_details", "fieldtype": "struct SteamUGCDetails_t"}, { "fieldname": "m_bCachedData", "fieldtype": "_Bool"}]} @@ -2019,7 +2547,7 @@ { "fieldname": "unY", "fieldtype": "uint32"}, { "fieldname": "unWide", "fieldtype": "uint32"}, { "fieldname": "unTall", "fieldtype": "uint32"}, -{ "fieldname": "unNewWindow_BrowserHandle", "fieldtype": "HHTMLBrowser"}]} +{ "fieldname": "unNewWindow_BrowserHandle_IGNORE", "fieldtype": "HHTMLBrowser"}]} ,{"struct": "HTML_SetCursor_t","fields": [ { "fieldname": "unBrowserHandle", "fieldtype": "HHTMLBrowser"}, { "fieldname": "eMouseCursor", "fieldtype": "uint32"}]} @@ -2068,38 +2596,6 @@ ,{"struct": "GetOPFSettingsResult_t","fields": [ { "fieldname": "m_eResult", "fieldtype": "enum EResult"}, { "fieldname": "m_unVideoAppID", "fieldtype": "AppId_t"}]} -,{"struct": "CSteamAPIContext","fields": [ -{ "fieldname": "m_pSteamClient", "fieldtype": "class ISteamClient *"}, -{ "fieldname": "m_pSteamUser", "fieldtype": "class ISteamUser *"}, -{ "fieldname": "m_pSteamFriends", "fieldtype": "class ISteamFriends *"}, -{ "fieldname": "m_pSteamUtils", "fieldtype": "class ISteamUtils *"}, -{ "fieldname": "m_pSteamMatchmaking", "fieldtype": "class ISteamMatchmaking *"}, -{ "fieldname": "m_pSteamUserStats", "fieldtype": "class ISteamUserStats *"}, -{ "fieldname": "m_pSteamApps", "fieldtype": "class ISteamApps *"}, -{ "fieldname": "m_pSteamMatchmakingServers", "fieldtype": "class ISteamMatchmakingServers *"}, -{ "fieldname": "m_pSteamNetworking", "fieldtype": "class ISteamNetworking *"}, -{ "fieldname": "m_pSteamRemoteStorage", "fieldtype": "class ISteamRemoteStorage *"}, -{ "fieldname": "m_pSteamScreenshots", "fieldtype": "class ISteamScreenshots *"}, -{ "fieldname": "m_pSteamHTTP", "fieldtype": "class ISteamHTTP *"}, -{ "fieldname": "m_pController", "fieldtype": "class ISteamController *"}, -{ "fieldname": "m_pSteamUGC", "fieldtype": "class ISteamUGC *"}, -{ "fieldname": "m_pSteamAppList", "fieldtype": "class ISteamAppList *"}, -{ "fieldname": "m_pSteamMusic", "fieldtype": "class ISteamMusic *"}, -{ "fieldname": "m_pSteamMusicRemote", "fieldtype": "class ISteamMusicRemote *"}, -{ "fieldname": "m_pSteamHTMLSurface", "fieldtype": "class ISteamHTMLSurface *"}, -{ "fieldname": "m_pSteamInventory", "fieldtype": "class ISteamInventory *"}, -{ "fieldname": "m_pSteamVideo", "fieldtype": "class ISteamVideo *"}, -{ "fieldname": "m_pSteamParentalSettings", "fieldtype": "class ISteamParentalSettings *"}]} -,{"struct": "CCallbackBase","fields": [ -{ "fieldname": "m_nCallbackFlags", "fieldtype": "uint8"}, -{ "fieldname": "m_iCallback", "fieldtype": "int"}]} -,{"struct": "CCallResult","fields": [ -{ "fieldname": "m_hAPICall", "fieldtype": "SteamAPICall_t"}, -{ "fieldname": "m_pObj", "fieldtype": "T *"}, -{ "fieldname": "m_Func", "fieldtype": "func_t"}]} -,{"struct": "CCallback","fields": [ -{ "fieldname": "m_pObj", "fieldtype": "T *"}, -{ "fieldname": "m_Func", "fieldtype": "func_t"}]} ,{"struct": "GSClientApprove_t","fields": [ { "fieldname": "m_SteamID", "fieldtype": "class CSteamID"}, { "fieldname": "m_OwnerSteamID", "fieldtype": "class CSteamID"}]} @@ -2328,6 +2824,16 @@ { "paramname": "pchVersion" ,"paramtype": "const char *"} ] } +,{ + "classname": "ISteamClient", + "methodname": "GetISteamGameSearch", + "returntype": "class ISteamGameSearch *", + "params": [ +{ "paramname": "hSteamuser" ,"paramtype": "HSteamUser"}, +{ "paramname": "hSteamPipe" ,"paramtype": "HSteamPipe"}, +{ "paramname": "pchVersion" ,"paramtype": "const char *"} + ] +} ,{ "classname": "ISteamClient", "methodname": "GetIPCCallCount", @@ -2446,6 +2952,26 @@ { "paramname": "pchVersion" ,"paramtype": "const char *"} ] } +,{ + "classname": "ISteamClient", + "methodname": "GetISteamInput", + "returntype": "class ISteamInput *", + "params": [ +{ "paramname": "hSteamUser" ,"paramtype": "HSteamUser"}, +{ "paramname": "hSteamPipe" ,"paramtype": "HSteamPipe"}, +{ "paramname": "pchVersion" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamClient", + "methodname": "GetISteamParties", + "returntype": "class ISteamParties *", + "params": [ +{ "paramname": "hSteamUser" ,"paramtype": "HSteamUser"}, +{ "paramname": "hSteamPipe" ,"paramtype": "HSteamPipe"}, +{ "paramname": "pchVersion" ,"paramtype": "const char *"} + ] +} ,{ "classname": "ISteamUser", "methodname": "GetHSteamUser", @@ -2677,6 +3203,11 @@ "methodname": "BIsPhoneRequiringVerification", "returntype": "bool" } +,{ + "classname": "ISteamUser", + "methodname": "GetMarketEligibility", "callresult": "MarketEligibilityResponse_t", + "returntype": "SteamAPICall_t" +} ,{ "classname": "ISteamFriends", "methodname": "GetPersonaName", @@ -2924,7 +3455,8 @@ "methodname": "ActivateGameOverlayToWebPage", "returntype": "void", "params": [ -{ "paramname": "pchURL" ,"paramtype": "const char *"} +{ "paramname": "pchURL" ,"paramtype": "const char *"}, +{ "paramname": "eMode" ,"paramtype": "EActivateGameOverlayToWebPageMode"} ] } ,{ @@ -3266,6 +3798,11 @@ { "paramname": "steamIDClan" ,"paramtype": "class CSteamID"} ] } +,{ + "classname": "ISteamFriends", + "methodname": "GetNumChatsWithUnreadPriorityMessages", + "returntype": "int" +} ,{ "classname": "ISteamUtils", "methodname": "GetSecondsSinceAppActive", @@ -4057,6 +4594,225 @@ { "paramname": "hServerQuery" ,"paramtype": "HServerQuery"} ] } +,{ + "classname": "ISteamGameSearch", + "methodname": "AddGameSearchParams", + "returntype": "EGameSearchErrorCode_t", + "params": [ +{ "paramname": "pchKeyToFind" ,"paramtype": "const char *"}, +{ "paramname": "pchValuesToFind" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamGameSearch", + "methodname": "SearchForGameWithLobby", + "returntype": "EGameSearchErrorCode_t", + "params": [ +{ "paramname": "steamIDLobby" ,"paramtype": "class CSteamID"}, +{ "paramname": "nPlayerMin" ,"paramtype": "int"}, +{ "paramname": "nPlayerMax" ,"paramtype": "int"} + ] +} +,{ + "classname": "ISteamGameSearch", + "methodname": "SearchForGameSolo", + "returntype": "EGameSearchErrorCode_t", + "params": [ +{ "paramname": "nPlayerMin" ,"paramtype": "int"}, +{ "paramname": "nPlayerMax" ,"paramtype": "int"} + ] +} +,{ + "classname": "ISteamGameSearch", + "methodname": "AcceptGame", + "returntype": "EGameSearchErrorCode_t" +} +,{ + "classname": "ISteamGameSearch", + "methodname": "DeclineGame", + "returntype": "EGameSearchErrorCode_t" +} +,{ + "classname": "ISteamGameSearch", + "methodname": "RetrieveConnectionDetails", + "returntype": "EGameSearchErrorCode_t", + "params": [ +{ "paramname": "steamIDHost" ,"paramtype": "class CSteamID"}, +{ "paramname": "pchConnectionDetails" ,"paramtype": "char *"}, +{ "paramname": "cubConnectionDetails" ,"paramtype": "int"} + ] +} +,{ + "classname": "ISteamGameSearch", + "methodname": "EndGameSearch", + "returntype": "EGameSearchErrorCode_t" +} +,{ + "classname": "ISteamGameSearch", + "methodname": "SetGameHostParams", + "returntype": "EGameSearchErrorCode_t", + "params": [ +{ "paramname": "pchKey" ,"paramtype": "const char *"}, +{ "paramname": "pchValue" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamGameSearch", + "methodname": "SetConnectionDetails", + "returntype": "EGameSearchErrorCode_t", + "params": [ +{ "paramname": "pchConnectionDetails" ,"paramtype": "const char *"}, +{ "paramname": "cubConnectionDetails" ,"paramtype": "int"} + ] +} +,{ + "classname": "ISteamGameSearch", + "methodname": "RequestPlayersForGame", + "returntype": "EGameSearchErrorCode_t", + "params": [ +{ "paramname": "nPlayerMin" ,"paramtype": "int"}, +{ "paramname": "nPlayerMax" ,"paramtype": "int"}, +{ "paramname": "nMaxTeamSize" ,"paramtype": "int"} + ] +} +,{ + "classname": "ISteamGameSearch", + "methodname": "HostConfirmGameStart", + "returntype": "EGameSearchErrorCode_t", + "params": [ +{ "paramname": "ullUniqueGameID" ,"paramtype": "uint64"} + ] +} +,{ + "classname": "ISteamGameSearch", + "methodname": "CancelRequestPlayersForGame", + "returntype": "EGameSearchErrorCode_t" +} +,{ + "classname": "ISteamGameSearch", + "methodname": "SubmitPlayerResult", + "returntype": "EGameSearchErrorCode_t", + "params": [ +{ "paramname": "ullUniqueGameID" ,"paramtype": "uint64"}, +{ "paramname": "steamIDPlayer" ,"paramtype": "class CSteamID"}, +{ "paramname": "EPlayerResult" ,"paramtype": "EPlayerResult_t"} + ] +} +,{ + "classname": "ISteamGameSearch", + "methodname": "EndGame", + "returntype": "EGameSearchErrorCode_t", + "params": [ +{ "paramname": "ullUniqueGameID" ,"paramtype": "uint64"} + ] +} +,{ + "classname": "ISteamParties", + "methodname": "GetNumActiveBeacons", + "returntype": "uint32" +} +,{ + "classname": "ISteamParties", + "methodname": "GetBeaconByIndex", + "returntype": "PartyBeaconID_t", + "params": [ +{ "paramname": "unIndex" ,"paramtype": "uint32"} + ] +} +,{ + "classname": "ISteamParties", + "methodname": "GetBeaconDetails", + "returntype": "bool", + "params": [ +{ "paramname": "ulBeaconID" ,"paramtype": "PartyBeaconID_t"}, +{ "paramname": "pSteamIDBeaconOwner" ,"paramtype": "class CSteamID *"}, +{ "paramname": "pLocation" ,"out_struct": " " ,"paramtype": "struct SteamPartyBeaconLocation_t *"}, +{ "paramname": "pchMetadata" ,"out_string_count": "cchMetadata" ,"paramtype": "char *"}, +{ "paramname": "cchMetadata" ,"paramtype": "int"} + ] +} +,{ + "classname": "ISteamParties", + "methodname": "JoinParty", "callresult": "JoinPartyCallback_t", + "returntype": "SteamAPICall_t", + "params": [ +{ "paramname": "ulBeaconID" ,"paramtype": "PartyBeaconID_t"} + ] +} +,{ + "classname": "ISteamParties", + "methodname": "GetNumAvailableBeaconLocations", + "returntype": "bool", + "params": [ +{ "paramname": "puNumLocations" ,"paramtype": "uint32 *"} + ] +} +,{ + "classname": "ISteamParties", + "methodname": "GetAvailableBeaconLocations", + "returntype": "bool", + "params": [ +{ "paramname": "pLocationList" ,"paramtype": "struct SteamPartyBeaconLocation_t *"}, +{ "paramname": "uMaxNumLocations" ,"paramtype": "uint32"} + ] +} +,{ + "classname": "ISteamParties", + "methodname": "CreateBeacon", "callresult": "CreateBeaconCallback_t", + "returntype": "SteamAPICall_t", + "params": [ +{ "paramname": "unOpenSlots" ,"paramtype": "uint32"}, +{ "paramname": "pBeaconLocation" ,"paramtype": "struct SteamPartyBeaconLocation_t *"}, +{ "paramname": "pchConnectString" ,"paramtype": "const char *"}, +{ "paramname": "pchMetadata" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamParties", + "methodname": "OnReservationCompleted", + "returntype": "void", + "params": [ +{ "paramname": "ulBeacon" ,"paramtype": "PartyBeaconID_t"}, +{ "paramname": "steamIDUser" ,"paramtype": "class CSteamID"} + ] +} +,{ + "classname": "ISteamParties", + "methodname": "CancelReservation", + "returntype": "void", + "params": [ +{ "paramname": "ulBeacon" ,"paramtype": "PartyBeaconID_t"}, +{ "paramname": "steamIDUser" ,"paramtype": "class CSteamID"} + ] +} +,{ + "classname": "ISteamParties", + "methodname": "ChangeNumOpenSlots", "callresult": "ChangeNumOpenSlotsCallback_t", + "returntype": "SteamAPICall_t", + "params": [ +{ "paramname": "ulBeacon" ,"paramtype": "PartyBeaconID_t"}, +{ "paramname": "unOpenSlots" ,"paramtype": "uint32"} + ] +} +,{ + "classname": "ISteamParties", + "methodname": "DestroyBeacon", + "returntype": "bool", + "params": [ +{ "paramname": "ulBeacon" ,"paramtype": "PartyBeaconID_t"} + ] +} +,{ + "classname": "ISteamParties", + "methodname": "GetBeaconLocationData", + "returntype": "bool", + "params": [ +{ "paramname": "BeaconLocation" ,"paramtype": "struct SteamPartyBeaconLocation_t"}, +{ "paramname": "eData" ,"paramtype": "ESteamPartyBeaconLocationData"}, +{ "paramname": "pchDataStringOut" ,"out_string_count": "cchDataStringOut" ,"paramtype": "char *"}, +{ "paramname": "cchDataStringOut" ,"paramtype": "int"} + ] +} ,{ "classname": "ISteamRemoteStorage", "methodname": "FileWrite", @@ -5113,6 +5869,20 @@ { "paramname": "pszFileName" ,"paramtype": "const char *"} ] } +,{ + "classname": "ISteamApps", + "methodname": "GetLaunchCommandLine", + "returntype": "int", + "params": [ +{ "paramname": "pszCommandLine" ,"paramtype": "char *"}, +{ "paramname": "cubCommandLine" ,"paramtype": "int"} + ] +} +,{ + "classname": "ISteamApps", + "methodname": "BIsSubscribedFromFamilySharing", + "returntype": "bool" +} ,{ "classname": "ISteamNetworking", "methodname": "SendP2PPacket", @@ -5918,6 +6688,289 @@ { "paramname": "pbWasTimedOut" ,"paramtype": "bool *"} ] } +,{ + "classname": "ISteamInput", + "methodname": "Init", + "returntype": "bool" +} +,{ + "classname": "ISteamInput", + "methodname": "Shutdown", + "returntype": "bool" +} +,{ + "classname": "ISteamInput", + "methodname": "RunFrame", + "returntype": "void" +} +,{ + "classname": "ISteamInput", + "methodname": "GetConnectedControllers", + "returntype": "int", + "params": [ +{ "paramname": "handlesOut" ,"paramtype": "InputHandle_t *"} + ] +} +,{ + "classname": "ISteamInput", + "methodname": "GetActionSetHandle", + "returntype": "InputActionSetHandle_t", + "params": [ +{ "paramname": "pszActionSetName" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamInput", + "methodname": "ActivateActionSet", + "returntype": "void", + "params": [ +{ "paramname": "inputHandle" ,"paramtype": "InputHandle_t"}, +{ "paramname": "actionSetHandle" ,"paramtype": "InputActionSetHandle_t"} + ] +} +,{ + "classname": "ISteamInput", + "methodname": "GetCurrentActionSet", + "returntype": "InputActionSetHandle_t", + "params": [ +{ "paramname": "inputHandle" ,"paramtype": "InputHandle_t"} + ] +} +,{ + "classname": "ISteamInput", + "methodname": "ActivateActionSetLayer", + "returntype": "void", + "params": [ +{ "paramname": "inputHandle" ,"paramtype": "InputHandle_t"}, +{ "paramname": "actionSetLayerHandle" ,"paramtype": "InputActionSetHandle_t"} + ] +} +,{ + "classname": "ISteamInput", + "methodname": "DeactivateActionSetLayer", + "returntype": "void", + "params": [ +{ "paramname": "inputHandle" ,"paramtype": "InputHandle_t"}, +{ "paramname": "actionSetLayerHandle" ,"paramtype": "InputActionSetHandle_t"} + ] +} +,{ + "classname": "ISteamInput", + "methodname": "DeactivateAllActionSetLayers", + "returntype": "void", + "params": [ +{ "paramname": "inputHandle" ,"paramtype": "InputHandle_t"} + ] +} +,{ + "classname": "ISteamInput", + "methodname": "GetActiveActionSetLayers", + "returntype": "int", + "params": [ +{ "paramname": "inputHandle" ,"paramtype": "InputHandle_t"}, +{ "paramname": "handlesOut" ,"paramtype": "InputActionSetHandle_t *"} + ] +} +,{ + "classname": "ISteamInput", + "methodname": "GetDigitalActionHandle", + "returntype": "InputDigitalActionHandle_t", + "params": [ +{ "paramname": "pszActionName" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamInput", + "methodname": "GetDigitalActionData", + "returntype": "struct InputDigitalActionData_t", + "params": [ +{ "paramname": "inputHandle" ,"paramtype": "InputHandle_t"}, +{ "paramname": "digitalActionHandle" ,"paramtype": "InputDigitalActionHandle_t"} + ] +} +,{ + "classname": "ISteamInput", + "methodname": "GetDigitalActionOrigins", + "returntype": "int", + "params": [ +{ "paramname": "inputHandle" ,"paramtype": "InputHandle_t"}, +{ "paramname": "actionSetHandle" ,"paramtype": "InputActionSetHandle_t"}, +{ "paramname": "digitalActionHandle" ,"paramtype": "InputDigitalActionHandle_t"}, +{ "paramname": "originsOut" ,"paramtype": "EInputActionOrigin *"} + ] +} +,{ + "classname": "ISteamInput", + "methodname": "GetAnalogActionHandle", + "returntype": "InputAnalogActionHandle_t", + "params": [ +{ "paramname": "pszActionName" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamInput", + "methodname": "GetAnalogActionData", + "returntype": "struct InputAnalogActionData_t", + "params": [ +{ "paramname": "inputHandle" ,"paramtype": "InputHandle_t"}, +{ "paramname": "analogActionHandle" ,"paramtype": "InputAnalogActionHandle_t"} + ] +} +,{ + "classname": "ISteamInput", + "methodname": "GetAnalogActionOrigins", + "returntype": "int", + "params": [ +{ "paramname": "inputHandle" ,"paramtype": "InputHandle_t"}, +{ "paramname": "actionSetHandle" ,"paramtype": "InputActionSetHandle_t"}, +{ "paramname": "analogActionHandle" ,"paramtype": "InputAnalogActionHandle_t"}, +{ "paramname": "originsOut" ,"paramtype": "EInputActionOrigin *"} + ] +} +,{ + "classname": "ISteamInput", + "methodname": "GetGlyphForActionOrigin", + "returntype": "const char *", + "params": [ +{ "paramname": "eOrigin" ,"paramtype": "EInputActionOrigin"} + ] +} +,{ + "classname": "ISteamInput", + "methodname": "GetStringForActionOrigin", + "returntype": "const char *", + "params": [ +{ "paramname": "eOrigin" ,"paramtype": "EInputActionOrigin"} + ] +} +,{ + "classname": "ISteamInput", + "methodname": "StopAnalogActionMomentum", + "returntype": "void", + "params": [ +{ "paramname": "inputHandle" ,"paramtype": "InputHandle_t"}, +{ "paramname": "eAction" ,"paramtype": "InputAnalogActionHandle_t"} + ] +} +,{ + "classname": "ISteamInput", + "methodname": "GetMotionData", + "returntype": "struct InputMotionData_t", + "params": [ +{ "paramname": "inputHandle" ,"paramtype": "InputHandle_t"} + ] +} +,{ + "classname": "ISteamInput", + "methodname": "TriggerVibration", + "returntype": "void", + "params": [ +{ "paramname": "inputHandle" ,"paramtype": "InputHandle_t"}, +{ "paramname": "usLeftSpeed" ,"paramtype": "unsigned short"}, +{ "paramname": "usRightSpeed" ,"paramtype": "unsigned short"} + ] +} +,{ + "classname": "ISteamInput", + "methodname": "SetLEDColor", + "returntype": "void", + "params": [ +{ "paramname": "inputHandle" ,"paramtype": "InputHandle_t"}, +{ "paramname": "nColorR" ,"paramtype": "uint8"}, +{ "paramname": "nColorG" ,"paramtype": "uint8"}, +{ "paramname": "nColorB" ,"paramtype": "uint8"}, +{ "paramname": "nFlags" ,"paramtype": "unsigned int"} + ] +} +,{ + "classname": "ISteamInput", + "methodname": "TriggerHapticPulse", + "returntype": "void", + "params": [ +{ "paramname": "inputHandle" ,"paramtype": "InputHandle_t"}, +{ "paramname": "eTargetPad" ,"paramtype": "ESteamControllerPad"}, +{ "paramname": "usDurationMicroSec" ,"paramtype": "unsigned short"} + ] +} +,{ + "classname": "ISteamInput", + "methodname": "TriggerRepeatedHapticPulse", + "returntype": "void", + "params": [ +{ "paramname": "inputHandle" ,"paramtype": "InputHandle_t"}, +{ "paramname": "eTargetPad" ,"paramtype": "ESteamControllerPad"}, +{ "paramname": "usDurationMicroSec" ,"paramtype": "unsigned short"}, +{ "paramname": "usOffMicroSec" ,"paramtype": "unsigned short"}, +{ "paramname": "unRepeat" ,"paramtype": "unsigned short"}, +{ "paramname": "nFlags" ,"paramtype": "unsigned int"} + ] +} +,{ + "classname": "ISteamInput", + "methodname": "ShowBindingPanel", + "returntype": "bool", + "params": [ +{ "paramname": "inputHandle" ,"paramtype": "InputHandle_t"} + ] +} +,{ + "classname": "ISteamInput", + "methodname": "GetInputTypeForHandle", + "returntype": "ESteamInputType", + "params": [ +{ "paramname": "inputHandle" ,"paramtype": "InputHandle_t"} + ] +} +,{ + "classname": "ISteamInput", + "methodname": "GetControllerForGamepadIndex", + "returntype": "InputHandle_t", + "params": [ +{ "paramname": "nIndex" ,"paramtype": "int"} + ] +} +,{ + "classname": "ISteamInput", + "methodname": "GetGamepadIndexForController", + "returntype": "int", + "params": [ +{ "paramname": "ulinputHandle" ,"paramtype": "InputHandle_t"} + ] +} +,{ + "classname": "ISteamInput", + "methodname": "GetStringForXboxOrigin", + "returntype": "const char *", + "params": [ +{ "paramname": "eOrigin" ,"paramtype": "EXboxOrigin"} + ] +} +,{ + "classname": "ISteamInput", + "methodname": "GetGlyphForXboxOrigin", + "returntype": "const char *", + "params": [ +{ "paramname": "eOrigin" ,"paramtype": "EXboxOrigin"} + ] +} +,{ + "classname": "ISteamInput", + "methodname": "GetActionOriginFromXboxOrigin", + "returntype": "EInputActionOrigin", + "params": [ +{ "paramname": "inputHandle" ,"paramtype": "InputHandle_t"}, +{ "paramname": "eOrigin" ,"paramtype": "EXboxOrigin"} + ] +} +,{ + "classname": "ISteamInput", + "methodname": "TranslateActionOrigin", + "returntype": "EInputActionOrigin", + "params": [ +{ "paramname": "eDestinationInputType" ,"paramtype": "ESteamInputType"}, +{ "paramname": "eSourceOrigin" ,"paramtype": "EInputActionOrigin"} + ] +} ,{ "classname": "ISteamController", "methodname": "Init", @@ -5941,14 +6994,6 @@ { "paramname": "handlesOut" ,"paramtype": "ControllerHandle_t *"} ] } -,{ - "classname": "ISteamController", - "methodname": "ShowBindingPanel", - "returntype": "bool", - "params": [ -{ "paramname": "controllerHandle" ,"paramtype": "ControllerHandle_t"} - ] -} ,{ "classname": "ISteamController", "methodname": "GetActionSetHandle", @@ -6020,7 +7065,7 @@ ,{ "classname": "ISteamController", "methodname": "GetDigitalActionData", - "returntype": "struct ControllerDigitalActionData_t", + "returntype": "struct InputDigitalActionData_t", "params": [ { "paramname": "controllerHandle" ,"paramtype": "ControllerHandle_t"}, { "paramname": "digitalActionHandle" ,"paramtype": "ControllerDigitalActionHandle_t"} @@ -6048,7 +7093,7 @@ ,{ "classname": "ISteamController", "methodname": "GetAnalogActionData", - "returntype": "struct ControllerAnalogActionData_t", + "returntype": "struct InputAnalogActionData_t", "params": [ { "paramname": "controllerHandle" ,"paramtype": "ControllerHandle_t"}, { "paramname": "analogActionHandle" ,"paramtype": "ControllerAnalogActionHandle_t"} @@ -6065,6 +7110,22 @@ { "paramname": "originsOut" ,"paramtype": "EControllerActionOrigin *"} ] } +,{ + "classname": "ISteamController", + "methodname": "GetGlyphForActionOrigin", + "returntype": "const char *", + "params": [ +{ "paramname": "eOrigin" ,"paramtype": "EControllerActionOrigin"} + ] +} +,{ + "classname": "ISteamController", + "methodname": "GetStringForActionOrigin", + "returntype": "const char *", + "params": [ +{ "paramname": "eOrigin" ,"paramtype": "EControllerActionOrigin"} + ] +} ,{ "classname": "ISteamController", "methodname": "StopAnalogActionMomentum", @@ -6074,6 +7135,14 @@ { "paramname": "eAction" ,"paramtype": "ControllerAnalogActionHandle_t"} ] } +,{ + "classname": "ISteamController", + "methodname": "GetMotionData", + "returntype": "struct InputMotionData_t", + "params": [ +{ "paramname": "controllerHandle" ,"paramtype": "ControllerHandle_t"} + ] +} ,{ "classname": "ISteamController", "methodname": "TriggerHapticPulse", @@ -6121,10 +7190,18 @@ } ,{ "classname": "ISteamController", - "methodname": "GetGamepadIndexForController", - "returntype": "int", + "methodname": "ShowBindingPanel", + "returntype": "bool", "params": [ -{ "paramname": "ulControllerHandle" ,"paramtype": "ControllerHandle_t"} +{ "paramname": "controllerHandle" ,"paramtype": "ControllerHandle_t"} + ] +} +,{ + "classname": "ISteamController", + "methodname": "GetInputTypeForHandle", + "returntype": "ESteamInputType", + "params": [ +{ "paramname": "controllerHandle" ,"paramtype": "ControllerHandle_t"} ] } ,{ @@ -6137,58 +7214,44 @@ } ,{ "classname": "ISteamController", - "methodname": "GetMotionData", - "returntype": "struct ControllerMotionData_t", + "methodname": "GetGamepadIndexForController", + "returntype": "int", "params": [ -{ "paramname": "controllerHandle" ,"paramtype": "ControllerHandle_t"} +{ "paramname": "ulControllerHandle" ,"paramtype": "ControllerHandle_t"} ] } ,{ "classname": "ISteamController", - "methodname": "ShowDigitalActionOrigins", - "returntype": "bool", - "params": [ -{ "paramname": "controllerHandle" ,"paramtype": "ControllerHandle_t"}, -{ "paramname": "digitalActionHandle" ,"paramtype": "ControllerDigitalActionHandle_t"}, -{ "paramname": "flScale" ,"paramtype": "float"}, -{ "paramname": "flXPosition" ,"paramtype": "float"}, -{ "paramname": "flYPosition" ,"paramtype": "float"} - ] -} -,{ - "classname": "ISteamController", - "methodname": "ShowAnalogActionOrigins", - "returntype": "bool", - "params": [ -{ "paramname": "controllerHandle" ,"paramtype": "ControllerHandle_t"}, -{ "paramname": "analogActionHandle" ,"paramtype": "ControllerAnalogActionHandle_t"}, -{ "paramname": "flScale" ,"paramtype": "float"}, -{ "paramname": "flXPosition" ,"paramtype": "float"}, -{ "paramname": "flYPosition" ,"paramtype": "float"} - ] -} -,{ - "classname": "ISteamController", - "methodname": "GetStringForActionOrigin", + "methodname": "GetStringForXboxOrigin", "returntype": "const char *", "params": [ -{ "paramname": "eOrigin" ,"paramtype": "EControllerActionOrigin"} +{ "paramname": "eOrigin" ,"paramtype": "EXboxOrigin"} ] } ,{ "classname": "ISteamController", - "methodname": "GetGlyphForActionOrigin", + "methodname": "GetGlyphForXboxOrigin", "returntype": "const char *", "params": [ -{ "paramname": "eOrigin" ,"paramtype": "EControllerActionOrigin"} +{ "paramname": "eOrigin" ,"paramtype": "EXboxOrigin"} ] } ,{ "classname": "ISteamController", - "methodname": "GetInputTypeForHandle", - "returntype": "ESteamInputType", + "methodname": "GetActionOriginFromXboxOrigin", + "returntype": "EControllerActionOrigin", "params": [ -{ "paramname": "controllerHandle" ,"paramtype": "ControllerHandle_t"} +{ "paramname": "controllerHandle" ,"paramtype": "ControllerHandle_t"}, +{ "paramname": "eOrigin" ,"paramtype": "EXboxOrigin"} + ] +} +,{ + "classname": "ISteamController", + "methodname": "TranslateActionOrigin", + "returntype": "EControllerActionOrigin", + "params": [ +{ "paramname": "eDestinationInputType" ,"paramtype": "ESteamInputType"}, +{ "paramname": "eSourceOrigin" ,"paramtype": "EControllerActionOrigin"} ] } ,{ @@ -6217,6 +7280,18 @@ { "paramname": "unPage" ,"paramtype": "uint32"} ] } +,{ + "classname": "ISteamUGC", + "methodname": "CreateQueryAllUGCRequest", + "returntype": "UGCQueryHandle_t", + "params": [ +{ "paramname": "eQueryType" ,"paramtype": "EUGCQuery"}, +{ "paramname": "eMatchingeMatchingUGCTypeFileType" ,"paramtype": "EUGCMatchingUGCType"}, +{ "paramname": "nCreatorAppID" ,"paramtype": "AppId_t"}, +{ "paramname": "nConsumerAppID" ,"paramtype": "AppId_t"}, +{ "paramname": "pchCursor" ,"paramtype": "const char *"} + ] +} ,{ "classname": "ISteamUGC", "methodname": "CreateQueryUGCDetailsRequest", @@ -6596,6 +7671,15 @@ { "paramname": "pszPreviewFile" ,"paramtype": "const char *"} ] } +,{ + "classname": "ISteamUGC", + "methodname": "SetAllowLegacyUpload", + "returntype": "bool", + "params": [ +{ "paramname": "handle" ,"paramtype": "UGCUpdateHandle_t"}, +{ "paramname": "bAllowLegacyUpload" ,"paramtype": "bool"} + ] +} ,{ "classname": "ISteamUGC", "methodname": "RemoveItemKeyValueTags", @@ -7076,7 +8160,8 @@ "params": [ { "paramname": "unBrowserHandle" ,"paramtype": "HHTMLBrowser"}, { "paramname": "nNativeKeyCode" ,"paramtype": "uint32"}, -{ "paramname": "eHTMLKeyModifiers" ,"paramtype": "ISteamHTMLSurface::EHTMLKeyModifiers"} +{ "paramname": "eHTMLKeyModifiers" ,"paramtype": "ISteamHTMLSurface::EHTMLKeyModifiers"}, +{ "paramname": "bIsSystemKey" ,"paramtype": "bool"} ] } ,{ @@ -7222,6 +8307,14 @@ { "paramname": "flDPIScaling" ,"paramtype": "float"} ] } +,{ + "classname": "ISteamHTMLSurface", + "methodname": "OpenDeveloperTools", + "returntype": "void", + "params": [ +{ "paramname": "unBrowserHandle" ,"paramtype": "HHTMLBrowser"} + ] +} ,{ "classname": "ISteamHTMLSurface", "methodname": "AllowStartRequest", @@ -7505,7 +8598,8 @@ "returntype": "bool", "params": [ { "paramname": "pArrayItemDefs" ,"out_array_count": "pArrayItemDefs" ,"desc": "Items with prices" ,"paramtype": "SteamItemDef_t *"}, -{ "paramname": "pPrices" ,"out_array_count": "pPrices" ,"desc": "List of prices for the given item defs" ,"paramtype": "uint64 *"}, +{ "paramname": "pCurrentPrices" ,"out_array_count": "pPrices" ,"desc": "List of prices for the given item defs" ,"paramtype": "uint64 *"}, +{ "paramname": "pBasePrices" ,"out_array_count": "pPrices" ,"desc": "List of prices for the given item defs" ,"paramtype": "uint64 *"}, { "paramname": "unArrayLength" ,"paramtype": "uint32"} ] } @@ -7515,7 +8609,8 @@ "returntype": "bool", "params": [ { "paramname": "iDefinition" ,"paramtype": "SteamItemDef_t"}, -{ "paramname": "pPrice" ,"paramtype": "uint64 *"} +{ "paramname": "pCurrentPrice" ,"paramtype": "uint64 *"}, +{ "paramname": "pBasePrice" ,"paramtype": "uint64 *"} ] } ,{ diff --git a/Generator/steam_sdk/steam_api_common.h b/Generator/steam_sdk/steam_api_common.h new file mode 100644 index 0000000..cc936de --- /dev/null +++ b/Generator/steam_sdk/steam_api_common.h @@ -0,0 +1,231 @@ +//====== Copyright Valve Corporation, All rights reserved. ==================== +// +// Steamworks SDK minimal include +// +// Defines the minimal set of things we need to use any single interface +// or register for any callback. +// +//============================================================================= + +#ifndef STEAM_API_COMMON_H +#define STEAM_API_COMMON_H +#ifdef _WIN32 +#pragma once +#endif + +#include "steamtypes.h" +#include "steamclientpublic.h" + +// S_API defines the linkage and calling conventions for steam_api.dll exports +#if defined( _WIN32 ) && !defined( _X360 ) + #if defined( STEAM_API_EXPORTS ) + #define S_API extern "C" __declspec( dllexport ) + #elif defined( STEAM_API_NODLL ) + #define S_API extern "C" + #else + #define S_API extern "C" __declspec( dllimport ) + #endif // STEAM_API_EXPORTS +#elif defined( GNUC ) + #if defined( STEAM_API_EXPORTS ) + #define S_API extern "C" __attribute__ ((visibility("default"))) + #else + #define S_API extern "C" + #endif // STEAM_API_EXPORTS +#else // !WIN32 + #if defined( STEAM_API_EXPORTS ) + #define S_API extern "C" + #else + #define S_API extern "C" + #endif // STEAM_API_EXPORTS +#endif + +#if ( defined(STEAM_API_EXPORTS) || defined(STEAM_API_NODLL) ) && !defined(API_GEN) +#define STEAM_PRIVATE_API( ... ) __VA_ARGS__ +#elif defined(STEAM_API_EXPORTS) && defined(API_GEN) +#define STEAM_PRIVATE_API( ... ) +#else +#define STEAM_PRIVATE_API( ... ) protected: __VA_ARGS__ public: +#endif + +// handle to a communication pipe to the Steam client +typedef int32 HSteamPipe; +// handle to single instance of a steam user +typedef int32 HSteamUser; +// function prototype +#if defined( POSIX ) +#define __cdecl +#endif +extern "C" typedef void (__cdecl *SteamAPIWarningMessageHook_t)(int, const char *); +extern "C" typedef uint32 ( *SteamAPI_CheckCallbackRegistered_t )( int iCallbackNum ); +#if defined( __SNC__ ) + #pragma diag_suppress=1700 // warning 1700: class "%s" has virtual functions but non-virtual destructor +#endif + +//----------------------------------------------------------------------------------------------------------------------------------------------------------// +// steam callback and call-result helpers +// +// The following macros and classes are used to register your application for +// callbacks and call-results, which are delivered in a predictable manner. +// +// STEAM_CALLBACK macros are meant for use inside of a C++ class definition. +// They map a Steam notification callback directly to a class member function +// which is automatically prototyped as "void func( callback_type *pParam )". +// +// CCallResult is used with specific Steam APIs that return "result handles". +// The handle can be passed to a CCallResult object's Set function, along with +// an object pointer and member-function pointer. The member function will +// be executed once the results of the Steam API call are available. +// +// CCallback and CCallbackManual classes can be used instead of STEAM_CALLBACK +// macros if you require finer control over registration and unregistration. +// +// Callbacks and call-results are queued automatically and are only +// delivered/executed when your application calls SteamAPI_RunCallbacks(). +//----------------------------------------------------------------------------------------------------------------------------------------------------------// + +// Dispatch all queued Steamworks callbacks. +// +// This is safe to call from multiple threads simultaneously, +// but if you choose to do this, callback code could be executed on any thread. +// One alternative is to call SteamAPI_RunCallbacks from the main thread only, +// and call SteamAPI_ReleaseCurrentThreadMemory regularly on other threads. +S_API void S_CALLTYPE SteamAPI_RunCallbacks(); + +// Declares a callback member function plus a helper member variable which +// registers the callback on object creation and unregisters on destruction. +// The optional fourth 'var' param exists only for backwards-compatibility +// and can be ignored. +#define STEAM_CALLBACK( thisclass, func, .../*callback_type, [deprecated] var*/ ) \ + _STEAM_CALLBACK_SELECT( ( __VA_ARGS__, 4, 3 ), ( /**/, thisclass, func, __VA_ARGS__ ) ) + +// Declares a callback function and a named CCallbackManual variable which +// has Register and Unregister functions instead of automatic registration. +#define STEAM_CALLBACK_MANUAL( thisclass, func, callback_type, var ) \ + CCallbackManual< thisclass, callback_type > var; void func( callback_type *pParam ) + +// Dispatch callbacks relevant to the gameserver client and interfaces. +// To register for these, you need to use STEAM_GAMESERVER_CALLBACK. +// (Or call SetGameserverFlag on your CCallbackBase object.) +S_API void S_CALLTYPE SteamGameServer_RunCallbacks(); + +// Same as STEAM_CALLBACK, but for callbacks on the gameserver interface. +// These will be dispatched during SteamGameServer_RunCallbacks +#define STEAM_GAMESERVER_CALLBACK( thisclass, func, /*callback_type, [deprecated] var*/... ) \ + _STEAM_CALLBACK_SELECT( ( __VA_ARGS__, GS, 3 ), ( this->SetGameserverFlag();, thisclass, func, __VA_ARGS__ ) ) +#define STEAM_GAMESERVER_CALLBACK_MANUAL( thisclass, func, callback_type, var ) \ + CCallbackManual< thisclass, callback_type, true > var; void func( callback_type *pParam ) + +//----------------------------------------------------------------------------- +// Purpose: base for callbacks and call results - internal implementation detail +//----------------------------------------------------------------------------- +class CCallbackBase +{ +public: + CCallbackBase() { m_nCallbackFlags = 0; m_iCallback = 0; } + // don't add a virtual destructor because we export this binary interface across dll's + virtual void Run( void *pvParam ) = 0; + virtual void Run( void *pvParam, bool bIOFailure, SteamAPICall_t hSteamAPICall ) = 0; + int GetICallback() { return m_iCallback; } + virtual int GetCallbackSizeBytes() = 0; + +protected: + enum { k_ECallbackFlagsRegistered = 0x01, k_ECallbackFlagsGameServer = 0x02 }; + uint8 m_nCallbackFlags; + int m_iCallback; + friend class CCallbackMgr; + +private: + CCallbackBase( const CCallbackBase& ); + CCallbackBase& operator=( const CCallbackBase& ); +}; + +//----------------------------------------------------------------------------- +// Purpose: templated base for callbacks - internal implementation detail +//----------------------------------------------------------------------------- +template< int sizeof_P > +class CCallbackImpl : protected CCallbackBase +{ +public: + virtual ~CCallbackImpl() { if ( m_nCallbackFlags & k_ECallbackFlagsRegistered ) SteamAPI_UnregisterCallback( this ); } + void SetGameserverFlag() { m_nCallbackFlags |= k_ECallbackFlagsGameServer; } + +protected: + virtual void Run( void *pvParam ) = 0; + virtual void Run( void *pvParam, bool /*bIOFailure*/, SteamAPICall_t /*hSteamAPICall*/ ) { Run( pvParam ); } + virtual int GetCallbackSizeBytes() { return sizeof_P; } +}; + + +//----------------------------------------------------------------------------- +// Purpose: maps a steam async call result to a class member function +// template params: T = local class, P = parameter struct +//----------------------------------------------------------------------------- +template< class T, class P > +class CCallResult : private CCallbackBase +{ +public: + typedef void (T::*func_t)( P*, bool ); + + CCallResult(); + ~CCallResult(); + + void Set( SteamAPICall_t hAPICall, T *p, func_t func ); + bool IsActive() const; + void Cancel(); + + void SetGameserverFlag() { m_nCallbackFlags |= k_ECallbackFlagsGameServer; } +private: + virtual void Run( void *pvParam ); + virtual void Run( void *pvParam, bool bIOFailure, SteamAPICall_t hSteamAPICall ); + virtual int GetCallbackSizeBytes() { return sizeof( P ); } + + SteamAPICall_t m_hAPICall; + T *m_pObj; + func_t m_Func; +}; + + + +//----------------------------------------------------------------------------- +// Purpose: maps a steam callback to a class member function +// template params: T = local class, P = parameter struct, +// bGameserver = listen for gameserver callbacks instead of client callbacks +//----------------------------------------------------------------------------- +template< class T, class P, bool bGameserver = false > +class CCallback : public CCallbackImpl< sizeof( P ) > +{ +public: + typedef void (T::*func_t)(P*); + + // NOTE: If you can't provide the correct parameters at construction time, you should + // use the CCallbackManual callback object (STEAM_CALLBACK_MANUAL macro) instead. + CCallback( T *pObj, func_t func ); + + void Register( T *pObj, func_t func ); + void Unregister(); + +protected: + virtual void Run( void *pvParam ); + + T *m_pObj; + func_t m_Func; +}; + + +//----------------------------------------------------------------------------- +// Purpose: subclass of CCallback which allows default-construction in +// an unregistered state; you must call Register manually +//----------------------------------------------------------------------------- +template< class T, class P, bool bGameServer = false > +class CCallbackManual : public CCallback< T, P, bGameServer > +{ +public: + CCallbackManual() : CCallback< T, P, bGameServer >( nullptr, nullptr ) {} + + // Inherits public Register and Unregister functions from base class +}; + +// Internal implementation details for all of the above +#include "steam_api_internal.h" + +#endif // STEAM_API_COMMON_H diff --git a/Generator/steam_sdk/steam_api_flat.h b/Generator/steam_sdk/steam_api_flat.h index 45ba7c3..b8c579e 100644 --- a/Generator/steam_sdk/steam_api_flat.h +++ b/Generator/steam_sdk/steam_api_flat.h @@ -42,6 +42,7 @@ typedef uint32 AccountID_t; typedef uint32 PartnerId_t; typedef uint64 ManifestId_t; typedef uint64 SiteId_t; +typedef uint64 PartyBeaconID_t; typedef uint32 HAuthTicket; typedef void * BREAKPAD_HANDLE; typedef char compile_time_assert_type[1]; @@ -62,6 +63,10 @@ typedef uint32 SNetListenSocket_t; typedef uint32 ScreenshotHandle; typedef uint32 HTTPRequestHandle; typedef uint32 HTTPCookieContainerHandle; +typedef uint64 InputHandle_t; +typedef uint64 InputActionSetHandle_t; +typedef uint64 InputDigitalActionHandle_t; +typedef uint64 InputAnalogActionHandle_t; typedef uint64 ControllerHandle_t; typedef uint64 ControllerActionSetHandle_t; typedef uint64 ControllerDigitalActionHandle_t; @@ -86,6 +91,8 @@ int const_k_iClientUserCallbacks = 900; int const_k_iSteamAppsCallbacks = 1000; int const_k_iSteamUserStatsCallbacks = 1100; int const_k_iSteamNetworkingCallbacks = 1200; +int const_k_iSteamNetworkingSocketsCallbacks = 1220; +int const_k_iSteamNetworkingMessagesCallbacks = 1250; int const_k_iClientRemoteStorageCallbacks = 1300; int const_k_iClientDepotBuilderCallbacks = 1400; int const_k_iSteamGameServerItemsCallbacks = 1500; @@ -125,9 +132,12 @@ int const_k_iClientBluetoothManagerCallbacks = 4800; int const_k_iClientSharedConnectionCallbacks = 4900; int const_k_ISteamParentalSettingsCallbacks = 5000; int const_k_iClientShaderCallbacks = 5100; +int const_k_iSteamGameSearchCallbacks = 5200; +int const_k_iSteamPartiesCallbacks = 5300; +int const_k_iClientPartiesCallbacks = 5400; int const_k_cchPersonaNameMax = 128; int const_k_cwchPersonaNameMax = 32; -int const_k_cchMaxRichPresenceKeys = 20; +int const_k_cchMaxRichPresenceKeys = 30; int const_k_cchMaxRichPresenceKeyLength = 64; int const_k_cchMaxRichPresenceValueLength = 256; int const_k_cchStatNameMax = 128; @@ -162,6 +172,7 @@ S_API class ISteamApps * SteamAPI_ISteamClient_GetISteamApps(intptr_t instancePt S_API class ISteamNetworking * SteamAPI_ISteamClient_GetISteamNetworking(intptr_t instancePtr, HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char * pchVersion); S_API class ISteamRemoteStorage * SteamAPI_ISteamClient_GetISteamRemoteStorage(intptr_t instancePtr, HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char * pchVersion); S_API class ISteamScreenshots * SteamAPI_ISteamClient_GetISteamScreenshots(intptr_t instancePtr, HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char * pchVersion); +S_API class ISteamGameSearch * SteamAPI_ISteamClient_GetISteamGameSearch(intptr_t instancePtr, HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char * pchVersion); S_API uint32 SteamAPI_ISteamClient_GetIPCCallCount(intptr_t instancePtr); S_API void SteamAPI_ISteamClient_SetWarningMessageHook(intptr_t instancePtr, SteamAPIWarningMessageHook_t pFunction); S_API bool SteamAPI_ISteamClient_BShutdownIfAllPipesClosed(intptr_t instancePtr); @@ -175,6 +186,8 @@ S_API class ISteamHTMLSurface * SteamAPI_ISteamClient_GetISteamHTMLSurface(intpt S_API class ISteamInventory * SteamAPI_ISteamClient_GetISteamInventory(intptr_t instancePtr, HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char * pchVersion); S_API class ISteamVideo * SteamAPI_ISteamClient_GetISteamVideo(intptr_t instancePtr, HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char * pchVersion); S_API class ISteamParentalSettings * SteamAPI_ISteamClient_GetISteamParentalSettings(intptr_t instancePtr, HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char * pchVersion); +S_API class ISteamInput * SteamAPI_ISteamClient_GetISteamInput(intptr_t instancePtr, HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char * pchVersion); +S_API class ISteamParties * SteamAPI_ISteamClient_GetISteamParties(intptr_t instancePtr, HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char * pchVersion); S_API HSteamUser SteamAPI_ISteamUser_GetHSteamUser(intptr_t instancePtr); S_API bool SteamAPI_ISteamUser_BLoggedOn(intptr_t instancePtr); S_API uint64 SteamAPI_ISteamUser_GetSteamID(intptr_t instancePtr); @@ -204,6 +217,7 @@ S_API bool SteamAPI_ISteamUser_BIsPhoneVerified(intptr_t instancePtr); S_API bool SteamAPI_ISteamUser_BIsTwoFactorEnabled(intptr_t instancePtr); S_API bool SteamAPI_ISteamUser_BIsPhoneIdentifying(intptr_t instancePtr); S_API bool SteamAPI_ISteamUser_BIsPhoneRequiringVerification(intptr_t instancePtr); +S_API SteamAPICall_t SteamAPI_ISteamUser_GetMarketEligibility(intptr_t instancePtr); S_API const char * SteamAPI_ISteamFriends_GetPersonaName(intptr_t instancePtr); S_API SteamAPICall_t SteamAPI_ISteamFriends_SetPersonaName(intptr_t instancePtr, const char * pchPersonaName); S_API EPersonaState SteamAPI_ISteamFriends_GetPersonaState(intptr_t instancePtr); @@ -234,7 +248,7 @@ S_API bool SteamAPI_ISteamFriends_IsUserInSource(intptr_t instancePtr, class CSt S_API void SteamAPI_ISteamFriends_SetInGameVoiceSpeaking(intptr_t instancePtr, class CSteamID steamIDUser, bool bSpeaking); S_API void SteamAPI_ISteamFriends_ActivateGameOverlay(intptr_t instancePtr, const char * pchDialog); S_API void SteamAPI_ISteamFriends_ActivateGameOverlayToUser(intptr_t instancePtr, const char * pchDialog, class CSteamID steamID); -S_API void SteamAPI_ISteamFriends_ActivateGameOverlayToWebPage(intptr_t instancePtr, const char * pchURL); +S_API void SteamAPI_ISteamFriends_ActivateGameOverlayToWebPage(intptr_t instancePtr, const char * pchURL, EActivateGameOverlayToWebPageMode eMode); S_API void SteamAPI_ISteamFriends_ActivateGameOverlayToStore(intptr_t instancePtr, AppId_t nAppID, EOverlayToStoreFlag eFlag); S_API void SteamAPI_ISteamFriends_SetPlayedWith(intptr_t instancePtr, class CSteamID steamIDUserPlayedWith); S_API void SteamAPI_ISteamFriends_ActivateGameOverlayInviteDialog(intptr_t instancePtr, class CSteamID steamIDLobby); @@ -276,6 +290,7 @@ S_API SteamAPICall_t SteamAPI_ISteamFriends_IsFollowing(intptr_t instancePtr, cl S_API SteamAPICall_t SteamAPI_ISteamFriends_EnumerateFollowingList(intptr_t instancePtr, uint32 unStartIndex); S_API bool SteamAPI_ISteamFriends_IsClanPublic(intptr_t instancePtr, class CSteamID steamIDClan); S_API bool SteamAPI_ISteamFriends_IsClanOfficialGameGroup(intptr_t instancePtr, class CSteamID steamIDClan); +S_API int SteamAPI_ISteamFriends_GetNumChatsWithUnreadPriorityMessages(intptr_t instancePtr); S_API uint32 SteamAPI_ISteamUtils_GetSecondsSinceAppActive(intptr_t instancePtr); S_API uint32 SteamAPI_ISteamUtils_GetSecondsSinceComputerActive(intptr_t instancePtr); S_API EUniverse SteamAPI_ISteamUtils_GetConnectedUniverse(intptr_t instancePtr); @@ -371,6 +386,32 @@ S_API HServerQuery SteamAPI_ISteamMatchmakingServers_PingServer(intptr_t instanc S_API HServerQuery SteamAPI_ISteamMatchmakingServers_PlayerDetails(intptr_t instancePtr, uint32 unIP, uint16 usPort, class ISteamMatchmakingPlayersResponse * pRequestServersResponse); S_API HServerQuery SteamAPI_ISteamMatchmakingServers_ServerRules(intptr_t instancePtr, uint32 unIP, uint16 usPort, class ISteamMatchmakingRulesResponse * pRequestServersResponse); S_API void SteamAPI_ISteamMatchmakingServers_CancelServerQuery(intptr_t instancePtr, HServerQuery hServerQuery); +S_API EGameSearchErrorCode_t SteamAPI_ISteamGameSearch_AddGameSearchParams(intptr_t instancePtr, const char * pchKeyToFind, const char * pchValuesToFind); +S_API EGameSearchErrorCode_t SteamAPI_ISteamGameSearch_SearchForGameWithLobby(intptr_t instancePtr, class CSteamID steamIDLobby, int nPlayerMin, int nPlayerMax); +S_API EGameSearchErrorCode_t SteamAPI_ISteamGameSearch_SearchForGameSolo(intptr_t instancePtr, int nPlayerMin, int nPlayerMax); +S_API EGameSearchErrorCode_t SteamAPI_ISteamGameSearch_AcceptGame(intptr_t instancePtr); +S_API EGameSearchErrorCode_t SteamAPI_ISteamGameSearch_DeclineGame(intptr_t instancePtr); +S_API EGameSearchErrorCode_t SteamAPI_ISteamGameSearch_RetrieveConnectionDetails(intptr_t instancePtr, class CSteamID steamIDHost, char * pchConnectionDetails, int cubConnectionDetails); +S_API EGameSearchErrorCode_t SteamAPI_ISteamGameSearch_EndGameSearch(intptr_t instancePtr); +S_API EGameSearchErrorCode_t SteamAPI_ISteamGameSearch_SetGameHostParams(intptr_t instancePtr, const char * pchKey, const char * pchValue); +S_API EGameSearchErrorCode_t SteamAPI_ISteamGameSearch_SetConnectionDetails(intptr_t instancePtr, const char * pchConnectionDetails, int cubConnectionDetails); +S_API EGameSearchErrorCode_t SteamAPI_ISteamGameSearch_RequestPlayersForGame(intptr_t instancePtr, int nPlayerMin, int nPlayerMax, int nMaxTeamSize); +S_API EGameSearchErrorCode_t SteamAPI_ISteamGameSearch_HostConfirmGameStart(intptr_t instancePtr, uint64 ullUniqueGameID); +S_API EGameSearchErrorCode_t SteamAPI_ISteamGameSearch_CancelRequestPlayersForGame(intptr_t instancePtr); +S_API EGameSearchErrorCode_t SteamAPI_ISteamGameSearch_SubmitPlayerResult(intptr_t instancePtr, uint64 ullUniqueGameID, class CSteamID steamIDPlayer, EPlayerResult_t EPlayerResult); +S_API EGameSearchErrorCode_t SteamAPI_ISteamGameSearch_EndGame(intptr_t instancePtr, uint64 ullUniqueGameID); +S_API uint32 SteamAPI_ISteamParties_GetNumActiveBeacons(intptr_t instancePtr); +S_API PartyBeaconID_t SteamAPI_ISteamParties_GetBeaconByIndex(intptr_t instancePtr, uint32 unIndex); +S_API bool SteamAPI_ISteamParties_GetBeaconDetails(intptr_t instancePtr, PartyBeaconID_t ulBeaconID, class CSteamID * pSteamIDBeaconOwner, struct SteamPartyBeaconLocation_t * pLocation, char * pchMetadata, int cchMetadata); +S_API SteamAPICall_t SteamAPI_ISteamParties_JoinParty(intptr_t instancePtr, PartyBeaconID_t ulBeaconID); +S_API bool SteamAPI_ISteamParties_GetNumAvailableBeaconLocations(intptr_t instancePtr, uint32 * puNumLocations); +S_API bool SteamAPI_ISteamParties_GetAvailableBeaconLocations(intptr_t instancePtr, struct SteamPartyBeaconLocation_t * pLocationList, uint32 uMaxNumLocations); +S_API SteamAPICall_t SteamAPI_ISteamParties_CreateBeacon(intptr_t instancePtr, uint32 unOpenSlots, struct SteamPartyBeaconLocation_t * pBeaconLocation, const char * pchConnectString, const char * pchMetadata); +S_API void SteamAPI_ISteamParties_OnReservationCompleted(intptr_t instancePtr, PartyBeaconID_t ulBeacon, class CSteamID steamIDUser); +S_API void SteamAPI_ISteamParties_CancelReservation(intptr_t instancePtr, PartyBeaconID_t ulBeacon, class CSteamID steamIDUser); +S_API SteamAPICall_t SteamAPI_ISteamParties_ChangeNumOpenSlots(intptr_t instancePtr, PartyBeaconID_t ulBeacon, uint32 unOpenSlots); +S_API bool SteamAPI_ISteamParties_DestroyBeacon(intptr_t instancePtr, PartyBeaconID_t ulBeacon); +S_API bool SteamAPI_ISteamParties_GetBeaconLocationData(intptr_t instancePtr, struct SteamPartyBeaconLocation_t BeaconLocation, ESteamPartyBeaconLocationData eData, char * pchDataStringOut, int cchDataStringOut); S_API bool SteamAPI_ISteamRemoteStorage_FileWrite(intptr_t instancePtr, const char * pchFile, const void * pvData, int32 cubData); S_API int32 SteamAPI_ISteamRemoteStorage_FileRead(intptr_t instancePtr, const char * pchFile, void * pvData, int32 cubDataToRead); S_API SteamAPICall_t SteamAPI_ISteamRemoteStorage_FileWriteAsync(intptr_t instancePtr, const char * pchFile, const void * pvData, uint32 cubData); @@ -495,6 +536,8 @@ S_API bool SteamAPI_ISteamApps_GetDlcDownloadProgress(intptr_t instancePtr, AppI S_API int SteamAPI_ISteamApps_GetAppBuildId(intptr_t instancePtr); S_API void SteamAPI_ISteamApps_RequestAllProofOfPurchaseKeys(intptr_t instancePtr); S_API SteamAPICall_t SteamAPI_ISteamApps_GetFileDetails(intptr_t instancePtr, const char * pszFileName); +S_API int SteamAPI_ISteamApps_GetLaunchCommandLine(intptr_t instancePtr, char * pszCommandLine, int cubCommandLine); +S_API bool SteamAPI_ISteamApps_BIsSubscribedFromFamilySharing(intptr_t instancePtr); S_API bool SteamAPI_ISteamNetworking_SendP2PPacket(intptr_t instancePtr, class CSteamID steamIDRemote, const void * pubData, uint32 cubData, EP2PSend eP2PSendType, int nChannel); S_API bool SteamAPI_ISteamNetworking_IsP2PPacketAvailable(intptr_t instancePtr, uint32 * pcubMsgSize, int nChannel); S_API bool SteamAPI_ISteamNetworking_ReadP2PPacket(intptr_t instancePtr, void * pubDest, uint32 cubDest, uint32 * pcubMsgSize, class CSteamID * psteamIDRemote, int nChannel); @@ -592,11 +635,43 @@ S_API bool SteamAPI_ISteamHTTP_SetHTTPRequestUserAgentInfo(intptr_t instancePtr, S_API bool SteamAPI_ISteamHTTP_SetHTTPRequestRequiresVerifiedCertificate(intptr_t instancePtr, HTTPRequestHandle hRequest, bool bRequireVerifiedCertificate); S_API bool SteamAPI_ISteamHTTP_SetHTTPRequestAbsoluteTimeoutMS(intptr_t instancePtr, HTTPRequestHandle hRequest, uint32 unMilliseconds); S_API bool SteamAPI_ISteamHTTP_GetHTTPRequestWasTimedOut(intptr_t instancePtr, HTTPRequestHandle hRequest, bool * pbWasTimedOut); +S_API bool SteamAPI_ISteamInput_Init(intptr_t instancePtr); +S_API bool SteamAPI_ISteamInput_Shutdown(intptr_t instancePtr); +S_API void SteamAPI_ISteamInput_RunFrame(intptr_t instancePtr); +S_API int SteamAPI_ISteamInput_GetConnectedControllers(intptr_t instancePtr, InputHandle_t * handlesOut); +S_API InputActionSetHandle_t SteamAPI_ISteamInput_GetActionSetHandle(intptr_t instancePtr, const char * pszActionSetName); +S_API void SteamAPI_ISteamInput_ActivateActionSet(intptr_t instancePtr, InputHandle_t inputHandle, InputActionSetHandle_t actionSetHandle); +S_API InputActionSetHandle_t SteamAPI_ISteamInput_GetCurrentActionSet(intptr_t instancePtr, InputHandle_t inputHandle); +S_API void SteamAPI_ISteamInput_ActivateActionSetLayer(intptr_t instancePtr, InputHandle_t inputHandle, InputActionSetHandle_t actionSetLayerHandle); +S_API void SteamAPI_ISteamInput_DeactivateActionSetLayer(intptr_t instancePtr, InputHandle_t inputHandle, InputActionSetHandle_t actionSetLayerHandle); +S_API void SteamAPI_ISteamInput_DeactivateAllActionSetLayers(intptr_t instancePtr, InputHandle_t inputHandle); +S_API int SteamAPI_ISteamInput_GetActiveActionSetLayers(intptr_t instancePtr, InputHandle_t inputHandle, InputActionSetHandle_t * handlesOut); +S_API InputDigitalActionHandle_t SteamAPI_ISteamInput_GetDigitalActionHandle(intptr_t instancePtr, const char * pszActionName); +S_API struct InputDigitalActionData_t SteamAPI_ISteamInput_GetDigitalActionData(intptr_t instancePtr, InputHandle_t inputHandle, InputDigitalActionHandle_t digitalActionHandle); +S_API int SteamAPI_ISteamInput_GetDigitalActionOrigins(intptr_t instancePtr, InputHandle_t inputHandle, InputActionSetHandle_t actionSetHandle, InputDigitalActionHandle_t digitalActionHandle, EInputActionOrigin * originsOut); +S_API InputAnalogActionHandle_t SteamAPI_ISteamInput_GetAnalogActionHandle(intptr_t instancePtr, const char * pszActionName); +S_API struct InputAnalogActionData_t SteamAPI_ISteamInput_GetAnalogActionData(intptr_t instancePtr, InputHandle_t inputHandle, InputAnalogActionHandle_t analogActionHandle); +S_API int SteamAPI_ISteamInput_GetAnalogActionOrigins(intptr_t instancePtr, InputHandle_t inputHandle, InputActionSetHandle_t actionSetHandle, InputAnalogActionHandle_t analogActionHandle, EInputActionOrigin * originsOut); +S_API const char * SteamAPI_ISteamInput_GetGlyphForActionOrigin(intptr_t instancePtr, EInputActionOrigin eOrigin); +S_API const char * SteamAPI_ISteamInput_GetStringForActionOrigin(intptr_t instancePtr, EInputActionOrigin eOrigin); +S_API void SteamAPI_ISteamInput_StopAnalogActionMomentum(intptr_t instancePtr, InputHandle_t inputHandle, InputAnalogActionHandle_t eAction); +S_API struct InputMotionData_t SteamAPI_ISteamInput_GetMotionData(intptr_t instancePtr, InputHandle_t inputHandle); +S_API void SteamAPI_ISteamInput_TriggerVibration(intptr_t instancePtr, InputHandle_t inputHandle, unsigned short usLeftSpeed, unsigned short usRightSpeed); +S_API void SteamAPI_ISteamInput_SetLEDColor(intptr_t instancePtr, InputHandle_t inputHandle, uint8 nColorR, uint8 nColorG, uint8 nColorB, unsigned int nFlags); +S_API void SteamAPI_ISteamInput_TriggerHapticPulse(intptr_t instancePtr, InputHandle_t inputHandle, ESteamControllerPad eTargetPad, unsigned short usDurationMicroSec); +S_API void SteamAPI_ISteamInput_TriggerRepeatedHapticPulse(intptr_t instancePtr, InputHandle_t inputHandle, ESteamControllerPad eTargetPad, unsigned short usDurationMicroSec, unsigned short usOffMicroSec, unsigned short unRepeat, unsigned int nFlags); +S_API bool SteamAPI_ISteamInput_ShowBindingPanel(intptr_t instancePtr, InputHandle_t inputHandle); +S_API ESteamInputType SteamAPI_ISteamInput_GetInputTypeForHandle(intptr_t instancePtr, InputHandle_t inputHandle); +S_API InputHandle_t SteamAPI_ISteamInput_GetControllerForGamepadIndex(intptr_t instancePtr, int nIndex); +S_API int SteamAPI_ISteamInput_GetGamepadIndexForController(intptr_t instancePtr, InputHandle_t ulinputHandle); +S_API const char * SteamAPI_ISteamInput_GetStringForXboxOrigin(intptr_t instancePtr, EXboxOrigin eOrigin); +S_API const char * SteamAPI_ISteamInput_GetGlyphForXboxOrigin(intptr_t instancePtr, EXboxOrigin eOrigin); +S_API EInputActionOrigin SteamAPI_ISteamInput_GetActionOriginFromXboxOrigin(intptr_t instancePtr, InputHandle_t inputHandle, EXboxOrigin eOrigin); +S_API EInputActionOrigin SteamAPI_ISteamInput_TranslateActionOrigin(intptr_t instancePtr, ESteamInputType eDestinationInputType, EInputActionOrigin eSourceOrigin); S_API bool SteamAPI_ISteamController_Init(intptr_t instancePtr); S_API bool SteamAPI_ISteamController_Shutdown(intptr_t instancePtr); S_API void SteamAPI_ISteamController_RunFrame(intptr_t instancePtr); S_API int SteamAPI_ISteamController_GetConnectedControllers(intptr_t instancePtr, ControllerHandle_t * handlesOut); -S_API bool SteamAPI_ISteamController_ShowBindingPanel(intptr_t instancePtr, ControllerHandle_t controllerHandle); S_API ControllerActionSetHandle_t SteamAPI_ISteamController_GetActionSetHandle(intptr_t instancePtr, const char * pszActionSetName); S_API void SteamAPI_ISteamController_ActivateActionSet(intptr_t instancePtr, ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetHandle); S_API ControllerActionSetHandle_t SteamAPI_ISteamController_GetCurrentActionSet(intptr_t instancePtr, ControllerHandle_t controllerHandle); @@ -605,26 +680,30 @@ S_API void SteamAPI_ISteamController_DeactivateActionSetLayer(intptr_t instanceP S_API void SteamAPI_ISteamController_DeactivateAllActionSetLayers(intptr_t instancePtr, ControllerHandle_t controllerHandle); S_API int SteamAPI_ISteamController_GetActiveActionSetLayers(intptr_t instancePtr, ControllerHandle_t controllerHandle, ControllerActionSetHandle_t * handlesOut); S_API ControllerDigitalActionHandle_t SteamAPI_ISteamController_GetDigitalActionHandle(intptr_t instancePtr, const char * pszActionName); -S_API struct ControllerDigitalActionData_t SteamAPI_ISteamController_GetDigitalActionData(intptr_t instancePtr, ControllerHandle_t controllerHandle, ControllerDigitalActionHandle_t digitalActionHandle); +S_API struct InputDigitalActionData_t SteamAPI_ISteamController_GetDigitalActionData(intptr_t instancePtr, ControllerHandle_t controllerHandle, ControllerDigitalActionHandle_t digitalActionHandle); S_API int SteamAPI_ISteamController_GetDigitalActionOrigins(intptr_t instancePtr, ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetHandle, ControllerDigitalActionHandle_t digitalActionHandle, EControllerActionOrigin * originsOut); S_API ControllerAnalogActionHandle_t SteamAPI_ISteamController_GetAnalogActionHandle(intptr_t instancePtr, const char * pszActionName); -S_API struct ControllerAnalogActionData_t SteamAPI_ISteamController_GetAnalogActionData(intptr_t instancePtr, ControllerHandle_t controllerHandle, ControllerAnalogActionHandle_t analogActionHandle); +S_API struct InputAnalogActionData_t SteamAPI_ISteamController_GetAnalogActionData(intptr_t instancePtr, ControllerHandle_t controllerHandle, ControllerAnalogActionHandle_t analogActionHandle); S_API int SteamAPI_ISteamController_GetAnalogActionOrigins(intptr_t instancePtr, ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetHandle, ControllerAnalogActionHandle_t analogActionHandle, EControllerActionOrigin * originsOut); +S_API const char * SteamAPI_ISteamController_GetGlyphForActionOrigin(intptr_t instancePtr, EControllerActionOrigin eOrigin); +S_API const char * SteamAPI_ISteamController_GetStringForActionOrigin(intptr_t instancePtr, EControllerActionOrigin eOrigin); S_API void SteamAPI_ISteamController_StopAnalogActionMomentum(intptr_t instancePtr, ControllerHandle_t controllerHandle, ControllerAnalogActionHandle_t eAction); +S_API struct InputMotionData_t SteamAPI_ISteamController_GetMotionData(intptr_t instancePtr, ControllerHandle_t controllerHandle); S_API void SteamAPI_ISteamController_TriggerHapticPulse(intptr_t instancePtr, ControllerHandle_t controllerHandle, ESteamControllerPad eTargetPad, unsigned short usDurationMicroSec); S_API void SteamAPI_ISteamController_TriggerRepeatedHapticPulse(intptr_t instancePtr, ControllerHandle_t controllerHandle, ESteamControllerPad eTargetPad, unsigned short usDurationMicroSec, unsigned short usOffMicroSec, unsigned short unRepeat, unsigned int nFlags); S_API void SteamAPI_ISteamController_TriggerVibration(intptr_t instancePtr, ControllerHandle_t controllerHandle, unsigned short usLeftSpeed, unsigned short usRightSpeed); S_API void SteamAPI_ISteamController_SetLEDColor(intptr_t instancePtr, ControllerHandle_t controllerHandle, uint8 nColorR, uint8 nColorG, uint8 nColorB, unsigned int nFlags); -S_API int SteamAPI_ISteamController_GetGamepadIndexForController(intptr_t instancePtr, ControllerHandle_t ulControllerHandle); -S_API ControllerHandle_t SteamAPI_ISteamController_GetControllerForGamepadIndex(intptr_t instancePtr, int nIndex); -S_API struct ControllerMotionData_t SteamAPI_ISteamController_GetMotionData(intptr_t instancePtr, ControllerHandle_t controllerHandle); -S_API bool SteamAPI_ISteamController_ShowDigitalActionOrigins(intptr_t instancePtr, ControllerHandle_t controllerHandle, ControllerDigitalActionHandle_t digitalActionHandle, float flScale, float flXPosition, float flYPosition); -S_API bool SteamAPI_ISteamController_ShowAnalogActionOrigins(intptr_t instancePtr, ControllerHandle_t controllerHandle, ControllerAnalogActionHandle_t analogActionHandle, float flScale, float flXPosition, float flYPosition); -S_API const char * SteamAPI_ISteamController_GetStringForActionOrigin(intptr_t instancePtr, EControllerActionOrigin eOrigin); -S_API const char * SteamAPI_ISteamController_GetGlyphForActionOrigin(intptr_t instancePtr, EControllerActionOrigin eOrigin); +S_API bool SteamAPI_ISteamController_ShowBindingPanel(intptr_t instancePtr, ControllerHandle_t controllerHandle); S_API ESteamInputType SteamAPI_ISteamController_GetInputTypeForHandle(intptr_t instancePtr, ControllerHandle_t controllerHandle); +S_API ControllerHandle_t SteamAPI_ISteamController_GetControllerForGamepadIndex(intptr_t instancePtr, int nIndex); +S_API int SteamAPI_ISteamController_GetGamepadIndexForController(intptr_t instancePtr, ControllerHandle_t ulControllerHandle); +S_API const char * SteamAPI_ISteamController_GetStringForXboxOrigin(intptr_t instancePtr, EXboxOrigin eOrigin); +S_API const char * SteamAPI_ISteamController_GetGlyphForXboxOrigin(intptr_t instancePtr, EXboxOrigin eOrigin); +S_API EControllerActionOrigin SteamAPI_ISteamController_GetActionOriginFromXboxOrigin(intptr_t instancePtr, ControllerHandle_t controllerHandle, EXboxOrigin eOrigin); +S_API EControllerActionOrigin SteamAPI_ISteamController_TranslateActionOrigin(intptr_t instancePtr, ESteamInputType eDestinationInputType, EControllerActionOrigin eSourceOrigin); S_API UGCQueryHandle_t SteamAPI_ISteamUGC_CreateQueryUserUGCRequest(intptr_t instancePtr, AccountID_t unAccountID, EUserUGCList eListType, EUGCMatchingUGCType eMatchingUGCType, EUserUGCListSortOrder eSortOrder, AppId_t nCreatorAppID, AppId_t nConsumerAppID, uint32 unPage); S_API UGCQueryHandle_t SteamAPI_ISteamUGC_CreateQueryAllUGCRequest(intptr_t instancePtr, EUGCQuery eQueryType, EUGCMatchingUGCType eMatchingeMatchingUGCTypeFileType, AppId_t nCreatorAppID, AppId_t nConsumerAppID, uint32 unPage); +S_API UGCQueryHandle_t SteamAPI_ISteamUGC_CreateQueryAllUGCRequest0(intptr_t instancePtr, EUGCQuery eQueryType, EUGCMatchingUGCType eMatchingeMatchingUGCTypeFileType, AppId_t nCreatorAppID, AppId_t nConsumerAppID, const char * pchCursor); S_API UGCQueryHandle_t SteamAPI_ISteamUGC_CreateQueryUGCDetailsRequest(intptr_t instancePtr, PublishedFileId_t * pvecPublishedFileID, uint32 unNumPublishedFileIDs); S_API SteamAPICall_t SteamAPI_ISteamUGC_SendQueryUGCRequest(intptr_t instancePtr, UGCQueryHandle_t handle); S_API bool SteamAPI_ISteamUGC_GetQueryUGCResult(intptr_t instancePtr, UGCQueryHandle_t handle, uint32 index, struct SteamUGCDetails_t * pDetails); @@ -665,6 +744,7 @@ S_API bool SteamAPI_ISteamUGC_SetItemVisibility(intptr_t instancePtr, UGCUpdateH S_API bool SteamAPI_ISteamUGC_SetItemTags(intptr_t instancePtr, UGCUpdateHandle_t updateHandle, const struct SteamParamStringArray_t * pTags); S_API bool SteamAPI_ISteamUGC_SetItemContent(intptr_t instancePtr, UGCUpdateHandle_t handle, const char * pszContentFolder); S_API bool SteamAPI_ISteamUGC_SetItemPreview(intptr_t instancePtr, UGCUpdateHandle_t handle, const char * pszPreviewFile); +S_API bool SteamAPI_ISteamUGC_SetAllowLegacyUpload(intptr_t instancePtr, UGCUpdateHandle_t handle, bool bAllowLegacyUpload); S_API bool SteamAPI_ISteamUGC_RemoveItemKeyValueTags(intptr_t instancePtr, UGCUpdateHandle_t handle, const char * pchKey); S_API bool SteamAPI_ISteamUGC_AddItemKeyValueTag(intptr_t instancePtr, UGCUpdateHandle_t handle, const char * pchKey, const char * pchValue); S_API bool SteamAPI_ISteamUGC_AddItemPreviewFile(intptr_t instancePtr, UGCUpdateHandle_t handle, const char * pszPreviewFile, EItemPreviewType type); @@ -720,7 +800,7 @@ S_API void SteamAPI_ISteamHTMLSurface_MouseDown(intptr_t instancePtr, HHTMLBrows S_API void SteamAPI_ISteamHTMLSurface_MouseDoubleClick(intptr_t instancePtr, HHTMLBrowser unBrowserHandle, ISteamHTMLSurface::EHTMLMouseButton eMouseButton); S_API void SteamAPI_ISteamHTMLSurface_MouseMove(intptr_t instancePtr, HHTMLBrowser unBrowserHandle, int x, int y); S_API void SteamAPI_ISteamHTMLSurface_MouseWheel(intptr_t instancePtr, HHTMLBrowser unBrowserHandle, int32 nDelta); -S_API void SteamAPI_ISteamHTMLSurface_KeyDown(intptr_t instancePtr, HHTMLBrowser unBrowserHandle, uint32 nNativeKeyCode, ISteamHTMLSurface::EHTMLKeyModifiers eHTMLKeyModifiers); +S_API void SteamAPI_ISteamHTMLSurface_KeyDown(intptr_t instancePtr, HHTMLBrowser unBrowserHandle, uint32 nNativeKeyCode, ISteamHTMLSurface::EHTMLKeyModifiers eHTMLKeyModifiers, bool bIsSystemKey); S_API void SteamAPI_ISteamHTMLSurface_KeyUp(intptr_t instancePtr, HHTMLBrowser unBrowserHandle, uint32 nNativeKeyCode, ISteamHTMLSurface::EHTMLKeyModifiers eHTMLKeyModifiers); S_API void SteamAPI_ISteamHTMLSurface_KeyChar(intptr_t instancePtr, HHTMLBrowser unBrowserHandle, uint32 cUnicodeChar, ISteamHTMLSurface::EHTMLKeyModifiers eHTMLKeyModifiers); S_API void SteamAPI_ISteamHTMLSurface_SetHorizontalScroll(intptr_t instancePtr, HHTMLBrowser unBrowserHandle, uint32 nAbsolutePixelScroll); @@ -736,6 +816,7 @@ S_API void SteamAPI_ISteamHTMLSurface_SetCookie(intptr_t instancePtr, const char S_API void SteamAPI_ISteamHTMLSurface_SetPageScaleFactor(intptr_t instancePtr, HHTMLBrowser unBrowserHandle, float flZoom, int nPointX, int nPointY); S_API void SteamAPI_ISteamHTMLSurface_SetBackgroundMode(intptr_t instancePtr, HHTMLBrowser unBrowserHandle, bool bBackgroundMode); S_API void SteamAPI_ISteamHTMLSurface_SetDPIScalingFactor(intptr_t instancePtr, HHTMLBrowser unBrowserHandle, float flDPIScaling); +S_API void SteamAPI_ISteamHTMLSurface_OpenDeveloperTools(intptr_t instancePtr, HHTMLBrowser unBrowserHandle); S_API void SteamAPI_ISteamHTMLSurface_AllowStartRequest(intptr_t instancePtr, HHTMLBrowser unBrowserHandle, bool bAllowed); S_API void SteamAPI_ISteamHTMLSurface_JSDialogResponse(intptr_t instancePtr, HHTMLBrowser unBrowserHandle, bool bResult); S_API EResult SteamAPI_ISteamInventory_GetResultStatus(intptr_t instancePtr, SteamInventoryResult_t resultHandle); @@ -766,8 +847,8 @@ S_API bool SteamAPI_ISteamInventory_GetEligiblePromoItemDefinitionIDs(intptr_t i S_API SteamAPICall_t SteamAPI_ISteamInventory_StartPurchase(intptr_t instancePtr, const SteamItemDef_t * pArrayItemDefs, const uint32 * punArrayQuantity, uint32 unArrayLength); S_API SteamAPICall_t SteamAPI_ISteamInventory_RequestPrices(intptr_t instancePtr); S_API uint32 SteamAPI_ISteamInventory_GetNumItemsWithPrices(intptr_t instancePtr); -S_API bool SteamAPI_ISteamInventory_GetItemsWithPrices(intptr_t instancePtr, SteamItemDef_t * pArrayItemDefs, uint64 * pPrices, uint32 unArrayLength); -S_API bool SteamAPI_ISteamInventory_GetItemPrice(intptr_t instancePtr, SteamItemDef_t iDefinition, uint64 * pPrice); +S_API bool SteamAPI_ISteamInventory_GetItemsWithPrices(intptr_t instancePtr, SteamItemDef_t * pArrayItemDefs, uint64 * pCurrentPrices, uint64 * pBasePrices, uint32 unArrayLength); +S_API bool SteamAPI_ISteamInventory_GetItemPrice(intptr_t instancePtr, SteamItemDef_t iDefinition, uint64 * pCurrentPrice, uint64 * pBasePrice); S_API SteamInventoryUpdateHandle_t SteamAPI_ISteamInventory_StartUpdateProperties(intptr_t instancePtr); S_API bool SteamAPI_ISteamInventory_RemoveProperty(intptr_t instancePtr, SteamInventoryUpdateHandle_t handle, SteamItemInstanceID_t nItemID, const char * pchPropertyName); S_API bool SteamAPI_ISteamInventory_SetProperty(intptr_t instancePtr, SteamInventoryUpdateHandle_t handle, SteamItemInstanceID_t nItemID, const char * pchPropertyName, const char * pchPropertyValue); diff --git a/Generator/steam_sdk/steam_api_internal.h b/Generator/steam_sdk/steam_api_internal.h index f5e5721..6c98b25 100644 --- a/Generator/steam_sdk/steam_api_internal.h +++ b/Generator/steam_sdk/steam_api_internal.h @@ -1,188 +1,40 @@ -//====== Copyright 1996-2015, Valve Corporation, All rights reserved. ======= +//====== Copyright Valve Corporation, All rights reserved. ==================== // -// Purpose: Internal private Steamworks API declarations and definitions +// Internal implementation details of the steamworks SDK. // -//============================================================================= - -#ifndef STEAM_API_INTERNAL_H -#define STEAM_API_INTERNAL_H - -S_API HSteamUser SteamAPI_GetHSteamUser(); -S_API void * S_CALLTYPE SteamInternal_ContextInit( void *pContextInitData ); -S_API void * S_CALLTYPE SteamInternal_CreateInterface( const char *ver ); - -#if !defined( STEAM_API_EXPORTS ) - -inline void S_CALLTYPE SteamInternal_OnContextInit( void* p ) -{ - ((CSteamAPIContext*)p)->Clear(); - if ( SteamAPI_GetHSteamPipe() ) - ((CSteamAPIContext*)p)->Init(); -} -inline CSteamAPIContext& SteamInternal_ModuleContext() -{ - // SteamInternal_ContextInit takes a base pointer for the equivalent of - // struct { void (*pFn)(void* pCtx); uintp counter; CSteamAPIContext ctx; } - // Do not change layout of 2 + sizeof... or add non-pointer aligned data! - // NOTE: declaring "static CSteamAPIConext" creates a large function - // which queries the initialization status of the object. We know that - // it is pointer-aligned and fully memset with zeros, so just alias a - // static buffer of the appropriate size and call it a CSteamAPIContext. - static void* s_CallbackCounterAndContext[ 2 + sizeof(CSteamAPIContext)/sizeof(void*) ] = { (void*)&SteamInternal_OnContextInit, 0 }; - return *(CSteamAPIContext*)SteamInternal_ContextInit( s_CallbackCounterAndContext ); -} - -inline ISteamClient *SteamClient() { return SteamInternal_ModuleContext().SteamClient(); } -inline ISteamUser *SteamUser() { return SteamInternal_ModuleContext().SteamUser(); } -inline ISteamFriends *SteamFriends() { return SteamInternal_ModuleContext().SteamFriends(); } -inline ISteamUtils *SteamUtils() { return SteamInternal_ModuleContext().SteamUtils(); } -inline ISteamMatchmaking *SteamMatchmaking() { return SteamInternal_ModuleContext().SteamMatchmaking(); } -inline ISteamUserStats *SteamUserStats() { return SteamInternal_ModuleContext().SteamUserStats(); } -inline ISteamApps *SteamApps() { return SteamInternal_ModuleContext().SteamApps(); } -inline ISteamMatchmakingServers *SteamMatchmakingServers() { return SteamInternal_ModuleContext().SteamMatchmakingServers(); } -inline ISteamNetworking *SteamNetworking() { return SteamInternal_ModuleContext().SteamNetworking(); } -inline ISteamRemoteStorage *SteamRemoteStorage() { return SteamInternal_ModuleContext().SteamRemoteStorage(); } -inline ISteamScreenshots *SteamScreenshots() { return SteamInternal_ModuleContext().SteamScreenshots(); } -inline ISteamHTTP *SteamHTTP() { return SteamInternal_ModuleContext().SteamHTTP(); } -inline ISteamController *SteamController() { return SteamInternal_ModuleContext().SteamController(); } -inline ISteamUGC *SteamUGC() { return SteamInternal_ModuleContext().SteamUGC(); } -inline ISteamAppList *SteamAppList() { return SteamInternal_ModuleContext().SteamAppList(); } -inline ISteamMusic *SteamMusic() { return SteamInternal_ModuleContext().SteamMusic(); } -inline ISteamMusicRemote *SteamMusicRemote() { return SteamInternal_ModuleContext().SteamMusicRemote(); } -inline ISteamHTMLSurface *SteamHTMLSurface() { return SteamInternal_ModuleContext().SteamHTMLSurface(); } -inline ISteamInventory *SteamInventory() { return SteamInternal_ModuleContext().SteamInventory(); } -inline ISteamVideo *SteamVideo() { return SteamInternal_ModuleContext().SteamVideo(); } -inline ISteamParentalSettings *SteamParentalSettings() { return SteamInternal_ModuleContext().SteamParentalSettings(); } - -#endif // !defined( STEAM_API_EXPORTS ) - - -inline void CSteamAPIContext::Clear() -{ - m_pSteamClient = NULL; - m_pSteamUser = NULL; - m_pSteamFriends = NULL; - m_pSteamUtils = NULL; - m_pSteamMatchmaking = NULL; - m_pSteamUserStats = NULL; - m_pSteamApps = NULL; - m_pSteamMatchmakingServers = NULL; - m_pSteamNetworking = NULL; - m_pSteamRemoteStorage = NULL; - m_pSteamHTTP = NULL; - m_pSteamScreenshots = NULL; - m_pSteamMusic = NULL; - m_pController = NULL; - m_pSteamUGC = NULL; - m_pSteamAppList = NULL; - m_pSteamMusic = NULL; - m_pSteamMusicRemote = NULL; - m_pSteamHTMLSurface = NULL; - m_pSteamInventory = NULL; - m_pSteamVideo = NULL; - m_pSteamParentalSettings = NULL; -} - - -// This function must be declared inline in the header so the module using steam_api.dll gets the version names they want. -inline bool CSteamAPIContext::Init() -{ - HSteamUser hSteamUser = SteamAPI_GetHSteamUser(); - HSteamPipe hSteamPipe = SteamAPI_GetHSteamPipe(); - if ( !hSteamPipe ) - return false; - - m_pSteamClient = (ISteamClient*) SteamInternal_CreateInterface( STEAMCLIENT_INTERFACE_VERSION ); - if ( !m_pSteamClient ) - return false; - - m_pSteamUser = m_pSteamClient->GetISteamUser( hSteamUser, hSteamPipe, STEAMUSER_INTERFACE_VERSION ); - if ( !m_pSteamUser ) - return false; - - m_pSteamFriends = m_pSteamClient->GetISteamFriends( hSteamUser, hSteamPipe, STEAMFRIENDS_INTERFACE_VERSION ); - if ( !m_pSteamFriends ) - return false; - - m_pSteamUtils = m_pSteamClient->GetISteamUtils( hSteamPipe, STEAMUTILS_INTERFACE_VERSION ); - if ( !m_pSteamUtils ) - return false; - - m_pSteamMatchmaking = m_pSteamClient->GetISteamMatchmaking( hSteamUser, hSteamPipe, STEAMMATCHMAKING_INTERFACE_VERSION ); - if ( !m_pSteamMatchmaking ) - return false; - - m_pSteamMatchmakingServers = m_pSteamClient->GetISteamMatchmakingServers( hSteamUser, hSteamPipe, STEAMMATCHMAKINGSERVERS_INTERFACE_VERSION ); - if ( !m_pSteamMatchmakingServers ) - return false; - - m_pSteamUserStats = m_pSteamClient->GetISteamUserStats( hSteamUser, hSteamPipe, STEAMUSERSTATS_INTERFACE_VERSION ); - if ( !m_pSteamUserStats ) - return false; - - m_pSteamApps = m_pSteamClient->GetISteamApps( hSteamUser, hSteamPipe, STEAMAPPS_INTERFACE_VERSION ); - if ( !m_pSteamApps ) - return false; - - m_pSteamNetworking = m_pSteamClient->GetISteamNetworking( hSteamUser, hSteamPipe, STEAMNETWORKING_INTERFACE_VERSION ); - if ( !m_pSteamNetworking ) - return false; - - m_pSteamRemoteStorage = m_pSteamClient->GetISteamRemoteStorage( hSteamUser, hSteamPipe, STEAMREMOTESTORAGE_INTERFACE_VERSION ); - if ( !m_pSteamRemoteStorage ) - return false; - - m_pSteamScreenshots = m_pSteamClient->GetISteamScreenshots( hSteamUser, hSteamPipe, STEAMSCREENSHOTS_INTERFACE_VERSION ); - if ( !m_pSteamScreenshots ) - return false; - - m_pSteamHTTP = m_pSteamClient->GetISteamHTTP( hSteamUser, hSteamPipe, STEAMHTTP_INTERFACE_VERSION ); - if ( !m_pSteamHTTP ) - return false; - - m_pController = m_pSteamClient->GetISteamController( hSteamUser, hSteamPipe, STEAMCONTROLLER_INTERFACE_VERSION ); - if ( !m_pController ) - return false; - - m_pSteamUGC = m_pSteamClient->GetISteamUGC( hSteamUser, hSteamPipe, STEAMUGC_INTERFACE_VERSION ); - if ( !m_pSteamUGC ) - return false; - - m_pSteamAppList = m_pSteamClient->GetISteamAppList( hSteamUser, hSteamPipe, STEAMAPPLIST_INTERFACE_VERSION ); - if ( !m_pSteamAppList ) - return false; - - m_pSteamMusic = m_pSteamClient->GetISteamMusic( hSteamUser, hSteamPipe, STEAMMUSIC_INTERFACE_VERSION ); - if ( !m_pSteamMusic ) - return false; - - m_pSteamMusicRemote = m_pSteamClient->GetISteamMusicRemote( hSteamUser, hSteamPipe, STEAMMUSICREMOTE_INTERFACE_VERSION ); - if ( !m_pSteamMusicRemote ) - return false; - - m_pSteamHTMLSurface = m_pSteamClient->GetISteamHTMLSurface( hSteamUser, hSteamPipe, STEAMHTMLSURFACE_INTERFACE_VERSION ); - if ( !m_pSteamHTMLSurface ) - return false; - - m_pSteamInventory = m_pSteamClient->GetISteamInventory( hSteamUser, hSteamPipe, STEAMINVENTORY_INTERFACE_VERSION ); - if ( !m_pSteamInventory ) - return false; - - m_pSteamVideo = m_pSteamClient->GetISteamVideo( hSteamUser, hSteamPipe, STEAMVIDEO_INTERFACE_VERSION ); - if ( !m_pSteamVideo ) - return false; - - m_pSteamParentalSettings = m_pSteamClient->GetISteamParentalSettings( hSteamUser, hSteamPipe, STEAMPARENTALSETTINGS_INTERFACE_VERSION ); - if ( !m_pSteamParentalSettings ) - return false; - - return true; -} - - -//----------------------------------------------------------------------------- -// The following macros are implementation details, not intended for public use +// You should be able to figure out how to use the SDK by reading +// steam_api_common.h, and should not need to understand anything in here. +// //----------------------------------------------------------------------------- + +#ifdef STEAM_CALLBACK_BEGIN +#error "This file should only be included from steam_api_common.h" +#endif + +#include + +// Internal functions used by the utility CCallback objects to receive callbacks +S_API void S_CALLTYPE SteamAPI_RegisterCallback( class CCallbackBase *pCallback, int iCallback ); +S_API void S_CALLTYPE SteamAPI_UnregisterCallback( class CCallbackBase *pCallback ); +// Internal functions used by the utility CCallResult objects to receive async call results +S_API void S_CALLTYPE SteamAPI_RegisterCallResult( class CCallbackBase *pCallback, SteamAPICall_t hAPICall ); +S_API void S_CALLTYPE SteamAPI_UnregisterCallResult( class CCallbackBase *pCallback, SteamAPICall_t hAPICall ); + +S_API HSteamPipe S_CALLTYPE SteamAPI_GetHSteamPipe(); +S_API HSteamUser S_CALLTYPE SteamAPI_GetHSteamUser(); +S_API HSteamPipe S_CALLTYPE SteamGameServer_GetHSteamPipe(); +S_API HSteamUser S_CALLTYPE SteamGameServer_GetHSteamUser(); +S_API void *S_CALLTYPE SteamInternal_ContextInit( void *pContextInitData ); +S_API void *S_CALLTYPE SteamInternal_CreateInterface( const char *ver ); +S_API void *S_CALLTYPE SteamInternal_FindOrCreateUserInterface( HSteamUser hSteamUser, const char *pszVersion ); +S_API void *S_CALLTYPE SteamInternal_FindOrCreateGameServerInterface( HSteamUser hSteamUser, const char *pszVersion ); + +// disable this warning; this pattern need for steam callback registration +#ifdef _MSVC_VER +#pragma warning( push ) +#pragma warning( disable: 4355 ) // 'this' : used in base member initializer list +#endif + #define _STEAM_CALLBACK_AUTO_HOOK( thisclass, func, param ) #define _STEAM_CALLBACK_HELPER( _1, _2, SELECTED, ... ) _STEAM_CALLBACK_##SELECTED #define _STEAM_CALLBACK_SELECT( X, Y ) _STEAM_CALLBACK_HELPER X Y @@ -198,18 +50,15 @@ inline bool CSteamAPIContext::Init() } m_steamcallback_ ## func ; void func( param *pParam ) #define _STEAM_CALLBACK_4( _, thisclass, func, param, var ) \ CCallback< thisclass, param > var; void func( param *pParam ) +#define _STEAM_CALLBACK_GS( _, thisclass, func, param, var ) \ + CCallback< thisclass, param, true > var; void func( param *pParam ) - -//----------------------------------------------------------------------------- -// Purpose: maps a steam async call result to a class member function -// template params: T = local class, P = parameter struct -//----------------------------------------------------------------------------- template< class T, class P > inline CCallResult::CCallResult() { m_hAPICall = k_uAPICallInvalid; - m_pObj = NULL; - m_Func = NULL; + m_pObj = nullptr; + m_Func = nullptr; m_iCallback = P::k_iCallback; } @@ -241,7 +90,6 @@ inline void CCallResult::Cancel() SteamAPI_UnregisterCallResult( this, m_hAPICall ); m_hAPICall = k_uAPICallInvalid; } - } template< class T, class P > @@ -267,15 +115,9 @@ inline void CCallResult::Run( void *pvParam, bool bIOFailure, SteamAPICall } } - -//----------------------------------------------------------------------------- -// Purpose: maps a steam callback to a class member function -// template params: T = local class, P = parameter struct, -// bGameserver = listen for gameserver callbacks instead of client callbacks -//----------------------------------------------------------------------------- template< class T, class P, bool bGameserver > inline CCallback< T, P, bGameserver >::CCallback( T *pObj, func_t func ) - : m_pObj( NULL ), m_Func( NULL ) + : m_pObj( nullptr ), m_Func( nullptr ) { if ( bGameserver ) { @@ -312,17 +154,232 @@ inline void CCallback< T, P, bGameserver >::Run( void *pvParam ) (m_pObj->*m_Func)((P *)pvParam); } +//----------------------------------------------------------------------------- +// Macros to define steam callback structures. Used internally for debugging +//----------------------------------------------------------------------------- -#if defined(USE_BREAKPAD_HANDLER) || defined(STEAM_API_EXPORTS) -// this should be called before the game initialized the steam APIs -// pchDate should be of the format "Mmm dd yyyy" (such as from the __ DATE __ macro ) -// pchTime should be of the format "hh:mm:ss" (such as from the __ TIME __ macro ) -// bFullMemoryDumps (Win32 only) -- writes out a uuid-full.dmp in the client/dumps folder -// pvContext-- can be NULL, will be the void * context passed into m_pfnPreMinidumpCallback -// PFNPreMinidumpCallback m_pfnPreMinidumpCallback -- optional callback which occurs just before a .dmp file is written during a crash. Applications can hook this to allow adding additional information into the .dmp comment stream. -S_API void S_CALLTYPE SteamAPI_UseBreakpadCrashHandler( char const *pchVersion, char const *pchDate, char const *pchTime, bool bFullMemoryDumps, void *pvContext, PFNPreMinidumpCallback m_pfnPreMinidumpCallback ); -S_API void S_CALLTYPE SteamAPI_SetBreakpadAppID( uint32 unAppID ); +#ifdef STEAM_CALLBACK_INSPECTION_ENABLED + #include "../../clientdll/steam_api_callback_inspection.h" +#else + #define STEAM_CALLBACK_BEGIN( callbackname, callbackid ) struct callbackname { enum { k_iCallback = callbackid }; + #define STEAM_CALLBACK_MEMBER( varidx, vartype, varname ) vartype varname ; + #define STEAM_CALLBACK_MEMBER_ARRAY( varidx, vartype, varname, varcount ) vartype varname [ varcount ]; + #define STEAM_CALLBACK_END(nArgs) }; #endif +// Forward declare all of the Steam interfaces. (Do we really need to do this?) +class ISteamClient; +class ISteamUser; +class ISteamGameServer; +class ISteamFriends; +class ISteamUtils; +class ISteamMatchmaking; +class ISteamContentServer; +class ISteamMatchmakingServers; +class ISteamUserStats; +class ISteamApps; +class ISteamNetworking; +class ISteamRemoteStorage; +class ISteamScreenshots; +class ISteamMusic; +class ISteamMusicRemote; +class ISteamGameServerStats; +class ISteamPS3OverlayRender; +class ISteamHTTP; +class ISteamController; +class ISteamUGC; +class ISteamAppList; +class ISteamHTMLSurface; +class ISteamInventory; +class ISteamVideo; +class ISteamParentalSettings; +class ISteamGameSearch; +class ISteamInput; +class ISteamParties; + +//----------------------------------------------------------------------------- +// Purpose: Base values for callback identifiers, each callback must +// have a unique ID. +//----------------------------------------------------------------------------- +enum { k_iSteamUserCallbacks = 100 }; +enum { k_iSteamGameServerCallbacks = 200 }; +enum { k_iSteamFriendsCallbacks = 300 }; +enum { k_iSteamBillingCallbacks = 400 }; +enum { k_iSteamMatchmakingCallbacks = 500 }; +enum { k_iSteamContentServerCallbacks = 600 }; +enum { k_iSteamUtilsCallbacks = 700 }; +enum { k_iClientFriendsCallbacks = 800 }; +enum { k_iClientUserCallbacks = 900 }; +enum { k_iSteamAppsCallbacks = 1000 }; +enum { k_iSteamUserStatsCallbacks = 1100 }; +enum { k_iSteamNetworkingCallbacks = 1200 }; +enum { k_iSteamNetworkingSocketsCallbacks = 1220 }; +enum { k_iSteamNetworkingMessagesCallbacks = 1250 }; +enum { k_iClientRemoteStorageCallbacks = 1300 }; +enum { k_iClientDepotBuilderCallbacks = 1400 }; +enum { k_iSteamGameServerItemsCallbacks = 1500 }; +enum { k_iClientUtilsCallbacks = 1600 }; +enum { k_iSteamGameCoordinatorCallbacks = 1700 }; +enum { k_iSteamGameServerStatsCallbacks = 1800 }; +enum { k_iSteam2AsyncCallbacks = 1900 }; +enum { k_iSteamGameStatsCallbacks = 2000 }; +enum { k_iClientHTTPCallbacks = 2100 }; +enum { k_iClientScreenshotsCallbacks = 2200 }; +enum { k_iSteamScreenshotsCallbacks = 2300 }; +enum { k_iClientAudioCallbacks = 2400 }; +enum { k_iClientUnifiedMessagesCallbacks = 2500 }; +enum { k_iSteamStreamLauncherCallbacks = 2600 }; +enum { k_iClientControllerCallbacks = 2700 }; +enum { k_iSteamControllerCallbacks = 2800 }; +enum { k_iClientParentalSettingsCallbacks = 2900 }; +enum { k_iClientDeviceAuthCallbacks = 3000 }; +enum { k_iClientNetworkDeviceManagerCallbacks = 3100 }; +enum { k_iClientMusicCallbacks = 3200 }; +enum { k_iClientRemoteClientManagerCallbacks = 3300 }; +enum { k_iClientUGCCallbacks = 3400 }; +enum { k_iSteamStreamClientCallbacks = 3500 }; +enum { k_IClientProductBuilderCallbacks = 3600 }; +enum { k_iClientShortcutsCallbacks = 3700 }; +enum { k_iClientRemoteControlManagerCallbacks = 3800 }; +enum { k_iSteamAppListCallbacks = 3900 }; +enum { k_iSteamMusicCallbacks = 4000 }; +enum { k_iSteamMusicRemoteCallbacks = 4100 }; +enum { k_iClientVRCallbacks = 4200 }; +enum { k_iClientGameNotificationCallbacks = 4300 }; +enum { k_iSteamGameNotificationCallbacks = 4400 }; +enum { k_iSteamHTMLSurfaceCallbacks = 4500 }; +enum { k_iClientVideoCallbacks = 4600 }; +enum { k_iClientInventoryCallbacks = 4700 }; +enum { k_iClientBluetoothManagerCallbacks = 4800 }; +enum { k_iClientSharedConnectionCallbacks = 4900 }; +enum { k_ISteamParentalSettingsCallbacks = 5000 }; +enum { k_iClientShaderCallbacks = 5100 }; +enum { k_iSteamGameSearchCallbacks = 5200 }; +enum { k_iSteamPartiesCallbacks = 5300 }; +enum { k_iClientPartiesCallbacks = 5400 }; + +// Macro used to define a type-safe accessor that will always return the version +// of the interface of the *header file* you are compiling with! We also bounce +// through a safety function that checks for interfaces being created or destroyed. +#ifndef STEAM_API_EXPORTS + // SteamInternal_ContextInit takes a base pointer for the equivalent of + // struct { void (*pFn)(void* pCtx); uintp counter; CSteamAPIContext ctx; } + // Do not change layout of 2 + sizeof... or add non-pointer aligned data! + // NOTE: declaring "static CSteamAPIConext" creates a large function + // which queries the initialization status of the object. We know that + // it is pointer-aligned and fully memset with zeros, so just alias a + // static buffer of the appropriate size and call it a CSteamAPIContext. + #define STEAM_DEFINE_INTERFACE_ACCESSOR( type, name, expr ) \ + inline void S_CALLTYPE SteamInternal_Init_ ## name( type *p ) { *p = (type)( expr ); } \ + inline type name() { \ + static void* s_CallbackCounterAndContext[ 3 ] = { (void*)&SteamInternal_Init_ ## name, 0, 0 }; \ + return *(type*)SteamInternal_ContextInit( s_CallbackCounterAndContext ); \ + } + +#else + // Stub when we're compiling steam_api.dll itself. These are inline + // functions defined when the header is included. not functions exported + // by the lib! + #define STEAM_DEFINE_INTERFACE_ACCESSOR( type, name, expr ) +#endif + +#define STEAM_DEFINE_USER_INTERFACE_ACCESSOR( type, name, version ) \ + STEAM_DEFINE_INTERFACE_ACCESSOR( type, name, SteamInternal_FindOrCreateUserInterface( SteamAPI_GetHSteamUser(), version ) ) +#define STEAM_DEFINE_GAMESERVER_INTERFACE_ACCESSOR( type, name, version ) \ + STEAM_DEFINE_INTERFACE_ACCESSOR( type, name, SteamInternal_FindOrCreateGameServerInterface( SteamGameServer_GetHSteamUser(), version ) ) + +#ifdef _MSVC_VER +#pragma warning( pop ) +#endif + +// CSteamAPIContext encapsulates the Steamworks API global accessors into +// a single object. +// +// DEPRECATED: Used the global interface accessors instead! +// +// This will be removed in a future iteration of the SDK +class CSteamAPIContext +{ +public: + CSteamAPIContext() { Clear(); } + inline void Clear() { memset( this, 0, sizeof(*this) ); } + inline bool Init(); // NOTE: This is defined in steam_api.h, to avoid this file having to include everything + ISteamClient* SteamClient() const { return m_pSteamClient; } + ISteamUser* SteamUser() const { return m_pSteamUser; } + ISteamFriends* SteamFriends() const { return m_pSteamFriends; } + ISteamUtils* SteamUtils() const { return m_pSteamUtils; } + ISteamMatchmaking* SteamMatchmaking() const { return m_pSteamMatchmaking; } + ISteamGameSearch* SteamGameSearch() const { return m_pSteamGameSearch; } + ISteamUserStats* SteamUserStats() const { return m_pSteamUserStats; } + ISteamApps* SteamApps() const { return m_pSteamApps; } + ISteamMatchmakingServers* SteamMatchmakingServers() const { return m_pSteamMatchmakingServers; } + ISteamNetworking* SteamNetworking() const { return m_pSteamNetworking; } + ISteamRemoteStorage* SteamRemoteStorage() const { return m_pSteamRemoteStorage; } + ISteamScreenshots* SteamScreenshots() const { return m_pSteamScreenshots; } + ISteamHTTP* SteamHTTP() const { return m_pSteamHTTP; } + ISteamController* SteamController() const { return m_pController; } + ISteamUGC* SteamUGC() const { return m_pSteamUGC; } + ISteamAppList* SteamAppList() const { return m_pSteamAppList; } + ISteamMusic* SteamMusic() const { return m_pSteamMusic; } + ISteamMusicRemote* SteamMusicRemote() const { return m_pSteamMusicRemote; } + ISteamHTMLSurface* SteamHTMLSurface() const { return m_pSteamHTMLSurface; } + ISteamInventory* SteamInventory() const { return m_pSteamInventory; } + ISteamVideo* SteamVideo() const { return m_pSteamVideo; } + ISteamParentalSettings* SteamParentalSettings() const { return m_pSteamParentalSettings; } + ISteamInput* SteamInput() const { return m_pSteamInput; } +private: + ISteamClient *m_pSteamClient; + ISteamUser *m_pSteamUser; + ISteamFriends *m_pSteamFriends; + ISteamUtils *m_pSteamUtils; + ISteamMatchmaking *m_pSteamMatchmaking; + ISteamGameSearch *m_pSteamGameSearch; + ISteamUserStats *m_pSteamUserStats; + ISteamApps *m_pSteamApps; + ISteamMatchmakingServers *m_pSteamMatchmakingServers; + ISteamNetworking *m_pSteamNetworking; + ISteamRemoteStorage *m_pSteamRemoteStorage; + ISteamScreenshots *m_pSteamScreenshots; + ISteamHTTP *m_pSteamHTTP; + ISteamController *m_pController; + ISteamUGC *m_pSteamUGC; + ISteamAppList *m_pSteamAppList; + ISteamMusic *m_pSteamMusic; + ISteamMusicRemote *m_pSteamMusicRemote; + ISteamHTMLSurface *m_pSteamHTMLSurface; + ISteamInventory *m_pSteamInventory; + ISteamVideo *m_pSteamVideo; + ISteamParentalSettings *m_pSteamParentalSettings; + ISteamInput *m_pSteamInput; +}; + +class CSteamGameServerAPIContext +{ +public: + CSteamGameServerAPIContext() { Clear(); } + inline void Clear() { memset( this, 0, sizeof(*this) ); } + inline bool Init(); // NOTE: This is defined in steam_gameserver.h, to avoid this file having to include everything + + ISteamClient *SteamClient() const { return m_pSteamClient; } + ISteamGameServer *SteamGameServer() const { return m_pSteamGameServer; } + ISteamUtils *SteamGameServerUtils() const { return m_pSteamGameServerUtils; } + ISteamNetworking *SteamGameServerNetworking() const { return m_pSteamGameServerNetworking; } + ISteamGameServerStats *SteamGameServerStats() const { return m_pSteamGameServerStats; } + ISteamHTTP *SteamHTTP() const { return m_pSteamHTTP; } + ISteamInventory *SteamInventory() const { return m_pSteamInventory; } + ISteamUGC *SteamUGC() const { return m_pSteamUGC; } + ISteamApps *SteamApps() const { return m_pSteamApps; } + +private: + ISteamClient *m_pSteamClient; + ISteamGameServer *m_pSteamGameServer; + ISteamUtils *m_pSteamGameServerUtils; + ISteamNetworking *m_pSteamGameServerNetworking; + ISteamGameServerStats *m_pSteamGameServerStats; + ISteamHTTP *m_pSteamHTTP; + ISteamInventory *m_pSteamInventory; + ISteamUGC *m_pSteamUGC; + ISteamApps *m_pSteamApps; +}; + -#endif // STEAM_API_INTERNAL_H diff --git a/Generator/steam_sdk/steam_api_interop.cs b/Generator/steam_sdk/steam_api_interop.cs index eb8721c..52bff12 100644 --- a/Generator/steam_sdk/steam_api_interop.cs +++ b/Generator/steam_sdk/steam_api_interop.cs @@ -55,6 +55,8 @@ public class NativeEntrypoints internal static extern IntPtr SteamAPI_ISteamClient_GetISteamRemoteStorage(IntPtr instancePtr, uint hSteamuser, uint hSteamPipe, string pchVersion); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamClient_GetISteamScreenshots")] internal static extern IntPtr SteamAPI_ISteamClient_GetISteamScreenshots(IntPtr instancePtr, uint hSteamuser, uint hSteamPipe, string pchVersion); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamClient_GetISteamGameSearch")] +internal static extern IntPtr SteamAPI_ISteamClient_GetISteamGameSearch(IntPtr instancePtr, uint hSteamuser, uint hSteamPipe, string pchVersion); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamClient_GetIPCCallCount")] internal static extern uint SteamAPI_ISteamClient_GetIPCCallCount(IntPtr instancePtr); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamClient_SetWarningMessageHook")] @@ -81,6 +83,10 @@ public class NativeEntrypoints internal static extern IntPtr SteamAPI_ISteamClient_GetISteamVideo(IntPtr instancePtr, uint hSteamuser, uint hSteamPipe, string pchVersion); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamClient_GetISteamParentalSettings")] internal static extern IntPtr SteamAPI_ISteamClient_GetISteamParentalSettings(IntPtr instancePtr, uint hSteamuser, uint hSteamPipe, string pchVersion); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamClient_GetISteamInput")] +internal static extern IntPtr SteamAPI_ISteamClient_GetISteamInput(IntPtr instancePtr, uint hSteamUser, uint hSteamPipe, string pchVersion); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamClient_GetISteamParties")] +internal static extern IntPtr SteamAPI_ISteamClient_GetISteamParties(IntPtr instancePtr, uint hSteamUser, uint hSteamPipe, string pchVersion); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUser_GetHSteamUser")] internal static extern uint SteamAPI_ISteamUser_GetHSteamUser(IntPtr instancePtr); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUser_BLoggedOn")] @@ -139,6 +145,8 @@ public class NativeEntrypoints internal static extern bool SteamAPI_ISteamUser_BIsPhoneIdentifying(IntPtr instancePtr); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUser_BIsPhoneRequiringVerification")] internal static extern bool SteamAPI_ISteamUser_BIsPhoneRequiringVerification(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUser_GetMarketEligibility")] +internal static extern ulong SteamAPI_ISteamUser_GetMarketEligibility(IntPtr instancePtr); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_GetPersonaName")] internal static extern IntPtr SteamAPI_ISteamFriends_GetPersonaName(IntPtr instancePtr); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_SetPersonaName")] @@ -200,7 +208,7 @@ public class NativeEntrypoints [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_ActivateGameOverlayToUser")] internal static extern void SteamAPI_ISteamFriends_ActivateGameOverlayToUser(IntPtr instancePtr, string pchDialog, ulong steamID); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_ActivateGameOverlayToWebPage")] -internal static extern void SteamAPI_ISteamFriends_ActivateGameOverlayToWebPage(IntPtr instancePtr, string pchURL); +internal static extern void SteamAPI_ISteamFriends_ActivateGameOverlayToWebPage(IntPtr instancePtr, string pchURL, uint eMode); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_ActivateGameOverlayToStore")] internal static extern void SteamAPI_ISteamFriends_ActivateGameOverlayToStore(IntPtr instancePtr, uint nAppID, char eFlag); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_SetPlayedWith")] @@ -283,6 +291,8 @@ public class NativeEntrypoints internal static extern bool SteamAPI_ISteamFriends_IsClanPublic(IntPtr instancePtr, ulong steamIDClan); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_IsClanOfficialGameGroup")] internal static extern bool SteamAPI_ISteamFriends_IsClanOfficialGameGroup(IntPtr instancePtr, ulong steamIDClan); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_GetNumChatsWithUnreadPriorityMessages")] +internal static extern int SteamAPI_ISteamFriends_GetNumChatsWithUnreadPriorityMessages(IntPtr instancePtr); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUtils_GetSecondsSinceAppActive")] internal static extern uint SteamAPI_ISteamUtils_GetSecondsSinceAppActive(IntPtr instancePtr); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUtils_GetSecondsSinceComputerActive")] @@ -473,6 +483,58 @@ public class NativeEntrypoints internal static extern uint SteamAPI_ISteamMatchmakingServers_ServerRules(IntPtr instancePtr, uint unIP, char usPort, IntPtr pRequestServersResponse); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMatchmakingServers_CancelServerQuery")] internal static extern void SteamAPI_ISteamMatchmakingServers_CancelServerQuery(IntPtr instancePtr, uint hServerQuery); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamGameSearch_AddGameSearchParams")] +internal static extern uint SteamAPI_ISteamGameSearch_AddGameSearchParams(IntPtr instancePtr, string pchKeyToFind, string pchValuesToFind); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamGameSearch_SearchForGameWithLobby")] +internal static extern uint SteamAPI_ISteamGameSearch_SearchForGameWithLobby(IntPtr instancePtr, ulong steamIDLobby, int nPlayerMin, int nPlayerMax); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamGameSearch_SearchForGameSolo")] +internal static extern uint SteamAPI_ISteamGameSearch_SearchForGameSolo(IntPtr instancePtr, int nPlayerMin, int nPlayerMax); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamGameSearch_AcceptGame")] +internal static extern uint SteamAPI_ISteamGameSearch_AcceptGame(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamGameSearch_DeclineGame")] +internal static extern uint SteamAPI_ISteamGameSearch_DeclineGame(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamGameSearch_RetrieveConnectionDetails")] +internal static extern uint SteamAPI_ISteamGameSearch_RetrieveConnectionDetails(IntPtr instancePtr, ulong steamIDHost, string pchConnectionDetails, int cubConnectionDetails); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamGameSearch_EndGameSearch")] +internal static extern uint SteamAPI_ISteamGameSearch_EndGameSearch(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamGameSearch_SetGameHostParams")] +internal static extern uint SteamAPI_ISteamGameSearch_SetGameHostParams(IntPtr instancePtr, string pchKey, string pchValue); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamGameSearch_SetConnectionDetails")] +internal static extern uint SteamAPI_ISteamGameSearch_SetConnectionDetails(IntPtr instancePtr, string pchConnectionDetails, int cubConnectionDetails); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamGameSearch_RequestPlayersForGame")] +internal static extern uint SteamAPI_ISteamGameSearch_RequestPlayersForGame(IntPtr instancePtr, int nPlayerMin, int nPlayerMax, int nMaxTeamSize); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamGameSearch_HostConfirmGameStart")] +internal static extern uint SteamAPI_ISteamGameSearch_HostConfirmGameStart(IntPtr instancePtr, ulong ullUniqueGameID); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamGameSearch_CancelRequestPlayersForGame")] +internal static extern uint SteamAPI_ISteamGameSearch_CancelRequestPlayersForGame(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamGameSearch_SubmitPlayerResult")] +internal static extern uint SteamAPI_ISteamGameSearch_SubmitPlayerResult(IntPtr instancePtr, ulong ullUniqueGameID, ulong steamIDPlayer, uint EPlayerResult); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamGameSearch_EndGame")] +internal static extern uint SteamAPI_ISteamGameSearch_EndGame(IntPtr instancePtr, ulong ullUniqueGameID); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamParties_GetNumActiveBeacons")] +internal static extern uint SteamAPI_ISteamParties_GetNumActiveBeacons(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamParties_GetBeaconByIndex")] +internal static extern ulong SteamAPI_ISteamParties_GetBeaconByIndex(IntPtr instancePtr, uint unIndex); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamParties_GetBeaconDetails")] +internal static extern bool SteamAPI_ISteamParties_GetBeaconDetails(IntPtr instancePtr, ulong ulBeaconID, ref CSteamID pSteamIDBeaconOwner, ref SteamPartyBeaconLocation_t pLocation, System.Text.StringBuilder pchMetadata, int cchMetadata); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamParties_JoinParty")] +internal static extern ulong SteamAPI_ISteamParties_JoinParty(IntPtr instancePtr, ulong ulBeaconID); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamParties_GetNumAvailableBeaconLocations")] +internal static extern bool SteamAPI_ISteamParties_GetNumAvailableBeaconLocations(IntPtr instancePtr, ref uint puNumLocations); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamParties_GetAvailableBeaconLocations")] +internal static extern bool SteamAPI_ISteamParties_GetAvailableBeaconLocations(IntPtr instancePtr, ref SteamPartyBeaconLocation_t pLocationList, uint uMaxNumLocations); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamParties_CreateBeacon")] +internal static extern ulong SteamAPI_ISteamParties_CreateBeacon(IntPtr instancePtr, uint unOpenSlots, ref SteamPartyBeaconLocation_t pBeaconLocation, string pchConnectString, string pchMetadata); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamParties_OnReservationCompleted")] +internal static extern void SteamAPI_ISteamParties_OnReservationCompleted(IntPtr instancePtr, ulong ulBeacon, ulong steamIDUser); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamParties_CancelReservation")] +internal static extern void SteamAPI_ISteamParties_CancelReservation(IntPtr instancePtr, ulong ulBeacon, ulong steamIDUser); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamParties_ChangeNumOpenSlots")] +internal static extern ulong SteamAPI_ISteamParties_ChangeNumOpenSlots(IntPtr instancePtr, ulong ulBeacon, uint unOpenSlots); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamParties_DestroyBeacon")] +internal static extern bool SteamAPI_ISteamParties_DestroyBeacon(IntPtr instancePtr, ulong ulBeacon); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamParties_GetBeaconLocationData")] +internal static extern bool SteamAPI_ISteamParties_GetBeaconLocationData(IntPtr instancePtr, SteamPartyBeaconLocation_t BeaconLocation, uint eData, System.Text.StringBuilder pchDataStringOut, int cchDataStringOut); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamRemoteStorage_FileWrite")] internal static extern bool SteamAPI_ISteamRemoteStorage_FileWrite(IntPtr instancePtr, string pchFile, IntPtr pvData, int cubData); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamRemoteStorage_FileRead")] @@ -721,6 +783,10 @@ public class NativeEntrypoints internal static extern void SteamAPI_ISteamApps_RequestAllProofOfPurchaseKeys(IntPtr instancePtr); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamApps_GetFileDetails")] internal static extern ulong SteamAPI_ISteamApps_GetFileDetails(IntPtr instancePtr, string pszFileName); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamApps_GetLaunchCommandLine")] +internal static extern int SteamAPI_ISteamApps_GetLaunchCommandLine(IntPtr instancePtr, string pszCommandLine, int cubCommandLine); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamApps_BIsSubscribedFromFamilySharing")] +internal static extern bool SteamAPI_ISteamApps_BIsSubscribedFromFamilySharing(IntPtr instancePtr); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamNetworking_SendP2PPacket")] internal static extern bool SteamAPI_ISteamNetworking_SendP2PPacket(IntPtr instancePtr, ulong steamIDRemote, IntPtr pubData, uint cubData, uint eP2PSendType, int nChannel); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamNetworking_IsP2PPacketAvailable")] @@ -915,6 +981,72 @@ public class NativeEntrypoints internal static extern bool SteamAPI_ISteamHTTP_SetHTTPRequestAbsoluteTimeoutMS(IntPtr instancePtr, uint hRequest, uint unMilliseconds); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamHTTP_GetHTTPRequestWasTimedOut")] internal static extern bool SteamAPI_ISteamHTTP_GetHTTPRequestWasTimedOut(IntPtr instancePtr, uint hRequest, ref bool pbWasTimedOut); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInput_Init")] +internal static extern bool SteamAPI_ISteamInput_Init(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInput_Shutdown")] +internal static extern bool SteamAPI_ISteamInput_Shutdown(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInput_RunFrame")] +internal static extern void SteamAPI_ISteamInput_RunFrame(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInput_GetConnectedControllers")] +internal static extern int SteamAPI_ISteamInput_GetConnectedControllers(IntPtr instancePtr, ref ulong handlesOut); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInput_GetActionSetHandle")] +internal static extern ulong SteamAPI_ISteamInput_GetActionSetHandle(IntPtr instancePtr, string pszActionSetName); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInput_ActivateActionSet")] +internal static extern void SteamAPI_ISteamInput_ActivateActionSet(IntPtr instancePtr, ulong inputHandle, ulong actionSetHandle); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInput_GetCurrentActionSet")] +internal static extern ulong SteamAPI_ISteamInput_GetCurrentActionSet(IntPtr instancePtr, ulong inputHandle); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInput_ActivateActionSetLayer")] +internal static extern void SteamAPI_ISteamInput_ActivateActionSetLayer(IntPtr instancePtr, ulong inputHandle, ulong actionSetLayerHandle); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInput_DeactivateActionSetLayer")] +internal static extern void SteamAPI_ISteamInput_DeactivateActionSetLayer(IntPtr instancePtr, ulong inputHandle, ulong actionSetLayerHandle); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInput_DeactivateAllActionSetLayers")] +internal static extern void SteamAPI_ISteamInput_DeactivateAllActionSetLayers(IntPtr instancePtr, ulong inputHandle); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInput_GetActiveActionSetLayers")] +internal static extern int SteamAPI_ISteamInput_GetActiveActionSetLayers(IntPtr instancePtr, ulong inputHandle, ref ulong handlesOut); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInput_GetDigitalActionHandle")] +internal static extern ulong SteamAPI_ISteamInput_GetDigitalActionHandle(IntPtr instancePtr, string pszActionName); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInput_GetDigitalActionData")] +internal static extern InputDigitalActionData_t SteamAPI_ISteamInput_GetDigitalActionData(IntPtr instancePtr, ulong inputHandle, ulong digitalActionHandle); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInput_GetDigitalActionOrigins")] +internal static extern int SteamAPI_ISteamInput_GetDigitalActionOrigins(IntPtr instancePtr, ulong inputHandle, ulong actionSetHandle, ulong digitalActionHandle, ref uint originsOut); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInput_GetAnalogActionHandle")] +internal static extern ulong SteamAPI_ISteamInput_GetAnalogActionHandle(IntPtr instancePtr, string pszActionName); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInput_GetAnalogActionData")] +internal static extern InputAnalogActionData_t SteamAPI_ISteamInput_GetAnalogActionData(IntPtr instancePtr, ulong inputHandle, ulong analogActionHandle); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInput_GetAnalogActionOrigins")] +internal static extern int SteamAPI_ISteamInput_GetAnalogActionOrigins(IntPtr instancePtr, ulong inputHandle, ulong actionSetHandle, ulong analogActionHandle, ref uint originsOut); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInput_GetGlyphForActionOrigin")] +internal static extern IntPtr SteamAPI_ISteamInput_GetGlyphForActionOrigin(IntPtr instancePtr, uint eOrigin); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInput_GetStringForActionOrigin")] +internal static extern IntPtr SteamAPI_ISteamInput_GetStringForActionOrigin(IntPtr instancePtr, uint eOrigin); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInput_StopAnalogActionMomentum")] +internal static extern void SteamAPI_ISteamInput_StopAnalogActionMomentum(IntPtr instancePtr, ulong inputHandle, ulong eAction); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInput_GetMotionData")] +internal static extern InputMotionData_t SteamAPI_ISteamInput_GetMotionData(IntPtr instancePtr, ulong inputHandle); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInput_TriggerVibration")] +internal static extern void SteamAPI_ISteamInput_TriggerVibration(IntPtr instancePtr, ulong inputHandle, char usLeftSpeed, char usRightSpeed); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInput_SetLEDColor")] +internal static extern void SteamAPI_ISteamInput_SetLEDColor(IntPtr instancePtr, ulong inputHandle, byte nColorR, byte nColorG, byte nColorB, uint nFlags); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInput_TriggerHapticPulse")] +internal static extern void SteamAPI_ISteamInput_TriggerHapticPulse(IntPtr instancePtr, ulong inputHandle, uint eTargetPad, char usDurationMicroSec); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInput_TriggerRepeatedHapticPulse")] +internal static extern void SteamAPI_ISteamInput_TriggerRepeatedHapticPulse(IntPtr instancePtr, ulong inputHandle, uint eTargetPad, char usDurationMicroSec, char usOffMicroSec, char unRepeat, uint nFlags); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInput_ShowBindingPanel")] +internal static extern bool SteamAPI_ISteamInput_ShowBindingPanel(IntPtr instancePtr, ulong inputHandle); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInput_GetInputTypeForHandle")] +internal static extern uint SteamAPI_ISteamInput_GetInputTypeForHandle(IntPtr instancePtr, ulong inputHandle); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInput_GetControllerForGamepadIndex")] +internal static extern ulong SteamAPI_ISteamInput_GetControllerForGamepadIndex(IntPtr instancePtr, int nIndex); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInput_GetGamepadIndexForController")] +internal static extern int SteamAPI_ISteamInput_GetGamepadIndexForController(IntPtr instancePtr, ulong ulinputHandle); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInput_GetStringForXboxOrigin")] +internal static extern IntPtr SteamAPI_ISteamInput_GetStringForXboxOrigin(IntPtr instancePtr, uint eOrigin); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInput_GetGlyphForXboxOrigin")] +internal static extern IntPtr SteamAPI_ISteamInput_GetGlyphForXboxOrigin(IntPtr instancePtr, uint eOrigin); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInput_GetActionOriginFromXboxOrigin")] +internal static extern uint SteamAPI_ISteamInput_GetActionOriginFromXboxOrigin(IntPtr instancePtr, ulong inputHandle, uint eOrigin); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInput_TranslateActionOrigin")] +internal static extern uint SteamAPI_ISteamInput_TranslateActionOrigin(IntPtr instancePtr, uint eDestinationInputType, uint eSourceOrigin); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_Init")] internal static extern bool SteamAPI_ISteamController_Init(IntPtr instancePtr); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_Shutdown")] @@ -923,8 +1055,6 @@ public class NativeEntrypoints internal static extern void SteamAPI_ISteamController_RunFrame(IntPtr instancePtr); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_GetConnectedControllers")] internal static extern int SteamAPI_ISteamController_GetConnectedControllers(IntPtr instancePtr, ref ulong handlesOut); -[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_ShowBindingPanel")] -internal static extern bool SteamAPI_ISteamController_ShowBindingPanel(IntPtr instancePtr, ulong controllerHandle); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_GetActionSetHandle")] internal static extern ulong SteamAPI_ISteamController_GetActionSetHandle(IntPtr instancePtr, string pszActionSetName); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_ActivateActionSet")] @@ -942,17 +1072,23 @@ public class NativeEntrypoints [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_GetDigitalActionHandle")] internal static extern ulong SteamAPI_ISteamController_GetDigitalActionHandle(IntPtr instancePtr, string pszActionName); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_GetDigitalActionData")] -internal static extern ControllerDigitalActionData_t SteamAPI_ISteamController_GetDigitalActionData(IntPtr instancePtr, ulong controllerHandle, ulong digitalActionHandle); +internal static extern InputDigitalActionData_t SteamAPI_ISteamController_GetDigitalActionData(IntPtr instancePtr, ulong controllerHandle, ulong digitalActionHandle); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_GetDigitalActionOrigins")] internal static extern int SteamAPI_ISteamController_GetDigitalActionOrigins(IntPtr instancePtr, ulong controllerHandle, ulong actionSetHandle, ulong digitalActionHandle, ref uint originsOut); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_GetAnalogActionHandle")] internal static extern ulong SteamAPI_ISteamController_GetAnalogActionHandle(IntPtr instancePtr, string pszActionName); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_GetAnalogActionData")] -internal static extern ControllerAnalogActionData_t SteamAPI_ISteamController_GetAnalogActionData(IntPtr instancePtr, ulong controllerHandle, ulong analogActionHandle); +internal static extern InputAnalogActionData_t SteamAPI_ISteamController_GetAnalogActionData(IntPtr instancePtr, ulong controllerHandle, ulong analogActionHandle); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_GetAnalogActionOrigins")] internal static extern int SteamAPI_ISteamController_GetAnalogActionOrigins(IntPtr instancePtr, ulong controllerHandle, ulong actionSetHandle, ulong analogActionHandle, ref uint originsOut); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_GetGlyphForActionOrigin")] +internal static extern IntPtr SteamAPI_ISteamController_GetGlyphForActionOrigin(IntPtr instancePtr, uint eOrigin); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_GetStringForActionOrigin")] +internal static extern IntPtr SteamAPI_ISteamController_GetStringForActionOrigin(IntPtr instancePtr, uint eOrigin); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_StopAnalogActionMomentum")] internal static extern void SteamAPI_ISteamController_StopAnalogActionMomentum(IntPtr instancePtr, ulong controllerHandle, ulong eAction); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_GetMotionData")] +internal static extern InputMotionData_t SteamAPI_ISteamController_GetMotionData(IntPtr instancePtr, ulong controllerHandle); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_TriggerHapticPulse")] internal static extern void SteamAPI_ISteamController_TriggerHapticPulse(IntPtr instancePtr, ulong controllerHandle, uint eTargetPad, char usDurationMicroSec); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_TriggerRepeatedHapticPulse")] @@ -961,26 +1097,28 @@ public class NativeEntrypoints internal static extern void SteamAPI_ISteamController_TriggerVibration(IntPtr instancePtr, ulong controllerHandle, char usLeftSpeed, char usRightSpeed); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_SetLEDColor")] internal static extern void SteamAPI_ISteamController_SetLEDColor(IntPtr instancePtr, ulong controllerHandle, byte nColorR, byte nColorG, byte nColorB, uint nFlags); -[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_GetGamepadIndexForController")] -internal static extern int SteamAPI_ISteamController_GetGamepadIndexForController(IntPtr instancePtr, ulong ulControllerHandle); -[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_GetControllerForGamepadIndex")] -internal static extern ulong SteamAPI_ISteamController_GetControllerForGamepadIndex(IntPtr instancePtr, int nIndex); -[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_GetMotionData")] -internal static extern ControllerMotionData_t SteamAPI_ISteamController_GetMotionData(IntPtr instancePtr, ulong controllerHandle); -[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_ShowDigitalActionOrigins")] -internal static extern bool SteamAPI_ISteamController_ShowDigitalActionOrigins(IntPtr instancePtr, ulong controllerHandle, ulong digitalActionHandle, float flScale, float flXPosition, float flYPosition); -[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_ShowAnalogActionOrigins")] -internal static extern bool SteamAPI_ISteamController_ShowAnalogActionOrigins(IntPtr instancePtr, ulong controllerHandle, ulong analogActionHandle, float flScale, float flXPosition, float flYPosition); -[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_GetStringForActionOrigin")] -internal static extern IntPtr SteamAPI_ISteamController_GetStringForActionOrigin(IntPtr instancePtr, uint eOrigin); -[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_GetGlyphForActionOrigin")] -internal static extern IntPtr SteamAPI_ISteamController_GetGlyphForActionOrigin(IntPtr instancePtr, uint eOrigin); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_ShowBindingPanel")] +internal static extern bool SteamAPI_ISteamController_ShowBindingPanel(IntPtr instancePtr, ulong controllerHandle); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_GetInputTypeForHandle")] internal static extern uint SteamAPI_ISteamController_GetInputTypeForHandle(IntPtr instancePtr, ulong controllerHandle); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_GetControllerForGamepadIndex")] +internal static extern ulong SteamAPI_ISteamController_GetControllerForGamepadIndex(IntPtr instancePtr, int nIndex); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_GetGamepadIndexForController")] +internal static extern int SteamAPI_ISteamController_GetGamepadIndexForController(IntPtr instancePtr, ulong ulControllerHandle); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_GetStringForXboxOrigin")] +internal static extern IntPtr SteamAPI_ISteamController_GetStringForXboxOrigin(IntPtr instancePtr, uint eOrigin); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_GetGlyphForXboxOrigin")] +internal static extern IntPtr SteamAPI_ISteamController_GetGlyphForXboxOrigin(IntPtr instancePtr, uint eOrigin); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_GetActionOriginFromXboxOrigin")] +internal static extern uint SteamAPI_ISteamController_GetActionOriginFromXboxOrigin(IntPtr instancePtr, ulong controllerHandle, uint eOrigin); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_TranslateActionOrigin")] +internal static extern uint SteamAPI_ISteamController_TranslateActionOrigin(IntPtr instancePtr, uint eDestinationInputType, uint eSourceOrigin); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUGC_CreateQueryUserUGCRequest")] internal static extern ulong SteamAPI_ISteamUGC_CreateQueryUserUGCRequest(IntPtr instancePtr, uint unAccountID, uint eListType, uint eMatchingUGCType, uint eSortOrder, uint nCreatorAppID, uint nConsumerAppID, uint unPage); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUGC_CreateQueryAllUGCRequest")] internal static extern ulong SteamAPI_ISteamUGC_CreateQueryAllUGCRequest(IntPtr instancePtr, uint eQueryType, uint eMatchingeMatchingUGCTypeFileType, uint nCreatorAppID, uint nConsumerAppID, uint unPage); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUGC_CreateQueryAllUGCRequest0")] +internal static extern ulong SteamAPI_ISteamUGC_CreateQueryAllUGCRequest0(IntPtr instancePtr, uint eQueryType, uint eMatchingeMatchingUGCTypeFileType, uint nCreatorAppID, uint nConsumerAppID, string pchCursor); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUGC_CreateQueryUGCDetailsRequest")] internal static extern ulong SteamAPI_ISteamUGC_CreateQueryUGCDetailsRequest(IntPtr instancePtr, ref ulong pvecPublishedFileID, uint unNumPublishedFileIDs); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUGC_SendQueryUGCRequest")] @@ -1061,6 +1199,8 @@ public class NativeEntrypoints internal static extern bool SteamAPI_ISteamUGC_SetItemContent(IntPtr instancePtr, ulong handle, string pszContentFolder); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUGC_SetItemPreview")] internal static extern bool SteamAPI_ISteamUGC_SetItemPreview(IntPtr instancePtr, ulong handle, string pszPreviewFile); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUGC_SetAllowLegacyUpload")] +internal static extern bool SteamAPI_ISteamUGC_SetAllowLegacyUpload(IntPtr instancePtr, ulong handle, bool bAllowLegacyUpload); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUGC_RemoveItemKeyValueTags")] internal static extern bool SteamAPI_ISteamUGC_RemoveItemKeyValueTags(IntPtr instancePtr, ulong handle, string pchKey); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUGC_AddItemKeyValueTag")] @@ -1172,7 +1312,7 @@ public class NativeEntrypoints [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamHTMLSurface_MouseWheel")] internal static extern void SteamAPI_ISteamHTMLSurface_MouseWheel(IntPtr instancePtr, uint unBrowserHandle, int nDelta); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamHTMLSurface_KeyDown")] -internal static extern void SteamAPI_ISteamHTMLSurface_KeyDown(IntPtr instancePtr, uint unBrowserHandle, uint nNativeKeyCode, uint eHTMLKeyModifiers); +internal static extern void SteamAPI_ISteamHTMLSurface_KeyDown(IntPtr instancePtr, uint unBrowserHandle, uint nNativeKeyCode, uint eHTMLKeyModifiers, bool bIsSystemKey); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamHTMLSurface_KeyUp")] internal static extern void SteamAPI_ISteamHTMLSurface_KeyUp(IntPtr instancePtr, uint unBrowserHandle, uint nNativeKeyCode, uint eHTMLKeyModifiers); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamHTMLSurface_KeyChar")] @@ -1203,6 +1343,8 @@ public class NativeEntrypoints internal static extern void SteamAPI_ISteamHTMLSurface_SetBackgroundMode(IntPtr instancePtr, uint unBrowserHandle, bool bBackgroundMode); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamHTMLSurface_SetDPIScalingFactor")] internal static extern void SteamAPI_ISteamHTMLSurface_SetDPIScalingFactor(IntPtr instancePtr, uint unBrowserHandle, float flDPIScaling); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamHTMLSurface_OpenDeveloperTools")] +internal static extern void SteamAPI_ISteamHTMLSurface_OpenDeveloperTools(IntPtr instancePtr, uint unBrowserHandle); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamHTMLSurface_AllowStartRequest")] internal static extern void SteamAPI_ISteamHTMLSurface_AllowStartRequest(IntPtr instancePtr, uint unBrowserHandle, bool bAllowed); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamHTMLSurface_JSDialogResponse")] @@ -1264,9 +1406,9 @@ public class NativeEntrypoints [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInventory_GetNumItemsWithPrices")] internal static extern uint SteamAPI_ISteamInventory_GetNumItemsWithPrices(IntPtr instancePtr); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInventory_GetItemsWithPrices")] -internal static extern bool SteamAPI_ISteamInventory_GetItemsWithPrices(IntPtr instancePtr, [In, Out] int[] pArrayItemDefs, [In, Out] ulong[] pPrices, uint unArrayLength); +internal static extern bool SteamAPI_ISteamInventory_GetItemsWithPrices(IntPtr instancePtr, [In, Out] int[] pArrayItemDefs, [In, Out] ulong[] pCurrentPrices, [In, Out] ulong[] pBasePrices, uint unArrayLength); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInventory_GetItemPrice")] -internal static extern bool SteamAPI_ISteamInventory_GetItemPrice(IntPtr instancePtr, int iDefinition, ref ulong pPrice); +internal static extern bool SteamAPI_ISteamInventory_GetItemPrice(IntPtr instancePtr, int iDefinition, ref ulong pCurrentPrice, ref ulong pBasePrice); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInventory_StartUpdateProperties")] internal static extern ulong SteamAPI_ISteamInventory_StartUpdateProperties(IntPtr instancePtr); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInventory_RemoveProperty")] @@ -1539,6 +1681,11 @@ public class NativeEntrypoints public static extern ulong CHTML_BrowserReady_t_SetCallResult(ulong hAPICall, SteamAPI_HTML_BrowserReady_t_CallResult func); [DllImportAttribute("Steam_api", EntryPoint = "CHTML_BrowserReady_t_RemoveCallResult")] public static extern ulong CHTML_BrowserReady_t_RemoveCallResult(ulong handle); +public delegate void SteamAPI_MarketEligibilityResponse_t_CallResult(MarketEligibilityResponse_t pMarketEligibilityResponse_t, bool bIOFailure); +[DllImportAttribute("Steam_api", EntryPoint = "CMarketEligibilityResponse_t_SetCallResult")] +public static extern ulong CMarketEligibilityResponse_t_SetCallResult(ulong hAPICall, SteamAPI_MarketEligibilityResponse_t_CallResult func); +[DllImportAttribute("Steam_api", EntryPoint = "CMarketEligibilityResponse_t_RemoveCallResult")] +public static extern ulong CMarketEligibilityResponse_t_RemoveCallResult(ulong handle); public delegate void SteamAPI_LeaderboardScoresDownloaded_t_CallResult(LeaderboardScoresDownloaded_t pLeaderboardScoresDownloaded_t, bool bIOFailure); [DllImportAttribute("Steam_api", EntryPoint = "CLeaderboardScoresDownloaded_t_SetCallResult")] public static extern ulong CLeaderboardScoresDownloaded_t_SetCallResult(ulong hAPICall, SteamAPI_LeaderboardScoresDownloaded_t_CallResult func); @@ -1549,11 +1696,11 @@ public class NativeEntrypoints public static extern ulong CRemoteStorageUpdateUserPublishedItemVoteResult_t_SetCallResult(ulong hAPICall, SteamAPI_RemoteStorageUpdateUserPublishedItemVoteResult_t_CallResult func); [DllImportAttribute("Steam_api", EntryPoint = "CRemoteStorageUpdateUserPublishedItemVoteResult_t_RemoveCallResult")] public static extern ulong CRemoteStorageUpdateUserPublishedItemVoteResult_t_RemoveCallResult(ulong handle); -public delegate void SteamAPI_RemoteStorageEnumerateUserSubscribedFilesResult_t_CallResult(RemoteStorageEnumerateUserSubscribedFilesResult_t pRemoteStorageEnumerateUserSubscribedFilesResult_t, bool bIOFailure); -[DllImportAttribute("Steam_api", EntryPoint = "CRemoteStorageEnumerateUserSubscribedFilesResult_t_SetCallResult")] -public static extern ulong CRemoteStorageEnumerateUserSubscribedFilesResult_t_SetCallResult(ulong hAPICall, SteamAPI_RemoteStorageEnumerateUserSubscribedFilesResult_t_CallResult func); -[DllImportAttribute("Steam_api", EntryPoint = "CRemoteStorageEnumerateUserSubscribedFilesResult_t_RemoveCallResult")] -public static extern ulong CRemoteStorageEnumerateUserSubscribedFilesResult_t_RemoveCallResult(ulong handle); +public delegate void SteamAPI_CreateBeaconCallback_t_CallResult(CreateBeaconCallback_t pCreateBeaconCallback_t, bool bIOFailure); +[DllImportAttribute("Steam_api", EntryPoint = "CCreateBeaconCallback_t_SetCallResult")] +public static extern ulong CCreateBeaconCallback_t_SetCallResult(ulong hAPICall, SteamAPI_CreateBeaconCallback_t_CallResult func); +[DllImportAttribute("Steam_api", EntryPoint = "CCreateBeaconCallback_t_RemoveCallResult")] +public static extern ulong CCreateBeaconCallback_t_RemoveCallResult(ulong handle); public delegate void SteamAPI_CreateItemResult_t_CallResult(CreateItemResult_t pCreateItemResult_t, bool bIOFailure); [DllImportAttribute("Steam_api", EntryPoint = "CCreateItemResult_t_SetCallResult")] public static extern ulong CCreateItemResult_t_SetCallResult(ulong hAPICall, SteamAPI_CreateItemResult_t_CallResult func); @@ -1584,11 +1731,16 @@ public class NativeEntrypoints public static extern ulong CLeaderboardScoreUploaded_t_SetCallResult(ulong hAPICall, SteamAPI_LeaderboardScoreUploaded_t_CallResult func); [DllImportAttribute("Steam_api", EntryPoint = "CLeaderboardScoreUploaded_t_RemoveCallResult")] public static extern ulong CLeaderboardScoreUploaded_t_RemoveCallResult(ulong handle); -public delegate void SteamAPI_GlobalAchievementPercentagesReady_t_CallResult(GlobalAchievementPercentagesReady_t pGlobalAchievementPercentagesReady_t, bool bIOFailure); -[DllImportAttribute("Steam_api", EntryPoint = "CGlobalAchievementPercentagesReady_t_SetCallResult")] -public static extern ulong CGlobalAchievementPercentagesReady_t_SetCallResult(ulong hAPICall, SteamAPI_GlobalAchievementPercentagesReady_t_CallResult func); -[DllImportAttribute("Steam_api", EntryPoint = "CGlobalAchievementPercentagesReady_t_RemoveCallResult")] -public static extern ulong CGlobalAchievementPercentagesReady_t_RemoveCallResult(ulong handle); +public delegate void SteamAPI_JoinPartyCallback_t_CallResult(JoinPartyCallback_t pJoinPartyCallback_t, bool bIOFailure); +[DllImportAttribute("Steam_api", EntryPoint = "CJoinPartyCallback_t_SetCallResult")] +public static extern ulong CJoinPartyCallback_t_SetCallResult(ulong hAPICall, SteamAPI_JoinPartyCallback_t_CallResult func); +[DllImportAttribute("Steam_api", EntryPoint = "CJoinPartyCallback_t_RemoveCallResult")] +public static extern ulong CJoinPartyCallback_t_RemoveCallResult(ulong handle); +public delegate void SteamAPI_RemoteStorageEnumerateUserSubscribedFilesResult_t_CallResult(RemoteStorageEnumerateUserSubscribedFilesResult_t pRemoteStorageEnumerateUserSubscribedFilesResult_t, bool bIOFailure); +[DllImportAttribute("Steam_api", EntryPoint = "CRemoteStorageEnumerateUserSubscribedFilesResult_t_SetCallResult")] +public static extern ulong CRemoteStorageEnumerateUserSubscribedFilesResult_t_SetCallResult(ulong hAPICall, SteamAPI_RemoteStorageEnumerateUserSubscribedFilesResult_t_CallResult func); +[DllImportAttribute("Steam_api", EntryPoint = "CRemoteStorageEnumerateUserSubscribedFilesResult_t_RemoveCallResult")] +public static extern ulong CRemoteStorageEnumerateUserSubscribedFilesResult_t_RemoveCallResult(ulong handle); public delegate void SteamAPI_GlobalStatsReceived_t_CallResult(GlobalStatsReceived_t pGlobalStatsReceived_t, bool bIOFailure); [DllImportAttribute("Steam_api", EntryPoint = "CGlobalStatsReceived_t_SetCallResult")] public static extern ulong CGlobalStatsReceived_t_SetCallResult(ulong hAPICall, SteamAPI_GlobalStatsReceived_t_CallResult func); @@ -1624,6 +1776,11 @@ public class NativeEntrypoints public static extern ulong CGSReputation_t_SetCallResult(ulong hAPICall, SteamAPI_GSReputation_t_CallResult func); [DllImportAttribute("Steam_api", EntryPoint = "CGSReputation_t_RemoveCallResult")] public static extern ulong CGSReputation_t_RemoveCallResult(ulong handle); +public delegate void SteamAPI_GlobalAchievementPercentagesReady_t_CallResult(GlobalAchievementPercentagesReady_t pGlobalAchievementPercentagesReady_t, bool bIOFailure); +[DllImportAttribute("Steam_api", EntryPoint = "CGlobalAchievementPercentagesReady_t_SetCallResult")] +public static extern ulong CGlobalAchievementPercentagesReady_t_SetCallResult(ulong hAPICall, SteamAPI_GlobalAchievementPercentagesReady_t_CallResult func); +[DllImportAttribute("Steam_api", EntryPoint = "CGlobalAchievementPercentagesReady_t_RemoveCallResult")] +public static extern ulong CGlobalAchievementPercentagesReady_t_RemoveCallResult(ulong handle); public delegate void SteamAPI_UserFavoriteItemsListChanged_t_CallResult(UserFavoriteItemsListChanged_t pUserFavoriteItemsListChanged_t, bool bIOFailure); [DllImportAttribute("Steam_api", EntryPoint = "CUserFavoriteItemsListChanged_t_SetCallResult")] public static extern ulong CUserFavoriteItemsListChanged_t_SetCallResult(ulong hAPICall, SteamAPI_UserFavoriteItemsListChanged_t_CallResult func); @@ -1659,6 +1816,11 @@ public class NativeEntrypoints public static extern ulong CFriendsEnumerateFollowingList_t_SetCallResult(ulong hAPICall, SteamAPI_FriendsEnumerateFollowingList_t_CallResult func); [DllImportAttribute("Steam_api", EntryPoint = "CFriendsEnumerateFollowingList_t_RemoveCallResult")] public static extern ulong CFriendsEnumerateFollowingList_t_RemoveCallResult(ulong handle); +public delegate void SteamAPI_ChangeNumOpenSlotsCallback_t_CallResult(ChangeNumOpenSlotsCallback_t pChangeNumOpenSlotsCallback_t, bool bIOFailure); +[DllImportAttribute("Steam_api", EntryPoint = "CChangeNumOpenSlotsCallback_t_SetCallResult")] +public static extern ulong CChangeNumOpenSlotsCallback_t_SetCallResult(ulong hAPICall, SteamAPI_ChangeNumOpenSlotsCallback_t_CallResult func); +[DllImportAttribute("Steam_api", EntryPoint = "CChangeNumOpenSlotsCallback_t_RemoveCallResult")] +public static extern ulong CChangeNumOpenSlotsCallback_t_RemoveCallResult(ulong handle); public delegate void SteamAPI_RemoteStorageSubscribePublishedFileResult_t_CallResult(RemoteStorageSubscribePublishedFileResult_t pRemoteStorageSubscribePublishedFileResult_t, bool bIOFailure); [DllImportAttribute("Steam_api", EntryPoint = "CRemoteStorageSubscribePublishedFileResult_t_SetCallResult")] public static extern ulong CRemoteStorageSubscribePublishedFileResult_t_SetCallResult(ulong hAPICall, SteamAPI_RemoteStorageSubscribePublishedFileResult_t_CallResult func); @@ -1754,6 +1916,7 @@ public abstract class ISteamClient public abstract ISteamNetworking GetISteamNetworking(uint hSteamUser,uint hSteamPipe,string pchVersion); public abstract ISteamRemoteStorage GetISteamRemoteStorage(uint hSteamuser,uint hSteamPipe,string pchVersion); public abstract ISteamScreenshots GetISteamScreenshots(uint hSteamuser,uint hSteamPipe,string pchVersion); + public abstract ISteamGameSearch GetISteamGameSearch(uint hSteamuser,uint hSteamPipe,string pchVersion); public abstract uint GetIPCCallCount(); public abstract void SetWarningMessageHook(IntPtr pFunction); public abstract bool BShutdownIfAllPipesClosed(); @@ -1767,6 +1930,8 @@ public abstract class ISteamClient public abstract ISteamInventory GetISteamInventory(uint hSteamuser,uint hSteamPipe,string pchVersion); public abstract ISteamVideo GetISteamVideo(uint hSteamuser,uint hSteamPipe,string pchVersion); public abstract ISteamParentalSettings GetISteamParentalSettings(uint hSteamuser,uint hSteamPipe,string pchVersion); + public abstract ISteamInput GetISteamInput(uint hSteamUser,uint hSteamPipe,string pchVersion); + public abstract ISteamParties GetISteamParties(uint hSteamUser,uint hSteamPipe,string pchVersion); } @@ -1802,6 +1967,7 @@ public abstract class ISteamUser public abstract bool BIsTwoFactorEnabled(); public abstract bool BIsPhoneIdentifying(); public abstract bool BIsPhoneRequiringVerification(); + public abstract ulong GetMarketEligibility(); } @@ -1838,7 +2004,7 @@ public abstract class ISteamFriends public abstract void SetInGameVoiceSpeaking(ulong steamIDUser,bool bSpeaking); public abstract void ActivateGameOverlay(string pchDialog); public abstract void ActivateGameOverlayToUser(string pchDialog,ulong steamID); - public abstract void ActivateGameOverlayToWebPage(string pchURL); + public abstract void ActivateGameOverlayToWebPage(string pchURL,uint eMode); public abstract void ActivateGameOverlayToStore(uint nAppID,char eFlag); public abstract void SetPlayedWith(ulong steamIDUserPlayedWith); public abstract void ActivateGameOverlayInviteDialog(ulong steamIDLobby); @@ -1880,6 +2046,7 @@ public abstract class ISteamFriends public abstract ulong EnumerateFollowingList(uint unStartIndex); public abstract bool IsClanPublic(ulong steamIDClan); public abstract bool IsClanOfficialGameGroup(ulong steamIDClan); + public abstract int GetNumChatsWithUnreadPriorityMessages(); } @@ -2020,6 +2187,44 @@ public abstract class ISteamMatchmakingServers } + public abstract class ISteamGameSearch + { + public abstract IntPtr GetIntPtr(); + public abstract uint AddGameSearchParams(string pchKeyToFind,string pchValuesToFind); + public abstract uint SearchForGameWithLobby(ulong steamIDLobby,int nPlayerMin,int nPlayerMax); + public abstract uint SearchForGameSolo(int nPlayerMin,int nPlayerMax); + public abstract uint AcceptGame(); + public abstract uint DeclineGame(); + public abstract uint RetrieveConnectionDetails(ulong steamIDHost,string pchConnectionDetails,int cubConnectionDetails); + public abstract uint EndGameSearch(); + public abstract uint SetGameHostParams(string pchKey,string pchValue); + public abstract uint SetConnectionDetails(string pchConnectionDetails,int cubConnectionDetails); + public abstract uint RequestPlayersForGame(int nPlayerMin,int nPlayerMax,int nMaxTeamSize); + public abstract uint HostConfirmGameStart(ulong ullUniqueGameID); + public abstract uint CancelRequestPlayersForGame(); + public abstract uint SubmitPlayerResult(ulong ullUniqueGameID,ulong steamIDPlayer,uint EPlayerResult); + public abstract uint EndGame(ulong ullUniqueGameID); + } + + + public abstract class ISteamParties + { + public abstract IntPtr GetIntPtr(); + public abstract uint GetNumActiveBeacons(); + public abstract ulong GetBeaconByIndex(uint unIndex); + public abstract bool GetBeaconDetails(ulong ulBeaconID,ref CSteamID pSteamIDBeaconOwner,out SteamPartyBeaconLocation_t pLocation,out string pchMetadata); + public abstract ulong JoinParty(ulong ulBeaconID); + public abstract bool GetNumAvailableBeaconLocations(ref uint puNumLocations); + public abstract bool GetAvailableBeaconLocations(ref SteamPartyBeaconLocation_t pLocationList,uint uMaxNumLocations); + public abstract ulong CreateBeacon(uint unOpenSlots,ref SteamPartyBeaconLocation_t pBeaconLocation,string pchConnectString,string pchMetadata); + public abstract void OnReservationCompleted(ulong ulBeacon,ulong steamIDUser); + public abstract void CancelReservation(ulong ulBeacon,ulong steamIDUser); + public abstract ulong ChangeNumOpenSlots(ulong ulBeacon,uint unOpenSlots); + public abstract bool DestroyBeacon(ulong ulBeacon); + public abstract bool GetBeaconLocationData(SteamPartyBeaconLocation_t BeaconLocation,uint eData,out string pchDataStringOut); + } + + public abstract class ISteamRemoteStorage { public abstract IntPtr GetIntPtr(); @@ -2159,6 +2364,8 @@ public abstract class ISteamApps public abstract int GetAppBuildId(); public abstract void RequestAllProofOfPurchaseKeys(); public abstract ulong GetFileDetails(string pszFileName); + public abstract int GetLaunchCommandLine(string pszCommandLine,int cubCommandLine); + public abstract bool BIsSubscribedFromFamilySharing(); } @@ -2289,6 +2496,45 @@ public abstract class ISteamHTTP } + public abstract class ISteamInput + { + public abstract IntPtr GetIntPtr(); + public abstract bool Init(); + public abstract bool Shutdown(); + public abstract void RunFrame(); + public abstract int GetConnectedControllers(ref ulong handlesOut); + public abstract ulong GetActionSetHandle(string pszActionSetName); + public abstract void ActivateActionSet(ulong inputHandle,ulong actionSetHandle); + public abstract ulong GetCurrentActionSet(ulong inputHandle); + public abstract void ActivateActionSetLayer(ulong inputHandle,ulong actionSetLayerHandle); + public abstract void DeactivateActionSetLayer(ulong inputHandle,ulong actionSetLayerHandle); + public abstract void DeactivateAllActionSetLayers(ulong inputHandle); + public abstract int GetActiveActionSetLayers(ulong inputHandle,ref ulong handlesOut); + public abstract ulong GetDigitalActionHandle(string pszActionName); + public abstract InputDigitalActionData_t GetDigitalActionData(ulong inputHandle,ulong digitalActionHandle); + public abstract int GetDigitalActionOrigins(ulong inputHandle,ulong actionSetHandle,ulong digitalActionHandle,ref uint originsOut); + public abstract ulong GetAnalogActionHandle(string pszActionName); + public abstract InputAnalogActionData_t GetAnalogActionData(ulong inputHandle,ulong analogActionHandle); + public abstract int GetAnalogActionOrigins(ulong inputHandle,ulong actionSetHandle,ulong analogActionHandle,ref uint originsOut); + public abstract string GetGlyphForActionOrigin(uint eOrigin); + public abstract string GetStringForActionOrigin(uint eOrigin); + public abstract void StopAnalogActionMomentum(ulong inputHandle,ulong eAction); + public abstract InputMotionData_t GetMotionData(ulong inputHandle); + public abstract void TriggerVibration(ulong inputHandle,char usLeftSpeed,char usRightSpeed); + public abstract void SetLEDColor(ulong inputHandle,byte nColorR,byte nColorG,byte nColorB,uint nFlags); + public abstract void TriggerHapticPulse(ulong inputHandle,uint eTargetPad,char usDurationMicroSec); + public abstract void TriggerRepeatedHapticPulse(ulong inputHandle,uint eTargetPad,char usDurationMicroSec,char usOffMicroSec,char unRepeat,uint nFlags); + public abstract bool ShowBindingPanel(ulong inputHandle); + public abstract uint GetInputTypeForHandle(ulong inputHandle); + public abstract ulong GetControllerForGamepadIndex(int nIndex); + public abstract int GetGamepadIndexForController(ulong ulinputHandle); + public abstract string GetStringForXboxOrigin(uint eOrigin); + public abstract string GetGlyphForXboxOrigin(uint eOrigin); + public abstract uint GetActionOriginFromXboxOrigin(ulong inputHandle,uint eOrigin); + public abstract uint TranslateActionOrigin(uint eDestinationInputType,uint eSourceOrigin); + } + + public abstract class ISteamController { public abstract IntPtr GetIntPtr(); @@ -2296,7 +2542,6 @@ public abstract class ISteamController public abstract bool Shutdown(); public abstract void RunFrame(); public abstract int GetConnectedControllers(ref ulong handlesOut); - public abstract bool ShowBindingPanel(ulong controllerHandle); public abstract ulong GetActionSetHandle(string pszActionSetName); public abstract void ActivateActionSet(ulong controllerHandle,ulong actionSetHandle); public abstract ulong GetCurrentActionSet(ulong controllerHandle); @@ -2305,24 +2550,27 @@ public abstract class ISteamController public abstract void DeactivateAllActionSetLayers(ulong controllerHandle); public abstract int GetActiveActionSetLayers(ulong controllerHandle,ref ulong handlesOut); public abstract ulong GetDigitalActionHandle(string pszActionName); - public abstract ControllerDigitalActionData_t GetDigitalActionData(ulong controllerHandle,ulong digitalActionHandle); + public abstract InputDigitalActionData_t GetDigitalActionData(ulong controllerHandle,ulong digitalActionHandle); public abstract int GetDigitalActionOrigins(ulong controllerHandle,ulong actionSetHandle,ulong digitalActionHandle,ref uint originsOut); public abstract ulong GetAnalogActionHandle(string pszActionName); - public abstract ControllerAnalogActionData_t GetAnalogActionData(ulong controllerHandle,ulong analogActionHandle); + public abstract InputAnalogActionData_t GetAnalogActionData(ulong controllerHandle,ulong analogActionHandle); public abstract int GetAnalogActionOrigins(ulong controllerHandle,ulong actionSetHandle,ulong analogActionHandle,ref uint originsOut); + public abstract string GetGlyphForActionOrigin(uint eOrigin); + public abstract string GetStringForActionOrigin(uint eOrigin); public abstract void StopAnalogActionMomentum(ulong controllerHandle,ulong eAction); + public abstract InputMotionData_t GetMotionData(ulong controllerHandle); public abstract void TriggerHapticPulse(ulong controllerHandle,uint eTargetPad,char usDurationMicroSec); public abstract void TriggerRepeatedHapticPulse(ulong controllerHandle,uint eTargetPad,char usDurationMicroSec,char usOffMicroSec,char unRepeat,uint nFlags); public abstract void TriggerVibration(ulong controllerHandle,char usLeftSpeed,char usRightSpeed); public abstract void SetLEDColor(ulong controllerHandle,byte nColorR,byte nColorG,byte nColorB,uint nFlags); - public abstract int GetGamepadIndexForController(ulong ulControllerHandle); - public abstract ulong GetControllerForGamepadIndex(int nIndex); - public abstract ControllerMotionData_t GetMotionData(ulong controllerHandle); - public abstract bool ShowDigitalActionOrigins(ulong controllerHandle,ulong digitalActionHandle,float flScale,float flXPosition,float flYPosition); - public abstract bool ShowAnalogActionOrigins(ulong controllerHandle,ulong analogActionHandle,float flScale,float flXPosition,float flYPosition); - public abstract string GetStringForActionOrigin(uint eOrigin); - public abstract string GetGlyphForActionOrigin(uint eOrigin); + public abstract bool ShowBindingPanel(ulong controllerHandle); public abstract uint GetInputTypeForHandle(ulong controllerHandle); + public abstract ulong GetControllerForGamepadIndex(int nIndex); + public abstract int GetGamepadIndexForController(ulong ulControllerHandle); + public abstract string GetStringForXboxOrigin(uint eOrigin); + public abstract string GetGlyphForXboxOrigin(uint eOrigin); + public abstract uint GetActionOriginFromXboxOrigin(ulong controllerHandle,uint eOrigin); + public abstract uint TranslateActionOrigin(uint eDestinationInputType,uint eSourceOrigin); } @@ -2331,6 +2579,7 @@ public abstract class ISteamUGC public abstract IntPtr GetIntPtr(); public abstract ulong CreateQueryUserUGCRequest(uint unAccountID,uint eListType,uint eMatchingUGCType,uint eSortOrder,uint nCreatorAppID,uint nConsumerAppID,uint unPage); public abstract ulong CreateQueryAllUGCRequest(uint eQueryType,uint eMatchingeMatchingUGCTypeFileType,uint nCreatorAppID,uint nConsumerAppID,uint unPage); + public abstract ulong CreateQueryAllUGCRequest0(uint eQueryType,uint eMatchingeMatchingUGCTypeFileType,uint nCreatorAppID,uint nConsumerAppID,string pchCursor); public abstract ulong CreateQueryUGCDetailsRequest(ref ulong pvecPublishedFileID,uint unNumPublishedFileIDs); public abstract ulong SendQueryUGCRequest(ulong handle); public abstract bool GetQueryUGCResult(ulong handle,uint index,ref SteamUGCDetails_t pDetails); @@ -2371,6 +2620,7 @@ public abstract class ISteamUGC public abstract bool SetItemTags(ulong updateHandle,ref SteamParamStringArray_t pTags); public abstract bool SetItemContent(ulong handle,string pszContentFolder); public abstract bool SetItemPreview(ulong handle,string pszPreviewFile); + public abstract bool SetAllowLegacyUpload(ulong handle,bool bAllowLegacyUpload); public abstract bool RemoveItemKeyValueTags(ulong handle,string pchKey); public abstract bool AddItemKeyValueTag(ulong handle,string pchKey,string pchValue); public abstract bool AddItemPreviewFile(ulong handle,string pszPreviewFile,uint type); @@ -2438,7 +2688,7 @@ public abstract class ISteamHTMLSurface public abstract void MouseDoubleClick(uint unBrowserHandle,uint eMouseButton); public abstract void MouseMove(uint unBrowserHandle,int x,int y); public abstract void MouseWheel(uint unBrowserHandle,int nDelta); - public abstract void KeyDown(uint unBrowserHandle,uint nNativeKeyCode,uint eHTMLKeyModifiers); + public abstract void KeyDown(uint unBrowserHandle,uint nNativeKeyCode,uint eHTMLKeyModifiers,bool bIsSystemKey); public abstract void KeyUp(uint unBrowserHandle,uint nNativeKeyCode,uint eHTMLKeyModifiers); public abstract void KeyChar(uint unBrowserHandle,uint cUnicodeChar,uint eHTMLKeyModifiers); public abstract void SetHorizontalScroll(uint unBrowserHandle,uint nAbsolutePixelScroll); @@ -2454,6 +2704,7 @@ public abstract class ISteamHTMLSurface public abstract void SetPageScaleFactor(uint unBrowserHandle,float flZoom,int nPointX,int nPointY); public abstract void SetBackgroundMode(uint unBrowserHandle,bool bBackgroundMode); public abstract void SetDPIScalingFactor(uint unBrowserHandle,float flDPIScaling); + public abstract void OpenDeveloperTools(uint unBrowserHandle); public abstract void AllowStartRequest(uint unBrowserHandle,bool bAllowed); public abstract void JSDialogResponse(uint unBrowserHandle,bool bResult); } @@ -2490,8 +2741,8 @@ public abstract class ISteamInventory public abstract ulong StartPurchase(int [] pArrayItemDefs,uint [] punArrayQuantity); public abstract ulong RequestPrices(); public abstract uint GetNumItemsWithPrices(); - public abstract bool GetItemsWithPrices(out int [] pArrayItemDefs,out ulong [] pPrices,uint unArrayLength); - public abstract bool GetItemPrice(int iDefinition,ref ulong pPrice); + public abstract bool GetItemsWithPrices(out int [] pArrayItemDefs,out ulong [] pCurrentPrices,out ulong [] pBasePrices,uint unArrayLength); + public abstract bool GetItemPrice(int iDefinition,ref ulong pCurrentPrice,ref ulong pBasePrice); public abstract ulong StartUpdateProperties(); public abstract bool RemoveProperty(ulong handle,ulong nItemID,string pchPropertyName); public abstract bool SetProperty(ulong handle,ulong nItemID,string pchPropertyName,string pchPropertyValue); @@ -2720,6 +2971,12 @@ public override ISteamScreenshots GetISteamScreenshots(uint hSteamuser,uint hSte IntPtr result = NativeEntrypoints.SteamAPI_ISteamClient_GetISteamScreenshots(m_pSteamClient,hSteamuser,hSteamPipe,pchVersion); return (ISteamScreenshots) Marshal.PtrToStructure(result, typeof(ISteamScreenshots)); } +public override ISteamGameSearch GetISteamGameSearch(uint hSteamuser,uint hSteamPipe,string pchVersion) +{ + CheckIfUsable(); + IntPtr result = NativeEntrypoints.SteamAPI_ISteamClient_GetISteamGameSearch(m_pSteamClient,hSteamuser,hSteamPipe,pchVersion); + return (ISteamGameSearch) Marshal.PtrToStructure(result, typeof(ISteamGameSearch)); +} public override uint GetIPCCallCount() { CheckIfUsable(); @@ -2797,6 +3054,18 @@ public override ISteamParentalSettings GetISteamParentalSettings(uint hSteamuser IntPtr result = NativeEntrypoints.SteamAPI_ISteamClient_GetISteamParentalSettings(m_pSteamClient,hSteamuser,hSteamPipe,pchVersion); return (ISteamParentalSettings) Marshal.PtrToStructure(result, typeof(ISteamParentalSettings)); } +public override ISteamInput GetISteamInput(uint hSteamUser,uint hSteamPipe,string pchVersion) +{ + CheckIfUsable(); + IntPtr result = NativeEntrypoints.SteamAPI_ISteamClient_GetISteamInput(m_pSteamClient,hSteamUser,hSteamPipe,pchVersion); + return (ISteamInput) Marshal.PtrToStructure(result, typeof(ISteamInput)); +} +public override ISteamParties GetISteamParties(uint hSteamUser,uint hSteamPipe,string pchVersion) +{ + CheckIfUsable(); + IntPtr result = NativeEntrypoints.SteamAPI_ISteamClient_GetISteamParties(m_pSteamClient,hSteamUser,hSteamPipe,pchVersion); + return (ISteamParties) Marshal.PtrToStructure(result, typeof(ISteamParties)); +} } @@ -2991,6 +3260,12 @@ public override bool BIsPhoneRequiringVerification() bool result = NativeEntrypoints.SteamAPI_ISteamUser_BIsPhoneRequiringVerification(m_pSteamUser); return result; } +public override ulong GetMarketEligibility() +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamUser_GetMarketEligibility(m_pSteamUser); + return result; +} } @@ -3193,10 +3468,10 @@ public override void ActivateGameOverlayToUser(string pchDialog,ulong steamID) CheckIfUsable(); NativeEntrypoints.SteamAPI_ISteamFriends_ActivateGameOverlayToUser(m_pSteamFriends,pchDialog,steamID); } -public override void ActivateGameOverlayToWebPage(string pchURL) +public override void ActivateGameOverlayToWebPage(string pchURL,uint eMode) { CheckIfUsable(); - NativeEntrypoints.SteamAPI_ISteamFriends_ActivateGameOverlayToWebPage(m_pSteamFriends,pchURL); + NativeEntrypoints.SteamAPI_ISteamFriends_ActivateGameOverlayToWebPage(m_pSteamFriends,pchURL,eMode); } public override void ActivateGameOverlayToStore(uint nAppID,char eFlag) { @@ -3442,6 +3717,12 @@ public override bool IsClanOfficialGameGroup(ulong steamIDClan) bool result = NativeEntrypoints.SteamAPI_ISteamFriends_IsClanOfficialGameGroup(m_pSteamFriends,steamIDClan); return result; } +public override int GetNumChatsWithUnreadPriorityMessages() +{ + CheckIfUsable(); + int result = NativeEntrypoints.SteamAPI_ISteamFriends_GetNumChatsWithUnreadPriorityMessages(m_pSteamFriends); + return result; +} } @@ -4141,6 +4422,210 @@ public override void CancelServerQuery(uint hServerQuery) } +public class CSteamGameSearch : ISteamGameSearch +{ +public CSteamGameSearch(IntPtr SteamGameSearch) +{ + m_pSteamGameSearch = SteamGameSearch; +} +IntPtr m_pSteamGameSearch; + +public override IntPtr GetIntPtr() { return m_pSteamGameSearch; } + +private void CheckIfUsable() +{ + if (m_pSteamGameSearch == IntPtr.Zero) + { + throw new Exception("Steam Pointer not configured"); + } +} +public override uint AddGameSearchParams(string pchKeyToFind,string pchValuesToFind) +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamGameSearch_AddGameSearchParams(m_pSteamGameSearch,pchKeyToFind,pchValuesToFind); + return result; +} +public override uint SearchForGameWithLobby(ulong steamIDLobby,int nPlayerMin,int nPlayerMax) +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamGameSearch_SearchForGameWithLobby(m_pSteamGameSearch,steamIDLobby,nPlayerMin,nPlayerMax); + return result; +} +public override uint SearchForGameSolo(int nPlayerMin,int nPlayerMax) +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamGameSearch_SearchForGameSolo(m_pSteamGameSearch,nPlayerMin,nPlayerMax); + return result; +} +public override uint AcceptGame() +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamGameSearch_AcceptGame(m_pSteamGameSearch); + return result; +} +public override uint DeclineGame() +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamGameSearch_DeclineGame(m_pSteamGameSearch); + return result; +} +public override uint RetrieveConnectionDetails(ulong steamIDHost,string pchConnectionDetails,int cubConnectionDetails) +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamGameSearch_RetrieveConnectionDetails(m_pSteamGameSearch,steamIDHost,pchConnectionDetails,cubConnectionDetails); + return result; +} +public override uint EndGameSearch() +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamGameSearch_EndGameSearch(m_pSteamGameSearch); + return result; +} +public override uint SetGameHostParams(string pchKey,string pchValue) +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamGameSearch_SetGameHostParams(m_pSteamGameSearch,pchKey,pchValue); + return result; +} +public override uint SetConnectionDetails(string pchConnectionDetails,int cubConnectionDetails) +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamGameSearch_SetConnectionDetails(m_pSteamGameSearch,pchConnectionDetails,cubConnectionDetails); + return result; +} +public override uint RequestPlayersForGame(int nPlayerMin,int nPlayerMax,int nMaxTeamSize) +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamGameSearch_RequestPlayersForGame(m_pSteamGameSearch,nPlayerMin,nPlayerMax,nMaxTeamSize); + return result; +} +public override uint HostConfirmGameStart(ulong ullUniqueGameID) +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamGameSearch_HostConfirmGameStart(m_pSteamGameSearch,ullUniqueGameID); + return result; +} +public override uint CancelRequestPlayersForGame() +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamGameSearch_CancelRequestPlayersForGame(m_pSteamGameSearch); + return result; +} +public override uint SubmitPlayerResult(ulong ullUniqueGameID,ulong steamIDPlayer,uint EPlayerResult) +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamGameSearch_SubmitPlayerResult(m_pSteamGameSearch,ullUniqueGameID,steamIDPlayer,EPlayerResult); + return result; +} +public override uint EndGame(ulong ullUniqueGameID) +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamGameSearch_EndGame(m_pSteamGameSearch,ullUniqueGameID); + return result; +} +} + + +public class CSteamParties : ISteamParties +{ +public CSteamParties(IntPtr SteamParties) +{ + m_pSteamParties = SteamParties; +} +IntPtr m_pSteamParties; + +public override IntPtr GetIntPtr() { return m_pSteamParties; } + +private void CheckIfUsable() +{ + if (m_pSteamParties == IntPtr.Zero) + { + throw new Exception("Steam Pointer not configured"); + } +} +public override uint GetNumActiveBeacons() +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamParties_GetNumActiveBeacons(m_pSteamParties); + return result; +} +public override ulong GetBeaconByIndex(uint unIndex) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamParties_GetBeaconByIndex(m_pSteamParties,unIndex); + return result; +} +public override bool GetBeaconDetails(ulong ulBeaconID,ref CSteamID pSteamIDBeaconOwner,out SteamPartyBeaconLocation_t pLocation,out string pchMetadata) +{ + CheckIfUsable(); + pLocation = new SteamPartyBeaconLocation_t(); + int cchMetadata = 0; + bool result = NativeEntrypoints.SteamAPI_ISteamParties_GetBeaconDetails(m_pSteamParties,ulBeaconID,ref pSteamIDBeaconOwner,ref pLocation,null,ref cchMetadata); + System.Text.StringBuilder pStrBuffer1 = new System.Text.StringBuilder((int)cchMetadata); + result = NativeEntrypoints.SteamAPI_ISteamParties_GetBeaconDetails(m_pSteamParties,ulBeaconID,ref pSteamIDBeaconOwner,ref pLocation,pStrBuffer1,ref cchMetadata); + pchMetadata = pStrBuffer1.ToString(); + return result; +} +public override ulong JoinParty(ulong ulBeaconID) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamParties_JoinParty(m_pSteamParties,ulBeaconID); + return result; +} +public override bool GetNumAvailableBeaconLocations(ref uint puNumLocations) +{ + CheckIfUsable(); + puNumLocations = 0; + bool result = NativeEntrypoints.SteamAPI_ISteamParties_GetNumAvailableBeaconLocations(m_pSteamParties,ref puNumLocations); + return result; +} +public override bool GetAvailableBeaconLocations(ref SteamPartyBeaconLocation_t pLocationList,uint uMaxNumLocations) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamParties_GetAvailableBeaconLocations(m_pSteamParties,ref pLocationList,uMaxNumLocations); + return result; +} +public override ulong CreateBeacon(uint unOpenSlots,ref SteamPartyBeaconLocation_t pBeaconLocation,string pchConnectString,string pchMetadata) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamParties_CreateBeacon(m_pSteamParties,unOpenSlots,ref pBeaconLocation,pchConnectString,pchMetadata); + return result; +} +public override void OnReservationCompleted(ulong ulBeacon,ulong steamIDUser) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamParties_OnReservationCompleted(m_pSteamParties,ulBeacon,steamIDUser); +} +public override void CancelReservation(ulong ulBeacon,ulong steamIDUser) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamParties_CancelReservation(m_pSteamParties,ulBeacon,steamIDUser); +} +public override ulong ChangeNumOpenSlots(ulong ulBeacon,uint unOpenSlots) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamParties_ChangeNumOpenSlots(m_pSteamParties,ulBeacon,unOpenSlots); + return result; +} +public override bool DestroyBeacon(ulong ulBeacon) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamParties_DestroyBeacon(m_pSteamParties,ulBeacon); + return result; +} +public override bool GetBeaconLocationData(SteamPartyBeaconLocation_t BeaconLocation,uint eData,out string pchDataStringOut) +{ + CheckIfUsable(); + int cchDataStringOut = 0; + bool result = NativeEntrypoints.SteamAPI_ISteamParties_GetBeaconLocationData(m_pSteamParties,BeaconLocation,eData,null,ref cchDataStringOut); + System.Text.StringBuilder pStrBuffer1 = new System.Text.StringBuilder((int)cchDataStringOut); + result = NativeEntrypoints.SteamAPI_ISteamParties_GetBeaconLocationData(m_pSteamParties,BeaconLocation,eData,pStrBuffer1,ref cchDataStringOut); + pchDataStringOut = pStrBuffer1.ToString(); + return result; +} +} + + public class CSteamRemoteStorage : ISteamRemoteStorage { public CSteamRemoteStorage(IntPtr SteamRemoteStorage) @@ -4969,6 +5454,18 @@ public override ulong GetFileDetails(string pszFileName) ulong result = NativeEntrypoints.SteamAPI_ISteamApps_GetFileDetails(m_pSteamApps,pszFileName); return result; } +public override int GetLaunchCommandLine(string pszCommandLine,int cubCommandLine) +{ + CheckIfUsable(); + int result = NativeEntrypoints.SteamAPI_ISteamApps_GetLaunchCommandLine(m_pSteamApps,pszCommandLine,cubCommandLine); + return result; +} +public override bool BIsSubscribedFromFamilySharing() +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamApps_BIsSubscribedFromFamilySharing(m_pSteamApps); + return result; +} } @@ -5666,6 +6163,218 @@ public override bool GetHTTPRequestWasTimedOut(uint hRequest,ref bool pbWasTimed } +public class CSteamInput : ISteamInput +{ +public CSteamInput(IntPtr SteamInput) +{ + m_pSteamInput = SteamInput; +} +IntPtr m_pSteamInput; + +public override IntPtr GetIntPtr() { return m_pSteamInput; } + +private void CheckIfUsable() +{ + if (m_pSteamInput == IntPtr.Zero) + { + throw new Exception("Steam Pointer not configured"); + } +} +public override bool Init() +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamInput_Init(m_pSteamInput); + return result; +} +public override bool Shutdown() +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamInput_Shutdown(m_pSteamInput); + return result; +} +public override void RunFrame() +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamInput_RunFrame(m_pSteamInput); +} +public override int GetConnectedControllers(ref ulong handlesOut) +{ + CheckIfUsable(); + handlesOut = 0; + int result = NativeEntrypoints.SteamAPI_ISteamInput_GetConnectedControllers(m_pSteamInput,ref handlesOut); + return result; +} +public override ulong GetActionSetHandle(string pszActionSetName) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamInput_GetActionSetHandle(m_pSteamInput,pszActionSetName); + return result; +} +public override void ActivateActionSet(ulong inputHandle,ulong actionSetHandle) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamInput_ActivateActionSet(m_pSteamInput,inputHandle,actionSetHandle); +} +public override ulong GetCurrentActionSet(ulong inputHandle) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamInput_GetCurrentActionSet(m_pSteamInput,inputHandle); + return result; +} +public override void ActivateActionSetLayer(ulong inputHandle,ulong actionSetLayerHandle) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamInput_ActivateActionSetLayer(m_pSteamInput,inputHandle,actionSetLayerHandle); +} +public override void DeactivateActionSetLayer(ulong inputHandle,ulong actionSetLayerHandle) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamInput_DeactivateActionSetLayer(m_pSteamInput,inputHandle,actionSetLayerHandle); +} +public override void DeactivateAllActionSetLayers(ulong inputHandle) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamInput_DeactivateAllActionSetLayers(m_pSteamInput,inputHandle); +} +public override int GetActiveActionSetLayers(ulong inputHandle,ref ulong handlesOut) +{ + CheckIfUsable(); + handlesOut = 0; + int result = NativeEntrypoints.SteamAPI_ISteamInput_GetActiveActionSetLayers(m_pSteamInput,inputHandle,ref handlesOut); + return result; +} +public override ulong GetDigitalActionHandle(string pszActionName) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamInput_GetDigitalActionHandle(m_pSteamInput,pszActionName); + return result; +} +public override InputDigitalActionData_t GetDigitalActionData(ulong inputHandle,ulong digitalActionHandle) +{ + CheckIfUsable(); + InputDigitalActionData_t result = NativeEntrypoints.SteamAPI_ISteamInput_GetDigitalActionData(m_pSteamInput,inputHandle,digitalActionHandle); + return result; +} +public override int GetDigitalActionOrigins(ulong inputHandle,ulong actionSetHandle,ulong digitalActionHandle,ref uint originsOut) +{ + CheckIfUsable(); + originsOut = 0; + int result = NativeEntrypoints.SteamAPI_ISteamInput_GetDigitalActionOrigins(m_pSteamInput,inputHandle,actionSetHandle,digitalActionHandle,ref originsOut); + return result; +} +public override ulong GetAnalogActionHandle(string pszActionName) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamInput_GetAnalogActionHandle(m_pSteamInput,pszActionName); + return result; +} +public override InputAnalogActionData_t GetAnalogActionData(ulong inputHandle,ulong analogActionHandle) +{ + CheckIfUsable(); + InputAnalogActionData_t result = NativeEntrypoints.SteamAPI_ISteamInput_GetAnalogActionData(m_pSteamInput,inputHandle,analogActionHandle); + return result; +} +public override int GetAnalogActionOrigins(ulong inputHandle,ulong actionSetHandle,ulong analogActionHandle,ref uint originsOut) +{ + CheckIfUsable(); + originsOut = 0; + int result = NativeEntrypoints.SteamAPI_ISteamInput_GetAnalogActionOrigins(m_pSteamInput,inputHandle,actionSetHandle,analogActionHandle,ref originsOut); + return result; +} +public override string GetGlyphForActionOrigin(uint eOrigin) +{ + CheckIfUsable(); + IntPtr result = NativeEntrypoints.SteamAPI_ISteamInput_GetGlyphForActionOrigin(m_pSteamInput,eOrigin); + return Marshal.PtrToStringAnsi(result); +} +public override string GetStringForActionOrigin(uint eOrigin) +{ + CheckIfUsable(); + IntPtr result = NativeEntrypoints.SteamAPI_ISteamInput_GetStringForActionOrigin(m_pSteamInput,eOrigin); + return Marshal.PtrToStringAnsi(result); +} +public override void StopAnalogActionMomentum(ulong inputHandle,ulong eAction) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamInput_StopAnalogActionMomentum(m_pSteamInput,inputHandle,eAction); +} +public override InputMotionData_t GetMotionData(ulong inputHandle) +{ + CheckIfUsable(); + InputMotionData_t result = NativeEntrypoints.SteamAPI_ISteamInput_GetMotionData(m_pSteamInput,inputHandle); + return result; +} +public override void TriggerVibration(ulong inputHandle,char usLeftSpeed,char usRightSpeed) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamInput_TriggerVibration(m_pSteamInput,inputHandle,usLeftSpeed,usRightSpeed); +} +public override void SetLEDColor(ulong inputHandle,byte nColorR,byte nColorG,byte nColorB,uint nFlags) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamInput_SetLEDColor(m_pSteamInput,inputHandle,nColorR,nColorG,nColorB,nFlags); +} +public override void TriggerHapticPulse(ulong inputHandle,uint eTargetPad,char usDurationMicroSec) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamInput_TriggerHapticPulse(m_pSteamInput,inputHandle,eTargetPad,usDurationMicroSec); +} +public override void TriggerRepeatedHapticPulse(ulong inputHandle,uint eTargetPad,char usDurationMicroSec,char usOffMicroSec,char unRepeat,uint nFlags) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamInput_TriggerRepeatedHapticPulse(m_pSteamInput,inputHandle,eTargetPad,usDurationMicroSec,usOffMicroSec,unRepeat,nFlags); +} +public override bool ShowBindingPanel(ulong inputHandle) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamInput_ShowBindingPanel(m_pSteamInput,inputHandle); + return result; +} +public override uint GetInputTypeForHandle(ulong inputHandle) +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamInput_GetInputTypeForHandle(m_pSteamInput,inputHandle); + return result; +} +public override ulong GetControllerForGamepadIndex(int nIndex) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamInput_GetControllerForGamepadIndex(m_pSteamInput,nIndex); + return result; +} +public override int GetGamepadIndexForController(ulong ulinputHandle) +{ + CheckIfUsable(); + int result = NativeEntrypoints.SteamAPI_ISteamInput_GetGamepadIndexForController(m_pSteamInput,ulinputHandle); + return result; +} +public override string GetStringForXboxOrigin(uint eOrigin) +{ + CheckIfUsable(); + IntPtr result = NativeEntrypoints.SteamAPI_ISteamInput_GetStringForXboxOrigin(m_pSteamInput,eOrigin); + return Marshal.PtrToStringAnsi(result); +} +public override string GetGlyphForXboxOrigin(uint eOrigin) +{ + CheckIfUsable(); + IntPtr result = NativeEntrypoints.SteamAPI_ISteamInput_GetGlyphForXboxOrigin(m_pSteamInput,eOrigin); + return Marshal.PtrToStringAnsi(result); +} +public override uint GetActionOriginFromXboxOrigin(ulong inputHandle,uint eOrigin) +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamInput_GetActionOriginFromXboxOrigin(m_pSteamInput,inputHandle,eOrigin); + return result; +} +public override uint TranslateActionOrigin(uint eDestinationInputType,uint eSourceOrigin) +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamInput_TranslateActionOrigin(m_pSteamInput,eDestinationInputType,eSourceOrigin); + return result; +} +} + + public class CSteamController : ISteamController { public CSteamController(IntPtr SteamController) @@ -5707,12 +6416,6 @@ public override int GetConnectedControllers(ref ulong handlesOut) int result = NativeEntrypoints.SteamAPI_ISteamController_GetConnectedControllers(m_pSteamController,ref handlesOut); return result; } -public override bool ShowBindingPanel(ulong controllerHandle) -{ - CheckIfUsable(); - bool result = NativeEntrypoints.SteamAPI_ISteamController_ShowBindingPanel(m_pSteamController,controllerHandle); - return result; -} public override ulong GetActionSetHandle(string pszActionSetName) { CheckIfUsable(); @@ -5758,10 +6461,10 @@ public override ulong GetDigitalActionHandle(string pszActionName) ulong result = NativeEntrypoints.SteamAPI_ISteamController_GetDigitalActionHandle(m_pSteamController,pszActionName); return result; } -public override ControllerDigitalActionData_t GetDigitalActionData(ulong controllerHandle,ulong digitalActionHandle) +public override InputDigitalActionData_t GetDigitalActionData(ulong controllerHandle,ulong digitalActionHandle) { CheckIfUsable(); - ControllerDigitalActionData_t result = NativeEntrypoints.SteamAPI_ISteamController_GetDigitalActionData(m_pSteamController,controllerHandle,digitalActionHandle); + InputDigitalActionData_t result = NativeEntrypoints.SteamAPI_ISteamController_GetDigitalActionData(m_pSteamController,controllerHandle,digitalActionHandle); return result; } public override int GetDigitalActionOrigins(ulong controllerHandle,ulong actionSetHandle,ulong digitalActionHandle,ref uint originsOut) @@ -5777,10 +6480,10 @@ public override ulong GetAnalogActionHandle(string pszActionName) ulong result = NativeEntrypoints.SteamAPI_ISteamController_GetAnalogActionHandle(m_pSteamController,pszActionName); return result; } -public override ControllerAnalogActionData_t GetAnalogActionData(ulong controllerHandle,ulong analogActionHandle) +public override InputAnalogActionData_t GetAnalogActionData(ulong controllerHandle,ulong analogActionHandle) { CheckIfUsable(); - ControllerAnalogActionData_t result = NativeEntrypoints.SteamAPI_ISteamController_GetAnalogActionData(m_pSteamController,controllerHandle,analogActionHandle); + InputAnalogActionData_t result = NativeEntrypoints.SteamAPI_ISteamController_GetAnalogActionData(m_pSteamController,controllerHandle,analogActionHandle); return result; } public override int GetAnalogActionOrigins(ulong controllerHandle,ulong actionSetHandle,ulong analogActionHandle,ref uint originsOut) @@ -5790,11 +6493,29 @@ public override int GetAnalogActionOrigins(ulong controllerHandle,ulong actionSe int result = NativeEntrypoints.SteamAPI_ISteamController_GetAnalogActionOrigins(m_pSteamController,controllerHandle,actionSetHandle,analogActionHandle,ref originsOut); return result; } +public override string GetGlyphForActionOrigin(uint eOrigin) +{ + CheckIfUsable(); + IntPtr result = NativeEntrypoints.SteamAPI_ISteamController_GetGlyphForActionOrigin(m_pSteamController,eOrigin); + return Marshal.PtrToStringAnsi(result); +} +public override string GetStringForActionOrigin(uint eOrigin) +{ + CheckIfUsable(); + IntPtr result = NativeEntrypoints.SteamAPI_ISteamController_GetStringForActionOrigin(m_pSteamController,eOrigin); + return Marshal.PtrToStringAnsi(result); +} public override void StopAnalogActionMomentum(ulong controllerHandle,ulong eAction) { CheckIfUsable(); NativeEntrypoints.SteamAPI_ISteamController_StopAnalogActionMomentum(m_pSteamController,controllerHandle,eAction); } +public override InputMotionData_t GetMotionData(ulong controllerHandle) +{ + CheckIfUsable(); + InputMotionData_t result = NativeEntrypoints.SteamAPI_ISteamController_GetMotionData(m_pSteamController,controllerHandle); + return result; +} public override void TriggerHapticPulse(ulong controllerHandle,uint eTargetPad,char usDurationMicroSec) { CheckIfUsable(); @@ -5815,10 +6536,16 @@ public override void SetLEDColor(ulong controllerHandle,byte nColorR,byte nColor CheckIfUsable(); NativeEntrypoints.SteamAPI_ISteamController_SetLEDColor(m_pSteamController,controllerHandle,nColorR,nColorG,nColorB,nFlags); } -public override int GetGamepadIndexForController(ulong ulControllerHandle) +public override bool ShowBindingPanel(ulong controllerHandle) { CheckIfUsable(); - int result = NativeEntrypoints.SteamAPI_ISteamController_GetGamepadIndexForController(m_pSteamController,ulControllerHandle); + bool result = NativeEntrypoints.SteamAPI_ISteamController_ShowBindingPanel(m_pSteamController,controllerHandle); + return result; +} +public override uint GetInputTypeForHandle(ulong controllerHandle) +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamController_GetInputTypeForHandle(m_pSteamController,controllerHandle); return result; } public override ulong GetControllerForGamepadIndex(int nIndex) @@ -5827,40 +6554,34 @@ public override ulong GetControllerForGamepadIndex(int nIndex) ulong result = NativeEntrypoints.SteamAPI_ISteamController_GetControllerForGamepadIndex(m_pSteamController,nIndex); return result; } -public override ControllerMotionData_t GetMotionData(ulong controllerHandle) +public override int GetGamepadIndexForController(ulong ulControllerHandle) { CheckIfUsable(); - ControllerMotionData_t result = NativeEntrypoints.SteamAPI_ISteamController_GetMotionData(m_pSteamController,controllerHandle); + int result = NativeEntrypoints.SteamAPI_ISteamController_GetGamepadIndexForController(m_pSteamController,ulControllerHandle); return result; } -public override bool ShowDigitalActionOrigins(ulong controllerHandle,ulong digitalActionHandle,float flScale,float flXPosition,float flYPosition) +public override string GetStringForXboxOrigin(uint eOrigin) { CheckIfUsable(); - bool result = NativeEntrypoints.SteamAPI_ISteamController_ShowDigitalActionOrigins(m_pSteamController,controllerHandle,digitalActionHandle,flScale,flXPosition,flYPosition); - return result; -} -public override bool ShowAnalogActionOrigins(ulong controllerHandle,ulong analogActionHandle,float flScale,float flXPosition,float flYPosition) -{ - CheckIfUsable(); - bool result = NativeEntrypoints.SteamAPI_ISteamController_ShowAnalogActionOrigins(m_pSteamController,controllerHandle,analogActionHandle,flScale,flXPosition,flYPosition); - return result; -} -public override string GetStringForActionOrigin(uint eOrigin) -{ - CheckIfUsable(); - IntPtr result = NativeEntrypoints.SteamAPI_ISteamController_GetStringForActionOrigin(m_pSteamController,eOrigin); + IntPtr result = NativeEntrypoints.SteamAPI_ISteamController_GetStringForXboxOrigin(m_pSteamController,eOrigin); return Marshal.PtrToStringAnsi(result); } -public override string GetGlyphForActionOrigin(uint eOrigin) +public override string GetGlyphForXboxOrigin(uint eOrigin) { CheckIfUsable(); - IntPtr result = NativeEntrypoints.SteamAPI_ISteamController_GetGlyphForActionOrigin(m_pSteamController,eOrigin); + IntPtr result = NativeEntrypoints.SteamAPI_ISteamController_GetGlyphForXboxOrigin(m_pSteamController,eOrigin); return Marshal.PtrToStringAnsi(result); } -public override uint GetInputTypeForHandle(ulong controllerHandle) +public override uint GetActionOriginFromXboxOrigin(ulong controllerHandle,uint eOrigin) { CheckIfUsable(); - uint result = NativeEntrypoints.SteamAPI_ISteamController_GetInputTypeForHandle(m_pSteamController,controllerHandle); + uint result = NativeEntrypoints.SteamAPI_ISteamController_GetActionOriginFromXboxOrigin(m_pSteamController,controllerHandle,eOrigin); + return result; +} +public override uint TranslateActionOrigin(uint eDestinationInputType,uint eSourceOrigin) +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamController_TranslateActionOrigin(m_pSteamController,eDestinationInputType,eSourceOrigin); return result; } } @@ -5895,6 +6616,12 @@ public override ulong CreateQueryAllUGCRequest(uint eQueryType,uint eMatchingeMa ulong result = NativeEntrypoints.SteamAPI_ISteamUGC_CreateQueryAllUGCRequest(m_pSteamUGC,eQueryType,eMatchingeMatchingUGCTypeFileType,nCreatorAppID,nConsumerAppID,unPage); return result; } +public override ulong CreateQueryAllUGCRequest0(uint eQueryType,uint eMatchingeMatchingUGCTypeFileType,uint nCreatorAppID,uint nConsumerAppID,string pchCursor) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamUGC_CreateQueryAllUGCRequest0(m_pSteamUGC,eQueryType,eMatchingeMatchingUGCTypeFileType,nCreatorAppID,nConsumerAppID,pchCursor); + return result; +} public override ulong CreateQueryUGCDetailsRequest(ref ulong pvecPublishedFileID,uint unNumPublishedFileIDs) { CheckIfUsable(); @@ -6151,6 +6878,12 @@ public override bool SetItemPreview(ulong handle,string pszPreviewFile) bool result = NativeEntrypoints.SteamAPI_ISteamUGC_SetItemPreview(m_pSteamUGC,handle,pszPreviewFile); return result; } +public override bool SetAllowLegacyUpload(ulong handle,bool bAllowLegacyUpload) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamUGC_SetAllowLegacyUpload(m_pSteamUGC,handle,bAllowLegacyUpload); + return result; +} public override bool RemoveItemKeyValueTags(ulong handle,string pchKey) { CheckIfUsable(); @@ -6517,10 +7250,10 @@ public override void MouseWheel(uint unBrowserHandle,int nDelta) CheckIfUsable(); NativeEntrypoints.SteamAPI_ISteamHTMLSurface_MouseWheel(m_pSteamHTMLSurface,unBrowserHandle,nDelta); } -public override void KeyDown(uint unBrowserHandle,uint nNativeKeyCode,uint eHTMLKeyModifiers) +public override void KeyDown(uint unBrowserHandle,uint nNativeKeyCode,uint eHTMLKeyModifiers,bool bIsSystemKey) { CheckIfUsable(); - NativeEntrypoints.SteamAPI_ISteamHTMLSurface_KeyDown(m_pSteamHTMLSurface,unBrowserHandle,nNativeKeyCode,eHTMLKeyModifiers); + NativeEntrypoints.SteamAPI_ISteamHTMLSurface_KeyDown(m_pSteamHTMLSurface,unBrowserHandle,nNativeKeyCode,eHTMLKeyModifiers,bIsSystemKey); } public override void KeyUp(uint unBrowserHandle,uint nNativeKeyCode,uint eHTMLKeyModifiers) { @@ -6597,6 +7330,11 @@ public override void SetDPIScalingFactor(uint unBrowserHandle,float flDPIScaling CheckIfUsable(); NativeEntrypoints.SteamAPI_ISteamHTMLSurface_SetDPIScalingFactor(m_pSteamHTMLSurface,unBrowserHandle,flDPIScaling); } +public override void OpenDeveloperTools(uint unBrowserHandle) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamHTMLSurface_OpenDeveloperTools(m_pSteamHTMLSurface,unBrowserHandle); +} public override void AllowStartRequest(uint unBrowserHandle,bool bAllowed) { CheckIfUsable(); @@ -6823,22 +7561,25 @@ public override uint GetNumItemsWithPrices() uint result = NativeEntrypoints.SteamAPI_ISteamInventory_GetNumItemsWithPrices(m_pSteamInventory); return result; } -public override bool GetItemsWithPrices(out int [] pArrayItemDefs,out ulong [] pPrices,uint unArrayLength) +public override bool GetItemsWithPrices(out int [] pArrayItemDefs,out ulong [] pCurrentPrices,out ulong [] pBasePrices,uint unArrayLength) { CheckIfUsable(); pArrayItemDefs = 0; pPrices = 0; - bool result = NativeEntrypoints.SteamAPI_ISteamInventory_GetItemsWithPrices(m_pSteamInventory,pArrayItemDefs,null,unArrayLength); + pBasePrices = 0; + bool result = NativeEntrypoints.SteamAPI_ISteamInventory_GetItemsWithPrices(m_pSteamInventory,pArrayItemDefs,pCurrentPrices,null,unArrayLength); pArrayItemDefs= new int[pArrayItemDefs]; - pPrices= new ulong[pPrices]; - result = NativeEntrypoints.SteamAPI_ISteamInventory_GetItemsWithPrices(m_pSteamInventory,pArrayItemDefs,pPrices,unArrayLength); + pCurrentPrices= new ulong[pPrices]; + pBasePrices= new ulong[pPrices]; + result = NativeEntrypoints.SteamAPI_ISteamInventory_GetItemsWithPrices(m_pSteamInventory,pArrayItemDefs,pCurrentPrices,pBasePrices,unArrayLength); return result; } -public override bool GetItemPrice(int iDefinition,ref ulong pPrice) +public override bool GetItemPrice(int iDefinition,ref ulong pCurrentPrice,ref ulong pBasePrice) { CheckIfUsable(); - pPrice = 0; - bool result = NativeEntrypoints.SteamAPI_ISteamInventory_GetItemPrice(m_pSteamInventory,iDefinition,ref pPrice); + pCurrentPrice = 0; + pBasePrice = 0; + bool result = NativeEntrypoints.SteamAPI_ISteamInventory_GetItemPrice(m_pSteamInventory,iDefinition,ref pCurrentPrice,ref pBasePrice); return result; } public override ulong StartUpdateProperties() @@ -7851,6 +8592,26 @@ public void Set(ulong hAPICall, Valve.Interop.NativeEntrypoints.SteamAPI_HTML_Br m_Handle = Valve.Interop.NativeEntrypoints.CHTML_BrowserReady_t_SetCallResult(hAPICall, func); } } +public class CMarketEligibilityResponse_t_CallResult +{ + public CMarketEligibilityResponse_t_CallResult() { } + ~CMarketEligibilityResponse_t_CallResult() + { + if(m_Handle != 0) + { + Valve.Interop.NativeEntrypoints.CMarketEligibilityResponse_t_RemoveCallResult(m_Handle); + } + } + ulong m_Handle = 0; + public void Set(ulong hAPICall, Valve.Interop.NativeEntrypoints.SteamAPI_MarketEligibilityResponse_t_CallResult func) + { + if (m_Handle != 0) + { + Valve.Interop.NativeEntrypoints.CMarketEligibilityResponse_t_RemoveCallResult(m_Handle); + } + m_Handle = Valve.Interop.NativeEntrypoints.CMarketEligibilityResponse_t_SetCallResult(hAPICall, func); + } +} public class CLeaderboardScoresDownloaded_t_CallResult { public CLeaderboardScoresDownloaded_t_CallResult() { } @@ -7891,24 +8652,24 @@ public void Set(ulong hAPICall, Valve.Interop.NativeEntrypoints.SteamAPI_RemoteS m_Handle = Valve.Interop.NativeEntrypoints.CRemoteStorageUpdateUserPublishedItemVoteResult_t_SetCallResult(hAPICall, func); } } -public class CRemoteStorageEnumerateUserSubscribedFilesResult_t_CallResult +public class CCreateBeaconCallback_t_CallResult { - public CRemoteStorageEnumerateUserSubscribedFilesResult_t_CallResult() { } - ~CRemoteStorageEnumerateUserSubscribedFilesResult_t_CallResult() + public CCreateBeaconCallback_t_CallResult() { } + ~CCreateBeaconCallback_t_CallResult() { if(m_Handle != 0) { - Valve.Interop.NativeEntrypoints.CRemoteStorageEnumerateUserSubscribedFilesResult_t_RemoveCallResult(m_Handle); + Valve.Interop.NativeEntrypoints.CCreateBeaconCallback_t_RemoveCallResult(m_Handle); } } ulong m_Handle = 0; - public void Set(ulong hAPICall, Valve.Interop.NativeEntrypoints.SteamAPI_RemoteStorageEnumerateUserSubscribedFilesResult_t_CallResult func) + public void Set(ulong hAPICall, Valve.Interop.NativeEntrypoints.SteamAPI_CreateBeaconCallback_t_CallResult func) { if (m_Handle != 0) { - Valve.Interop.NativeEntrypoints.CRemoteStorageEnumerateUserSubscribedFilesResult_t_RemoveCallResult(m_Handle); + Valve.Interop.NativeEntrypoints.CCreateBeaconCallback_t_RemoveCallResult(m_Handle); } - m_Handle = Valve.Interop.NativeEntrypoints.CRemoteStorageEnumerateUserSubscribedFilesResult_t_SetCallResult(hAPICall, func); + m_Handle = Valve.Interop.NativeEntrypoints.CCreateBeaconCallback_t_SetCallResult(hAPICall, func); } } public class CCreateItemResult_t_CallResult @@ -8031,24 +8792,44 @@ public void Set(ulong hAPICall, Valve.Interop.NativeEntrypoints.SteamAPI_Leaderb m_Handle = Valve.Interop.NativeEntrypoints.CLeaderboardScoreUploaded_t_SetCallResult(hAPICall, func); } } -public class CGlobalAchievementPercentagesReady_t_CallResult +public class CJoinPartyCallback_t_CallResult { - public CGlobalAchievementPercentagesReady_t_CallResult() { } - ~CGlobalAchievementPercentagesReady_t_CallResult() + public CJoinPartyCallback_t_CallResult() { } + ~CJoinPartyCallback_t_CallResult() { if(m_Handle != 0) { - Valve.Interop.NativeEntrypoints.CGlobalAchievementPercentagesReady_t_RemoveCallResult(m_Handle); + Valve.Interop.NativeEntrypoints.CJoinPartyCallback_t_RemoveCallResult(m_Handle); } } ulong m_Handle = 0; - public void Set(ulong hAPICall, Valve.Interop.NativeEntrypoints.SteamAPI_GlobalAchievementPercentagesReady_t_CallResult func) + public void Set(ulong hAPICall, Valve.Interop.NativeEntrypoints.SteamAPI_JoinPartyCallback_t_CallResult func) { if (m_Handle != 0) { - Valve.Interop.NativeEntrypoints.CGlobalAchievementPercentagesReady_t_RemoveCallResult(m_Handle); + Valve.Interop.NativeEntrypoints.CJoinPartyCallback_t_RemoveCallResult(m_Handle); } - m_Handle = Valve.Interop.NativeEntrypoints.CGlobalAchievementPercentagesReady_t_SetCallResult(hAPICall, func); + m_Handle = Valve.Interop.NativeEntrypoints.CJoinPartyCallback_t_SetCallResult(hAPICall, func); + } +} +public class CRemoteStorageEnumerateUserSubscribedFilesResult_t_CallResult +{ + public CRemoteStorageEnumerateUserSubscribedFilesResult_t_CallResult() { } + ~CRemoteStorageEnumerateUserSubscribedFilesResult_t_CallResult() + { + if(m_Handle != 0) + { + Valve.Interop.NativeEntrypoints.CRemoteStorageEnumerateUserSubscribedFilesResult_t_RemoveCallResult(m_Handle); + } + } + ulong m_Handle = 0; + public void Set(ulong hAPICall, Valve.Interop.NativeEntrypoints.SteamAPI_RemoteStorageEnumerateUserSubscribedFilesResult_t_CallResult func) + { + if (m_Handle != 0) + { + Valve.Interop.NativeEntrypoints.CRemoteStorageEnumerateUserSubscribedFilesResult_t_RemoveCallResult(m_Handle); + } + m_Handle = Valve.Interop.NativeEntrypoints.CRemoteStorageEnumerateUserSubscribedFilesResult_t_SetCallResult(hAPICall, func); } } public class CGlobalStatsReceived_t_CallResult @@ -8191,6 +8972,26 @@ public void Set(ulong hAPICall, Valve.Interop.NativeEntrypoints.SteamAPI_GSReput m_Handle = Valve.Interop.NativeEntrypoints.CGSReputation_t_SetCallResult(hAPICall, func); } } +public class CGlobalAchievementPercentagesReady_t_CallResult +{ + public CGlobalAchievementPercentagesReady_t_CallResult() { } + ~CGlobalAchievementPercentagesReady_t_CallResult() + { + if(m_Handle != 0) + { + Valve.Interop.NativeEntrypoints.CGlobalAchievementPercentagesReady_t_RemoveCallResult(m_Handle); + } + } + ulong m_Handle = 0; + public void Set(ulong hAPICall, Valve.Interop.NativeEntrypoints.SteamAPI_GlobalAchievementPercentagesReady_t_CallResult func) + { + if (m_Handle != 0) + { + Valve.Interop.NativeEntrypoints.CGlobalAchievementPercentagesReady_t_RemoveCallResult(m_Handle); + } + m_Handle = Valve.Interop.NativeEntrypoints.CGlobalAchievementPercentagesReady_t_SetCallResult(hAPICall, func); + } +} public class CUserFavoriteItemsListChanged_t_CallResult { public CUserFavoriteItemsListChanged_t_CallResult() { } @@ -8331,6 +9132,26 @@ public void Set(ulong hAPICall, Valve.Interop.NativeEntrypoints.SteamAPI_Friends m_Handle = Valve.Interop.NativeEntrypoints.CFriendsEnumerateFollowingList_t_SetCallResult(hAPICall, func); } } +public class CChangeNumOpenSlotsCallback_t_CallResult +{ + public CChangeNumOpenSlotsCallback_t_CallResult() { } + ~CChangeNumOpenSlotsCallback_t_CallResult() + { + if(m_Handle != 0) + { + Valve.Interop.NativeEntrypoints.CChangeNumOpenSlotsCallback_t_RemoveCallResult(m_Handle); + } + } + ulong m_Handle = 0; + public void Set(ulong hAPICall, Valve.Interop.NativeEntrypoints.SteamAPI_ChangeNumOpenSlotsCallback_t_CallResult func) + { + if (m_Handle != 0) + { + Valve.Interop.NativeEntrypoints.CChangeNumOpenSlotsCallback_t_RemoveCallResult(m_Handle); + } + m_Handle = Valve.Interop.NativeEntrypoints.CChangeNumOpenSlotsCallback_t_SetCallResult(hAPICall, func); + } +} public class CRemoteStorageSubscribePublishedFileResult_t_CallResult { public CRemoteStorageSubscribePublishedFileResult_t_CallResult() { } @@ -8623,6 +9444,10 @@ public class SteamAPIInterop internal static extern IntPtr SteamMatchmakingRulesResponse(); [DllImportAttribute("Steam_api", EntryPoint = "SteamMatchmakingServers")] internal static extern IntPtr SteamMatchmakingServers(); +[DllImportAttribute("Steam_api", EntryPoint = "SteamGameSearch")] +internal static extern IntPtr SteamGameSearch(); +[DllImportAttribute("Steam_api", EntryPoint = "SteamParties")] +internal static extern IntPtr SteamParties(); [DllImportAttribute("Steam_api", EntryPoint = "SteamRemoteStorage")] internal static extern IntPtr SteamRemoteStorage(); [DllImportAttribute("Steam_api", EntryPoint = "SteamUserStats")] @@ -8639,6 +9464,8 @@ public class SteamAPIInterop internal static extern IntPtr SteamMusicRemote(); [DllImportAttribute("Steam_api", EntryPoint = "SteamHTTP")] internal static extern IntPtr SteamHTTP(); +[DllImportAttribute("Steam_api", EntryPoint = "SteamInput")] +internal static extern IntPtr SteamInput(); [DllImportAttribute("Steam_api", EntryPoint = "SteamController")] internal static extern IntPtr SteamController(); [DllImportAttribute("Steam_api", EntryPoint = "SteamUGC")] @@ -8782,6 +9609,7 @@ public enum EResult k_EResultWGNetworkSendExceeded = 110, k_EResultAccountNotFriends = 111, k_EResultLimitedUserAccount = 112, + k_EResultCantRemoveItem = 113, } public enum EVoiceResult { @@ -8990,6 +9818,16 @@ public enum EBroadcastUploadResult k_EBroadcastUploadResultMissingAudio = 11, k_EBroadcastUploadResultTooFarBehind = 12, k_EBroadcastUploadResultTranscodeBehind = 13, + k_EBroadcastUploadResultNotAllowedToPlay = 14, + k_EBroadcastUploadResultBusy = 15, + k_EBroadcastUploadResultBanned = 16, + k_EBroadcastUploadResultAlreadyActive = 17, + k_EBroadcastUploadResultForcedOff = 18, + k_EBroadcastUploadResultAudioBehind = 19, + k_EBroadcastUploadResultShutdown = 20, + k_EBroadcastUploadResultDisconnect = 21, + k_EBroadcastUploadResultVideoInitFailed = 22, + k_EBroadcastUploadResultAudioInitFailed = 23, } public enum ELaunchOptionType { @@ -9018,6 +9856,7 @@ public enum EVRHMDType k_eEVRHMDType_HTC_Dev = 1, k_eEVRHMDType_HTC_VivePre = 2, k_eEVRHMDType_HTC_Vive = 3, + k_eEVRHMDType_HTC_VivePro = 4, k_eEVRHMDType_HTC_Unknown = 20, k_eEVRHMDType_Oculus_DK1 = 21, k_eEVRHMDType_Oculus_DK2 = 22, @@ -9035,6 +9874,50 @@ public enum EVRHMDType k_eEVRHMDType_Samsung_Odyssey = 91, k_eEVRHMDType_Unannounced_Unknown = 100, k_eEVRHMDType_Unannounced_WindowsMR = 101, + k_eEVRHMDType_vridge = 110, + k_eEVRHMDType_Huawei_Unknown = 120, + k_eEVRHMDType_Huawei_VR2 = 121, + k_eEVRHMDType_Huawei_Unannounced = 129, +} +public enum EMarketNotAllowedReasonFlags +{ + k_EMarketNotAllowedReason_None = 0, + k_EMarketNotAllowedReason_TemporaryFailure = 1, + k_EMarketNotAllowedReason_AccountDisabled = 2, + k_EMarketNotAllowedReason_AccountLockedDown = 4, + k_EMarketNotAllowedReason_AccountLimited = 8, + k_EMarketNotAllowedReason_TradeBanned = 16, + k_EMarketNotAllowedReason_AccountNotTrusted = 32, + k_EMarketNotAllowedReason_SteamGuardNotEnabled = 64, + k_EMarketNotAllowedReason_SteamGuardOnlyRecentlyEnabled = 128, + k_EMarketNotAllowedReason_RecentPasswordReset = 256, + k_EMarketNotAllowedReason_NewPaymentMethod = 512, + k_EMarketNotAllowedReason_InvalidCookie = 1024, + k_EMarketNotAllowedReason_UsingNewDevice = 2048, + k_EMarketNotAllowedReason_RecentSelfRefund = 4096, + k_EMarketNotAllowedReason_NewPaymentMethodCannotBeVerified = 8192, + k_EMarketNotAllowedReason_NoRecentPurchases = 16384, + k_EMarketNotAllowedReason_AcceptedWalletGift = 32768, +} +public enum EGameSearchErrorCode_t +{ + k_EGameSearchErrorCode_OK = 1, + k_EGameSearchErrorCode_Failed_Search_Already_In_Progress = 2, + k_EGameSearchErrorCode_Failed_No_Search_In_Progress = 3, + k_EGameSearchErrorCode_Failed_Not_Lobby_Leader = 4, + k_EGameSearchErrorCode_Failed_No_Host_Available = 5, + k_EGameSearchErrorCode_Failed_Search_Params_Invalid = 6, + k_EGameSearchErrorCode_Failed_Offline = 7, + k_EGameSearchErrorCode_Failed_NotAuthorized = 8, + k_EGameSearchErrorCode_Failed_Unknown_Error = 9, +} +public enum EPlayerResult_t +{ + k_EPlayerResultFailedToConnect = 1, + k_EPlayerResultAbandoned = 2, + k_EPlayerResultKicked = 3, + k_EPlayerResultIncomplete = 4, + k_EPlayerResultCompleted = 5, } public enum EFailureType { @@ -9062,7 +9945,8 @@ public enum EPersonaState k_EPersonaStateSnooze = 4, k_EPersonaStateLookingToTrade = 5, k_EPersonaStateLookingToPlay = 6, - k_EPersonaStateMax = 7, + k_EPersonaStateInvisible = 7, + k_EPersonaStateMax = 8, } public enum EFriendFlags { @@ -9096,6 +9980,11 @@ public enum EOverlayToStoreFlag k_EOverlayToStoreFlag_AddToCart = 1, k_EOverlayToStoreFlag_AddToCartAndShow = 2, } +public enum EActivateGameOverlayToWebPageMode +{ + k_EActivateGameOverlayToWebPageMode_Default = 0, + k_EActivateGameOverlayToWebPageMode_Modal = 1, +} public enum EPersonaChange { k_EPersonaChangeName = 1, @@ -9109,9 +9998,10 @@ public enum EPersonaChange k_EPersonaChangeLeftSource = 256, k_EPersonaChangeRelationshipChanged = 512, k_EPersonaChangeNameFirstSet = 1024, - k_EPersonaChangeFacebookInfo = 2048, + k_EPersonaChangeBroadcast = 2048, k_EPersonaChangeNickname = 4096, k_EPersonaChangeSteamLevel = 8192, + k_EPersonaChangeRichPresence = 16384, } public enum ESteamAPICallFailure { @@ -9176,6 +10066,20 @@ public enum EChatMemberStateChange k_EChatMemberStateChangeKicked = 8, k_EChatMemberStateChangeBanned = 16, } +public enum ESteamPartyBeaconLocationType +{ + k_ESteamPartyBeaconLocationType_Invalid = 0, + k_ESteamPartyBeaconLocationType_ChatGroup = 1, + k_ESteamPartyBeaconLocationType_Max = 2, +} +public enum ESteamPartyBeaconLocationData +{ + k_ESteamPartyBeaconLocationDataInvalid = 0, + k_ESteamPartyBeaconLocationDataName = 1, + k_ESteamPartyBeaconLocationDataIconURLSmall = 2, + k_ESteamPartyBeaconLocationDataIconURLMedium = 3, + k_ESteamPartyBeaconLocationDataIconURLLarge = 4, +} public enum ERemoteStoragePlatform { k_ERemoteStoragePlatformNone = 0, @@ -9184,6 +10088,7 @@ public enum ERemoteStoragePlatform k_ERemoteStoragePlatformPS3 = 4, k_ERemoteStoragePlatformLinux = 8, k_ERemoteStoragePlatformReserved2 = 16, + k_ERemoteStoragePlatformAndroid = 32, k_ERemoteStoragePlatformAll = -1, } public enum ERemoteStoragePublishedFileVisibility @@ -9390,11 +10295,370 @@ public enum EHTTPStatusCode k_EHTTPStatusCode505HTTPVersionNotSupported = 505, k_EHTTPStatusCode5xxUnknown = 599, } +public enum EInputSource +{ + k_EInputSource_None = 0, + k_EInputSource_LeftTrackpad = 1, + k_EInputSource_RightTrackpad = 2, + k_EInputSource_Joystick = 3, + k_EInputSource_ABXY = 4, + k_EInputSource_Switch = 5, + k_EInputSource_LeftTrigger = 6, + k_EInputSource_RightTrigger = 7, + k_EInputSource_LeftBumper = 8, + k_EInputSource_RightBumper = 9, + k_EInputSource_Gyro = 10, + k_EInputSource_CenterTrackpad = 11, + k_EInputSource_RightJoystick = 12, + k_EInputSource_DPad = 13, + k_EInputSource_Key = 14, + k_EInputSource_Mouse = 15, + k_EInputSource_LeftGyro = 16, + k_EInputSource_Count = 17, +} +public enum EInputSourceMode +{ + k_EInputSourceMode_None = 0, + k_EInputSourceMode_Dpad = 1, + k_EInputSourceMode_Buttons = 2, + k_EInputSourceMode_FourButtons = 3, + k_EInputSourceMode_AbsoluteMouse = 4, + k_EInputSourceMode_RelativeMouse = 5, + k_EInputSourceMode_JoystickMove = 6, + k_EInputSourceMode_JoystickMouse = 7, + k_EInputSourceMode_JoystickCamera = 8, + k_EInputSourceMode_ScrollWheel = 9, + k_EInputSourceMode_Trigger = 10, + k_EInputSourceMode_TouchMenu = 11, + k_EInputSourceMode_MouseJoystick = 12, + k_EInputSourceMode_MouseRegion = 13, + k_EInputSourceMode_RadialMenu = 14, + k_EInputSourceMode_SingleButton = 15, + k_EInputSourceMode_Switches = 16, +} +public enum EInputActionOrigin +{ + k_EInputActionOrigin_None = 0, + k_EInputActionOrigin_SteamController_A = 1, + k_EInputActionOrigin_SteamController_B = 2, + k_EInputActionOrigin_SteamController_X = 3, + k_EInputActionOrigin_SteamController_Y = 4, + k_EInputActionOrigin_SteamController_LeftBumper = 5, + k_EInputActionOrigin_SteamController_RightBumper = 6, + k_EInputActionOrigin_SteamController_LeftGrip = 7, + k_EInputActionOrigin_SteamController_RightGrip = 8, + k_EInputActionOrigin_SteamController_Start = 9, + k_EInputActionOrigin_SteamController_Back = 10, + k_EInputActionOrigin_SteamController_LeftPad_Touch = 11, + k_EInputActionOrigin_SteamController_LeftPad_Swipe = 12, + k_EInputActionOrigin_SteamController_LeftPad_Click = 13, + k_EInputActionOrigin_SteamController_LeftPad_DPadNorth = 14, + k_EInputActionOrigin_SteamController_LeftPad_DPadSouth = 15, + k_EInputActionOrigin_SteamController_LeftPad_DPadWest = 16, + k_EInputActionOrigin_SteamController_LeftPad_DPadEast = 17, + k_EInputActionOrigin_SteamController_RightPad_Touch = 18, + k_EInputActionOrigin_SteamController_RightPad_Swipe = 19, + k_EInputActionOrigin_SteamController_RightPad_Click = 20, + k_EInputActionOrigin_SteamController_RightPad_DPadNorth = 21, + k_EInputActionOrigin_SteamController_RightPad_DPadSouth = 22, + k_EInputActionOrigin_SteamController_RightPad_DPadWest = 23, + k_EInputActionOrigin_SteamController_RightPad_DPadEast = 24, + k_EInputActionOrigin_SteamController_LeftTrigger_Pull = 25, + k_EInputActionOrigin_SteamController_LeftTrigger_Click = 26, + k_EInputActionOrigin_SteamController_RightTrigger_Pull = 27, + k_EInputActionOrigin_SteamController_RightTrigger_Click = 28, + k_EInputActionOrigin_SteamController_LeftStick_Move = 29, + k_EInputActionOrigin_SteamController_LeftStick_Click = 30, + k_EInputActionOrigin_SteamController_LeftStick_DPadNorth = 31, + k_EInputActionOrigin_SteamController_LeftStick_DPadSouth = 32, + k_EInputActionOrigin_SteamController_LeftStick_DPadWest = 33, + k_EInputActionOrigin_SteamController_LeftStick_DPadEast = 34, + k_EInputActionOrigin_SteamController_Gyro_Move = 35, + k_EInputActionOrigin_SteamController_Gyro_Pitch = 36, + k_EInputActionOrigin_SteamController_Gyro_Yaw = 37, + k_EInputActionOrigin_SteamController_Gyro_Roll = 38, + k_EInputActionOrigin_SteamController_Reserved0 = 39, + k_EInputActionOrigin_SteamController_Reserved1 = 40, + k_EInputActionOrigin_SteamController_Reserved2 = 41, + k_EInputActionOrigin_SteamController_Reserved3 = 42, + k_EInputActionOrigin_SteamController_Reserved4 = 43, + k_EInputActionOrigin_SteamController_Reserved5 = 44, + k_EInputActionOrigin_SteamController_Reserved6 = 45, + k_EInputActionOrigin_SteamController_Reserved7 = 46, + k_EInputActionOrigin_SteamController_Reserved8 = 47, + k_EInputActionOrigin_SteamController_Reserved9 = 48, + k_EInputActionOrigin_SteamController_Reserved10 = 49, + k_EInputActionOrigin_PS4_X = 50, + k_EInputActionOrigin_PS4_Circle = 51, + k_EInputActionOrigin_PS4_Triangle = 52, + k_EInputActionOrigin_PS4_Square = 53, + k_EInputActionOrigin_PS4_LeftBumper = 54, + k_EInputActionOrigin_PS4_RightBumper = 55, + k_EInputActionOrigin_PS4_Options = 56, + k_EInputActionOrigin_PS4_Share = 57, + k_EInputActionOrigin_PS4_LeftPad_Touch = 58, + k_EInputActionOrigin_PS4_LeftPad_Swipe = 59, + k_EInputActionOrigin_PS4_LeftPad_Click = 60, + k_EInputActionOrigin_PS4_LeftPad_DPadNorth = 61, + k_EInputActionOrigin_PS4_LeftPad_DPadSouth = 62, + k_EInputActionOrigin_PS4_LeftPad_DPadWest = 63, + k_EInputActionOrigin_PS4_LeftPad_DPadEast = 64, + k_EInputActionOrigin_PS4_RightPad_Touch = 65, + k_EInputActionOrigin_PS4_RightPad_Swipe = 66, + k_EInputActionOrigin_PS4_RightPad_Click = 67, + k_EInputActionOrigin_PS4_RightPad_DPadNorth = 68, + k_EInputActionOrigin_PS4_RightPad_DPadSouth = 69, + k_EInputActionOrigin_PS4_RightPad_DPadWest = 70, + k_EInputActionOrigin_PS4_RightPad_DPadEast = 71, + k_EInputActionOrigin_PS4_CenterPad_Touch = 72, + k_EInputActionOrigin_PS4_CenterPad_Swipe = 73, + k_EInputActionOrigin_PS4_CenterPad_Click = 74, + k_EInputActionOrigin_PS4_CenterPad_DPadNorth = 75, + k_EInputActionOrigin_PS4_CenterPad_DPadSouth = 76, + k_EInputActionOrigin_PS4_CenterPad_DPadWest = 77, + k_EInputActionOrigin_PS4_CenterPad_DPadEast = 78, + k_EInputActionOrigin_PS4_LeftTrigger_Pull = 79, + k_EInputActionOrigin_PS4_LeftTrigger_Click = 80, + k_EInputActionOrigin_PS4_RightTrigger_Pull = 81, + k_EInputActionOrigin_PS4_RightTrigger_Click = 82, + k_EInputActionOrigin_PS4_LeftStick_Move = 83, + k_EInputActionOrigin_PS4_LeftStick_Click = 84, + k_EInputActionOrigin_PS4_LeftStick_DPadNorth = 85, + k_EInputActionOrigin_PS4_LeftStick_DPadSouth = 86, + k_EInputActionOrigin_PS4_LeftStick_DPadWest = 87, + k_EInputActionOrigin_PS4_LeftStick_DPadEast = 88, + k_EInputActionOrigin_PS4_RightStick_Move = 89, + k_EInputActionOrigin_PS4_RightStick_Click = 90, + k_EInputActionOrigin_PS4_RightStick_DPadNorth = 91, + k_EInputActionOrigin_PS4_RightStick_DPadSouth = 92, + k_EInputActionOrigin_PS4_RightStick_DPadWest = 93, + k_EInputActionOrigin_PS4_RightStick_DPadEast = 94, + k_EInputActionOrigin_PS4_DPad_North = 95, + k_EInputActionOrigin_PS4_DPad_South = 96, + k_EInputActionOrigin_PS4_DPad_West = 97, + k_EInputActionOrigin_PS4_DPad_East = 98, + k_EInputActionOrigin_PS4_Gyro_Move = 99, + k_EInputActionOrigin_PS4_Gyro_Pitch = 100, + k_EInputActionOrigin_PS4_Gyro_Yaw = 101, + k_EInputActionOrigin_PS4_Gyro_Roll = 102, + k_EInputActionOrigin_PS4_Reserved0 = 103, + k_EInputActionOrigin_PS4_Reserved1 = 104, + k_EInputActionOrigin_PS4_Reserved2 = 105, + k_EInputActionOrigin_PS4_Reserved3 = 106, + k_EInputActionOrigin_PS4_Reserved4 = 107, + k_EInputActionOrigin_PS4_Reserved5 = 108, + k_EInputActionOrigin_PS4_Reserved6 = 109, + k_EInputActionOrigin_PS4_Reserved7 = 110, + k_EInputActionOrigin_PS4_Reserved8 = 111, + k_EInputActionOrigin_PS4_Reserved9 = 112, + k_EInputActionOrigin_PS4_Reserved10 = 113, + k_EInputActionOrigin_XBoxOne_A = 114, + k_EInputActionOrigin_XBoxOne_B = 115, + k_EInputActionOrigin_XBoxOne_X = 116, + k_EInputActionOrigin_XBoxOne_Y = 117, + k_EInputActionOrigin_XBoxOne_LeftBumper = 118, + k_EInputActionOrigin_XBoxOne_RightBumper = 119, + k_EInputActionOrigin_XBoxOne_Menu = 120, + k_EInputActionOrigin_XBoxOne_View = 121, + k_EInputActionOrigin_XBoxOne_LeftTrigger_Pull = 122, + k_EInputActionOrigin_XBoxOne_LeftTrigger_Click = 123, + k_EInputActionOrigin_XBoxOne_RightTrigger_Pull = 124, + k_EInputActionOrigin_XBoxOne_RightTrigger_Click = 125, + k_EInputActionOrigin_XBoxOne_LeftStick_Move = 126, + k_EInputActionOrigin_XBoxOne_LeftStick_Click = 127, + k_EInputActionOrigin_XBoxOne_LeftStick_DPadNorth = 128, + k_EInputActionOrigin_XBoxOne_LeftStick_DPadSouth = 129, + k_EInputActionOrigin_XBoxOne_LeftStick_DPadWest = 130, + k_EInputActionOrigin_XBoxOne_LeftStick_DPadEast = 131, + k_EInputActionOrigin_XBoxOne_RightStick_Move = 132, + k_EInputActionOrigin_XBoxOne_RightStick_Click = 133, + k_EInputActionOrigin_XBoxOne_RightStick_DPadNorth = 134, + k_EInputActionOrigin_XBoxOne_RightStick_DPadSouth = 135, + k_EInputActionOrigin_XBoxOne_RightStick_DPadWest = 136, + k_EInputActionOrigin_XBoxOne_RightStick_DPadEast = 137, + k_EInputActionOrigin_XBoxOne_DPad_North = 138, + k_EInputActionOrigin_XBoxOne_DPad_South = 139, + k_EInputActionOrigin_XBoxOne_DPad_West = 140, + k_EInputActionOrigin_XBoxOne_DPad_East = 141, + k_EInputActionOrigin_XBoxOne_Reserved0 = 142, + k_EInputActionOrigin_XBoxOne_Reserved1 = 143, + k_EInputActionOrigin_XBoxOne_Reserved2 = 144, + k_EInputActionOrigin_XBoxOne_Reserved3 = 145, + k_EInputActionOrigin_XBoxOne_Reserved4 = 146, + k_EInputActionOrigin_XBoxOne_Reserved5 = 147, + k_EInputActionOrigin_XBoxOne_Reserved6 = 148, + k_EInputActionOrigin_XBoxOne_Reserved7 = 149, + k_EInputActionOrigin_XBoxOne_Reserved8 = 150, + k_EInputActionOrigin_XBoxOne_Reserved9 = 151, + k_EInputActionOrigin_XBoxOne_Reserved10 = 152, + k_EInputActionOrigin_XBox360_A = 153, + k_EInputActionOrigin_XBox360_B = 154, + k_EInputActionOrigin_XBox360_X = 155, + k_EInputActionOrigin_XBox360_Y = 156, + k_EInputActionOrigin_XBox360_LeftBumper = 157, + k_EInputActionOrigin_XBox360_RightBumper = 158, + k_EInputActionOrigin_XBox360_Start = 159, + k_EInputActionOrigin_XBox360_Back = 160, + k_EInputActionOrigin_XBox360_LeftTrigger_Pull = 161, + k_EInputActionOrigin_XBox360_LeftTrigger_Click = 162, + k_EInputActionOrigin_XBox360_RightTrigger_Pull = 163, + k_EInputActionOrigin_XBox360_RightTrigger_Click = 164, + k_EInputActionOrigin_XBox360_LeftStick_Move = 165, + k_EInputActionOrigin_XBox360_LeftStick_Click = 166, + k_EInputActionOrigin_XBox360_LeftStick_DPadNorth = 167, + k_EInputActionOrigin_XBox360_LeftStick_DPadSouth = 168, + k_EInputActionOrigin_XBox360_LeftStick_DPadWest = 169, + k_EInputActionOrigin_XBox360_LeftStick_DPadEast = 170, + k_EInputActionOrigin_XBox360_RightStick_Move = 171, + k_EInputActionOrigin_XBox360_RightStick_Click = 172, + k_EInputActionOrigin_XBox360_RightStick_DPadNorth = 173, + k_EInputActionOrigin_XBox360_RightStick_DPadSouth = 174, + k_EInputActionOrigin_XBox360_RightStick_DPadWest = 175, + k_EInputActionOrigin_XBox360_RightStick_DPadEast = 176, + k_EInputActionOrigin_XBox360_DPad_North = 177, + k_EInputActionOrigin_XBox360_DPad_South = 178, + k_EInputActionOrigin_XBox360_DPad_West = 179, + k_EInputActionOrigin_XBox360_DPad_East = 180, + k_EInputActionOrigin_XBox360_Reserved0 = 181, + k_EInputActionOrigin_XBox360_Reserved1 = 182, + k_EInputActionOrigin_XBox360_Reserved2 = 183, + k_EInputActionOrigin_XBox360_Reserved3 = 184, + k_EInputActionOrigin_XBox360_Reserved4 = 185, + k_EInputActionOrigin_XBox360_Reserved5 = 186, + k_EInputActionOrigin_XBox360_Reserved6 = 187, + k_EInputActionOrigin_XBox360_Reserved7 = 188, + k_EInputActionOrigin_XBox360_Reserved8 = 189, + k_EInputActionOrigin_XBox360_Reserved9 = 190, + k_EInputActionOrigin_XBox360_Reserved10 = 191, + k_EInputActionOrigin_Switch_A = 192, + k_EInputActionOrigin_Switch_B = 193, + k_EInputActionOrigin_Switch_X = 194, + k_EInputActionOrigin_Switch_Y = 195, + k_EInputActionOrigin_Switch_LeftBumper = 196, + k_EInputActionOrigin_Switch_RightBumper = 197, + k_EInputActionOrigin_Switch_Plus = 198, + k_EInputActionOrigin_Switch_Minus = 199, + k_EInputActionOrigin_Switch_Capture = 200, + k_EInputActionOrigin_Switch_LeftTrigger_Pull = 201, + k_EInputActionOrigin_Switch_LeftTrigger_Click = 202, + k_EInputActionOrigin_Switch_RightTrigger_Pull = 203, + k_EInputActionOrigin_Switch_RightTrigger_Click = 204, + k_EInputActionOrigin_Switch_LeftStick_Move = 205, + k_EInputActionOrigin_Switch_LeftStick_Click = 206, + k_EInputActionOrigin_Switch_LeftStick_DPadNorth = 207, + k_EInputActionOrigin_Switch_LeftStick_DPadSouth = 208, + k_EInputActionOrigin_Switch_LeftStick_DPadWest = 209, + k_EInputActionOrigin_Switch_LeftStick_DPadEast = 210, + k_EInputActionOrigin_Switch_RightStick_Move = 211, + k_EInputActionOrigin_Switch_RightStick_Click = 212, + k_EInputActionOrigin_Switch_RightStick_DPadNorth = 213, + k_EInputActionOrigin_Switch_RightStick_DPadSouth = 214, + k_EInputActionOrigin_Switch_RightStick_DPadWest = 215, + k_EInputActionOrigin_Switch_RightStick_DPadEast = 216, + k_EInputActionOrigin_Switch_DPad_North = 217, + k_EInputActionOrigin_Switch_DPad_South = 218, + k_EInputActionOrigin_Switch_DPad_West = 219, + k_EInputActionOrigin_Switch_DPad_East = 220, + k_EInputActionOrigin_Switch_ProGyro_Move = 221, + k_EInputActionOrigin_Switch_ProGyro_Pitch = 222, + k_EInputActionOrigin_Switch_ProGyro_Yaw = 223, + k_EInputActionOrigin_Switch_ProGyro_Roll = 224, + k_EInputActionOrigin_Switch_Reserved0 = 225, + k_EInputActionOrigin_Switch_Reserved1 = 226, + k_EInputActionOrigin_Switch_Reserved2 = 227, + k_EInputActionOrigin_Switch_Reserved3 = 228, + k_EInputActionOrigin_Switch_Reserved4 = 229, + k_EInputActionOrigin_Switch_Reserved5 = 230, + k_EInputActionOrigin_Switch_Reserved6 = 231, + k_EInputActionOrigin_Switch_Reserved7 = 232, + k_EInputActionOrigin_Switch_Reserved8 = 233, + k_EInputActionOrigin_Switch_Reserved9 = 234, + k_EInputActionOrigin_Switch_Reserved10 = 235, + k_EInputActionOrigin_Switch_RightGyro_Move = 236, + k_EInputActionOrigin_Switch_RightGyro_Pitch = 237, + k_EInputActionOrigin_Switch_RightGyro_Yaw = 238, + k_EInputActionOrigin_Switch_RightGyro_Roll = 239, + k_EInputActionOrigin_Switch_LeftGyro_Move = 240, + k_EInputActionOrigin_Switch_LeftGyro_Pitch = 241, + k_EInputActionOrigin_Switch_LeftGyro_Yaw = 242, + k_EInputActionOrigin_Switch_LeftGyro_Roll = 243, + k_EInputActionOrigin_Switch_LeftGrip_Lower = 244, + k_EInputActionOrigin_Switch_LeftGrip_Upper = 245, + k_EInputActionOrigin_Switch_RightGrip_Lower = 246, + k_EInputActionOrigin_Switch_RightGrip_Upper = 247, + k_EInputActionOrigin_Switch_Reserved11 = 248, + k_EInputActionOrigin_Switch_Reserved12 = 249, + k_EInputActionOrigin_Switch_Reserved13 = 250, + k_EInputActionOrigin_Switch_Reserved14 = 251, + k_EInputActionOrigin_Switch_Reserved15 = 252, + k_EInputActionOrigin_Switch_Reserved16 = 253, + k_EInputActionOrigin_Switch_Reserved17 = 254, + k_EInputActionOrigin_Switch_Reserved18 = 255, + k_EInputActionOrigin_Switch_Reserved19 = 256, + k_EInputActionOrigin_Switch_Reserved20 = 257, + k_EInputActionOrigin_Count = 258, + k_EInputActionOrigin_MaximumPossibleValue = 32767, +} +public enum EXboxOrigin +{ + k_EXboxOrigin_A = 0, + k_EXboxOrigin_B = 1, + k_EXboxOrigin_X = 2, + k_EXboxOrigin_Y = 3, + k_EXboxOrigin_LeftBumper = 4, + k_EXboxOrigin_RightBumper = 5, + k_EXboxOrigin_Menu = 6, + k_EXboxOrigin_View = 7, + k_EXboxOrigin_LeftTrigger_Pull = 8, + k_EXboxOrigin_LeftTrigger_Click = 9, + k_EXboxOrigin_RightTrigger_Pull = 10, + k_EXboxOrigin_RightTrigger_Click = 11, + k_EXboxOrigin_LeftStick_Move = 12, + k_EXboxOrigin_LeftStick_Click = 13, + k_EXboxOrigin_LeftStick_DPadNorth = 14, + k_EXboxOrigin_LeftStick_DPadSouth = 15, + k_EXboxOrigin_LeftStick_DPadWest = 16, + k_EXboxOrigin_LeftStick_DPadEast = 17, + k_EXboxOrigin_RightStick_Move = 18, + k_EXboxOrigin_RightStick_Click = 19, + k_EXboxOrigin_RightStick_DPadNorth = 20, + k_EXboxOrigin_RightStick_DPadSouth = 21, + k_EXboxOrigin_RightStick_DPadWest = 22, + k_EXboxOrigin_RightStick_DPadEast = 23, + k_EXboxOrigin_DPad_North = 24, + k_EXboxOrigin_DPad_South = 25, + k_EXboxOrigin_DPad_West = 26, + k_EXboxOrigin_DPad_East = 27, + k_EXboxOrigin_Count = 28, +} public enum ESteamControllerPad { k_ESteamControllerPad_Left = 0, k_ESteamControllerPad_Right = 1, } +public enum ESteamInputType +{ + k_ESteamInputType_Unknown = 0, + k_ESteamInputType_SteamController = 1, + k_ESteamInputType_XBox360Controller = 2, + k_ESteamInputType_XBoxOneController = 3, + k_ESteamInputType_GenericGamepad = 4, + k_ESteamInputType_PS4Controller = 5, + k_ESteamInputType_AppleMFiController = 6, + k_ESteamInputType_AndroidController = 7, + k_ESteamInputType_SwitchJoyConPair = 8, + k_ESteamInputType_SwitchJoyConSingle = 9, + k_ESteamInputType_SwitchProController = 10, + k_ESteamInputType_MobileTouch = 11, + k_ESteamInputType_PS3Controller = 12, + k_ESteamInputType_Count = 13, + k_ESteamInputType_MaximumPossibleValue = 255, +} +public enum ESteamInputLEDFlag +{ + k_ESteamInputLEDFlag_SetColor = 0, + k_ESteamInputLEDFlag_RestoreUserDefault = 1, +} public enum EControllerSource { k_EControllerSource_None = 0, @@ -9405,13 +10669,16 @@ public enum EControllerSource k_EControllerSource_Switch = 5, k_EControllerSource_LeftTrigger = 6, k_EControllerSource_RightTrigger = 7, - k_EControllerSource_Gyro = 8, - k_EControllerSource_CenterTrackpad = 9, - k_EControllerSource_RightJoystick = 10, - k_EControllerSource_DPad = 11, - k_EControllerSource_Key = 12, - k_EControllerSource_Mouse = 13, - k_EControllerSource_Count = 14, + k_EControllerSource_LeftBumper = 8, + k_EControllerSource_RightBumper = 9, + k_EControllerSource_Gyro = 10, + k_EControllerSource_CenterTrackpad = 11, + k_EControllerSource_RightJoystick = 12, + k_EControllerSource_DPad = 13, + k_EControllerSource_Key = 14, + k_EControllerSource_Mouse = 15, + k_EControllerSource_LeftGyro = 16, + k_EControllerSource_Count = 17, } public enum EControllerSourceMode { @@ -9589,9 +10856,9 @@ public enum EControllerActionOrigin k_EControllerActionOrigin_SteamV2_Y = 151, k_EControllerActionOrigin_SteamV2_LeftBumper = 152, k_EControllerActionOrigin_SteamV2_RightBumper = 153, - k_EControllerActionOrigin_SteamV2_LeftGrip = 154, - k_EControllerActionOrigin_SteamV2_RightGrip = 155, - k_EControllerActionOrigin_SteamV2_LeftGrip_Upper = 156, + k_EControllerActionOrigin_SteamV2_LeftGrip_Lower = 154, + k_EControllerActionOrigin_SteamV2_LeftGrip_Upper = 155, + k_EControllerActionOrigin_SteamV2_RightGrip_Lower = 156, k_EControllerActionOrigin_SteamV2_RightGrip_Upper = 157, k_EControllerActionOrigin_SteamV2_LeftBumper_Pressure = 158, k_EControllerActionOrigin_SteamV2_RightBumper_Pressure = 159, @@ -9631,22 +10898,59 @@ public enum EControllerActionOrigin k_EControllerActionOrigin_SteamV2_Gyro_Pitch = 193, k_EControllerActionOrigin_SteamV2_Gyro_Yaw = 194, k_EControllerActionOrigin_SteamV2_Gyro_Roll = 195, - k_EControllerActionOrigin_Count = 196, + k_EControllerActionOrigin_Switch_A = 196, + k_EControllerActionOrigin_Switch_B = 197, + k_EControllerActionOrigin_Switch_X = 198, + k_EControllerActionOrigin_Switch_Y = 199, + k_EControllerActionOrigin_Switch_LeftBumper = 200, + k_EControllerActionOrigin_Switch_RightBumper = 201, + k_EControllerActionOrigin_Switch_Plus = 202, + k_EControllerActionOrigin_Switch_Minus = 203, + k_EControllerActionOrigin_Switch_Capture = 204, + k_EControllerActionOrigin_Switch_LeftTrigger_Pull = 205, + k_EControllerActionOrigin_Switch_LeftTrigger_Click = 206, + k_EControllerActionOrigin_Switch_RightTrigger_Pull = 207, + k_EControllerActionOrigin_Switch_RightTrigger_Click = 208, + k_EControllerActionOrigin_Switch_LeftStick_Move = 209, + k_EControllerActionOrigin_Switch_LeftStick_Click = 210, + k_EControllerActionOrigin_Switch_LeftStick_DPadNorth = 211, + k_EControllerActionOrigin_Switch_LeftStick_DPadSouth = 212, + k_EControllerActionOrigin_Switch_LeftStick_DPadWest = 213, + k_EControllerActionOrigin_Switch_LeftStick_DPadEast = 214, + k_EControllerActionOrigin_Switch_RightStick_Move = 215, + k_EControllerActionOrigin_Switch_RightStick_Click = 216, + k_EControllerActionOrigin_Switch_RightStick_DPadNorth = 217, + k_EControllerActionOrigin_Switch_RightStick_DPadSouth = 218, + k_EControllerActionOrigin_Switch_RightStick_DPadWest = 219, + k_EControllerActionOrigin_Switch_RightStick_DPadEast = 220, + k_EControllerActionOrigin_Switch_DPad_North = 221, + k_EControllerActionOrigin_Switch_DPad_South = 222, + k_EControllerActionOrigin_Switch_DPad_West = 223, + k_EControllerActionOrigin_Switch_DPad_East = 224, + k_EControllerActionOrigin_Switch_ProGyro_Move = 225, + k_EControllerActionOrigin_Switch_ProGyro_Pitch = 226, + k_EControllerActionOrigin_Switch_ProGyro_Yaw = 227, + k_EControllerActionOrigin_Switch_ProGyro_Roll = 228, + k_EControllerActionOrigin_Switch_RightGyro_Move = 229, + k_EControllerActionOrigin_Switch_RightGyro_Pitch = 230, + k_EControllerActionOrigin_Switch_RightGyro_Yaw = 231, + k_EControllerActionOrigin_Switch_RightGyro_Roll = 232, + k_EControllerActionOrigin_Switch_LeftGyro_Move = 233, + k_EControllerActionOrigin_Switch_LeftGyro_Pitch = 234, + k_EControllerActionOrigin_Switch_LeftGyro_Yaw = 235, + k_EControllerActionOrigin_Switch_LeftGyro_Roll = 236, + k_EControllerActionOrigin_Switch_LeftGrip_Lower = 237, + k_EControllerActionOrigin_Switch_LeftGrip_Upper = 238, + k_EControllerActionOrigin_Switch_RightGrip_Lower = 239, + k_EControllerActionOrigin_Switch_RightGrip_Upper = 240, + k_EControllerActionOrigin_Count = 241, + k_EControllerActionOrigin_MaximumPossibleValue = 32767, } public enum ESteamControllerLEDFlag { k_ESteamControllerLEDFlag_SetColor = 0, k_ESteamControllerLEDFlag_RestoreUserDefault = 1, } -public enum ESteamInputType -{ - k_ESteamInputType_Unknown = 0, - k_ESteamInputType_SteamController = 1, - k_ESteamInputType_XBox360Controller = 2, - k_ESteamInputType_XBoxOneController = 3, - k_ESteamInputType_GenericXInput = 4, - k_ESteamInputType_PS4Controller = 5, -} public enum EUGCMatchingUGCType { k_EUGCMatchingUGCType_Items = 0, @@ -9862,6 +11166,60 @@ public enum EParentalFeature public char m_u16; public double m_d; } +[StructLayout(LayoutKind.Sequential)] public struct CCallbackBase +{ + public byte m_nCallbackFlags; + public int m_iCallback; +} +[StructLayout(LayoutKind.Sequential)] public struct CCallResult +{ + public ulong m_hAPICall; + public IntPtr m_pObj; // T * + public IntPtr m_Func; +} +[StructLayout(LayoutKind.Sequential)] public struct CCallback +{ + public IntPtr m_pObj; // T * + public IntPtr m_Func; +} +[StructLayout(LayoutKind.Sequential)] public struct CSteamAPIContext +{ + public IntPtr m_pSteamClient; // class ISteamClient * + public IntPtr m_pSteamUser; // class ISteamUser * + public IntPtr m_pSteamFriends; // class ISteamFriends * + public IntPtr m_pSteamUtils; // class ISteamUtils * + public IntPtr m_pSteamMatchmaking; // class ISteamMatchmaking * + public IntPtr m_pSteamGameSearch; // class ISteamGameSearch * + public IntPtr m_pSteamUserStats; // class ISteamUserStats * + public IntPtr m_pSteamApps; // class ISteamApps * + public IntPtr m_pSteamMatchmakingServers; // class ISteamMatchmakingServers * + public IntPtr m_pSteamNetworking; // class ISteamNetworking * + public IntPtr m_pSteamRemoteStorage; // class ISteamRemoteStorage * + public IntPtr m_pSteamScreenshots; // class ISteamScreenshots * + public IntPtr m_pSteamHTTP; // class ISteamHTTP * + public IntPtr m_pController; // class ISteamController * + public IntPtr m_pSteamUGC; // class ISteamUGC * + public IntPtr m_pSteamAppList; // class ISteamAppList * + public IntPtr m_pSteamMusic; // class ISteamMusic * + public IntPtr m_pSteamMusicRemote; // class ISteamMusicRemote * + public IntPtr m_pSteamHTMLSurface; // class ISteamHTMLSurface * + public IntPtr m_pSteamInventory; // class ISteamInventory * + public IntPtr m_pSteamVideo; // class ISteamVideo * + public IntPtr m_pSteamParentalSettings; // class ISteamParentalSettings * + public IntPtr m_pSteamInput; // class ISteamInput * +} +[StructLayout(LayoutKind.Sequential)] public struct CSteamGameServerAPIContext +{ + public IntPtr m_pSteamClient; // class ISteamClient * + public IntPtr m_pSteamGameServer; // class ISteamGameServer * + public IntPtr m_pSteamGameServerUtils; // class ISteamUtils * + public IntPtr m_pSteamGameServerNetworking; // class ISteamNetworking * + public IntPtr m_pSteamGameServerStats; // class ISteamGameServerStats * + public IntPtr m_pSteamHTTP; // class ISteamHTTP * + public IntPtr m_pSteamInventory; // class ISteamInventory * + public IntPtr m_pSteamUGC; // class ISteamUGC * + public IntPtr m_pSteamApps; // class ISteamApps * +} [StructLayout(LayoutKind.Sequential)] public struct CallbackMsg_t { public uint m_hSteamUser; @@ -9918,6 +11276,15 @@ public enum EParentalFeature [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 512)] public string m_szURL; //char[512] } +[StructLayout(LayoutKind.Sequential)] public struct MarketEligibilityResponse_t +{ + [MarshalAs(UnmanagedType.I1)] + public bool m_bAllowed; + public EMarketNotAllowedReasonFlags m_eNotAllowedReason; + public ulong m_rtAllowedAtTime; + public int m_cdaySteamGuardRequiredDays; + public int m_cdayNewDeviceCooldown; +} [StructLayout(LayoutKind.Sequential)] public struct FriendGameInfo_t { public ulong m_gameID; @@ -10103,6 +11470,11 @@ public enum EParentalFeature public string m_szGameTags; //char[128] public ulong m_steamID; } +[StructLayout(LayoutKind.Sequential)] public struct SteamPartyBeaconLocation_t +{ + public ESteamPartyBeaconLocationType m_eType; + public ulong m_ulLocationID; +} [StructLayout(LayoutKind.Sequential)] public struct FavoritesListChanged_t { public uint m_nIP; @@ -10180,6 +11552,82 @@ public enum EParentalFeature { public EResult m_eResult; } +[StructLayout(LayoutKind.Sequential)] public struct SearchForGameProgressCallback_t +{ + public ulong m_ullSearchID; + public EResult m_eResult; + public ulong m_lobbyID; + public ulong m_steamIDEndedSearch; + public int m_nSecondsRemainingEstimate; + public int m_cPlayersSearching; +} +[StructLayout(LayoutKind.Sequential)] public struct SearchForGameResultCallback_t +{ + public ulong m_ullSearchID; + public EResult m_eResult; + public int m_nCountPlayersInGame; + public int m_nCountAcceptedGame; + public ulong m_steamIDHost; + [MarshalAs(UnmanagedType.I1)] + public bool m_bFinalCallback; +} +[StructLayout(LayoutKind.Sequential)] public struct RequestPlayersForGameProgressCallback_t +{ + public EResult m_eResult; + public ulong m_ullSearchID; +} +[StructLayout(LayoutKind.Sequential)] public struct RequestPlayersForGameResultCallback_t +{ + public EResult m_eResult; + public ulong m_ullSearchID; + public ulong m_SteamIDPlayerFound; + public ulong m_SteamIDLobby; + public PlayerAcceptState_t m_ePlayerAcceptState; + public int m_nPlayerIndex; + public int m_nTotalPlayersFound; + public int m_nTotalPlayersAcceptedGame; + public int m_nSuggestedTeamIndex; + public ulong m_ullUniqueGameID; +} +[StructLayout(LayoutKind.Sequential)] public struct RequestPlayersForGameFinalResultCallback_t +{ + public EResult m_eResult; + public ulong m_ullSearchID; + public ulong m_ullUniqueGameID; +} +[StructLayout(LayoutKind.Sequential)] public struct SubmitPlayerResultResultCallback_t +{ + public EResult m_eResult; + public ulong ullUniqueGameID; + public ulong steamIDPlayer; +} +[StructLayout(LayoutKind.Sequential)] public struct EndGameResultCallback_t +{ + public EResult m_eResult; + public ulong ullUniqueGameID; +} +[StructLayout(LayoutKind.Sequential)] public struct JoinPartyCallback_t +{ + public EResult m_eResult; + public ulong m_ulBeaconID; + public ulong m_SteamIDBeaconOwner; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] + public string m_rgchConnectString; //char[256] +} +[StructLayout(LayoutKind.Sequential)] public struct CreateBeaconCallback_t +{ + public EResult m_eResult; + public ulong m_ulBeaconID; +} +[StructLayout(LayoutKind.Sequential)] public struct ReservationNotificationCallback_t +{ + public ulong m_ulBeaconID; + public ulong m_steamIDJoiner; +} +[StructLayout(LayoutKind.Sequential)] public struct ChangeNumOpenSlotsCallback_t +{ + public EResult m_eResult; +} [StructLayout(LayoutKind.Sequential)] public struct SteamParamStringArray_t { public IntPtr m_ppStrings; // const char ** @@ -10548,33 +11996,33 @@ public enum EParentalFeature public uint m_hLocal; public EResult m_eResult; } -[StructLayout(LayoutKind.Sequential)] public struct SteamCallback_t +[StructLayout(LayoutKind.Sequential)] public struct VolumeHasChanged_t { public float m_flNewVolume; } -[StructLayout(LayoutKind.Sequential)] public struct SteamCallback_t +[StructLayout(LayoutKind.Sequential)] public struct MusicPlayerWantsShuffled_t { [MarshalAs(UnmanagedType.I1)] public bool m_bShuffled; } -[StructLayout(LayoutKind.Sequential)] public struct SteamCallback_t +[StructLayout(LayoutKind.Sequential)] public struct MusicPlayerWantsLooped_t { [MarshalAs(UnmanagedType.I1)] public bool m_bLooped; } -[StructLayout(LayoutKind.Sequential)] public struct SteamCallback_t +[StructLayout(LayoutKind.Sequential)] public struct MusicPlayerWantsVolume_t { public float m_flNewVolume; } -[StructLayout(LayoutKind.Sequential)] public struct SteamCallback_t +[StructLayout(LayoutKind.Sequential)] public struct MusicPlayerSelectsQueueEntry_t { public int nID; } -[StructLayout(LayoutKind.Sequential)] public struct SteamCallback_t +[StructLayout(LayoutKind.Sequential)] public struct MusicPlayerSelectsPlaylistEntry_t { public int nID; } -[StructLayout(LayoutKind.Sequential)] public struct SteamCallback_t +[StructLayout(LayoutKind.Sequential)] public struct MusicPlayerWantsPlayingRepeatStatus_t { public int m_nPlayingRepeatStatus; } @@ -10599,34 +12047,6 @@ public enum EParentalFeature public uint m_cOffset; public uint m_cBytesReceived; } -[StructLayout(LayoutKind.Sequential)] public struct ControllerAnalogActionData_t -{ - public EControllerSourceMode eMode; - public float x; - public float y; - [MarshalAs(UnmanagedType.I1)] - public bool bActive; -} -[StructLayout(LayoutKind.Sequential)] public struct ControllerDigitalActionData_t -{ - [MarshalAs(UnmanagedType.I1)] - public bool bState; - [MarshalAs(UnmanagedType.I1)] - public bool bActive; -} -[StructLayout(LayoutKind.Sequential)] public struct ControllerMotionData_t -{ - public float rotQuatX; - public float rotQuatY; - public float rotQuatZ; - public float rotQuatW; - public float posAccelX; - public float posAccelY; - public float posAccelZ; - public float rotVelX; - public float rotVelY; - public float rotVelZ; -} [StructLayout(LayoutKind.Sequential)] public struct SteamUGCDetails_t { public ulong m_nPublishedFileId; @@ -10672,6 +12092,8 @@ public enum EParentalFeature public uint m_unTotalMatchingResults; [MarshalAs(UnmanagedType.I1)] public bool m_bCachedData; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] + public string m_rgchNextCursor; //char[256] } [StructLayout(LayoutKind.Sequential)] public struct SteamUGCRequestUGCDetailsResult_t { @@ -10770,11 +12192,11 @@ public enum EParentalFeature public EResult m_eResult; public ulong m_nPublishedFileId; } -[StructLayout(LayoutKind.Sequential)] public struct SteamCallback_t +[StructLayout(LayoutKind.Sequential)] public struct SteamAppInstalled_t { public uint m_nAppID; } -[StructLayout(LayoutKind.Sequential)] public struct SteamCallback_t +[StructLayout(LayoutKind.Sequential)] public struct SteamAppUninstalled_t { public uint m_nAppID; } @@ -10906,7 +12328,7 @@ public enum EParentalFeature public uint unY; public uint unWide; public uint unTall; - public uint unNewWindow_BrowserHandle; + public uint unNewWindow_BrowserHandle_IGNORE; } [StructLayout(LayoutKind.Sequential)] public struct HTML_SetCursor_t { @@ -10973,62 +12395,22 @@ public enum EParentalFeature [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)] public string m_rgchCurrency; //char[4] } -[StructLayout(LayoutKind.Sequential)] public struct SteamCallback_t +[StructLayout(LayoutKind.Sequential)] public struct BroadcastUploadStop_t { public EBroadcastUploadResult m_eResult; } -[StructLayout(LayoutKind.Sequential)] public struct SteamCallback_t +[StructLayout(LayoutKind.Sequential)] public struct GetVideoURLResult_t { public EResult m_eResult; public uint m_unVideoAppID; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] public string m_rgchURL; //char[256] } -[StructLayout(LayoutKind.Sequential)] public struct SteamCallback_t +[StructLayout(LayoutKind.Sequential)] public struct GetOPFSettingsResult_t { public EResult m_eResult; public uint m_unVideoAppID; } -[StructLayout(LayoutKind.Sequential)] public struct CSteamAPIContext -{ - public IntPtr m_pSteamClient; // class ISteamClient * - public IntPtr m_pSteamUser; // class ISteamUser * - public IntPtr m_pSteamFriends; // class ISteamFriends * - public IntPtr m_pSteamUtils; // class ISteamUtils * - public IntPtr m_pSteamMatchmaking; // class ISteamMatchmaking * - public IntPtr m_pSteamUserStats; // class ISteamUserStats * - public IntPtr m_pSteamApps; // class ISteamApps * - public IntPtr m_pSteamMatchmakingServers; // class ISteamMatchmakingServers * - public IntPtr m_pSteamNetworking; // class ISteamNetworking * - public IntPtr m_pSteamRemoteStorage; // class ISteamRemoteStorage * - public IntPtr m_pSteamScreenshots; // class ISteamScreenshots * - public IntPtr m_pSteamHTTP; // class ISteamHTTP * - public IntPtr m_pController; // class ISteamController * - public IntPtr m_pSteamUGC; // class ISteamUGC * - public IntPtr m_pSteamAppList; // class ISteamAppList * - public IntPtr m_pSteamMusic; // class ISteamMusic * - public IntPtr m_pSteamMusicRemote; // class ISteamMusicRemote * - public IntPtr m_pSteamHTMLSurface; // class ISteamHTMLSurface * - public IntPtr m_pSteamInventory; // class ISteamInventory * - public IntPtr m_pSteamVideo; // class ISteamVideo * - public IntPtr m_pSteamParentalSettings; // class ISteamParentalSettings * -} -[StructLayout(LayoutKind.Sequential)] public struct CCallbackBase -{ - public byte m_nCallbackFlags; - public int m_iCallback; -} -[StructLayout(LayoutKind.Sequential)] public struct CCallResult -{ - public ulong m_hAPICall; - public IntPtr m_pObj; // T * - public IntPtr m_Func; -} -[StructLayout(LayoutKind.Sequential)] public struct CCallback -{ - public IntPtr m_pObj; // T * - public IntPtr m_Func; -} [StructLayout(LayoutKind.Sequential)] public struct GSClientApprove_t { public ulong m_SteamID; @@ -11147,6 +12529,8 @@ public static void UnregisterCallback(IntPtr pCallback) public const int k_iSteamAppsCallbacks = 1000; public const int k_iSteamUserStatsCallbacks = 1100; public const int k_iSteamNetworkingCallbacks = 1200; +public const int k_iSteamNetworkingSocketsCallbacks = 1220; +public const int k_iSteamNetworkingMessagesCallbacks = 1250; public const int k_iClientRemoteStorageCallbacks = 1300; public const int k_iClientDepotBuilderCallbacks = 1400; public const int k_iSteamGameServerItemsCallbacks = 1500; @@ -11186,9 +12570,12 @@ public static void UnregisterCallback(IntPtr pCallback) public const int k_iClientSharedConnectionCallbacks = 4900; public const int k_ISteamParentalSettingsCallbacks = 5000; public const int k_iClientShaderCallbacks = 5100; +public const int k_iSteamGameSearchCallbacks = 5200; +public const int k_iSteamPartiesCallbacks = 5300; +public const int k_iClientPartiesCallbacks = 5400; public const int k_cchPersonaNameMax = 128; public const int k_cwchPersonaNameMax = 32; -public const int k_cchMaxRichPresenceKeys = 20; +public const int k_cchMaxRichPresenceKeys = 30; public const int k_cchMaxRichPresenceKeyLength = 64; public const int k_cchMaxRichPresenceValueLength = 256; public const int k_cchStatNameMax = 128; @@ -11246,6 +12633,16 @@ public static ISteamMatchmakingServers SteamMatchmakingServers() return new CSteamMatchmakingServers(SteamAPIInterop.SteamMatchmakingServers()); } +public static ISteamGameSearch SteamGameSearch() +{ +return new CSteamGameSearch(SteamAPIInterop.SteamGameSearch()); +} + +public static ISteamParties SteamParties() +{ +return new CSteamParties(SteamAPIInterop.SteamParties()); +} + public static ISteamRemoteStorage SteamRemoteStorage() { return new CSteamRemoteStorage(SteamAPIInterop.SteamRemoteStorage()); @@ -11286,6 +12683,11 @@ public static ISteamHTTP SteamHTTP() return new CSteamHTTP(SteamAPIInterop.SteamHTTP()); } +public static ISteamInput SteamInput() +{ +return new CSteamInput(SteamAPIInterop.SteamInput()); +} + public static ISteamController SteamController() { return new CSteamController(SteamAPIInterop.SteamController()); diff --git a/Generator/steam_sdk/steam_gameserver.h b/Generator/steam_sdk/steam_gameserver.h index c6bdd52..bec600d 100644 --- a/Generator/steam_sdk/steam_gameserver.h +++ b/Generator/steam_sdk/steam_gameserver.h @@ -22,12 +22,17 @@ enum EServerMode eServerModeAuthenticationAndSecure = 3, // Authenticate users, list on the server list and VAC protect clients }; -// Initialize ISteamGameServer interface object, and set server properties which may not be changed. +// Initialize SteamGameServer client and interface objects, and set server properties which may not be changed. // // After calling this function, you should set any additional server parameters, and then // call ISteamGameServer::LogOnAnonymous() or ISteamGameServer::LogOn() // // - usSteamPort is the local port used to communicate with the steam servers. +// NOTE: unless you are using ver old Steam client binaries, this parameter is ignored, and +// you should pass 0. Gameservers now always use WebSockets to talk to Steam. +// This protocol is TCP-based and thus always uses an ephemeral local port. +// Older steam client binaries used UDP to talk to Steam, and this argument was useful. +// A future version of the SDK will remove this argument. // - usGamePort is the port that clients will connect to for gameplay. // - usQueryPort is the port that will manage server browser related duties and info // pings from clients. If you pass MASTERSERVERUPDATERPORT_USEGAMESOCKETSHARE for usQueryPort, then it @@ -35,11 +40,10 @@ enum EServerMode // UDP packets for the master server updater. See references to GameSocketShare in isteamgameserver.h. // - The version string is usually in the form x.x.x.x, and is used by the master server to detect when the // server is out of date. (Only servers with the latest version will be listed.) - inline bool SteamGameServer_Init( uint32 unIP, uint16 usSteamPort, uint16 usGamePort, uint16 usQueryPort, EServerMode eServerMode, const char *pchVersionString ); +// Shutdown SteamGameSeverXxx interfaces, log out, and free resources. S_API void SteamGameServer_Shutdown(); -S_API void SteamGameServer_RunCallbacks(); // Most Steam API functions allocate some amount of thread-local memory for // parameter storage. Calling SteamGameServer_ReleaseCurrentThreadMemory() @@ -51,56 +55,6 @@ inline void SteamGameServer_ReleaseCurrentThreadMemory(); S_API bool SteamGameServer_BSecure(); S_API uint64 SteamGameServer_GetSteamID(); - -//----------------------------------------------------------------------------------------------------------------------------------------------------------// -// Global accessors for game server C++ APIs. See individual isteam*.h files for details. -// You should not cache the results of these accessors or pass the result pointers across -// modules! Different modules may be compiled against different SDK header versions, and -// the interface pointers could therefore be different across modules. Every line of code -// which calls into a Steamworks API should retrieve the interface from a global accessor. -//----------------------------------------------------------------------------------------------------------------------------------------------------------// -#if !defined( STEAM_API_EXPORTS ) -inline ISteamClient *SteamGameServerClient(); -inline ISteamGameServer *SteamGameServer(); -inline ISteamUtils *SteamGameServerUtils(); -inline ISteamNetworking *SteamGameServerNetworking(); -inline ISteamGameServerStats *SteamGameServerStats(); -inline ISteamHTTP *SteamGameServerHTTP(); -inline ISteamInventory *SteamGameServerInventory(); -inline ISteamUGC *SteamGameServerUGC(); -inline ISteamApps *SteamGameServerApps(); -#endif - -class CSteamGameServerAPIContext -{ -public: - CSteamGameServerAPIContext() { Clear(); } - inline void Clear(); - inline bool Init(); - - ISteamClient *SteamClient() const { return m_pSteamClient; } - ISteamGameServer *SteamGameServer() const { return m_pSteamGameServer; } - ISteamUtils *SteamGameServerUtils() const { return m_pSteamGameServerUtils; } - ISteamNetworking *SteamGameServerNetworking() const { return m_pSteamGameServerNetworking; } - ISteamGameServerStats *SteamGameServerStats() const { return m_pSteamGameServerStats; } - ISteamHTTP *SteamHTTP() const { return m_pSteamHTTP; } - ISteamInventory *SteamInventory() const { return m_pSteamInventory; } - ISteamUGC *SteamUGC() const { return m_pSteamUGC; } - ISteamApps *SteamApps() const { return m_pSteamApps; } - -private: - ISteamClient *m_pSteamClient; - ISteamGameServer *m_pSteamGameServer; - ISteamUtils *m_pSteamGameServerUtils; - ISteamNetworking *m_pSteamGameServerNetworking; - ISteamGameServerStats *m_pSteamGameServerStats; - ISteamHTTP *m_pSteamHTTP; - ISteamInventory *m_pSteamInventory; - ISteamUGC *m_pSteamUGC; - ISteamApps *m_pSteamApps; -}; - - // Older SDKs exported this global pointer, but it is no longer supported. // You should use SteamGameServerClient() or CSteamGameServerAPIContext to // safely access the ISteamClient APIs from your game server application. @@ -110,122 +64,37 @@ private: // is no longer supported. Use SteamGameServer_Init instead. //S_API void S_CALLTYPE SteamGameServer_InitSafe(); - -//----------------------------------------------------------------------------------------------------------------------------------------------------------// -// These macros are similar to the STEAM_CALLBACK_* macros in steam_api.h, but only trigger for gameserver callbacks -//----------------------------------------------------------------------------------------------------------------------------------------------------------// -#define STEAM_GAMESERVER_CALLBACK( thisclass, func, /*callback_type, [deprecated] var*/... ) \ - _STEAM_CALLBACK_SELECT( ( __VA_ARGS__, GS, 3 ), ( this->SetGameserverFlag();, thisclass, func, __VA_ARGS__ ) ) - -#define STEAM_GAMESERVER_CALLBACK_MANUAL( thisclass, func, callback_type, var ) \ - CCallbackManual< thisclass, callback_type, true > var; void func( callback_type *pParam ) - - -#define _STEAM_CALLBACK_GS( _, thisclass, func, param, var ) \ - CCallback< thisclass, param, true > var; void func( param *pParam ) - -//----------------------------------------------------------------------------------------------------------------------------------------------------------// -// steamclient.dll private wrapper functions +//============================================================================= // -// The following functions are part of abstracting API access to the steamclient.dll, but should only be used in very specific cases -//----------------------------------------------------------------------------------------------------------------------------------------------------------// -S_API HSteamPipe S_CALLTYPE SteamGameServer_GetHSteamPipe(); -S_API HSteamUser S_CALLTYPE SteamGameServer_GetHSteamUser(); -S_API bool S_CALLTYPE SteamInternal_GameServer_Init( uint32 unIP, uint16 usPort, uint16 usGamePort, uint16 usQueryPort, EServerMode eServerMode, const char *pchVersionString ); - - -#if !defined( STEAM_API_EXPORTS ) -inline void S_CALLTYPE SteamGameServerInternal_OnContextInit( void* p ) -{ - ((CSteamGameServerAPIContext*)p)->Clear(); - if ( SteamGameServer_GetHSteamPipe() ) - ((CSteamGameServerAPIContext*)p)->Init(); -} -inline CSteamGameServerAPIContext& SteamGameServerInternal_ModuleContext() -{ - // SteamInternal_ContextInit takes a base pointer for the equivalent of - // struct { void (*pFn)(void* pCtx); uintp counter; CSteamAPIContext ctx; } - // Do not change layout of 2 + sizeof... or add non-pointer aligned data! - // NOTE: declaring "static CSteamAPIConext" creates a large function - // which queries the initialization status of the object. We know that - // it is pointer-aligned and fully memset with zeros, so just alias a - // static buffer of the appropriate size and call it a CSteamAPIContext. - static void* s_CallbackCounterAndContext[2 + sizeof( CSteamGameServerAPIContext ) / sizeof( void* )] = { (void*)&SteamGameServerInternal_OnContextInit, 0 }; - return *(CSteamGameServerAPIContext*)SteamInternal_ContextInit( s_CallbackCounterAndContext ); -} -inline ISteamClient *SteamGameServerClient() { return SteamGameServerInternal_ModuleContext().SteamClient(); } -inline ISteamGameServer *SteamGameServer() { return SteamGameServerInternal_ModuleContext().SteamGameServer(); } -inline ISteamUtils *SteamGameServerUtils() { return SteamGameServerInternal_ModuleContext().SteamGameServerUtils(); } -inline ISteamNetworking *SteamGameServerNetworking() { return SteamGameServerInternal_ModuleContext().SteamGameServerNetworking(); } -inline ISteamGameServerStats *SteamGameServerStats() { return SteamGameServerInternal_ModuleContext().SteamGameServerStats(); } -inline ISteamHTTP *SteamGameServerHTTP() { return SteamGameServerInternal_ModuleContext().SteamHTTP(); } -inline ISteamInventory *SteamGameServerInventory() { return SteamGameServerInternal_ModuleContext().SteamInventory(); } -inline ISteamUGC *SteamGameServerUGC() { return SteamGameServerInternal_ModuleContext().SteamUGC(); } -inline ISteamApps *SteamGameServerApps() { return SteamGameServerInternal_ModuleContext().SteamApps(); } -#endif // !defined( STEAM_API_EXPORTS ) - - -inline void CSteamGameServerAPIContext::Clear() -{ - m_pSteamClient = NULL; - m_pSteamGameServer = NULL; - m_pSteamGameServerUtils = NULL; - m_pSteamGameServerNetworking = NULL; - m_pSteamGameServerStats = NULL; - m_pSteamHTTP = NULL; - m_pSteamInventory = NULL; - m_pSteamUGC = NULL; - m_pSteamApps = NULL; -} +// Internal implementation details below +// +//============================================================================= +#ifndef STEAM_API_EXPORTS // This function must be declared inline in the header so the module using steam_api.dll gets the version names they want. inline bool CSteamGameServerAPIContext::Init() { - HSteamUser hSteamUser = SteamGameServer_GetHSteamUser(); - HSteamPipe hSteamPipe = SteamGameServer_GetHSteamPipe(); - if ( !hSteamPipe ) - return false; - - m_pSteamClient = (ISteamClient*) SteamInternal_CreateInterface( STEAMCLIENT_INTERFACE_VERSION ); + m_pSteamClient = ::SteamGameServerClient(); if ( !m_pSteamClient ) return false; - - m_pSteamGameServer = m_pSteamClient->GetISteamGameServer( hSteamUser, hSteamPipe, STEAMGAMESERVER_INTERFACE_VERSION ); - if ( !m_pSteamGameServer ) - return false; - m_pSteamGameServerUtils = m_pSteamClient->GetISteamUtils( hSteamPipe, STEAMUTILS_INTERFACE_VERSION ); - if ( !m_pSteamGameServerUtils ) - return false; - - m_pSteamGameServerNetworking = m_pSteamClient->GetISteamNetworking( hSteamUser, hSteamPipe, STEAMNETWORKING_INTERFACE_VERSION ); - if ( !m_pSteamGameServerNetworking ) - return false; - - m_pSteamGameServerStats = m_pSteamClient->GetISteamGameServerStats( hSteamUser, hSteamPipe, STEAMGAMESERVERSTATS_INTERFACE_VERSION ); - if ( !m_pSteamGameServerStats ) - return false; - - m_pSteamHTTP = m_pSteamClient->GetISteamHTTP( hSteamUser, hSteamPipe, STEAMHTTP_INTERFACE_VERSION ); - if ( !m_pSteamHTTP ) - return false; - - m_pSteamInventory = m_pSteamClient->GetISteamInventory( hSteamUser, hSteamPipe, STEAMINVENTORY_INTERFACE_VERSION ); - if ( !m_pSteamInventory ) - return false; - - m_pSteamUGC = m_pSteamClient->GetISteamUGC( hSteamUser, hSteamPipe, STEAMUGC_INTERFACE_VERSION ); - if ( !m_pSteamUGC ) - return false; - - m_pSteamApps = m_pSteamClient->GetISteamApps( hSteamUser, hSteamPipe, STEAMAPPS_INTERFACE_VERSION ); - if ( !m_pSteamApps ) + m_pSteamGameServer = ::SteamGameServer(); + m_pSteamGameServerUtils = ::SteamGameServerUtils(); + m_pSteamGameServerNetworking = ::SteamGameServerNetworking(); + m_pSteamGameServerStats = ::SteamGameServerStats(); + m_pSteamHTTP = ::SteamGameServerHTTP(); + m_pSteamInventory = ::SteamGameServerInventory(); + m_pSteamUGC = ::SteamGameServerUGC(); + m_pSteamApps = ::SteamGameServerApps(); + if ( !m_pSteamGameServer || !m_pSteamGameServerUtils || !m_pSteamGameServerNetworking || !m_pSteamGameServerStats + || !m_pSteamHTTP || !m_pSteamInventory || !m_pSteamUGC || !m_pSteamApps ) return false; return true; } +#endif - +S_API bool S_CALLTYPE SteamInternal_GameServer_Init( uint32 unIP, uint16 usPort, uint16 usGamePort, uint16 usQueryPort, EServerMode eServerMode, const char *pchVersionString ); inline bool SteamGameServer_Init( uint32 unIP, uint16 usSteamPort, uint16 usGamePort, uint16 usQueryPort, EServerMode eServerMode, const char *pchVersionString ) { if ( !SteamInternal_GameServer_Init( unIP, usSteamPort, usGamePort, usQueryPort, eServerMode, pchVersionString ) ) @@ -233,8 +102,6 @@ inline bool SteamGameServer_Init( uint32 unIP, uint16 usSteamPort, uint16 usGame return true; } - - inline void SteamGameServer_ReleaseCurrentThreadMemory() { SteamAPI_ReleaseCurrentThreadMemory(); diff --git a/Generator/steam_sdk/steamclientpublic.h b/Generator/steam_sdk/steamclientpublic.h index 7b89ba2..a03f172 100644 --- a/Generator/steam_sdk/steamclientpublic.h +++ b/Generator/steam_sdk/steamclientpublic.h @@ -137,6 +137,7 @@ enum EResult k_EResultWGNetworkSendExceeded = 110, // the WG couldn't send a response because we exceeded max network send size k_EResultAccountNotFriends = 111, // the user is not mutually friends k_EResultLimitedUserAccount = 112, // the user is limited + k_EResultCantRemoveItem = 113, // item can't be removed }; // Error codes for use with the voice functions @@ -448,6 +449,16 @@ enum EBroadcastUploadResult k_EBroadcastUploadResultMissingAudio = 11, // client failed to send audio data k_EBroadcastUploadResultTooFarBehind = 12, // clients was too slow uploading k_EBroadcastUploadResultTranscodeBehind = 13, // server failed to keep up with transcode + k_EBroadcastUploadResultNotAllowedToPlay = 14, // Broadcast does not have permissions to play game + k_EBroadcastUploadResultBusy = 15, // RTMP host to busy to take new broadcast stream, choose another + k_EBroadcastUploadResultBanned = 16, // Account banned from community broadcast + k_EBroadcastUploadResultAlreadyActive = 17, // We already already have an stream running. + k_EBroadcastUploadResultForcedOff = 18, // We explicitly shutting down a broadcast + k_EBroadcastUploadResultAudioBehind = 19, // Audio stream was too far behind video + k_EBroadcastUploadResultShutdown = 20, // Broadcast Server was shut down + k_EBroadcastUploadResultDisconnect = 21, // broadcast uploader TCP disconnected + k_EBroadcastUploadResultVideoInitFailed = 22, // invalid video settings + k_EBroadcastUploadResultAudioInitFailed = 23, // invalid audio settings }; @@ -503,6 +514,7 @@ enum EVRHMDType k_eEVRHMDType_HTC_Dev = 1, // original HTC dev kits k_eEVRHMDType_HTC_VivePre = 2, // htc vive pre k_eEVRHMDType_HTC_Vive = 3, // htc vive consumer release + k_eEVRHMDType_HTC_VivePro = 4, // htc vive pro release k_eEVRHMDType_HTC_Unknown = 20, // unknown htc hmd @@ -530,6 +542,12 @@ enum EVRHMDType k_eEVRHMDType_Unannounced_Unknown = 100, // Unannounced unknown HMD k_eEVRHMDType_Unannounced_WindowsMR = 101, // Unannounced Windows MR headset + k_eEVRHMDType_vridge = 110, // VRIDGE tool + + k_eEVRHMDType_Huawei_Unknown = 120, // Huawei unknown HMD + k_eEVRHMDType_Huawei_VR2 = 121, // Huawei VR2 3DOF headset + k_eEVRHMDType_Huawei_EndOfRange = 129, // end of Huawei HMD range + }; @@ -551,15 +569,84 @@ static inline bool BIsWindowsMRHeadset( EVRHMDType eType ) } +//----------------------------------------------------------------------------- +// Purpose: true if this is from a Hauwei HMD +//----------------------------------------------------------------------------- +static inline bool BIsHuaweiHeadset( EVRHMDType eType ) +{ + return eType >= k_eEVRHMDType_Huawei_Unknown && eType <= k_eEVRHMDType_Huawei_EndOfRange; +} + + //----------------------------------------------------------------------------- // Purpose: true if this is from an Vive HMD //----------------------------------------------------------------------------- static inline bool BIsViveHMD( EVRHMDType eType ) { - return eType == k_eEVRHMDType_HTC_Dev || eType == k_eEVRHMDType_HTC_VivePre || eType == k_eEVRHMDType_HTC_Vive || eType == k_eEVRHMDType_HTC_Unknown; + return eType == k_eEVRHMDType_HTC_Dev || eType == k_eEVRHMDType_HTC_VivePre || eType == k_eEVRHMDType_HTC_Vive || eType == k_eEVRHMDType_HTC_Unknown || eType == k_eEVRHMDType_HTC_VivePro; } +//----------------------------------------------------------------------------- +// Purpose: Reasons a user may not use the Community Market. +// Used in MarketEligibilityResponse_t. +//----------------------------------------------------------------------------- +enum EMarketNotAllowedReasonFlags +{ + k_EMarketNotAllowedReason_None = 0, + + // A back-end call failed or something that might work again on retry + k_EMarketNotAllowedReason_TemporaryFailure = (1 << 0), + + // Disabled account + k_EMarketNotAllowedReason_AccountDisabled = (1 << 1), + + // Locked account + k_EMarketNotAllowedReason_AccountLockedDown = (1 << 2), + + // Limited account (no purchases) + k_EMarketNotAllowedReason_AccountLimited = (1 << 3), + + // The account is banned from trading items + k_EMarketNotAllowedReason_TradeBanned = (1 << 4), + + // Wallet funds aren't tradable because the user has had no purchase + // activity in the last year or has had no purchases prior to last month + k_EMarketNotAllowedReason_AccountNotTrusted = (1 << 5), + + // The user doesn't have Steam Guard enabled + k_EMarketNotAllowedReason_SteamGuardNotEnabled = (1 << 6), + + // The user has Steam Guard, but it hasn't been enabled for the required + // number of days + k_EMarketNotAllowedReason_SteamGuardOnlyRecentlyEnabled = (1 << 7), + + // The user has recently forgotten their password and reset it + k_EMarketNotAllowedReason_RecentPasswordReset = (1 << 8), + + // The user has recently funded his or her wallet with a new payment method + k_EMarketNotAllowedReason_NewPaymentMethod = (1 << 9), + + // An invalid cookie was sent by the user + k_EMarketNotAllowedReason_InvalidCookie = (1 << 10), + + // The user has Steam Guard, but is using a new computer or web browser + k_EMarketNotAllowedReason_UsingNewDevice = (1 << 11), + + // The user has recently refunded a store purchase by his or herself + k_EMarketNotAllowedReason_RecentSelfRefund = (1 << 12), + + // The user has recently funded his or her wallet with a new payment method that cannot be verified + k_EMarketNotAllowedReason_NewPaymentMethodCannotBeVerified = (1 << 13), + + // Not only is the account not trusted, but they have no recent purchases at all + k_EMarketNotAllowedReason_NoRecentPurchases = (1 << 14), + + // User accepted a wallet gift that was recently purchased + k_EMarketNotAllowedReason_AcceptedWalletGift = (1 << 15), +}; + + #pragma pack( push, 1 ) #define CSTEAMID_DEFINED @@ -1197,9 +1284,6 @@ public: return m_gameID.m_nAppID == k_uAppIdInvalid && m_gameID.m_nModID & 0x80000000; default: -#if defined(Assert) - Assert(false); -#endif return false; } @@ -1267,4 +1351,67 @@ typedef void (*PFNPreMinidumpCallback)(void *context); typedef void *BREAKPAD_HANDLE; #define BREAKPAD_INVALID_HANDLE (BREAKPAD_HANDLE)0 +enum EGameSearchErrorCode_t +{ + k_EGameSearchErrorCode_OK = 1, + k_EGameSearchErrorCode_Failed_Search_Already_In_Progress = 2, + k_EGameSearchErrorCode_Failed_No_Search_In_Progress = 3, + k_EGameSearchErrorCode_Failed_Not_Lobby_Leader = 4, // if not the lobby leader can not call SearchForGameWithLobby + k_EGameSearchErrorCode_Failed_No_Host_Available = 5, // no host is available that matches those search params + k_EGameSearchErrorCode_Failed_Search_Params_Invalid = 6, // search params are invalid + k_EGameSearchErrorCode_Failed_Offline = 7, // offline, could not communicate with server + k_EGameSearchErrorCode_Failed_NotAuthorized = 8, // either the user or the application does not have priveledges to do this + k_EGameSearchErrorCode_Failed_Unknown_Error = 9, // unknown error +}; + +enum EPlayerResult_t +{ + k_EPlayerResultFailedToConnect = 1, // failed to connect after confirming + k_EPlayerResultAbandoned = 2, // quit game without completing it + k_EPlayerResultKicked = 3, // kicked by other players/moderator/server rules + k_EPlayerResultIncomplete = 4, // player stayed to end but game did not conclude successfully ( nofault to player ) + k_EPlayerResultCompleted = 5, // player completed game +}; + +// Define compile time assert macros to let us validate the structure sizes. +#define VALVE_COMPILE_TIME_ASSERT( pred ) typedef char compile_time_assert_type[(pred) ? 1 : -1]; + +#if defined(__linux__) || defined(__APPLE__) +// The 32-bit version of gcc has the alignment requirement for uint64 and double set to +// 4 meaning that even with #pragma pack(8) these types will only be four-byte aligned. +// The 64-bit version of gcc has the alignment requirement for these types set to +// 8 meaning that unless we use #pragma pack(4) our structures will get bigger. +// The 64-bit structure packing has to match the 32-bit structure packing for each platform. +#define VALVE_CALLBACK_PACK_SMALL +#else +#define VALVE_CALLBACK_PACK_LARGE +#endif + +#if defined( VALVE_CALLBACK_PACK_SMALL ) +#pragma pack( push, 4 ) +#elif defined( VALVE_CALLBACK_PACK_LARGE ) +#pragma pack( push, 8 ) +#else +#error ??? +#endif + +typedef struct ValvePackingSentinel_t +{ + uint32 m_u32; + uint64 m_u64; + uint16 m_u16; + double m_d; +} ValvePackingSentinel_t; + +#pragma pack( pop ) + + +#if defined(VALVE_CALLBACK_PACK_SMALL) +VALVE_COMPILE_TIME_ASSERT( sizeof(ValvePackingSentinel_t) == 24 ) +#elif defined(VALVE_CALLBACK_PACK_LARGE) +VALVE_COMPILE_TIME_ASSERT( sizeof(ValvePackingSentinel_t) == 32 ) +#else +#error ??? +#endif + #endif // STEAMCLIENTPUBLIC_H diff --git a/Generator/steam_sdk/steamdatagram_ticketgen.h b/Generator/steam_sdk/steamdatagram_ticketgen.h new file mode 100644 index 0000000..5518a9d --- /dev/null +++ b/Generator/steam_sdk/steamdatagram_ticketgen.h @@ -0,0 +1,69 @@ +//====== Copyright Valve Corporation, All rights reserved. ==================== +// +// Backend functions to generate authorization tickets for steam datagram +// +//============================================================================= + +#ifndef STEAMDATAGRAM_TICKETGEN_H +#define STEAMDATAGRAM_TICKETGEN_H +#ifdef _WIN32 +#pragma once +#endif + +// Import some common stuff that is useful by both the client +// and the backend ticket-generating authority. +#include "steamdatagram_tickets.h" + +#if defined( STEAMDATAGRAM_TICKETGEN_FOREXPORT ) + #define STEAMDATAGRAM_TICKET_INTERFACE DLL_EXPORT +#elif defined( STEAMNETWORKINGSOCKETS_STATIC_LINK ) + #define STEAMDATAGRAM_TICKET_INTERFACE extern "C" +#else + #define STEAMDATAGRAM_TICKET_INTERFACE DLL_IMPORT +#endif + +struct SteamDatagramSignedTicketBlob +{ + int m_sz; + uint8 m_blob[ k_cbSteamDatagramMaxSerializedTicket ]; +}; + +/// Initialize ticket generation with an Ed25519 private key. +/// See: https://ed25519.cr.yp.to/ +/// +/// Input buffer will be securely wiped. +/// +/// You can generate an Ed25519 key using OpenSSH: ssh-keygen -t ed25519 +/// Or with our cert tool: steamnetworkingsockets_certtool gen_keypair +/// +/// The private key should be a PEM-like block of text +/// ("-----BEGIN OPENSSH PRIVATE KEY-----"). +/// Private keys encrypted with a password are not supported. +/// +/// In order for signatures using this key to be accepted by the relay network, +/// you need to send your public key to Valve. This key should be on a single line +/// of text that begins with "ssh-ed25519". (The format used in the .ssh/authorized_keys +/// file.) +STEAMDATAGRAM_TICKET_INTERFACE bool SteamDatagram_InitTicketGenerator_Ed25519( void *pvPrivateKey, size_t cbPrivateKey ); + +/// Serialize the specified auth ticket and attach a signature. +/// Returns false if you did something stupid like forgot to load a key. +/// Will also fail if your ticket is too big. (Probably because you +/// added too many extra fields.) +/// +/// The resulting blob should be sent to the client, who will put it in +/// their ticket cache using ISteamNetworkingSockets::ReceivedRelayAuthTicket +STEAMDATAGRAM_TICKET_INTERFACE bool SteamDatagram_SerializeAndSignTicket( const SteamDatagramRelayAuthTicket &ticket, SteamDatagramSignedTicketBlob &outBlob, SteamNetworkingErrMsg &errMsg ); + +// +// Some ping-related tools that don't have anything to do with tickets. +// But it's something that a backend might find useful, so we're putting it in this library for now. +// + +/// Parse location string. Returns true on success +STEAMDATAGRAM_TICKET_INTERFACE bool SteamDatagram_ParsePingLocation( const char *pszString, SteamNetworkPingLocation_t &outLocation ); + +/// Estimate ping time between two locations. +STEAMDATAGRAM_TICKET_INTERFACE int SteamDatagram_EstimatePingBetweenTwoLocations( const SteamNetworkPingLocation_t &location1, const SteamNetworkPingLocation_t &location2 ); + +#endif // STEAMDATAGRAM_TICKETGEN_H diff --git a/Generator/steam_sdk/steamdatagram_tickets.h b/Generator/steam_sdk/steamdatagram_tickets.h new file mode 100644 index 0000000..a72e517 --- /dev/null +++ b/Generator/steam_sdk/steamdatagram_tickets.h @@ -0,0 +1,247 @@ +//====== Copyright Valve Corporation, All rights reserved. ==================== +// +// Types and utilities for handling steam datagram tickets. These are +// useful for both the client and the backend ticket generating authority. +// +//============================================================================= + +#ifndef STEAMDATAGRAM_TICKETS_H +#define STEAMDATAGRAM_TICKETS_H +#ifdef _WIN32 +#pragma once +#endif + +#ifndef assert + #include +#endif + +#include +#include "steamnetworkingtypes.h" + +#if defined( VALVE_CALLBACK_PACK_SMALL ) +#pragma pack( push, 4 ) +#elif defined( VALVE_CALLBACK_PACK_LARGE ) +#pragma pack( push, 8 ) +#else +#error "Must define VALVE_CALLBACK_PACK_SMALL or VALVE_CALLBACK_PACK_LARGE" +#endif + +/// Max length of serialized auth ticket. This is important so that we +/// can ensure that we always fit into a single UDP datagram (along with +/// other certs and signatures) and keep the implementation simple. +const size_t k_cbSteamDatagramMaxSerializedTicket = 512; + +/// Network-routable identifier for a service. This is an intentionally +/// opaque byte blob. The relays know how to use this to forward it on +/// to the intended destination, but otherwise clients really should not +/// need to know what's inside. (Indeed, we don't really want them to +/// know, as it could reveal information useful to an attacker.) +#ifndef IS_STEAMDATAGRAMROUTER +struct SteamDatagramHostedAddress +{ + + // Size of data blob. + int m_cbSize; + + // Opaque data + char m_data[ 128 ]; + + // Reset to empty state + void Clear() { memset( this, 0, sizeof(*this) ); } + + // Parse the data center out of the blob. + SteamNetworkingPOPID GetPopID() const { return CalculateSteamNetworkingPOPIDFromString( m_data ); } + + /// Set a dummy routing blob with a hardcoded IP:port. You should only use + /// this in a dev environment, since the address is in plaintext! + /// In production this information should come from the server, + /// using ISteamNetworkingSockets::GetHostedDedicatedServerAddress + void SetDevAddress( uint32 nIP, uint16 nPort, SteamNetworkingPOPID popid = 0 ) + { + GetSteamNetworkingLocationPOPStringFromID( popid, m_data ); + m_cbSize = 4; + m_data[m_cbSize++] = 1; + m_data[m_cbSize++] = 1; + m_data[m_cbSize++] = char(nPort); + m_data[m_cbSize++] = char(nPort>>8); + m_data[m_cbSize++] = char(nIP); + m_data[m_cbSize++] = char(nIP>>8); + m_data[m_cbSize++] = char(nIP>>16); + m_data[m_cbSize++] = char(nIP>>24); + } + + /// Convert to/from std::string (or anything that acts like it). + /// Useful for interfacing with google protobuf. It's a template + /// mainly so that we don't have to include in the header. + /// Note: by "string", we don't mean that it's text. Ut's a binary + /// blob, and it might have zeros in it. (std::string can handle that.) + template bool SetFromStdString( const T &str ) + { + if ( str.length() >= sizeof(m_data) ) + { + m_cbSize = 0; + return false; + } + m_cbSize = (int)str.length(); + memcpy( m_data, str.c_str(), m_cbSize ); + return true; + } + template void GetAsStdString( T *str ) const + { + str->assign( m_data, m_cbSize ); + } + +}; +#endif + +/// Ticket used to gain access to the relay network. +struct SteamDatagramRelayAuthTicket +{ + SteamDatagramRelayAuthTicket() { Clear(); } + + /// Reset all fields + void Clear() { memset( this, 0, sizeof(*this) ); m_nRestrictToVirtualPort = -1; } + + /// Identity of the gameserver we want to talk to. This is required. + SteamNetworkingIdentity m_identityGameserver; + + /// Identity of the person who was authorized. This is required. + SteamNetworkingIdentity m_identityAuthorizedClient; + + /// SteamID is authorized to send from a particular public IP. If this + /// is 0, then the sender is not restricted to a particular IP. + /// + /// Recommend to leave this set to zero. + uint32 m_unPublicIP; + + /// Time when the ticket expires. Recommended: take the current + /// time and add 6 hours, or maybe a bit longer if your gameplay + /// sessions are longer. + /// + /// NOTE: relays may reject tickets with expiry times excessively + /// far in the future, so contact us if you wish to use an expiry + /// longer than, say, 24 hours. + RTime32 m_rtimeTicketExpiry; + + /// Routing information where the gameserver is listening for + /// relayed traffic. You should fill this in when generating + /// a ticket. + /// + /// When generating tickets on your backend: + /// - In production: The gameserver knows the proper routing + /// information, so you need to call + /// ISteamNetworkingSockets::GetHostedDedicatedServerAddress + /// and send the info to your backend. + /// - In development, you will need to provide public IP + /// of the server using SteamDatagramServiceNetID::SetDevAddress. + /// Relays need to be able to send UDP + /// packets to this server. Since it's very likely that + /// your server is behind a firewall/NAT, make sure that + /// the address is the one that the outside world can use. + /// The traffic from the relays will be "unsolicited", so + /// stateful firewalls won't work -- you will probably have + /// to set up an explicit port forward. + /// On the client: + /// - this field will always be blank. + SteamDatagramHostedAddress m_routing; + + /// App ID this is for. This is required, and should be the + /// App ID the client is running. (Even if your gameserver + /// uses a different App ID.) + uint32 m_nAppID; + + /// Restrict this ticket to be used for a particular virtual port? + /// Set to -1 to allow any virtual port. + /// + /// This is useful as a security measure, and also so the client will + /// use the right ticket (which might have extra fields that are useful + /// for proper analytics), if the client happens to have more than one + /// appropriate ticket. + /// + /// Note: if a client has more that one acceptable ticket, they will + /// always use the one expiring the latest. + int m_nRestrictToVirtualPort; + + // + // Extra fields. + // + // These are collected for backend analytics. For example, you might + // send a MatchID so that all of the records for a particular match can + // be located. Or send a game mode field so that you can compare + // the network characteristics of different game modes. + // + // (At the time of this writing we don't have a way to expose the data + // we collect to partners, but we hope to in the future so that you can + // get visibility into network conditions.) + // + + struct ExtraField + { + enum EType + { + k_EType_String, + k_EType_Int, // For most small integral values. Uses google protobuf sint64, so it's small on the wire. WARNING: In some places this value may be transmitted in JSON, in which case precision may be lost in backend analytics. Don't use this for an "identifier", use it for a scalar quantity. + k_EType_Fixed64, // 64 arbitrary bits. This value is treated as an "identifier". In places where JSON format is used, it will be serialized as a string. No aggregation / analytics can be performed on this value. + }; + int /* EType */ m_eType; + char m_szName[28]; + + union { + char m_szStringValue[128]; + int64 m_nIntValue; + uint64 m_nFixed64Value; + }; + }; + enum { k_nMaxExtraFields = 16 }; + int m_nExtraFields; + ExtraField m_vecExtraFields[ k_nMaxExtraFields ]; + + /// Helper to add an extra field in a single call + void AddExtraField_Int( const char *pszName, int64 val ) + { + ExtraField *p = AddExtraField( pszName, ExtraField::k_EType_Int ); + if ( p ) + p->m_nIntValue = val; + } + void AddExtraField_Fixed64( const char *pszName, uint64 val ) + { + ExtraField *p = AddExtraField( pszName, ExtraField::k_EType_Fixed64 ); + if ( p ) + p->m_nFixed64Value = val; + } + void AddExtraField_String( const char *pszName, const char *val ) + { + ExtraField *p = AddExtraField( pszName, ExtraField::k_EType_String ); + if ( p ) + { + size_t l = strlen( val ); + if ( l > sizeof(p->m_szStringValue)-1 ) + l = sizeof(p->m_szStringValue)-1; + memcpy( p->m_szStringValue, val, l ); + p->m_szStringValue[l] = '\0'; + } + } + +private: + ExtraField *AddExtraField( const char *pszName, ExtraField::EType eType ) + { + if ( m_nExtraFields >= k_nMaxExtraFields ) + { + assert( false ); + return nullptr; + } + ExtraField *p = &m_vecExtraFields[ m_nExtraFields++ ]; + p->m_eType = eType; + + size_t l = strlen( pszName ); + if ( l > sizeof(p->m_szName)-1 ) + l = sizeof(p->m_szName)-1; + memcpy( p->m_szName, pszName, l ); + p->m_szName[l] = '\0'; + return p; + } +}; + +#pragma pack(pop) + +#endif // STEAMDATAGRAM_TICKETS_H diff --git a/Generator/steam_sdk/steamnetworkingtypes.h b/Generator/steam_sdk/steamnetworkingtypes.h new file mode 100644 index 0000000..f244c64 --- /dev/null +++ b/Generator/steam_sdk/steamnetworkingtypes.h @@ -0,0 +1,1114 @@ +//====== Copyright Valve Corporation, All rights reserved. ==================== +// +// Purpose: misc networking utilities +// +//============================================================================= + +#ifndef STEAMNETWORKINGTYPES +#define STEAMNETWORKINGTYPES +#ifdef _WIN32 +#pragma once +#endif + +#include + +//---------------------------------------- +// SteamNetworkingSockets library config +// Compiling in Steam public branch. +#define STEAMNETWORKINGSOCKETS_STEAM +#ifdef STEAMNETWORKINGSOCKETS_STATIC_LINK + #define STEAMNETWORKINGSOCKETS_INTERFACE extern +#endif +#define STEAMNETWORKINGSOCKETS_ENABLE_SDR +#include +// +//---------------------------------------- + + +#if defined( VALVE_CALLBACK_PACK_SMALL ) +#pragma pack( push, 4 ) +#elif defined( VALVE_CALLBACK_PACK_LARGE ) +#pragma pack( push, 8 ) +#else +#error "Must define VALVE_CALLBACK_PACK_SMALL or VALVE_CALLBACK_PACK_LARGE" +#endif + +struct SteamDatagramRelayAuthTicket; +struct SteamDatagramHostedAddress; +struct SteamNetConnectionStatusChangedCallback_t; + +/// Handle used to identify a connection to a remote host. +typedef uint32 HSteamNetConnection; +const HSteamNetConnection k_HSteamNetConnection_Invalid = 0; + +/// Handle used to identify a "listen socket". +typedef uint32 HSteamListenSocket; +const HSteamListenSocket k_HSteamListenSocket_Invalid = 0; + +/// Max length of diagnostic error message +const int k_cchMaxSteamNetworkingErrMsg = 1024; + +/// Used to return English-language diagnostic error messages to caller. +/// (For debugging or spewing to a console, etc. Not intended for UI.) +typedef char SteamNetworkingErrMsg[ k_cchMaxSteamNetworkingErrMsg ]; + +/// Identifier used for a network location point of presence. (E.g. a Valve data center.) +/// Typically you won't need to directly manipulate these. +typedef uint32 SteamNetworkingPOPID; + +/// A local timestamp. You can subtract two timestamps to get the number of elapsed +/// microseconds. This is guaranteed to increase over time during the lifetime +/// of a process, but not globally across runs. You don't need to worry about +/// the value wrapping around. Note that the underlying clock might not actually have +/// microsecond *resolution*. +typedef int64 SteamNetworkingMicroseconds; + +// +// Describing network hosts +// + +/// Different methods of describing the identity of a network host +enum ESteamNetworkingIdentityType +{ + // Dummy/unknown/invalid + k_ESteamNetworkingIdentityType_Invalid = 0, + + // + // Basic platform-specific identifiers. + // + k_ESteamNetworkingIdentityType_SteamID = 16, // 64-bit CSteamID + k_ESteamNetworkingIdentityType_XboxPairwiseID = 17, // Publisher-specific user identity, as string + //k_ESteamNetworkingIdentityType_PlaystationSomething = 18, + + // + // Special identifiers. + // + + // Use their IP address (and port) as their "identity". + // These types of identities are always unauthenticated. + // They are useful for porting plain sockets code, and other + // situations where you don't care about authentication. In this + // case, the local identity will be "localhost", + // and the remote address will be their network address. + // + // We use the same type for either IPv4 or IPv6, and + // the address is always store as IPv6. We use IPv4 + // mapped addresses to handle IPv4. + k_ESteamNetworkingIdentityType_IPAddress = 1, + + // Generic string/binary blobs. It's up to your app to interpret this. + // This library can tell you if the remote host presented a certificate + // signed by somebody you have chosen to trust, with this identity on it. + // It's up to you to ultimately decide what this identity means. + k_ESteamNetworkingIdentityType_GenericString = 2, + k_ESteamNetworkingIdentityType_GenericBytes = 3, + + // Make sure this enum is stored in an int. + k_ESteamNetworkingIdentityType__Force32bit = 0x7fffffff, +}; + +#pragma pack(push,1) + +/// Store an IP and port. IPv6 is always used; IPv4 is represented using +/// "IPv4-mapped" addresses: IPv4 aa.bb.cc.dd => IPv6 ::ffff:aabb:ccdd +/// (RFC 4291 section 2.5.5.2.) +struct SteamNetworkingIPAddr +{ + void Clear(); // Set everything to zero. E.g. [::]:0 + bool IsIPv6AllZeros() const; // Return true if the IP is ::0. (Doesn't check port.) + void SetIPv6( const uint8 *ipv6, uint16 nPort ); // Set IPv6 address. IP is interpreted as bytes, so there are no endian issues. (Same as inaddr_in6.) The IP can be a mapped IPv4 address + void SetIPv4( uint32 nIP, uint16 nPort ); // Sets to IPv4 mapped address. IP and port are in host byte order. + bool IsIPv4() const; // Return true if IP is mapped IPv4 + uint32 GetIPv4() const; // Returns IP in host byte order (e.g. aa.bb.cc.dd as 0xaabbccdd). Returns 0 if IP is not mapped IPv4. + void SetIPv6LocalHost( uint16 nPort = 0); // Set to the IPv6 localhost address ::1, and the specified port. + bool IsLocalHost() const; // Return true if this identity is localhost. (Either IPv6 ::1, or IPv4 127.0.0.1) + + // Max length of the buffer needed to hold IP formatted using ToString, including '\0' + // ([0123:4567:89ab:cdef:0123:4567:89ab:cdef]:12345) + enum { k_cchMaxString = 48 }; + + /// Print to a string, with or without the port. Mapped IPv4 addresses are printed + /// as dotted decimal (12.34.56.78), otherwise this will print the canonical + /// form according to RFC5952. If you include the port, IPv6 will be surrounded by + /// brackets, e.g. [::1:2]:80. Your buffer should be at least k_cchMaxString bytes + /// to avoid truncation + inline void ToString( char *buf, size_t cbBuf, bool bWithPort ) const; + + /// Parse an IP address and optional port. If a port is not present, it is set to 0. + /// (This means that you cannot tell if a zero port was explicitly specified.) + inline bool ParseString( const char *pszStr ); + + union + { + uint8 m_ipv6[ 16 ]; + struct // IPv4 "mapped address" (rfc4038 section 4.2) + { + uint64 m_8zeros; + uint16 m_0000; + uint16 m_ffff; + uint8 m_ip[ 4 ]; // NOTE: As bytes, i.e. network byte order + } m_ipv4; + }; + uint16 m_port; // Host byte order + + /// See if two addresses are identical + bool operator==(const SteamNetworkingIPAddr &x ) const; +}; + +/// An abstract way to represent the identity of a network host +struct SteamNetworkingIdentity +{ + /// Type of identity. + ESteamNetworkingIdentityType m_eType; + + // + // Get/Set in various formats. + // + + void Clear(); + bool IsInvalid() const; // Return true if we are the invalid type. Does not make any other validity checks (e.g. is SteamID actually valid) + + void SetSteamID( CSteamID steamID ); + CSteamID GetSteamID() const; // Return black CSteamID (!IsValid()) if identity is not a SteamID + void SetSteamID64( uint64 steamID ); // Takes SteamID as raw 64-bit number + uint64 GetSteamID64() const; // Returns 0 if identity is not SteamID + + bool SetXboxPairwiseID( const char *pszString ); // Returns false if invalid length + const char *GetXboxPairwiseID() const; // Returns nullptr if not Xbox ID + + void SetIPAddr( const SteamNetworkingIPAddr &addr ); // Set to specified IP:port + const SteamNetworkingIPAddr *GetIPAddr() const; // returns null if we are not an IP address. + + // "localhost" is equivalent for many purposes to "anonymous." Our remote + // will identify us by the network address we use. + void SetLocalHost(); // Set to localhost. (We always use IPv6 ::1 for this, not 127.0.0.1) + bool IsLocalHost() const; // Return true if this identity is localhost. + + bool SetGenericString( const char *pszString ); // Returns false if invalid length + const char *GetGenericString() const; // Returns nullptr if not generic string type + + bool SetGenericBytes( const void *data, size_t cbLen ); // Returns false if invalid size. + const uint8 *GetGenericBytes( int &cbLen ) const; // Returns null if not generic bytes type + + /// See if two identities are identical + bool operator==(const SteamNetworkingIdentity &x ) const; + + /// Print to a human-readable string. This is suitable for debug messages + /// or any other time you need to encode the identity as a string. It has a + /// URL-like format (type:). Your buffer should be at least + /// k_cchMaxString bytes big to avoid truncation. + void ToString( char *buf, size_t cbBuf ) const; + + /// Parse back a string that was generated using ToString + bool ParseString( const char *pszStr ); + + // Max sizes + enum { + k_cchMaxString = 128, // Max length of the buffer needed to hold any identity, formatted in string format by ToString + k_cchMaxGenericString = 32, // Max length of the string for generic string identities. Including terminating '\0' + k_cchMaxXboxPairwiseID = 32, // Including terminating '\0' + k_cbMaxGenericBytes = 32, + }; + + // + // Internal representation. Don't access this directly, use the accessors! + // + // Number of bytes that are relevant below. This MUST ALWAYS be + // set. (Use the accessors!) This is important to enable old code to work + // with new identity types. + int m_cbSize; + union { + uint64 m_steamID64; + char m_szGenericString[ k_cchMaxGenericString ]; + char m_szXboxPairwiseID[ k_cchMaxXboxPairwiseID ]; + uint8 m_genericBytes[ k_cbMaxGenericBytes ]; + SteamNetworkingIPAddr m_ip; + uint32 m_reserved[ 32 ]; // Pad structure to leave easy room for future expansion + }; +}; +#pragma pack(pop) + +// +// Connection status +// + +/// High level connection status +enum ESteamNetworkingConnectionState +{ + + /// Dummy value used to indicate an error condition in the API. + /// Specified connection doesn't exist or has already been closed. + k_ESteamNetworkingConnectionState_None = 0, + + /// We are trying to establish whether peers can talk to each other, + /// whether they WANT to talk to each other, perform basic auth, + /// and exchange crypt keys. + /// + /// - For connections on the "client" side (initiated locally): + /// We're in the process of trying to establish a connection. + /// Depending on the connection type, we might not know who they are. + /// Note that it is not possible to tell if we are waiting on the + /// network to complete handshake packets, or for the application layer + /// to accept the connection. + /// + /// - For connections on the "server" side (accepted through listen socket): + /// We have completed some basic handshake and the client has presented + /// some proof of identity. The connection is ready to be accepted + /// using AcceptConnection(). + /// + /// In either case, any unreliable packets sent now are almost certain + /// to be dropped. Attempts to receive packets are guaranteed to fail. + /// You may send messages if the send mode allows for them to be queued. + /// but if you close the connection before the connection is actually + /// established, any queued messages will be discarded immediately. + /// (We will not attempt to flush the queue and confirm delivery to the + /// remote host, which ordinarily happens when a connection is closed.) + k_ESteamNetworkingConnectionState_Connecting = 1, + + /// Some connection types use a back channel or trusted 3rd party + /// for earliest communication. If the server accepts the connection, + /// then these connections switch into the rendezvous state. During this + /// state, we still have not yet established an end-to-end route (through + /// the relay network), and so if you send any messages unreliable, they + /// are going to be discarded. + k_ESteamNetworkingConnectionState_FindingRoute = 2, + + /// We've received communications from our peer (and we know + /// who they are) and are all good. If you close the connection now, + /// we will make our best effort to flush out any reliable sent data that + /// has not been acknowledged by the peer. (But note that this happens + /// from within the application process, so unlike a TCP connection, you are + /// not totally handing it off to the operating system to deal with it.) + k_ESteamNetworkingConnectionState_Connected = 3, + + /// Connection has been closed by our peer, but not closed locally. + /// The connection still exists from an API perspective. You must close the + /// handle to free up resources. If there are any messages in the inbound queue, + /// you may retrieve them. Otherwise, nothing may be done with the connection + /// except to close it. + /// + /// This stats is similar to CLOSE_WAIT in the TCP state machine. + k_ESteamNetworkingConnectionState_ClosedByPeer = 4, + + /// A disruption in the connection has been detected locally. (E.g. timeout, + /// local internet connection disrupted, etc.) + /// + /// The connection still exists from an API perspective. You must close the + /// handle to free up resources. + /// + /// Attempts to send further messages will fail. Any remaining received messages + /// in the queue are available. + k_ESteamNetworkingConnectionState_ProblemDetectedLocally = 5, + +// +// The following values are used internally and will not be returned by any API. +// We document them here to provide a little insight into the state machine that is used +// under the hood. +// + + /// We've disconnected on our side, and from an API perspective the connection is closed. + /// No more data may be sent or received. All reliable data has been flushed, or else + /// we've given up and discarded it. We do not yet know for sure that the peer knows + /// the connection has been closed, however, so we're just hanging around so that if we do + /// get a packet from them, we can send them the appropriate packets so that they can + /// know why the connection was closed (and not have to rely on a timeout, which makes + /// it appear as if something is wrong). + k_ESteamNetworkingConnectionState_FinWait = -1, + + /// We've disconnected on our side, and from an API perspective the connection is closed. + /// No more data may be sent or received. From a network perspective, however, on the wire, + /// we have not yet given any indication to the peer that the connection is closed. + /// We are in the process of flushing out the last bit of reliable data. Once that is done, + /// we will inform the peer that the connection has been closed, and transition to the + /// FinWait state. + /// + /// Note that no indication is given to the remote host that we have closed the connection, + /// until the data has been flushed. If the remote host attempts to send us data, we will + /// do whatever is necessary to keep the connection alive until it can be closed properly. + /// But in fact the data will be discarded, since there is no way for the application to + /// read it back. Typically this is not a problem, as application protocols that utilize + /// the lingering functionality are designed for the remote host to wait for the response + /// before sending any more data. + k_ESteamNetworkingConnectionState_Linger = -2, + + /// Connection is completely inactive and ready to be destroyed + k_ESteamNetworkingConnectionState_Dead = -3, + + k_ESteamNetworkingConnectionState__Force32Bit = 0x7fffffff +}; + +/// Enumerate various causes of connection termination. These are designed to work similar +/// to HTTP error codes: the numeric range gives you a rough classification as to the source +/// of the problem. +enum ESteamNetConnectionEnd +{ + // Invalid/sentinel value + k_ESteamNetConnectionEnd_Invalid = 0, + + // + // Application codes. These are the values you will pass to + // ISteamNetworkingSockets::CloseConnection. You can use these codes if + // you want to plumb through application-specific reason codes. If you don't + // need this facility, feel free to always pass + // k_ESteamNetConnectionEnd_App_Generic. + // + // The distinction between "normal" and "exceptional" termination is + // one you may use if you find useful, but it's not necessary for you + // to do so. The only place where we distinguish between normal and + // exceptional is in connection analytics. If a significant + // proportion of connections terminates in an exceptional manner, + // this can trigger an alert. + // + + // 1xxx: Application ended the connection in a "usual" manner. + // E.g.: user intentionally disconnected from the server, + // gameplay ended normally, etc + k_ESteamNetConnectionEnd_App_Min = 1000, + k_ESteamNetConnectionEnd_App_Generic = k_ESteamNetConnectionEnd_App_Min, + // Use codes in this range for "normal" disconnection + k_ESteamNetConnectionEnd_App_Max = 1999, + + // 2xxx: Application ended the connection in some sort of exceptional + // or unusual manner that might indicate a bug or configuration + // issue. + // + k_ESteamNetConnectionEnd_AppException_Min = 2000, + k_ESteamNetConnectionEnd_AppException_Generic = k_ESteamNetConnectionEnd_AppException_Min, + // Use codes in this range for "unusual" disconnection + k_ESteamNetConnectionEnd_AppException_Max = 2999, + + // + // System codes. These will be returned by the system when + // the connection state is k_ESteamNetworkingConnectionState_ClosedByPeer + // or k_ESteamNetworkingConnectionState_ProblemDetectedLocally. It is + // illegal to pass a code in this range to ISteamNetworkingSockets::CloseConnection + // + + // 3xxx: Connection failed or ended because of problem with the + // local host or their connection to the Internet. + k_ESteamNetConnectionEnd_Local_Min = 3000, + + // You cannot do what you want to do because you're running in offline mode. + k_ESteamNetConnectionEnd_Local_OfflineMode = 3001, + + // We're having trouble contacting many (perhaps all) relays. + // Since it's unlikely that they all went offline at once, the best + // explanation is that we have a problem on our end. Note that we don't + // bother distinguishing between "many" and "all", because in practice, + // it takes time to detect a connection problem, and by the time + // the connection has timed out, we might not have been able to + // actively probe all of the relay clusters, even if we were able to + // contact them at one time. So this code just means that: + // + // * We don't have any recent successful communication with any relay. + // * We have evidence of recent failures to communicate with multiple relays. + k_ESteamNetConnectionEnd_Local_ManyRelayConnectivity = 3002, + + // A hosted server is having trouble talking to the relay + // that the client was using, so the problem is most likely + // on our end + k_ESteamNetConnectionEnd_Local_HostedServerPrimaryRelay = 3003, + + // We're not able to get the network config. This is + // *almost* always a local issue, since the network config + // comes from the CDN, which is pretty darn reliable. + k_ESteamNetConnectionEnd_Local_NetworkConfig = 3004, + + // Steam rejected our request because we don't have rights + // to do this. + k_ESteamNetConnectionEnd_Local_Rights = 3005, + + k_ESteamNetConnectionEnd_Local_Max = 3999, + + // 4xxx: Connection failed or ended, and it appears that the + // cause does NOT have to do with the local host or their + // connection to the Internet. It could be caused by the + // remote host, or it could be somewhere in between. + k_ESteamNetConnectionEnd_Remote_Min = 4000, + + // The connection was lost, and as far as we can tell our connection + // to relevant services (relays) has not been disrupted. This doesn't + // mean that the problem is "their fault", it just means that it doesn't + // appear that we are having network issues on our end. + k_ESteamNetConnectionEnd_Remote_Timeout = 4001, + + // Something was invalid with the cert or crypt handshake + // info you gave me, I don't understand or like your key types, + // etc. + k_ESteamNetConnectionEnd_Remote_BadCrypt = 4002, + + // You presented me with a cert that was I was able to parse + // and *technically* we could use encrypted communication. + // But there was a problem that prevents me from checking your identity + // or ensuring that somebody int he middle can't observe our communication. + // E.g.: - the CA key was missing (and I don't accept unsigned certs) + // - The CA key isn't one that I trust, + // - The cert doesn't was appropriately restricted by app, user, time, data center, etc. + // - The cert wasn't issued to you. + // - etc + k_ESteamNetConnectionEnd_Remote_BadCert = 4003, + + // We couldn't rendezvous with the remote host because + // they aren't logged into Steam + k_ESteamNetConnectionEnd_Remote_NotLoggedIn = 4004, + + // We couldn't rendezvous with the remote host because + // they aren't running the right application. + k_ESteamNetConnectionEnd_Remote_NotRunningApp = 4005, + + // Something wrong with the protocol version you are using. + // (Probably the code you are running is too old.) + k_ESteamNetConnectionEnd_Remote_BadProtocolVersion = 4006, + + k_ESteamNetConnectionEnd_Remote_Max = 4999, + + // 5xxx: Connection failed for some other reason. + k_ESteamNetConnectionEnd_Misc_Min = 5000, + + // A failure that isn't necessarily the result of a software bug, + // but that should happen rarely enough that it isn't worth specifically + // writing UI or making a localized message for. + // The debug string should contain further details. + k_ESteamNetConnectionEnd_Misc_Generic = 5001, + + // Generic failure that is most likely a software bug. + k_ESteamNetConnectionEnd_Misc_InternalError = 5002, + + // The connection to the remote host timed out, but we + // don't know if the problem is on our end, in the middle, + // or on their end. + k_ESteamNetConnectionEnd_Misc_Timeout = 5003, + + // We're having trouble talking to the relevant relay. + // We don't have enough information to say whether the + // problem is on our end or not. + k_ESteamNetConnectionEnd_Misc_RelayConnectivity = 5004, + + // There's some trouble talking to Steam. + k_ESteamNetConnectionEnd_Misc_SteamConnectivity = 5005, + + // A server in a dedicated hosting situation has no relay sessions + // active with which to talk back to a client. (It's the client's + // job to open and maintain those sessions.) + k_ESteamNetConnectionEnd_Misc_NoRelaySessionsToClient = 5006, + + k_ESteamNetConnectionEnd_Misc_Max = 5999, + + k_ESteamNetConnectionEnd__Force32Bit = 0x7fffffff +}; + +/// Max length, in bytes (including null terminator) of the reason string +/// when a connection is closed. +const int k_cchSteamNetworkingMaxConnectionCloseReason = 128; + +/// Max length, in bytes (include null terminator) of debug description +/// of a connection. +const int k_cchSteamNetworkingMaxConnectionDescription = 128; + +/// Describe the state of a connection. +struct SteamNetConnectionInfo_t +{ + + /// Who is on the other end? Depending on the connection type and phase of the connection, we might not know + SteamNetworkingIdentity m_identityRemote; + + /// Arbitrary user data set by the local application code + int64 m_nUserData; + + /// Handle to listen socket this was connected on, or k_HSteamListenSocket_Invalid if we initiated the connection + HSteamListenSocket m_hListenSocket; + + /// Remote address. Might be all 0's if we don't know it, or if this is N/A. + /// (E.g. Basically everything except direct UDP connection.) + SteamNetworkingIPAddr m_addrRemote; + uint16 m__pad1; + + /// What data center is the remote host in? (0 if we don't know.) + SteamNetworkingPOPID m_idPOPRemote; + + /// What relay are we using to communicate with the remote host? + /// (0 if not applicable.) + SteamNetworkingPOPID m_idPOPRelay; + + /// High level state of the connection + ESteamNetworkingConnectionState m_eState; + + /// Basic cause of the connection termination or problem. + /// See ESteamNetConnectionEnd for the values used + int m_eEndReason; + + /// Human-readable, but non-localized explanation for connection + /// termination or problem. This is intended for debugging / + /// diagnostic purposes only, not to display to users. It might + /// have some details specific to the issue. + char m_szEndDebug[ k_cchSteamNetworkingMaxConnectionCloseReason ]; + + /// Debug description. This includes the connection handle, + /// connection type (and peer information), and the app name. + /// This string is used in various internal logging messages + char m_szConnectionDescription[ k_cchSteamNetworkingMaxConnectionDescription ]; + + /// Internal stuff, room to change API easily + uint32 reserved[64]; +}; + +/// Quick connection state, pared down to something you could call +/// more frequently without it being too big of a perf hit. +struct SteamNetworkingQuickConnectionStatus +{ + + /// High level state of the connection + ESteamNetworkingConnectionState m_eState; + + /// Current ping (ms) + int m_nPing; + + /// Connection quality measured locally, 0...1. (Percentage of packets delivered + /// end-to-end in order). + float m_flConnectionQualityLocal; + + /// Packet delivery success rate as observed from remote host + float m_flConnectionQualityRemote; + + /// Current data rates from recent history. + float m_flOutPacketsPerSec; + float m_flOutBytesPerSec; + float m_flInPacketsPerSec; + float m_flInBytesPerSec; + + /// Estimate rate that we believe that we can send data to our peer. + /// Note that this could be significantly higher than m_flOutBytesPerSec, + /// meaning the capacity of the channel is higher than you are sending data. + /// (That's OK!) + int m_nSendRateBytesPerSecond; + + /// Number of bytes pending to be sent. This is data that you have recently + /// requested to be sent but has not yet actually been put on the wire. The + /// reliable number ALSO includes data that was previously placed on the wire, + /// but has now been scheduled for re-transmission. Thus, it's possible to + /// observe m_cbPendingReliable increasing between two checks, even if no + /// calls were made to send reliable data between the checks. Data that is + /// awaiting the nagle delay will appear in these numbers. + int m_cbPendingUnreliable; + int m_cbPendingReliable; + + /// Number of bytes of reliable data that has been placed the wire, but + /// for which we have not yet received an acknowledgment, and thus we may + /// have to re-transmit. + int m_cbSentUnackedReliable; + + /// If you asked us to send a message right now, how long would that message + /// sit in the queue before we actually started putting packets on the wire? + /// (And assuming Nagle does not cause any packets to be delayed.) + /// + /// In general, data that is sent by the application is limited by the + /// bandwidth of the channel. If you send data faster than this, it must + /// be queued and put on the wire at a metered rate. Even sending a small amount + /// of data (e.g. a few MTU, say ~3k) will require some of the data to be delayed + /// a bit. + /// + /// In general, the estimated delay will be approximately equal to + /// + /// ( m_cbPendingUnreliable+m_cbPendingReliable ) / m_nSendRateBytesPerSecond + /// + /// plus or minus one MTU. It depends on how much time has elapsed since the last + /// packet was put on the wire. For example, the queue might have *just* been emptied, + /// and the last packet placed on the wire, and we are exactly up against the send + /// rate limit. In that case we might need to wait for one packet's worth of time to + /// elapse before we can send again. On the other extreme, the queue might have data + /// in it waiting for Nagle. (This will always be less than one packet, because as soon + /// as we have a complete packet we would send it.) In that case, we might be ready + /// to send data now, and this value will be 0. + SteamNetworkingMicroseconds m_usecQueueTime; + + /// Internal stuff, room to change API easily + uint32 reserved[16]; +}; + +#pragma pack( pop ) + +// +// Network messages +// + +/// Max size of a single message that we can SEND. +/// Note: We might be wiling to receive larger messages, +/// and our peer might, too. +const int k_cbMaxSteamNetworkingSocketsMessageSizeSend = 512 * 1024; + +/// A message that has been received +struct SteamNetworkingMessage_t +{ + + /// Message payload + void *m_pData; + + /// Size of the payload. + uint32 m_cbSize; + + /// The connection this came from. (Not used when using the ISteamMessages interface) + HSteamNetConnection m_conn; + + /// Who sent this to us? + SteamNetworkingIdentity m_sender; + + /// The user data associated with the connection. + /// + /// This is *usually* the same as calling GetConnection() and then + /// fetching the user data associated with that connection, but for + /// the following subtle differences: + /// + /// - This user data will match the connection's user data at the time + /// is captured at the time the message is returned by the API. + /// If you subsequently change the userdata on the connection, + /// this won't be updated. + /// - This is an inline call, so it's *much* faster. + /// - You might have closed the connection, so fetching the user data + /// would not be possible. + int64 m_nConnUserData; + + /// Local timestamps when it was received + SteamNetworkingMicroseconds m_usecTimeReceived; + + /// Message number assigned by the sender + int64 m_nMessageNumber; + + /// Function used to free up m_pData. This mechanism exists so that + /// apps can create messages with buffers allocated from their own + /// heap, and pass them into the library. This function will + /// usually be something like: + /// + /// free( pMsg->m_pData ); + void (*m_pfnFreeData)( SteamNetworkingMessage_t *pMsg ); + + /// Function to used to decrement reference count and, if it's zero, release + /// the message. You should not normally need to access this directly. + /// (Use Release(), and don't set this.) + void (*m_pfnRelease)( SteamNetworkingMessage_t *pMsg ); + + /// The channel number the message was received on. + /// (Not used for messages received on "connections") + int m_nChannel; + + /// Pad to multiple of 8 bytes + int m___nPadDummy; + + #ifdef __cplusplus + + /// You MUST call this when you're done with the object, + /// to free up memory, etc. + inline void Release(); + + // For code compatibility, some accessors + inline uint32 GetSize() const { return m_cbSize; } + inline const void *GetData() const { return m_pData; } + inline int GetChannel() const { return m_nChannel; } + inline HSteamNetConnection GetConnection() const { return m_conn; } + inline int64 GetConnectionUserData() const { return m_nConnUserData; } + inline SteamNetworkingMicroseconds GetTimeReceived() const { return m_usecTimeReceived; } + inline int64 GetMessageNumber() const { return m_nMessageNumber; } + #endif +}; + +// +// Flags used to set options for message sending +// + +// Send the message unreliably. Can be lost. Messages *can* be larger than a +// single MTU (UDP packet), but there is no retransmission, so if any piece +// of the message is lost, the entire message will be dropped. +// +// The sending API does have some knowledge of the underlying connection, so +// if there is no NAT-traversal accomplished or there is a recognized adjustment +// happening on the connection, the packet will be batched until the connection +// is open again. +// +// Migration note: This is not exactly the same as k_EP2PSendUnreliable! You +// probably want k_ESteamNetworkingSendType_UnreliableNoNagle +const int k_nSteamNetworkingSend_Unreliable = 0; + +// Disable Nagle's algorithm. +// By default, Nagle's algorithm is applied to all outbound messages. This means +// that the message will NOT be sent immediately, in case further messages are +// sent soon after you send this, which can be grouped together. Any time there +// is enough buffered data to fill a packet, the packets will be pushed out immediately, +// but partially-full packets not be sent until the Nagle timer expires. See +// ISteamNetworkingSockets::FlushMessagesOnConnection, ISteamNetworkingMessages::FlushMessagesToUser +// +// NOTE: Don't just send every message without Nagle because you want packets to get there +// quicker. Make sure you understand the problem that Nagle is solving before disabling it. +// If you are sending small messages, often many at the same time, then it is very likely that +// it will be more efficient to leave Nagle enabled. A typical proper use of this flag is +// when you are sending what you know will be the last message sent for a while (e.g. the last +// in the server simulation tick to a particular client), and you use this flag to flush all +// messages. +const int k_nSteamNetworkingSend_NoNagle = 1; + +// Send a message unreliably, bypassing Nagle's algorithm for this message and any messages +// currently pending on the Nagle timer. This is equivalent to using k_ESteamNetworkingSend_Unreliable +// and then immediately flushing the messages using ISteamNetworkingSockets::FlushMessagesOnConnection +// or ISteamNetworkingMessages::FlushMessagesToUser. (But using this flag is more efficient since you +// only make one API call.) +const int k_nSteamNetworkingSend_UnreliableNoNagle = k_nSteamNetworkingSend_Unreliable|k_nSteamNetworkingSend_NoNagle; + +// If the message cannot be sent very soon (because the connection is still doing some initial +// handshaking, route negotiations, etc), then just drop it. This is only applicable for unreliable +// messages. Using this flag on reliable messages is invalid. +const int k_nSteamNetworkingSend_NoDelay = 4; + +// Send an unreliable message, but if it cannot be sent relatively quickly, just drop it instead of queuing it. +// This is useful for messages that are not useful if they are excessively delayed, such as voice data. +// NOTE: The Nagle algorithm is not used, and if the message is not dropped, any messages waiting on the +// Nagle timer are immediately flushed. +// +// A message will be dropped under the following circumstances: +// - the connection is not fully connected. (E.g. the "Connecting" or "FindingRoute" states) +// - there is a sufficiently large number of messages queued up already such that the current message +// will not be placed on the wire in the next ~200ms or so. +// +// if a message is dropped for these reasons, k_EResultIgnored will be returned. +const int k_nSteamNetworkingSend_UnreliableNoDelay = k_nSteamNetworkingSend_Unreliable|k_nSteamNetworkingSend_NoDelay|k_nSteamNetworkingSend_NoNagle; + +// Reliable message send. Can send up to k_cbMaxSteamNetworkingSocketsMessageSizeSend bytes in a single message. +// Does fragmentation/re-assembly of messages under the hood, as well as a sliding window for +// efficient sends of large chunks of data. +// +// The Nagle algorithm is used. See notes on k_ESteamNetworkingSendType_Unreliable for more details. +// See k_ESteamNetworkingSendType_ReliableNoNagle, ISteamNetworkingSockets::FlushMessagesOnConnection, +// ISteamNetworkingMessages::FlushMessagesToUser +// +// Migration note: This is NOT the same as k_EP2PSendReliable, it's more like k_EP2PSendReliableWithBuffering +const int k_nSteamNetworkingSend_Reliable = 8; + +// Send a message reliably, but bypass Nagle's algorithm. +// +// Migration note: This is equivalent to k_EP2PSendReliable +const int k_nSteamNetworkingSend_ReliableNoNagle = k_nSteamNetworkingSend_Reliable|k_nSteamNetworkingSend_NoNagle; + +// +// Ping location / measurement +// + +/// Object that describes a "location" on the Internet with sufficient +/// detail that we can reasonably estimate an upper bound on the ping between +/// the two hosts, even if a direct route between the hosts is not possible, +/// and the connection must be routed through the Steam Datagram Relay network. +/// This does not contain any information that identifies the host. Indeed, +/// if two hosts are in the same building or otherwise have nearly identical +/// networking characteristics, then it's valid to use the same location +/// object for both of them. +/// +/// NOTE: This object should only be used in the same process! Do not serialize it, +/// send it over the wire, or persist it in a file or database! If you need +/// to do that, convert it to a string representation using the methods in +/// ISteamNetworkingUtils(). +struct SteamNetworkPingLocation_t +{ + uint8 m_data[ 512 ]; +}; + +/// Max possible length of a ping location, in string format. This is +/// an extremely conservative worst case value which leaves room for future +/// syntax enhancements. Most strings in practice are a lot shorter. +/// If you are storing many of these, you will very likely benefit from +/// using dynamic memory. +const int k_cchMaxSteamNetworkingPingLocationString = 1024; + +/// Special values that are returned by some functions that return a ping. +const int k_nSteamNetworkingPing_Failed = -1; +const int k_nSteamNetworkingPing_Unknown = -2; + +// +// Configuration values +// + +/// Configuration values can be applied to different types of objects. +enum ESteamNetworkingConfigScope +{ + + /// Get/set global option, or defaults. Even options that apply to more specific scopes + /// have global scope, and you may be able to just change the global defaults. If you + /// need different settings per connection (for example), then you will need to set those + /// options at the more specific scope. + k_ESteamNetworkingConfig_Global = 1, + + /// Some options are specific to a particular interface. Note that all connection + /// and listen socket settings can also be set at the interface level, and they will + /// apply to objects created through those interfaces. + k_ESteamNetworkingConfig_SocketsInterface = 2, + + /// Options for a listen socket. Listen socket options can be set at the interface layer, + /// if you have multiple listen sockets and they all use the same options. + /// You can also set connection options on a listen socket, and they set the defaults + /// for all connections accepted through this listen socket. (They will be used if you don't + /// set a connection option.) + k_ESteamNetworkingConfig_ListenSocket = 3, + + /// Options for a specific connection. + k_ESteamNetworkingConfig_Connection = 4, + + k_ESteamNetworkingConfigScope__Force32Bit = 0x7fffffff +}; + +// Different configuration values have different data types +enum ESteamNetworkingConfigDataType +{ + k_ESteamNetworkingConfig_Int32 = 1, + k_ESteamNetworkingConfig_Int64 = 2, + k_ESteamNetworkingConfig_Float = 3, + k_ESteamNetworkingConfig_String = 4, + k_ESteamNetworkingConfig_FunctionPtr = 5, // NOTE: When setting callbacks, you should put the pointer into a variable and pass a pointer to that variable. + + k_ESteamNetworkingConfigDataType__Force32Bit = 0x7fffffff +}; + +/// Configuration options +enum ESteamNetworkingConfigValue +{ + k_ESteamNetworkingConfig_Invalid = 0, + + /// [global float, 0--100] Randomly discard N pct of packets instead of sending/recv + /// This is a global option only, since it is applied at a low level + /// where we don't have much context + k_ESteamNetworkingConfig_FakePacketLoss_Send = 2, + k_ESteamNetworkingConfig_FakePacketLoss_Recv = 3, + + /// [global int32]. Delay all outbound/inbound packets by N ms + k_ESteamNetworkingConfig_FakePacketLag_Send = 4, + k_ESteamNetworkingConfig_FakePacketLag_Recv = 5, + + /// [global float] 0-100 Percentage of packets we will add additional delay + /// to (causing them to be reordered) + k_ESteamNetworkingConfig_FakePacketReorder_Send = 6, + k_ESteamNetworkingConfig_FakePacketReorder_Recv = 7, + + /// [global int32] Extra delay, in ms, to apply to reordered packets. + k_ESteamNetworkingConfig_FakePacketReorder_Time = 8, + + /// [global float 0--100] Globally duplicate some percentage of packets we send + k_ESteamNetworkingConfig_FakePacketDup_Send = 26, + k_ESteamNetworkingConfig_FakePacketDup_Recv = 27, + + /// [global int32] Amount of delay, in ms, to delay duplicated packets. + /// (We chose a random delay between 0 and this value) + k_ESteamNetworkingConfig_FakePacketDup_TimeMax = 28, + + /// [connection int32] Timeout value (in ms) to use when first connecting + k_ESteamNetworkingConfig_TimeoutInitial = 24, + + /// [connection int32] Timeout value (in ms) to use after connection is established + k_ESteamNetworkingConfig_TimeoutConnected = 25, + + /// [connection int32] Upper limit of buffered pending bytes to be sent, + /// if this is reached SendMessage will return k_EResultLimitExceeded + /// Default is 512k (524288 bytes) + k_ESteamNetworkingConfig_SendBufferSize = 9, + + /// [connection int32] Minimum/maximum send rate clamp, 0 is no limit. + /// This value will control the min/max allowed sending rate that + /// bandwidth estimation is allowed to reach. Default is 0 (no-limit) + k_ESteamNetworkingConfig_SendRateMin = 10, + k_ESteamNetworkingConfig_SendRateMax = 11, + + /// [connection int32] Nagle time, in microseconds. When SendMessage is called, if + /// the outgoing message is less than the size of the MTU, it will be + /// queued for a delay equal to the Nagle timer value. This is to ensure + /// that if the application sends several small messages rapidly, they are + /// coalesced into a single packet. + /// See historical RFC 896. Value is in microseconds. + /// Default is 5000us (5ms). + k_ESteamNetworkingConfig_NagleTime = 12, + + /// [connection int32] Don't automatically fail IP connections that don't have + /// strong auth. On clients, this means we will attempt the connection even if + /// we don't know our identity or can't get a cert. On the server, it means that + /// we won't automatically reject a connection due to a failure to authenticate. + /// (You can examine the incoming connection and decide whether to accept it.) + k_ESteamNetworkingConfig_IP_AllowWithoutAuth = 23, + + // + // Settings for SDR relayed connections + // + + /// [int32 global] If the first N pings to a port all fail, mark that port as unavailable for + /// a while, and try a different one. Some ISPs and routers may drop the first + /// packet, so setting this to 1 may greatly disrupt communications. + k_ESteamNetworkingConfig_SDRClient_ConsecutitivePingTimeoutsFailInitial = 19, + + /// [int32 global] If N consecutive pings to a port fail, after having received successful + /// communication, mark that port as unavailable for a while, and try a + /// different one. + k_ESteamNetworkingConfig_SDRClient_ConsecutitivePingTimeoutsFail = 20, + + /// [int32 global] Minimum number of lifetime pings we need to send, before we think our estimate + /// is solid. The first ping to each cluster is very often delayed because of NAT, + /// routers not having the best route, etc. Until we've sent a sufficient number + /// of pings, our estimate is often inaccurate. Keep pinging until we get this + /// many pings. + k_ESteamNetworkingConfig_SDRClient_MinPingsBeforePingAccurate = 21, + + /// [int32 global] Set all steam datagram traffic to originate from the same + /// local port. By default, we open up a new UDP socket (on a different local + /// port) for each relay. This is slightly less optimal, but it works around + /// some routers that don't implement NAT properly. If you have intermittent + /// problems talking to relays that might be NAT related, try toggling + /// this flag + k_ESteamNetworkingConfig_SDRClient_SingleSocket = 22, + + /// [global string] Code of relay cluster to force use. If not empty, we will + /// only use relays in that cluster. E.g. 'iad' + k_ESteamNetworkingConfig_SDRClient_ForceRelayCluster = 29, + + /// [connection string] For debugging, generate our own (unsigned) ticket, using + /// the specified gameserver address. Router must be configured to accept unsigned + /// tickets. + k_ESteamNetworkingConfig_SDRClient_DebugTicketAddress = 30, + + /// [global string] For debugging. Override list of relays from the config with + /// this set (maybe just one). Comma-separated list. + k_ESteamNetworkingConfig_SDRClient_ForceProxyAddr = 31, + + // + // Log levels for debuging information. A higher priority + // (lower numeric value) will cause more stuff to be printed. + // + k_ESteamNetworkingConfig_LogLevel_AckRTT = 13, // [connection int32] RTT calculations for inline pings and replies + k_ESteamNetworkingConfig_LogLevel_PacketDecode = 14, // [connection int32] log SNP packets send + k_ESteamNetworkingConfig_LogLevel_Message = 15, // [connection int32] log each message send/recv + k_ESteamNetworkingConfig_LogLevel_PacketGaps = 16, // [connection int32] dropped packets + k_ESteamNetworkingConfig_LogLevel_P2PRendezvous = 17, // [connection int32] P2P rendezvous messages + k_ESteamNetworkingConfig_LogLevel_SDRRelayPings = 18, // [global int32] Ping relays + + k_ESteamNetworkingConfigValue__Force32Bit = 0x7fffffff +}; + +/// Return value of ISteamNetworkintgUtils::GetConfigValue +enum ESteamNetworkingGetConfigValueResult +{ + k_ESteamNetworkingGetConfigValue_BadValue = -1, // No such configuration value + k_ESteamNetworkingGetConfigValue_BadScopeObj = -2, // Bad connection handle, etc + k_ESteamNetworkingGetConfigValue_BufferTooSmall = -3, // Couldn't fit the result in your buffer + k_ESteamNetworkingGetConfigValue_OK = 1, + k_ESteamNetworkingGetConfigValue_OKInherited = 2, // A value was not set at this level, but the effective (inherited) value was returned. + + k_ESteamNetworkingGetConfigValueResult__Force32Bit = 0x7fffffff +}; + +// +// Debug output +// + +/// Detail level for diagnostic output callback. +/// See ISteamNetworkingUtils::SetDebugOutputFunction +enum ESteamNetworkingSocketsDebugOutputType +{ + k_ESteamNetworkingSocketsDebugOutputType_None = 0, + k_ESteamNetworkingSocketsDebugOutputType_Bug = 1, // You used the API incorrectly, or an internal error happened + k_ESteamNetworkingSocketsDebugOutputType_Error = 2, // Run-time error condition that isn't the result of a bug. (E.g. we are offline, cannot bind a port, etc) + k_ESteamNetworkingSocketsDebugOutputType_Important = 3, // Nothing is wrong, but this is an important notification + k_ESteamNetworkingSocketsDebugOutputType_Warning = 4, + k_ESteamNetworkingSocketsDebugOutputType_Msg = 5, // Recommended amount + k_ESteamNetworkingSocketsDebugOutputType_Verbose = 6, // Quite a bit + k_ESteamNetworkingSocketsDebugOutputType_Debug = 7, // Practically everything + k_ESteamNetworkingSocketsDebugOutputType_Everything = 8, // Wall of text, detailed packet contents breakdown, etc + + k_ESteamNetworkingSocketsDebugOutputType__Force32Bit = 0x7fffffff +}; + +/// Setup callback for debug output, and the desired verbosity you want. +typedef void (*FSteamNetworkingSocketsDebugOutput)( ESteamNetworkingSocketsDebugOutputType nType, const char *pszMsg ); + +// +// Valve data centers +// + +/// Convert 3- or 4-character ID to 32-bit int. +inline SteamNetworkingPOPID CalculateSteamNetworkingPOPIDFromString( const char *pszCode ) +{ + // OK we made a bad decision when we decided how to pack 3-character codes into a uint32. We'd like to support + // 4-character codes, but we don't want to break compatibility. The migration path has some subtleties that make + // this nontrivial, and there are already some IDs stored in SQL. Ug, so the 4 character code "abcd" will + // be encoded with the digits like "0xddaabbcc". + // + // Also: we don't currently use 1- or 2-character codes, but if ever do in the future, let's make sure don't read + // past the end of the string and access uninitialized memory. (And if the string is empty, we always want + // to return 0 and not read bytes past the '\0'.) + // + // There is also extra paranoia to make sure the bytes are not treated as signed. + SteamNetworkingPOPID result = (uint32)(uint8)pszCode[0] << 16U; + if ( pszCode[1] ) + { + result |= ( (uint32)(uint8)pszCode[1] << 8U ); + if ( pszCode[2] ) + { + result |= (uint32)(uint8)pszCode[2] | ( (uint32)(uint8)pszCode[3] << 24U ); + } + } + return result; +} + +/// Unpack integer to string representation, including terminating '\0' +template +inline void GetSteamNetworkingLocationPOPStringFromID( SteamNetworkingPOPID id, char (&szCode)[N] ) +{ + static_assert( N >= 5, "Fixed-size buffer not big enough to hold SDR POP ID" ); + szCode[0] = char( id >> 16U ); + szCode[1] = char( id >> 8U ); + szCode[2] = char( id ); + szCode[3] = char( id >> 24U ); // See comment above about deep regret and sadness + szCode[4] = 0; +} + +/////////////////////////////////////////////////////////////////////////////// +// +// Internal stuff + +// For code compatibility +typedef SteamNetworkingMessage_t ISteamNetworkingMessage; +typedef SteamNetworkingErrMsg SteamDatagramErrMsg; + +inline void SteamNetworkingIPAddr::Clear() { memset( this, 0, sizeof(*this) ); } +inline bool SteamNetworkingIPAddr::IsIPv6AllZeros() const { const uint64 *q = (const uint64 *)m_ipv6; return q[0] == 0 && q[1] == 0; } +inline void SteamNetworkingIPAddr::SetIPv6( const uint8 *ipv6, uint16 nPort ) { memcpy( m_ipv6, ipv6, 16 ); m_port = nPort; } +inline void SteamNetworkingIPAddr::SetIPv4( uint32 nIP, uint16 nPort ) { m_ipv4.m_8zeros = 0; m_ipv4.m_0000 = 0; m_ipv4.m_ffff = 0xffff; m_ipv4.m_ip[0] = uint8(nIP>>24); m_ipv4.m_ip[1] = uint8(nIP>>16); m_ipv4.m_ip[2] = uint8(nIP>>8); m_ipv4.m_ip[3] = uint8(nIP); m_port = nPort; } +inline bool SteamNetworkingIPAddr::IsIPv4() const { return m_ipv4.m_8zeros == 0 && m_ipv4.m_0000 == 0 && m_ipv4.m_ffff == 0xffff; } +inline uint32 SteamNetworkingIPAddr::GetIPv4() const { return IsIPv4() ? ( (uint32(m_ipv4.m_ip[0])<<24) | (uint32(m_ipv4.m_ip[1])<<16) | (uint32(m_ipv4.m_ip[2])<<8) | uint32(m_ipv4.m_ip[3]) ) : 0; } +inline void SteamNetworkingIPAddr::SetIPv6LocalHost( uint16 nPort ) { m_ipv4.m_8zeros = 0; m_ipv4.m_0000 = 0; m_ipv4.m_ffff = 0; m_ipv6[12] = 0; m_ipv6[13] = 0; m_ipv6[14] = 0; m_ipv6[15] = 1; m_port = nPort; } +inline bool SteamNetworkingIPAddr::IsLocalHost() const { return ( m_ipv4.m_8zeros == 0 && m_ipv4.m_0000 == 0 && m_ipv4.m_ffff == 0 && m_ipv6[12] == 0 && m_ipv6[13] == 0 && m_ipv6[14] == 0 && m_ipv6[15] == 1 ) || ( GetIPv4() == 0x7f000001 ); } +inline bool SteamNetworkingIPAddr::operator==(const SteamNetworkingIPAddr &x ) const { return memcmp( this, &x, sizeof(SteamNetworkingIPAddr) ) == 0; } + +inline void SteamNetworkingIdentity::Clear() { memset( this, 0, sizeof(*this) ); } +inline bool SteamNetworkingIdentity::IsInvalid() const { return m_eType == k_ESteamNetworkingIdentityType_Invalid; } +inline void SteamNetworkingIdentity::SetSteamID( CSteamID steamID ) { SetSteamID64( steamID.ConvertToUint64() ); } +inline CSteamID SteamNetworkingIdentity::GetSteamID() const { return CSteamID( GetSteamID64() ); } +inline void SteamNetworkingIdentity::SetSteamID64( uint64 steamID ) { m_eType = k_ESteamNetworkingIdentityType_SteamID; m_cbSize = sizeof( m_steamID64 ); m_steamID64 = steamID; } +inline uint64 SteamNetworkingIdentity::GetSteamID64() const { return m_eType == k_ESteamNetworkingIdentityType_SteamID ? m_steamID64 : 0; } +inline bool SteamNetworkingIdentity::SetXboxPairwiseID( const char *pszString ) { size_t l = strlen( pszString ); if ( l < 1 || l >= sizeof(m_szXboxPairwiseID) ) return false; + m_eType = k_ESteamNetworkingIdentityType_XboxPairwiseID; m_cbSize = int(l+1); memcpy( m_szXboxPairwiseID, pszString, m_cbSize ); return true; } +inline const char *SteamNetworkingIdentity::GetXboxPairwiseID() const { return m_eType == k_ESteamNetworkingIdentityType_XboxPairwiseID ? m_szXboxPairwiseID : nullptr; } +inline void SteamNetworkingIdentity::SetIPAddr( const SteamNetworkingIPAddr &addr ) { m_eType = k_ESteamNetworkingIdentityType_IPAddress; m_cbSize = (int)sizeof(m_ip); m_ip = addr; } +inline const SteamNetworkingIPAddr *SteamNetworkingIdentity::GetIPAddr() const { return m_eType == k_ESteamNetworkingIdentityType_IPAddress ? &m_ip : nullptr; } +inline void SteamNetworkingIdentity::SetLocalHost() { m_eType = k_ESteamNetworkingIdentityType_IPAddress; m_cbSize = (int)sizeof(m_ip); m_ip.SetIPv6LocalHost(); } +inline bool SteamNetworkingIdentity::IsLocalHost() const { return m_eType == k_ESteamNetworkingIdentityType_IPAddress && m_ip.IsLocalHost(); } +inline bool SteamNetworkingIdentity::SetGenericString( const char *pszString ) { size_t l = strlen( pszString ); if ( l >= sizeof(m_szGenericString) ) return false; + m_eType = k_ESteamNetworkingIdentityType_GenericString; m_cbSize = int(l+1); memcpy( m_szGenericString, pszString, m_cbSize ); return true; } +inline const char *SteamNetworkingIdentity::GetGenericString() const { return m_eType == k_ESteamNetworkingIdentityType_GenericString ? m_szGenericString : nullptr; } +inline bool SteamNetworkingIdentity::SetGenericBytes( const void *data, size_t cbLen ) { if ( cbLen > sizeof(m_genericBytes) ) return false; + m_eType = k_ESteamNetworkingIdentityType_GenericBytes; m_cbSize = int(cbLen); memcpy( m_genericBytes, data, m_cbSize ); return true; } +inline const uint8 *SteamNetworkingIdentity::GetGenericBytes( int &cbLen ) const { if ( m_eType != k_ESteamNetworkingIdentityType_GenericBytes ) return nullptr; + cbLen = m_cbSize; return m_genericBytes; } +inline bool SteamNetworkingIdentity::operator==(const SteamNetworkingIdentity &x ) const { return m_eType == x.m_eType && m_cbSize == x.m_cbSize && memcmp( m_genericBytes, x.m_genericBytes, m_cbSize ) == 0; } +inline void SteamNetworkingMessage_t::Release() { (*m_pfnRelease)( this ); } + +#if defined( STEAMNETWORKINGSOCKETS_STATIC_LINK ) || !defined( STEAMNETWORKINGSOCKETS_STEAM ) +STEAMNETWORKINGSOCKETS_INTERFACE void SteamAPI_SteamNetworkingIPAddr_ToString( const SteamNetworkingIPAddr *pAddr, char *buf, size_t cbBuf, bool bWithPort ); +STEAMNETWORKINGSOCKETS_INTERFACE bool SteamAPI_SteamNetworkingIPAddr_ParseString( SteamNetworkingIPAddr *pAddr, const char *pszStr ); +STEAMNETWORKINGSOCKETS_INTERFACE void SteamAPI_SteamNetworkingIdentity_ToString( const SteamNetworkingIdentity &identity, char *buf, size_t cbBuf ); +STEAMNETWORKINGSOCKETS_INTERFACE bool SteamAPI_SteamNetworkingIdentity_ParseString( SteamNetworkingIdentity *pIdentity, size_t sizeofIdentity, const char *pszStr ); +inline void SteamNetworkingIPAddr::ToString( char *buf, size_t cbBuf, bool bWithPort ) const { SteamAPI_SteamNetworkingIPAddr_ToString( this, buf, cbBuf, bWithPort ); } +inline bool SteamNetworkingIPAddr::ParseString( const char *pszStr ) { return SteamAPI_SteamNetworkingIPAddr_ParseString( this, pszStr ); } +inline void SteamNetworkingIdentity::ToString( char *buf, size_t cbBuf ) const { SteamAPI_SteamNetworkingIdentity_ToString( *this, buf, cbBuf ); } +inline bool SteamNetworkingIdentity::ParseString( const char *pszStr ) { return SteamAPI_SteamNetworkingIdentity_ParseString( this, sizeof(*this), pszStr ); } +#endif + +#endif // #ifndef STEAMNETWORKINGTYPES diff --git a/Generator/steam_sdk/steamtypes.h b/Generator/steam_sdk/steamtypes.h index 45c195e..72d2d17 100644 --- a/Generator/steam_sdk/steamtypes.h +++ b/Generator/steam_sdk/steamtypes.h @@ -85,25 +85,25 @@ typedef unsigned int uintp; #endif // else _WIN32 #ifdef API_GEN -# define CLANG_ATTR(ATTR) __attribute__((annotate( ATTR ))) +# define STEAM_CLANG_ATTR(ATTR) __attribute__((annotate( ATTR ))) #else -# define CLANG_ATTR(ATTR) +# define STEAM_CLANG_ATTR(ATTR) #endif -#define METHOD_DESC(DESC) CLANG_ATTR( "desc:" #DESC ";" ) -#define IGNOREATTR() CLANG_ATTR( "ignore" ) -#define OUT_STRUCT() CLANG_ATTR( "out_struct: ;" ) -#define OUT_STRING() CLANG_ATTR( "out_string: ;" ) -#define OUT_ARRAY_CALL(COUNTER,FUNCTION,PARAMS) CLANG_ATTR( "out_array_call:" #COUNTER "," #FUNCTION "," #PARAMS ";" ) -#define OUT_ARRAY_COUNT(COUNTER, DESC) CLANG_ATTR( "out_array_count:" #COUNTER ";desc:" #DESC ) -#define ARRAY_COUNT(COUNTER) CLANG_ATTR( "array_count:" #COUNTER ";" ) -#define ARRAY_COUNT_D(COUNTER, DESC) CLANG_ATTR( "array_count:" #COUNTER ";desc:" #DESC ) -#define BUFFER_COUNT(COUNTER) CLANG_ATTR( "buffer_count:" #COUNTER ";" ) -#define OUT_BUFFER_COUNT(COUNTER) CLANG_ATTR( "out_buffer_count:" #COUNTER ";" ) -#define OUT_STRING_COUNT(COUNTER) CLANG_ATTR( "out_string_count:" #COUNTER ";" ) -#define DESC(DESC) CLANG_ATTR("desc:" #DESC ";") -#define CALL_RESULT(RESULT_TYPE) CLANG_ATTR("callresult:" #RESULT_TYPE ";") -#define CALL_BACK(RESULT_TYPE) CLANG_ATTR("callback:" #RESULT_TYPE ";") +#define STEAM_METHOD_DESC(DESC) STEAM_CLANG_ATTR( "desc:" #DESC ";" ) +#define STEAM_IGNOREATTR() STEAM_CLANG_ATTR( "ignore" ) +#define STEAM_OUT_STRUCT() STEAM_CLANG_ATTR( "out_struct: ;" ) +#define STEAM_OUT_STRING() STEAM_CLANG_ATTR( "out_string: ;" ) +#define STEAM_OUT_ARRAY_CALL(COUNTER,FUNCTION,PARAMS) STEAM_CLANG_ATTR( "out_array_call:" #COUNTER "," #FUNCTION "," #PARAMS ";" ) +#define STEAM_OUT_ARRAY_COUNT(COUNTER, DESC) STEAM_CLANG_ATTR( "out_array_count:" #COUNTER ";desc:" #DESC ) +#define STEAM_ARRAY_COUNT(COUNTER) STEAM_CLANG_ATTR( "array_count:" #COUNTER ";" ) +#define STEAM_ARRAY_COUNT_D(COUNTER, DESC) STEAM_CLANG_ATTR( "array_count:" #COUNTER ";desc:" #DESC ) +#define STEAM_BUFFER_COUNT(COUNTER) STEAM_CLANG_ATTR( "buffer_count:" #COUNTER ";" ) +#define STEAM_OUT_BUFFER_COUNT(COUNTER) STEAM_CLANG_ATTR( "out_buffer_count:" #COUNTER ";" ) +#define STEAM_OUT_STRING_COUNT(COUNTER) STEAM_CLANG_ATTR( "out_string_count:" #COUNTER ";" ) +#define STEAM_DESC(DESC) STEAM_CLANG_ATTR("desc:" #DESC ";") +#define STEAM_CALL_RESULT(RESULT_TYPE) STEAM_CLANG_ATTR("callresult:" #RESULT_TYPE ";") +#define STEAM_CALL_BACK(RESULT_TYPE) STEAM_CLANG_ATTR("callback:" #RESULT_TYPE ";") const int k_cubSaltSize = 8; typedef uint8 Salt_t[ k_cubSaltSize ]; @@ -180,5 +180,8 @@ const ManifestId_t k_uManifestIdInvalid = 0; typedef uint64 SiteId_t; const SiteId_t k_ulSiteIdInvalid = 0; +// Party Beacon ID +typedef uint64 PartyBeaconID_t; +const PartyBeaconID_t k_ulPartyBeaconIdInvalid = 0; #endif // STEAMTYPES_H