mirror of
https://github.com/rehlds/rehlds.git
synced 2025-02-26 21:41:06 +03:00
Upgrade steamworks from v1.22 to v1.60
This commit is contained in:
parent
1a68407710
commit
659dd29869
@ -740,7 +740,7 @@ qboolean Master_IsLanGame(void)
|
||||
void Master_Heartbeat_f(void)
|
||||
{
|
||||
//Steam_ForceHeartbeat in move?
|
||||
CRehldsPlatformHolder::get()->SteamGameServer()->ForceHeartbeat();
|
||||
CRehldsPlatformHolder::get()->SteamGameServer()->ForceMasterServerHeartbeat();
|
||||
}
|
||||
|
||||
void Host_ComputeFPS(double frametime)
|
||||
|
@ -316,7 +316,7 @@ void CSteam3Server::Activate()
|
||||
{
|
||||
if (!gfNoMasterServer && g_psvs.maxclients > 1)
|
||||
{
|
||||
CRehldsPlatformHolder::get()->SteamGameServer()->EnableHeartbeats(true);
|
||||
CRehldsPlatformHolder::get()->SteamGameServer()->SetAdvertiseServerActive(true);
|
||||
double fMasterHeartbeatTimeout = 200.0;
|
||||
if (!Q_strcmp(gamedir, "dmc"))
|
||||
fMasterHeartbeatTimeout = 150.0;
|
||||
@ -325,7 +325,7 @@ void CSteam3Server::Activate()
|
||||
if (!Q_strcmp(gamedir, "cstrike"))
|
||||
fMasterHeartbeatTimeout = 400.0;
|
||||
|
||||
CRehldsPlatformHolder::get()->SteamGameServer()->SetHeartbeatInterval((int)fMasterHeartbeatTimeout);
|
||||
CRehldsPlatformHolder::get()->SteamGameServer()->SetMasterServerHeartbeatInterval((int)fMasterHeartbeatTimeout);
|
||||
CSteam3Server::NotifyOfLevelChange(true);
|
||||
}
|
||||
}
|
||||
@ -336,7 +336,7 @@ void CSteam3Server::Shutdown()
|
||||
{
|
||||
if (m_bLoggedOn)
|
||||
{
|
||||
SteamGameServer()->EnableHeartbeats(0);
|
||||
SteamGameServer()->SetAdvertiseServerActive(false);
|
||||
SteamGameServer()->LogOff();
|
||||
|
||||
SteamGameServer_Shutdown();
|
||||
@ -829,10 +829,7 @@ qboolean Steam_GSBSecurePreference()
|
||||
|
||||
TSteamGlobalUserID Steam_Steam3IDtoSteam2(uint64 unSteamID)
|
||||
{
|
||||
class CSteamID steamID = unSteamID;
|
||||
TSteamGlobalUserID steam2ID;
|
||||
steamID.ConvertToSteam2(&steam2ID);
|
||||
return steam2ID;
|
||||
return SteamIDToSteam2UserID(unSteamID);
|
||||
}
|
||||
|
||||
uint64 Steam_StringToSteamID(const char *pStr)
|
||||
@ -841,11 +838,11 @@ uint64 Steam_StringToSteamID(const char *pStr)
|
||||
if (Steam3Server())
|
||||
{
|
||||
CSteamID serverSteamId(Steam3Server()->GetSteamID());
|
||||
steamID.SetFromSteam2String(pStr, serverSteamId.GetEUniverse());
|
||||
SteamIDFromSteam2String(pStr, serverSteamId.GetEUniverse(), &steamID);
|
||||
}
|
||||
else
|
||||
{
|
||||
steamID.SetFromSteam2String(pStr, k_EUniversePublic);
|
||||
SteamIDFromSteam2String(pStr, k_EUniversePublic, &steamID);
|
||||
}
|
||||
|
||||
return steamID.ConvertToUint64();
|
||||
@ -912,14 +909,14 @@ void Master_SetMaster_f()
|
||||
if (gfNoMasterServer)
|
||||
{
|
||||
gfNoMasterServer = FALSE;
|
||||
CRehldsPlatformHolder::get()->SteamGameServer()->EnableHeartbeats(gfNoMasterServer != 0);
|
||||
CRehldsPlatformHolder::get()->SteamGameServer()->SetAdvertiseServerActive(gfNoMasterServer != 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
gfNoMasterServer = TRUE;
|
||||
CRehldsPlatformHolder::get()->SteamGameServer()->EnableHeartbeats(gfNoMasterServer != 0);
|
||||
CRehldsPlatformHolder::get()->SteamGameServer()->SetAdvertiseServerActive(gfNoMasterServer != 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -30,7 +30,12 @@
|
||||
|
||||
#include "maintypes.h"
|
||||
#include "common.h"
|
||||
|
||||
#if !defined(INCLUDED_STEAM_STEAMUSERIDTYPES_H)
|
||||
#define INCLUDED_STEAM2_USERID_STRUCTS
|
||||
#include "common/SteamCommon.h"
|
||||
#endif
|
||||
|
||||
#include "public/steam/steam_api.h"
|
||||
#include "public/steam/steam_gameserver.h"
|
||||
#include "public/steam/steamclientpublic.h"
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -407,26 +407,45 @@
|
||||
<ClInclude Include="..\public\rehlds\pr_dlls.h" />
|
||||
<ClInclude Include="..\public\savegame_version.h" />
|
||||
<ClInclude Include="..\public\steam\isteamapps.h" />
|
||||
<ClInclude Include="..\public\steam\isteambilling.h" />
|
||||
<ClInclude Include="..\public\steam\isteamclient.h" />
|
||||
<ClInclude Include="..\public\steam\isteamcontroller.h" />
|
||||
<ClInclude Include="..\public\steam\isteamdualsense.h" />
|
||||
<ClInclude Include="..\public\steam\isteamfriends.h" />
|
||||
<ClInclude Include="..\public\steam\isteamgamecoordinator.h" />
|
||||
<ClInclude Include="..\public\steam\isteamgameserver.h" />
|
||||
<ClInclude Include="..\public\steam\isteamgameserverstats.h" />
|
||||
<ClInclude Include="..\public\steam\isteamhtmlsurface.h" />
|
||||
<ClInclude Include="..\public\steam\isteamhttp.h" />
|
||||
<ClInclude Include="..\public\steam\isteaminput.h" />
|
||||
<ClInclude Include="..\public\steam\isteaminventory.h" />
|
||||
<ClInclude Include="..\public\steam\isteammatchmaking.h" />
|
||||
<ClInclude Include="..\public\steam\isteammusic.h" />
|
||||
<ClInclude Include="..\public\steam\isteammusicremote.h" />
|
||||
<ClInclude Include="..\public\steam\isteamnetworking.h" />
|
||||
<ClInclude Include="..\public\steam\isteamnetworkingmessages.h" />
|
||||
<ClInclude Include="..\public\steam\isteamnetworkingsockets.h" />
|
||||
<ClInclude Include="..\public\steam\isteamnetworkingutils.h" />
|
||||
<ClInclude Include="..\public\steam\isteamparentalsettings.h" />
|
||||
<ClInclude Include="..\public\steam\isteamremoteplay.h" />
|
||||
<ClInclude Include="..\public\steam\isteamremotestorage.h" />
|
||||
<ClInclude Include="..\public\steam\isteamscreenshots.h" />
|
||||
<ClInclude Include="..\public\steam\isteamunifiedmessages.h" />
|
||||
<ClInclude Include="..\public\steam\isteamtimeline.h" />
|
||||
<ClInclude Include="..\public\steam\isteamugc.h" />
|
||||
<ClInclude Include="..\public\steam\isteamuser.h" />
|
||||
<ClInclude Include="..\public\steam\isteamuserstats.h" />
|
||||
<ClInclude Include="..\public\steam\isteamutils.h" />
|
||||
<ClInclude Include="..\public\steam\isteamvideo.h" />
|
||||
<ClInclude Include="..\public\steam\matchmakingtypes.h" />
|
||||
<ClInclude Include="..\public\steam\steamclientpublic.h" />
|
||||
<ClInclude Include="..\public\steam\steamhttpenums.h" />
|
||||
<ClInclude Include="..\public\steam\steamnetworkingfakeip.h" />
|
||||
<ClInclude Include="..\public\steam\steamnetworkingtypes.h" />
|
||||
<ClInclude Include="..\public\steam\steamtypes.h" />
|
||||
<ClInclude Include="..\public\steam\steamuniverse.h" />
|
||||
<ClInclude Include="..\public\steam\steam_api.h" />
|
||||
<ClInclude Include="..\public\steam\steam_api_common.h" />
|
||||
<ClInclude Include="..\public\steam\steam_api_flat.h" />
|
||||
<ClInclude Include="..\public\steam\steam_api_internal.h" />
|
||||
<ClInclude Include="..\public\steam\steam_gameserver.h" />
|
||||
<ClInclude Include="..\public\string_t.h" />
|
||||
<ClInclude Include="..\public\strtools.h" />
|
||||
|
@ -550,9 +550,6 @@
|
||||
<ClInclude Include="..\public\interface.h">
|
||||
<Filter>public</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\steam\steamtypes.h">
|
||||
<Filter>public\steam</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\engine\filesystem_.h">
|
||||
<Filter>engine\common</Filter>
|
||||
</ClInclude>
|
||||
@ -589,69 +586,6 @@
|
||||
<ClInclude Include="..\engine\sv_steam3.h">
|
||||
<Filter>engine\common</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\steam\isteamapps.h">
|
||||
<Filter>public\steam</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\steam\isteambilling.h">
|
||||
<Filter>public\steam</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\steam\isteamclient.h">
|
||||
<Filter>public\steam</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\steam\isteamcontroller.h">
|
||||
<Filter>public\steam</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\steam\isteamfriends.h">
|
||||
<Filter>public\steam</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\steam\isteamgameserver.h">
|
||||
<Filter>public\steam</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\steam\isteamgameserverstats.h">
|
||||
<Filter>public\steam</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\steam\isteamhttp.h">
|
||||
<Filter>public\steam</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\steam\isteammatchmaking.h">
|
||||
<Filter>public\steam</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\steam\isteamnetworking.h">
|
||||
<Filter>public\steam</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\steam\isteamremotestorage.h">
|
||||
<Filter>public\steam</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\steam\isteamscreenshots.h">
|
||||
<Filter>public\steam</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\steam\isteamunifiedmessages.h">
|
||||
<Filter>public\steam</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\steam\isteamuser.h">
|
||||
<Filter>public\steam</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\steam\isteamuserstats.h">
|
||||
<Filter>public\steam</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\steam\isteamutils.h">
|
||||
<Filter>public\steam</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\steam\matchmakingtypes.h">
|
||||
<Filter>public\steam</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\steam\steam_api.h">
|
||||
<Filter>public\steam</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\steam\steam_gameserver.h">
|
||||
<Filter>public\steam</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\steam\steamclientpublic.h">
|
||||
<Filter>public\steam</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\steam\steamhttpenums.h">
|
||||
<Filter>public\steam</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\common\SteamCommon.h">
|
||||
<Filter>common</Filter>
|
||||
</ClInclude>
|
||||
@ -1069,5 +1003,128 @@
|
||||
<ClInclude Include="..\public\rehlds\IMessageManager.h">
|
||||
<Filter>public\rehlds</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\steam\isteamapps.h">
|
||||
<Filter>public\steam</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\steam\isteamclient.h">
|
||||
<Filter>public\steam</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\steam\isteamcontroller.h">
|
||||
<Filter>public\steam</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\steam\isteamdualsense.h">
|
||||
<Filter>public\steam</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\steam\isteamfriends.h">
|
||||
<Filter>public\steam</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\steam\isteamgamecoordinator.h">
|
||||
<Filter>public\steam</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\steam\isteamgameserver.h">
|
||||
<Filter>public\steam</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\steam\isteamgameserverstats.h">
|
||||
<Filter>public\steam</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\steam\isteamhtmlsurface.h">
|
||||
<Filter>public\steam</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\steam\isteamhttp.h">
|
||||
<Filter>public\steam</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\steam\isteaminput.h">
|
||||
<Filter>public\steam</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\steam\isteaminventory.h">
|
||||
<Filter>public\steam</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\steam\isteammatchmaking.h">
|
||||
<Filter>public\steam</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\steam\isteammusic.h">
|
||||
<Filter>public\steam</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\steam\isteammusicremote.h">
|
||||
<Filter>public\steam</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\steam\isteamnetworking.h">
|
||||
<Filter>public\steam</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\steam\isteamnetworkingmessages.h">
|
||||
<Filter>public\steam</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\steam\isteamnetworkingsockets.h">
|
||||
<Filter>public\steam</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\steam\isteamnetworkingutils.h">
|
||||
<Filter>public\steam</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\steam\isteamparentalsettings.h">
|
||||
<Filter>public\steam</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\steam\isteamremoteplay.h">
|
||||
<Filter>public\steam</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\steam\isteamremotestorage.h">
|
||||
<Filter>public\steam</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\steam\isteamscreenshots.h">
|
||||
<Filter>public\steam</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\steam\isteamtimeline.h">
|
||||
<Filter>public\steam</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\steam\isteamugc.h">
|
||||
<Filter>public\steam</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\steam\isteamuser.h">
|
||||
<Filter>public\steam</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\steam\isteamuserstats.h">
|
||||
<Filter>public\steam</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\steam\isteamutils.h">
|
||||
<Filter>public\steam</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\steam\isteamvideo.h">
|
||||
<Filter>public\steam</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\steam\matchmakingtypes.h">
|
||||
<Filter>public\steam</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\steam\steam_api.h">
|
||||
<Filter>public\steam</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\steam\steam_api_common.h">
|
||||
<Filter>public\steam</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\steam\steam_api_flat.h">
|
||||
<Filter>public\steam</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\steam\steam_api_internal.h">
|
||||
<Filter>public\steam</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\steam\steam_gameserver.h">
|
||||
<Filter>public\steam</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\steam\steamclientpublic.h">
|
||||
<Filter>public\steam</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\steam\steamhttpenums.h">
|
||||
<Filter>public\steam</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\steam\steamnetworkingfakeip.h">
|
||||
<Filter>public\steam</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\steam\steamnetworkingtypes.h">
|
||||
<Filter>public\steam</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\steam\steamtypes.h">
|
||||
<Filter>public\steam</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\steam\steamuniverse.h">
|
||||
<Filter>public\steam</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
@ -45,7 +45,7 @@ typedef __int32 intp; // intp is an integer that can accomodate a pointer
|
||||
typedef unsigned __int32 uintp; // (ie, sizeof(intp) >= sizeof(int) && sizeof(intp) >= sizeof(void *)
|
||||
|
||||
#else /* _WIN32 */
|
||||
typedef char int8;
|
||||
typedef signed char int8;
|
||||
typedef unsigned char uint8;
|
||||
typedef short int16;
|
||||
typedef unsigned short uint16;
|
||||
|
@ -1,4 +1,4 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//====== Copyright © 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: interface to app data in Steam
|
||||
//
|
||||
@ -10,7 +10,9 @@
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
const int k_cubAppProofOfPurchaseKeyMax = 64; // max bytes of a legacy cd key we support
|
||||
#include "steam_api_common.h"
|
||||
|
||||
const int k_cubAppProofOfPurchaseKeyMax = 240; // max supported length of a legacy cd key
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@ -50,7 +52,7 @@ public:
|
||||
virtual void InstallDLC( AppId_t nAppID ) = 0;
|
||||
virtual void UninstallDLC( AppId_t nAppID ) = 0;
|
||||
|
||||
// Request cd-key for yourself or owned DLC. If you are interested in this
|
||||
// Request legacy cd-key for yourself or owned DLC. If you are interested in this
|
||||
// data then make sure you provide us with a list of valid keys to be distributed
|
||||
// to users when they purchase the game, before the game ships.
|
||||
// You'll receive an AppProofOfPurchaseKeyResponse_t callback when
|
||||
@ -59,18 +61,72 @@ public:
|
||||
|
||||
virtual bool GetCurrentBetaName( char *pchName, int cchNameBufferSize ) = 0; // returns current beta branch name, 'public' is the default branch
|
||||
virtual bool MarkContentCorrupt( bool bMissingFilesOnly ) = 0; // signal Steam that game files seems corrupt or missing
|
||||
virtual uint32 GetInstalledDepots( DepotId_t *pvecDepots, uint32 cMaxDepots ) = 0; // return installed depots in mount order
|
||||
virtual uint32 GetInstalledDepots( AppId_t appID, DepotId_t *pvecDepots, uint32 cMaxDepots ) = 0; // return installed depots in mount order
|
||||
|
||||
// returns current app install folder for AppID, returns folder name length
|
||||
virtual uint32 GetAppInstallDir( AppId_t appID, char *pchFolder, uint32 cchFolderBufferSize ) = 0;
|
||||
virtual bool BIsAppInstalled( AppId_t appID ) = 0; // returns true if that app is installed (not necessarily owned)
|
||||
|
||||
#ifdef _PS3
|
||||
// Result returned in a RegisterActivationCodeResponse_t callresult
|
||||
virtual SteamAPICall_t RegisterActivationCode( const char *pchActivationCode ) = 0;
|
||||
#endif
|
||||
// returns the SteamID of the original owner. If this CSteamID is different from ISteamUser::GetSteamID(),
|
||||
// the user has a temporary license borrowed via Family Sharing
|
||||
virtual CSteamID GetAppOwner() = 0;
|
||||
|
||||
// Returns the associated launch param if the game is run via steam://run/<appid>//?param1=value1¶m2=value2¶m3=value3 etc.
|
||||
// Parameter names starting with the character '@' are reserved for internal use and will always return and empty string.
|
||||
// Parameter names starting with an underscore '_' are reserved for steam features -- they can be queried by the game,
|
||||
// but it is advised that you not param names beginning with an underscore for your own features.
|
||||
// Check for new launch parameters on callback NewUrlLaunchParameters_t
|
||||
virtual const char *GetLaunchQueryParam( const char *pchKey ) = 0;
|
||||
|
||||
// get download progress for optional DLC
|
||||
virtual bool GetDlcDownloadProgress( AppId_t nAppID, uint64 *punBytesDownloaded, uint64 *punBytesTotal ) = 0;
|
||||
|
||||
// return the buildid of this app, may change at any time based on backend updates to the game
|
||||
virtual int GetAppBuildId() = 0;
|
||||
|
||||
// Request all proof of purchase keys for the calling appid and associated DLC.
|
||||
// A series of AppProofOfPurchaseKeyResponse_t callbacks will be sent with
|
||||
// appropriate appid values, ending with a final callback where the m_nAppId
|
||||
// member is k_uAppIdInvalid (zero).
|
||||
virtual void RequestAllProofOfPurchaseKeys() = 0;
|
||||
|
||||
STEAM_CALL_RESULT( FileDetailsResult_t )
|
||||
virtual SteamAPICall_t GetFileDetails( const char* pszFileName ) = 0;
|
||||
|
||||
// Get command line if game was launched via Steam URL, e.g. steam://run/<appid>//<command line>/.
|
||||
// This method of passing a connect string (used when joining via rich presence, accepting an
|
||||
// invite, etc) is preferable to passing the connect string on the operating system command
|
||||
// line, which is a security risk. In order for rich presence joins to go through this
|
||||
// path and not be placed on the OS command line, you must set a value in your app's
|
||||
// configuration on Steam. Ask Valve for help with this.
|
||||
//
|
||||
// If game was already running and launched again, the NewUrlLaunchParameters_t will be fired.
|
||||
virtual int GetLaunchCommandLine( char *pszCommandLine, int cubCommandLine ) = 0;
|
||||
|
||||
// Check if user borrowed this game via Family Sharing, If true, call GetAppOwner() to get the lender SteamID
|
||||
virtual bool BIsSubscribedFromFamilySharing() = 0;
|
||||
|
||||
// check if game is a timed trial with limited playtime
|
||||
virtual bool BIsTimedTrial( uint32* punSecondsAllowed, uint32* punSecondsPlayed ) = 0;
|
||||
|
||||
// set current DLC AppID being played (or 0 if none). Allows Steam to track usage of major DLC extensions
|
||||
virtual bool SetDlcContext( AppId_t nAppID ) = 0;
|
||||
|
||||
// returns total number of known app beta branches (including default "public" branch )
|
||||
virtual int GetNumBetas( int *pnAvailable, int *pnPrivate ) = 0; //
|
||||
|
||||
// return beta branch details, name, description, current BuildID and state flags (EBetaBranchFlags)
|
||||
virtual bool GetBetaInfo( int iBetaIndex, uint32 *punFlags, uint32 *punBuildID, char *pchBetaName, int cchBetaName, char *pchDescription, int cchDescription ) = 0; // iterate through
|
||||
|
||||
// select this beta branch for this app as active, might need the game to restart so Steam can update to that branch
|
||||
virtual bool SetActiveBeta( const char *pchBetaName ) = 0;
|
||||
};
|
||||
|
||||
#define STEAMAPPS_INTERFACE_VERSION "STEAMAPPS_INTERFACE_VERSION005"
|
||||
#define STEAMAPPS_INTERFACE_VERSION "STEAMAPPS_INTERFACE_VERSION008"
|
||||
|
||||
// Global interface accessor
|
||||
inline ISteamApps *SteamApps();
|
||||
STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamApps *, SteamApps, STEAMAPPS_INTERFACE_VERSION );
|
||||
|
||||
// callbacks
|
||||
#if defined( VALVE_CALLBACK_PACK_SMALL )
|
||||
@ -78,8 +134,8 @@ public:
|
||||
#elif defined( VALVE_CALLBACK_PACK_LARGE )
|
||||
#pragma pack( push, 8 )
|
||||
#else
|
||||
#error isteamclient.h must be included
|
||||
#endif
|
||||
#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
|
||||
//-----------------------------------------------------------------------------
|
||||
@ -90,38 +146,56 @@ struct DlcInstalled_t
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: possible results when registering an activation code
|
||||
//-----------------------------------------------------------------------------
|
||||
enum ERegisterActivationCodeResult
|
||||
//---------------------------------------------------------------------------------
|
||||
// Purpose: posted after the user gains executes a Steam URL with command line or query parameters
|
||||
// such as steam://run/<appid>//-commandline/?param1=value1¶m2=value2¶m3=value3 etc
|
||||
// while the game is already running. The new params can be queried
|
||||
// with GetLaunchQueryParam and GetLaunchCommandLine
|
||||
//---------------------------------------------------------------------------------
|
||||
struct NewUrlLaunchParameters_t
|
||||
{
|
||||
k_ERegisterActivationCodeResultOK = 0,
|
||||
k_ERegisterActivationCodeResultFail = 1,
|
||||
k_ERegisterActivationCodeResultAlreadyRegistered = 2,
|
||||
k_ERegisterActivationCodeResultTimeout = 3,
|
||||
k_ERegisterActivationCodeAlreadyOwned = 4,
|
||||
enum { k_iCallback = k_iSteamAppsCallbacks + 14 };
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: response to RegisterActivationCode()
|
||||
//-----------------------------------------------------------------------------
|
||||
struct RegisterActivationCodeResponse_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamAppsCallbacks + 8 };
|
||||
ERegisterActivationCodeResult m_eResult;
|
||||
uint32 m_unPackageRegistered; // package that was registered. Only set on success
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: response to RegisterActivationCode()
|
||||
// Purpose: response to RequestAppProofOfPurchaseKey/RequestAllProofOfPurchaseKeys
|
||||
// for supporting third-party CD keys, or other proof-of-purchase systems.
|
||||
//-----------------------------------------------------------------------------
|
||||
struct AppProofOfPurchaseKeyResponse_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamAppsCallbacks + 13 };
|
||||
enum { k_iCallback = k_iSteamAppsCallbacks + 21 };
|
||||
EResult m_eResult;
|
||||
uint32 m_nAppID;
|
||||
char m_rgchKey[ k_cubAppProofOfPurchaseKeyMax ];
|
||||
uint32 m_cchKeyLength;
|
||||
char m_rgchKey[k_cubAppProofOfPurchaseKeyMax];
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: response to GetFileDetails
|
||||
//-----------------------------------------------------------------------------
|
||||
struct FileDetailsResult_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamAppsCallbacks + 23 };
|
||||
EResult m_eResult;
|
||||
uint64 m_ulFileSize; // original file size in bytes
|
||||
uint8 m_FileSHA[20]; // original file SHA1 hash
|
||||
uint32 m_unFlags; //
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: called for games in Timed Trial mode
|
||||
//-----------------------------------------------------------------------------
|
||||
struct TimedTrialStatus_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamAppsCallbacks + 30 };
|
||||
AppId_t m_unAppID; // appID
|
||||
bool m_bIsOffline; // if true, time allowed / played refers to offline time, not total time
|
||||
uint32 m_unSecondsAllowed; // how many seconds the app can be played in total
|
||||
uint32 m_unSecondsPlayed; // how many seconds the app was already played
|
||||
};
|
||||
|
||||
#pragma pack( pop )
|
||||
#endif // ISTEAMAPPS_H
|
||||
|
@ -1,108 +0,0 @@
|
||||
//====== Copyright © 1996-2004, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: interface to Billings data in Steam
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMBILLING_H
|
||||
#define ISTEAMBILLING_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: interface to billing
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamBilling
|
||||
{
|
||||
public:
|
||||
// Sets the billing address in the ISteamBilling object for use by other ISteamBilling functions (not stored on server)
|
||||
virtual bool SetBillingAddress( const char *pchName,
|
||||
const char *pchAddress1,
|
||||
const char *pchAddress2,
|
||||
const char *pchCity,
|
||||
const char *pchPostcode,
|
||||
const char *pchState,
|
||||
const char *pchCountry,
|
||||
const char *pchPhone ) = 0;
|
||||
// Gets any previous set billing address in the ISteamBilling object (not stored on server)
|
||||
virtual bool GetBillingAddress( char *pchName,
|
||||
char *pchAddress1,
|
||||
char *pchAddress2,
|
||||
char *pchCity,
|
||||
char *pchPostcode,
|
||||
char *pchState,
|
||||
char *pchCountry,
|
||||
char *pchPhone ) = 0;
|
||||
// Sets the billing address in the ISteamBilling object for use by other ISteamBilling functions (not stored on server)
|
||||
virtual bool SetShippingAddress( const char *pchName,
|
||||
const char *pchAddress1,
|
||||
const char *pchAddress2,
|
||||
const char *pchCity,
|
||||
const char *pchPostcode,
|
||||
const char *pchState,
|
||||
const char *pchCountry,
|
||||
const char *pchPhone ) = 0;
|
||||
// Gets any previous set billing address in the ISteamBilling object (not stored on server)
|
||||
virtual bool GetShippingAddress( char *pchName,
|
||||
char *pchAddress1,
|
||||
char *pchAddress2,
|
||||
char *pchCity,
|
||||
char *pchPostcode,
|
||||
char *pchState,
|
||||
char *pchCountry,
|
||||
char *pchPhone ) = 0;
|
||||
// Ask the server for the final price of package: requires that ISteamBilling billing & shipping address are set (can be same)
|
||||
virtual bool GetFinalPrice( int32 nPackageID ) = 0;
|
||||
|
||||
// Sets the credit card info in the ISteamBilling object for use by other ISteamBilling functions (may eventually also be stored on server)
|
||||
virtual bool SetCardInfo( int32 eCreditCardType,
|
||||
const char *pchCardNumber,
|
||||
const char *pchCardHolderName,
|
||||
const char *pchCardExpYear,
|
||||
const char *pchCardExpMonth,
|
||||
const char *pchCardCVV2 ) = 0;
|
||||
// Gets any credit card info in the ISteamBilling object (not stored on server)
|
||||
virtual bool GetCardInfo( int32 *eCreditCardType,
|
||||
char *pchCardNumber,
|
||||
char *pchCardHolderName,
|
||||
char *pchCardExpYear,
|
||||
char *pchCardExpMonth,
|
||||
char *pchCardCVV2 ) = 0;
|
||||
|
||||
// Ask the server to purchase a package: requires that ISteamBilling cardinfo, billing & shipping address are set
|
||||
virtual bool Purchase( int32 nPackageID,
|
||||
int32 nExpectedCostCents,
|
||||
uint64 gidCardID, // if non-NIL, use a server stored card
|
||||
bool bStoreCardInfo ) = 0; // Should this cardinfo also be stored on the server
|
||||
};
|
||||
|
||||
|
||||
#define STEAMBILLING_INTERFACE_VERSION "SteamBilling001"
|
||||
|
||||
|
||||
enum { k_iSteamBillingCallbacks = 400 };
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: called when this client has received a finalprice message from a Billing
|
||||
//-----------------------------------------------------------------------------
|
||||
struct FinalPriceMsg_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamBillingCallbacks + 1 };
|
||||
|
||||
uint32 m_bSuccess;
|
||||
uint32 m_nBaseCost;
|
||||
uint32 m_nTotalDiscount;
|
||||
uint32 m_nTax;
|
||||
uint32 m_nShippingCost;
|
||||
};
|
||||
|
||||
struct PurchaseMsg_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamBillingCallbacks + 2 };
|
||||
|
||||
uint32 m_bSuccess;
|
||||
int32 m_EPurchaseResultDetail; // Detailed result information
|
||||
};
|
||||
|
||||
#endif // ISTEAMBILLING_H
|
@ -1,8 +1,9 @@
|
||||
//========= Copyright 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,82 +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];
|
||||
|
||||
#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
|
||||
{
|
||||
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 *);
|
||||
|
||||
#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 ISteamGameServerStats;
|
||||
class ISteamPS3OverlayRender;
|
||||
class ISteamHTTP;
|
||||
class ISteamUnifiedMessages;
|
||||
#include "steam_api_common.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Interface to creating a new steam instance, or to
|
||||
@ -94,26 +20,32 @@ class ISteamUnifiedMessages;
|
||||
// different process or is local.
|
||||
//
|
||||
// For most scenarios this is all handled automatically via SteamAPI_Init().
|
||||
// You'll only need to use these interfaces if you have a more complex versioning scheme,
|
||||
// where you want to get different versions of the same interface in different dll's in your project.
|
||||
// You'll only need these APIs if you have a more complex versioning scheme,
|
||||
// or if you want to implement a multiplexed gameserver where a single process
|
||||
// is handling multiple games at once with independent gameserver SteamIDs.
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamClient
|
||||
{
|
||||
public:
|
||||
// Creates a communication pipe to the Steam client
|
||||
// Creates a communication pipe to the Steam client.
|
||||
// NOT THREADSAFE - ensure that no other threads are accessing Steamworks API when calling
|
||||
virtual HSteamPipe CreateSteamPipe() = 0;
|
||||
|
||||
// Releases a previously created communications pipe
|
||||
// NOT THREADSAFE - ensure that no other threads are accessing Steamworks API when calling
|
||||
virtual bool BReleaseSteamPipe( HSteamPipe hSteamPipe ) = 0;
|
||||
|
||||
// connects to an existing global user, failing if none exists
|
||||
// used by the game to coordinate with the steamUI
|
||||
// NOT THREADSAFE - ensure that no other threads are accessing Steamworks API when calling
|
||||
virtual HSteamUser ConnectToGlobalUser( HSteamPipe hSteamPipe ) = 0;
|
||||
|
||||
// used by game servers, create a steam user that won't be shared with anyone else
|
||||
// NOT THREADSAFE - ensure that no other threads are accessing Steamworks API when calling
|
||||
virtual HSteamUser CreateLocalUser( HSteamPipe *phSteamPipe, EAccountType eAccountType ) = 0;
|
||||
|
||||
// removes an allocated user
|
||||
// NOT THREADSAFE - ensure that no other threads are accessing Steamworks API when calling
|
||||
virtual void ReleaseUser( HSteamPipe hSteamPipe, HSteamUser hUser ) = 0;
|
||||
|
||||
// retrieves the ISteamUser interface associated with the handle
|
||||
@ -124,7 +56,7 @@ public:
|
||||
|
||||
// set the local IP and Port to bind to
|
||||
// this must be set before CreateLocalUser()
|
||||
virtual void SetLocalIPBinding( uint32 unIP, uint16 usPort ) = 0;
|
||||
virtual void SetLocalIPBinding( const SteamIPAddress_t &unIP, uint16 usPort ) = 0;
|
||||
|
||||
// returns the ISteamFriends interface
|
||||
virtual ISteamFriends *GetISteamFriends( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
@ -159,10 +91,11 @@ 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;
|
||||
|
||||
// this needs to be called every frame to process matchmaking results
|
||||
// redundant if you're already calling SteamAPI_RunCallbacks()
|
||||
virtual void RunFrame() = 0;
|
||||
// Deprecated. Applications should use SteamAPI_RunCallbacks() or SteamGameServer_RunCallbacks() instead.
|
||||
STEAM_PRIVATE_API( virtual void RunFrame() = 0; )
|
||||
|
||||
// returns the number of IPC calls made since the last time this function was called
|
||||
// Used for perf debugging so you can understand how many IPC calls your game makes per frame
|
||||
@ -173,177 +106,68 @@ public:
|
||||
// API warning handling
|
||||
// 'int' is the severity; 0 for msg, 1 for warning
|
||||
// 'const char *' is the text of the message
|
||||
// callbacks will occur directly after the API function is called that generated the warning or message
|
||||
// callbacks will occur directly after the API function is called that generated the warning or message.
|
||||
virtual void SetWarningMessageHook( SteamAPIWarningMessageHook_t pFunction ) = 0;
|
||||
|
||||
// Trigger global shutdown for the DLL
|
||||
virtual bool BShutdownIfAllPipesClosed() = 0;
|
||||
|
||||
#ifdef _PS3
|
||||
virtual ISteamPS3OverlayRender *GetISteamPS3OverlayRender() = 0;
|
||||
#endif
|
||||
|
||||
// Expose HTTP interface
|
||||
virtual ISteamHTTP *GetISteamHTTP( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// Exposes the ISteamUnifiedMessages interface
|
||||
virtual ISteamUnifiedMessages *GetISteamUnifiedMessages( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
// 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
|
||||
virtual ISteamUGC *GetISteamUGC( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// Music Player
|
||||
virtual ISteamMusic *GetISteamMusic( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// Music Player Remote
|
||||
virtual ISteamMusicRemote *GetISteamMusicRemote(HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion) = 0;
|
||||
|
||||
// html page display
|
||||
virtual ISteamHTMLSurface *GetISteamHTMLSurface(HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion) = 0;
|
||||
|
||||
// Helper functions for internal Steam usage
|
||||
STEAM_PRIVATE_API( virtual void DEPRECATED_Set_SteamAPI_CPostAPIResultInProcess( void (*)() ) = 0; )
|
||||
STEAM_PRIVATE_API( virtual void DEPRECATED_Remove_SteamAPI_CPostAPIResultInProcess( void (*)() ) = 0; )
|
||||
STEAM_PRIVATE_API( virtual void Set_SteamAPI_CCheckCallbackRegisteredInProcess( SteamAPI_CheckCallbackRegistered_t func ) = 0; )
|
||||
|
||||
// inventory
|
||||
virtual ISteamInventory *GetISteamInventory( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// Video
|
||||
virtual ISteamVideo *GetISteamVideo( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
// 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;
|
||||
|
||||
// Steam Remote Play interface
|
||||
virtual ISteamRemotePlay *GetISteamRemotePlay( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;
|
||||
|
||||
STEAM_PRIVATE_API( virtual void DestroyAllInterfaces() = 0; )
|
||||
|
||||
};
|
||||
#define STEAMCLIENT_INTERFACE_VERSION "SteamClient021"
|
||||
|
||||
#define STEAMCLIENT_INTERFACE_VERSION "SteamClient012"
|
||||
#ifndef STEAM_API_EXPORTS
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// 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_iSteamUserItemsCallbacks = 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 };
|
||||
// Global ISteamClient interface accessor
|
||||
inline ISteamClient *SteamClient();
|
||||
STEAM_DEFINE_INTERFACE_ACCESSOR( ISteamClient *, SteamClient, SteamInternal_CreateInterface( STEAMCLIENT_INTERFACE_VERSION ), "global", STEAMCLIENT_INTERFACE_VERSION );
|
||||
|
||||
// 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(); }
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// The CALLBACK macros are for client side callback logging enabled with
|
||||
// log_callback <first callnbackID> <last callbackID>
|
||||
// Do not change any of these.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class CSteamCallback
|
||||
{
|
||||
public:
|
||||
virtual const char *GetCallbackName() const = 0;
|
||||
virtual uint32 GetCallbackID() const = 0;
|
||||
virtual uint8 *GetFixedData() const = 0;
|
||||
virtual uint32 GetFixedSize() const = 0;
|
||||
virtual uint32 GetNumMemberVariables() const = 0;
|
||||
virtual bool GetMemberVariable( uint32 index, uint32 &varOffset, uint32 &varSize, uint32 &varCount, const char **pszName, const char **pszType ) const = 0;
|
||||
};
|
||||
|
||||
#define DEFINE_CALLBACK( callbackname, callbackid ) \
|
||||
struct callbackname##_t { \
|
||||
enum { k_iCallback = callbackid }; \
|
||||
static callbackname##_t *GetNullPointer() { return 0; }
|
||||
|
||||
#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( callbackname, numvars ) }; \
|
||||
class C##callbackname : public CSteamCallback { \
|
||||
public: callbackname##_t m_Data; \
|
||||
C##callbackname () { memset( &m_Data, 0, sizeof(m_Data) ); } \
|
||||
virtual const char *GetCallbackName() const { return #callbackname; } \
|
||||
virtual uint32 GetCallbackID() const { return callbackname##_t::k_iCallback; } \
|
||||
virtual uint32 GetFixedSize() const { return sizeof( m_Data ); } \
|
||||
virtual uint8 *GetFixedData() const { return (uint8*)&m_Data; } \
|
||||
virtual uint32 GetNumMemberVariables() const { return numvars; } \
|
||||
virtual bool GetMemberVariable( uint32 index, uint32 &varOffset, uint32 &varSize, uint32 &varCount, const char **pszName, const char **pszType ) const { \
|
||||
switch ( index ) { default : return false;
|
||||
|
||||
|
||||
#define END_CALLBACK_INTERNAL_SWITCH( varidx ) case varidx : m_Data.GetMemberVar_##varidx( varOffset, varSize, varCount, pszName, pszType ); return true;
|
||||
|
||||
#define END_CALLBACK_INTERNAL_END() }; }; };
|
||||
|
||||
#define END_DEFINE_CALLBACK_0( callbackname ) }; \
|
||||
class C##callbackname : public CSteamCallback { \
|
||||
public: callbackname##_t m_Data; \
|
||||
virtual const char *GetCallbackName() const { return #callbackname; } \
|
||||
virtual uint32 GetCallbackID() const { return callbackname##_t::k_iCallback; } \
|
||||
virtual uint32 GetFixedSize() const { return sizeof( m_Data ); } \
|
||||
virtual uint8 *GetFixedData() const { return (uint8*)&m_Data; } \
|
||||
virtual uint32 GetNumMemberVariables() const { return 0; } \
|
||||
virtual bool GetMemberVariable( uint32 index, uint32 &varOffset, uint32 &varSize, uint32 &varCount, const char **pszName, const char **pszType ) const { return false; } \
|
||||
}; \
|
||||
|
||||
|
||||
#define END_DEFINE_CALLBACK_1( callbackname ) \
|
||||
END_CALLBACK_INTERNAL_BEGIN( callbackname, 1 ) \
|
||||
END_CALLBACK_INTERNAL_SWITCH( 0 ) \
|
||||
END_CALLBACK_INTERNAL_END()
|
||||
|
||||
#define END_DEFINE_CALLBACK_2( callbackname ) \
|
||||
END_CALLBACK_INTERNAL_BEGIN( callbackname, 2 ) \
|
||||
END_CALLBACK_INTERNAL_SWITCH( 0 ) \
|
||||
END_CALLBACK_INTERNAL_SWITCH( 1 ) \
|
||||
END_CALLBACK_INTERNAL_END()
|
||||
|
||||
#define END_DEFINE_CALLBACK_3( callbackname ) \
|
||||
END_CALLBACK_INTERNAL_BEGIN( callbackname, 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( callbackname ) \
|
||||
END_CALLBACK_INTERNAL_BEGIN( callbackname, 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_6( callbackname ) \
|
||||
END_CALLBACK_INTERNAL_BEGIN( callbackname, 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( callbackname ) \
|
||||
END_CALLBACK_INTERNAL_BEGIN( callbackname, 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()
|
||||
#endif
|
||||
|
||||
#endif // ISTEAMCLIENT_H
|
||||
|
@ -1,6 +1,12 @@
|
||||
//========= Copyright 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,53 +16,711 @@
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "isteamclient.h"
|
||||
#include "steam_api_common.h"
|
||||
#include "isteaminput.h"
|
||||
|
||||
// callbacks
|
||||
#if defined( VALVE_CALLBACK_PACK_SMALL )
|
||||
#pragma pack( push, 4 )
|
||||
#elif defined( VALVE_CALLBACK_PACK_LARGE )
|
||||
#pragma pack( push, 8 )
|
||||
#define STEAM_CONTROLLER_MAX_COUNT 16
|
||||
|
||||
#define STEAM_CONTROLLER_MAX_ANALOG_ACTIONS 24
|
||||
|
||||
#define STEAM_CONTROLLER_MAX_DIGITAL_ACTIONS 256
|
||||
|
||||
#define STEAM_CONTROLLER_MAX_ORIGINS 8
|
||||
|
||||
#define STEAM_CONTROLLER_MAX_ACTIVE_LAYERS 16
|
||||
|
||||
// When sending an option to a specific controller handle, you can send to all controllers via this command
|
||||
#define STEAM_CONTROLLER_HANDLE_ALL_CONTROLLERS UINT64_MAX
|
||||
|
||||
#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
|
||||
|
||||
// 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
|
||||
k_EControllerActionOrigin_None,
|
||||
k_EControllerActionOrigin_A,
|
||||
k_EControllerActionOrigin_B,
|
||||
k_EControllerActionOrigin_X,
|
||||
k_EControllerActionOrigin_Y,
|
||||
k_EControllerActionOrigin_LeftBumper,
|
||||
k_EControllerActionOrigin_RightBumper,
|
||||
k_EControllerActionOrigin_LeftGrip,
|
||||
k_EControllerActionOrigin_RightGrip,
|
||||
k_EControllerActionOrigin_Start,
|
||||
k_EControllerActionOrigin_Back,
|
||||
k_EControllerActionOrigin_LeftPad_Touch,
|
||||
k_EControllerActionOrigin_LeftPad_Swipe,
|
||||
k_EControllerActionOrigin_LeftPad_Click,
|
||||
k_EControllerActionOrigin_LeftPad_DPadNorth,
|
||||
k_EControllerActionOrigin_LeftPad_DPadSouth,
|
||||
k_EControllerActionOrigin_LeftPad_DPadWest,
|
||||
k_EControllerActionOrigin_LeftPad_DPadEast,
|
||||
k_EControllerActionOrigin_RightPad_Touch,
|
||||
k_EControllerActionOrigin_RightPad_Swipe,
|
||||
k_EControllerActionOrigin_RightPad_Click,
|
||||
k_EControllerActionOrigin_RightPad_DPadNorth,
|
||||
k_EControllerActionOrigin_RightPad_DPadSouth,
|
||||
k_EControllerActionOrigin_RightPad_DPadWest,
|
||||
k_EControllerActionOrigin_RightPad_DPadEast,
|
||||
k_EControllerActionOrigin_LeftTrigger_Pull,
|
||||
k_EControllerActionOrigin_LeftTrigger_Click,
|
||||
k_EControllerActionOrigin_RightTrigger_Pull,
|
||||
k_EControllerActionOrigin_RightTrigger_Click,
|
||||
k_EControllerActionOrigin_LeftStick_Move,
|
||||
k_EControllerActionOrigin_LeftStick_Click,
|
||||
k_EControllerActionOrigin_LeftStick_DPadNorth,
|
||||
k_EControllerActionOrigin_LeftStick_DPadSouth,
|
||||
k_EControllerActionOrigin_LeftStick_DPadWest,
|
||||
k_EControllerActionOrigin_LeftStick_DPadEast,
|
||||
k_EControllerActionOrigin_Gyro_Move,
|
||||
k_EControllerActionOrigin_Gyro_Pitch,
|
||||
k_EControllerActionOrigin_Gyro_Yaw,
|
||||
k_EControllerActionOrigin_Gyro_Roll,
|
||||
|
||||
// PS4 Dual Shock
|
||||
k_EControllerActionOrigin_PS4_X,
|
||||
k_EControllerActionOrigin_PS4_Circle,
|
||||
k_EControllerActionOrigin_PS4_Triangle,
|
||||
k_EControllerActionOrigin_PS4_Square,
|
||||
k_EControllerActionOrigin_PS4_LeftBumper,
|
||||
k_EControllerActionOrigin_PS4_RightBumper,
|
||||
k_EControllerActionOrigin_PS4_Options, //Start
|
||||
k_EControllerActionOrigin_PS4_Share, //Back
|
||||
k_EControllerActionOrigin_PS4_LeftPad_Touch,
|
||||
k_EControllerActionOrigin_PS4_LeftPad_Swipe,
|
||||
k_EControllerActionOrigin_PS4_LeftPad_Click,
|
||||
k_EControllerActionOrigin_PS4_LeftPad_DPadNorth,
|
||||
k_EControllerActionOrigin_PS4_LeftPad_DPadSouth,
|
||||
k_EControllerActionOrigin_PS4_LeftPad_DPadWest,
|
||||
k_EControllerActionOrigin_PS4_LeftPad_DPadEast,
|
||||
k_EControllerActionOrigin_PS4_RightPad_Touch,
|
||||
k_EControllerActionOrigin_PS4_RightPad_Swipe,
|
||||
k_EControllerActionOrigin_PS4_RightPad_Click,
|
||||
k_EControllerActionOrigin_PS4_RightPad_DPadNorth,
|
||||
k_EControllerActionOrigin_PS4_RightPad_DPadSouth,
|
||||
k_EControllerActionOrigin_PS4_RightPad_DPadWest,
|
||||
k_EControllerActionOrigin_PS4_RightPad_DPadEast,
|
||||
k_EControllerActionOrigin_PS4_CenterPad_Touch,
|
||||
k_EControllerActionOrigin_PS4_CenterPad_Swipe,
|
||||
k_EControllerActionOrigin_PS4_CenterPad_Click,
|
||||
k_EControllerActionOrigin_PS4_CenterPad_DPadNorth,
|
||||
k_EControllerActionOrigin_PS4_CenterPad_DPadSouth,
|
||||
k_EControllerActionOrigin_PS4_CenterPad_DPadWest,
|
||||
k_EControllerActionOrigin_PS4_CenterPad_DPadEast,
|
||||
k_EControllerActionOrigin_PS4_LeftTrigger_Pull,
|
||||
k_EControllerActionOrigin_PS4_LeftTrigger_Click,
|
||||
k_EControllerActionOrigin_PS4_RightTrigger_Pull,
|
||||
k_EControllerActionOrigin_PS4_RightTrigger_Click,
|
||||
k_EControllerActionOrigin_PS4_LeftStick_Move,
|
||||
k_EControllerActionOrigin_PS4_LeftStick_Click,
|
||||
k_EControllerActionOrigin_PS4_LeftStick_DPadNorth,
|
||||
k_EControllerActionOrigin_PS4_LeftStick_DPadSouth,
|
||||
k_EControllerActionOrigin_PS4_LeftStick_DPadWest,
|
||||
k_EControllerActionOrigin_PS4_LeftStick_DPadEast,
|
||||
k_EControllerActionOrigin_PS4_RightStick_Move,
|
||||
k_EControllerActionOrigin_PS4_RightStick_Click,
|
||||
k_EControllerActionOrigin_PS4_RightStick_DPadNorth,
|
||||
k_EControllerActionOrigin_PS4_RightStick_DPadSouth,
|
||||
k_EControllerActionOrigin_PS4_RightStick_DPadWest,
|
||||
k_EControllerActionOrigin_PS4_RightStick_DPadEast,
|
||||
k_EControllerActionOrigin_PS4_DPad_North,
|
||||
k_EControllerActionOrigin_PS4_DPad_South,
|
||||
k_EControllerActionOrigin_PS4_DPad_West,
|
||||
k_EControllerActionOrigin_PS4_DPad_East,
|
||||
k_EControllerActionOrigin_PS4_Gyro_Move,
|
||||
k_EControllerActionOrigin_PS4_Gyro_Pitch,
|
||||
k_EControllerActionOrigin_PS4_Gyro_Yaw,
|
||||
k_EControllerActionOrigin_PS4_Gyro_Roll,
|
||||
|
||||
// XBox One
|
||||
k_EControllerActionOrigin_XBoxOne_A,
|
||||
k_EControllerActionOrigin_XBoxOne_B,
|
||||
k_EControllerActionOrigin_XBoxOne_X,
|
||||
k_EControllerActionOrigin_XBoxOne_Y,
|
||||
k_EControllerActionOrigin_XBoxOne_LeftBumper,
|
||||
k_EControllerActionOrigin_XBoxOne_RightBumper,
|
||||
k_EControllerActionOrigin_XBoxOne_Menu, //Start
|
||||
k_EControllerActionOrigin_XBoxOne_View, //Back
|
||||
k_EControllerActionOrigin_XBoxOne_LeftTrigger_Pull,
|
||||
k_EControllerActionOrigin_XBoxOne_LeftTrigger_Click,
|
||||
k_EControllerActionOrigin_XBoxOne_RightTrigger_Pull,
|
||||
k_EControllerActionOrigin_XBoxOne_RightTrigger_Click,
|
||||
k_EControllerActionOrigin_XBoxOne_LeftStick_Move,
|
||||
k_EControllerActionOrigin_XBoxOne_LeftStick_Click,
|
||||
k_EControllerActionOrigin_XBoxOne_LeftStick_DPadNorth,
|
||||
k_EControllerActionOrigin_XBoxOne_LeftStick_DPadSouth,
|
||||
k_EControllerActionOrigin_XBoxOne_LeftStick_DPadWest,
|
||||
k_EControllerActionOrigin_XBoxOne_LeftStick_DPadEast,
|
||||
k_EControllerActionOrigin_XBoxOne_RightStick_Move,
|
||||
k_EControllerActionOrigin_XBoxOne_RightStick_Click,
|
||||
k_EControllerActionOrigin_XBoxOne_RightStick_DPadNorth,
|
||||
k_EControllerActionOrigin_XBoxOne_RightStick_DPadSouth,
|
||||
k_EControllerActionOrigin_XBoxOne_RightStick_DPadWest,
|
||||
k_EControllerActionOrigin_XBoxOne_RightStick_DPadEast,
|
||||
k_EControllerActionOrigin_XBoxOne_DPad_North,
|
||||
k_EControllerActionOrigin_XBoxOne_DPad_South,
|
||||
k_EControllerActionOrigin_XBoxOne_DPad_West,
|
||||
k_EControllerActionOrigin_XBoxOne_DPad_East,
|
||||
|
||||
// XBox 360
|
||||
k_EControllerActionOrigin_XBox360_A,
|
||||
k_EControllerActionOrigin_XBox360_B,
|
||||
k_EControllerActionOrigin_XBox360_X,
|
||||
k_EControllerActionOrigin_XBox360_Y,
|
||||
k_EControllerActionOrigin_XBox360_LeftBumper,
|
||||
k_EControllerActionOrigin_XBox360_RightBumper,
|
||||
k_EControllerActionOrigin_XBox360_Start, //Start
|
||||
k_EControllerActionOrigin_XBox360_Back, //Back
|
||||
k_EControllerActionOrigin_XBox360_LeftTrigger_Pull,
|
||||
k_EControllerActionOrigin_XBox360_LeftTrigger_Click,
|
||||
k_EControllerActionOrigin_XBox360_RightTrigger_Pull,
|
||||
k_EControllerActionOrigin_XBox360_RightTrigger_Click,
|
||||
k_EControllerActionOrigin_XBox360_LeftStick_Move,
|
||||
k_EControllerActionOrigin_XBox360_LeftStick_Click,
|
||||
k_EControllerActionOrigin_XBox360_LeftStick_DPadNorth,
|
||||
k_EControllerActionOrigin_XBox360_LeftStick_DPadSouth,
|
||||
k_EControllerActionOrigin_XBox360_LeftStick_DPadWest,
|
||||
k_EControllerActionOrigin_XBox360_LeftStick_DPadEast,
|
||||
k_EControllerActionOrigin_XBox360_RightStick_Move,
|
||||
k_EControllerActionOrigin_XBox360_RightStick_Click,
|
||||
k_EControllerActionOrigin_XBox360_RightStick_DPadNorth,
|
||||
k_EControllerActionOrigin_XBox360_RightStick_DPadSouth,
|
||||
k_EControllerActionOrigin_XBox360_RightStick_DPadWest,
|
||||
k_EControllerActionOrigin_XBox360_RightStick_DPadEast,
|
||||
k_EControllerActionOrigin_XBox360_DPad_North,
|
||||
k_EControllerActionOrigin_XBox360_DPad_South,
|
||||
k_EControllerActionOrigin_XBox360_DPad_West,
|
||||
k_EControllerActionOrigin_XBox360_DPad_East,
|
||||
|
||||
// SteamController V2
|
||||
k_EControllerActionOrigin_SteamV2_A,
|
||||
k_EControllerActionOrigin_SteamV2_B,
|
||||
k_EControllerActionOrigin_SteamV2_X,
|
||||
k_EControllerActionOrigin_SteamV2_Y,
|
||||
k_EControllerActionOrigin_SteamV2_LeftBumper,
|
||||
k_EControllerActionOrigin_SteamV2_RightBumper,
|
||||
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,
|
||||
k_EControllerActionOrigin_SteamV2_LeftGrip_Pressure,
|
||||
k_EControllerActionOrigin_SteamV2_RightGrip_Pressure,
|
||||
k_EControllerActionOrigin_SteamV2_LeftGrip_Upper_Pressure,
|
||||
k_EControllerActionOrigin_SteamV2_RightGrip_Upper_Pressure,
|
||||
k_EControllerActionOrigin_SteamV2_Start,
|
||||
k_EControllerActionOrigin_SteamV2_Back,
|
||||
k_EControllerActionOrigin_SteamV2_LeftPad_Touch,
|
||||
k_EControllerActionOrigin_SteamV2_LeftPad_Swipe,
|
||||
k_EControllerActionOrigin_SteamV2_LeftPad_Click,
|
||||
k_EControllerActionOrigin_SteamV2_LeftPad_Pressure,
|
||||
k_EControllerActionOrigin_SteamV2_LeftPad_DPadNorth,
|
||||
k_EControllerActionOrigin_SteamV2_LeftPad_DPadSouth,
|
||||
k_EControllerActionOrigin_SteamV2_LeftPad_DPadWest,
|
||||
k_EControllerActionOrigin_SteamV2_LeftPad_DPadEast,
|
||||
k_EControllerActionOrigin_SteamV2_RightPad_Touch,
|
||||
k_EControllerActionOrigin_SteamV2_RightPad_Swipe,
|
||||
k_EControllerActionOrigin_SteamV2_RightPad_Click,
|
||||
k_EControllerActionOrigin_SteamV2_RightPad_Pressure,
|
||||
k_EControllerActionOrigin_SteamV2_RightPad_DPadNorth,
|
||||
k_EControllerActionOrigin_SteamV2_RightPad_DPadSouth,
|
||||
k_EControllerActionOrigin_SteamV2_RightPad_DPadWest,
|
||||
k_EControllerActionOrigin_SteamV2_RightPad_DPadEast,
|
||||
k_EControllerActionOrigin_SteamV2_LeftTrigger_Pull,
|
||||
k_EControllerActionOrigin_SteamV2_LeftTrigger_Click,
|
||||
k_EControllerActionOrigin_SteamV2_RightTrigger_Pull,
|
||||
k_EControllerActionOrigin_SteamV2_RightTrigger_Click,
|
||||
k_EControllerActionOrigin_SteamV2_LeftStick_Move,
|
||||
k_EControllerActionOrigin_SteamV2_LeftStick_Click,
|
||||
k_EControllerActionOrigin_SteamV2_LeftStick_DPadNorth,
|
||||
k_EControllerActionOrigin_SteamV2_LeftStick_DPadSouth,
|
||||
k_EControllerActionOrigin_SteamV2_LeftStick_DPadWest,
|
||||
k_EControllerActionOrigin_SteamV2_LeftStick_DPadEast,
|
||||
k_EControllerActionOrigin_SteamV2_Gyro_Move,
|
||||
k_EControllerActionOrigin_SteamV2_Gyro_Pitch,
|
||||
k_EControllerActionOrigin_SteamV2_Gyro_Yaw,
|
||||
k_EControllerActionOrigin_SteamV2_Gyro_Roll,
|
||||
|
||||
// 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
|
||||
|
||||
// Added in SDK 1.45
|
||||
k_EControllerActionOrigin_PS4_DPad_Move,
|
||||
k_EControllerActionOrigin_XBoxOne_DPad_Move,
|
||||
k_EControllerActionOrigin_XBox360_DPad_Move,
|
||||
k_EControllerActionOrigin_Switch_DPad_Move,
|
||||
|
||||
// Added in SDK 1.51
|
||||
k_EControllerActionOrigin_PS5_X,
|
||||
k_EControllerActionOrigin_PS5_Circle,
|
||||
k_EControllerActionOrigin_PS5_Triangle,
|
||||
k_EControllerActionOrigin_PS5_Square,
|
||||
k_EControllerActionOrigin_PS5_LeftBumper,
|
||||
k_EControllerActionOrigin_PS5_RightBumper,
|
||||
k_EControllerActionOrigin_PS5_Option, //Start
|
||||
k_EControllerActionOrigin_PS5_Create, //Back
|
||||
k_EControllerActionOrigin_PS5_Mute,
|
||||
k_EControllerActionOrigin_PS5_LeftPad_Touch,
|
||||
k_EControllerActionOrigin_PS5_LeftPad_Swipe,
|
||||
k_EControllerActionOrigin_PS5_LeftPad_Click,
|
||||
k_EControllerActionOrigin_PS5_LeftPad_DPadNorth,
|
||||
k_EControllerActionOrigin_PS5_LeftPad_DPadSouth,
|
||||
k_EControllerActionOrigin_PS5_LeftPad_DPadWest,
|
||||
k_EControllerActionOrigin_PS5_LeftPad_DPadEast,
|
||||
k_EControllerActionOrigin_PS5_RightPad_Touch,
|
||||
k_EControllerActionOrigin_PS5_RightPad_Swipe,
|
||||
k_EControllerActionOrigin_PS5_RightPad_Click,
|
||||
k_EControllerActionOrigin_PS5_RightPad_DPadNorth,
|
||||
k_EControllerActionOrigin_PS5_RightPad_DPadSouth,
|
||||
k_EControllerActionOrigin_PS5_RightPad_DPadWest,
|
||||
k_EControllerActionOrigin_PS5_RightPad_DPadEast,
|
||||
k_EControllerActionOrigin_PS5_CenterPad_Touch,
|
||||
k_EControllerActionOrigin_PS5_CenterPad_Swipe,
|
||||
k_EControllerActionOrigin_PS5_CenterPad_Click,
|
||||
k_EControllerActionOrigin_PS5_CenterPad_DPadNorth,
|
||||
k_EControllerActionOrigin_PS5_CenterPad_DPadSouth,
|
||||
k_EControllerActionOrigin_PS5_CenterPad_DPadWest,
|
||||
k_EControllerActionOrigin_PS5_CenterPad_DPadEast,
|
||||
k_EControllerActionOrigin_PS5_LeftTrigger_Pull,
|
||||
k_EControllerActionOrigin_PS5_LeftTrigger_Click,
|
||||
k_EControllerActionOrigin_PS5_RightTrigger_Pull,
|
||||
k_EControllerActionOrigin_PS5_RightTrigger_Click,
|
||||
k_EControllerActionOrigin_PS5_LeftStick_Move,
|
||||
k_EControllerActionOrigin_PS5_LeftStick_Click,
|
||||
k_EControllerActionOrigin_PS5_LeftStick_DPadNorth,
|
||||
k_EControllerActionOrigin_PS5_LeftStick_DPadSouth,
|
||||
k_EControllerActionOrigin_PS5_LeftStick_DPadWest,
|
||||
k_EControllerActionOrigin_PS5_LeftStick_DPadEast,
|
||||
k_EControllerActionOrigin_PS5_RightStick_Move,
|
||||
k_EControllerActionOrigin_PS5_RightStick_Click,
|
||||
k_EControllerActionOrigin_PS5_RightStick_DPadNorth,
|
||||
k_EControllerActionOrigin_PS5_RightStick_DPadSouth,
|
||||
k_EControllerActionOrigin_PS5_RightStick_DPadWest,
|
||||
k_EControllerActionOrigin_PS5_RightStick_DPadEast,
|
||||
k_EControllerActionOrigin_PS5_DPad_Move,
|
||||
k_EControllerActionOrigin_PS5_DPad_North,
|
||||
k_EControllerActionOrigin_PS5_DPad_South,
|
||||
k_EControllerActionOrigin_PS5_DPad_West,
|
||||
k_EControllerActionOrigin_PS5_DPad_East,
|
||||
k_EControllerActionOrigin_PS5_Gyro_Move,
|
||||
k_EControllerActionOrigin_PS5_Gyro_Pitch,
|
||||
k_EControllerActionOrigin_PS5_Gyro_Yaw,
|
||||
k_EControllerActionOrigin_PS5_Gyro_Roll,
|
||||
|
||||
k_EControllerActionOrigin_XBoxOne_LeftGrip_Lower,
|
||||
k_EControllerActionOrigin_XBoxOne_LeftGrip_Upper,
|
||||
k_EControllerActionOrigin_XBoxOne_RightGrip_Lower,
|
||||
k_EControllerActionOrigin_XBoxOne_RightGrip_Upper,
|
||||
k_EControllerActionOrigin_XBoxOne_Share,
|
||||
|
||||
// Added in SDK 1.53
|
||||
k_EControllerActionOrigin_SteamDeck_A,
|
||||
k_EControllerActionOrigin_SteamDeck_B,
|
||||
k_EControllerActionOrigin_SteamDeck_X,
|
||||
k_EControllerActionOrigin_SteamDeck_Y,
|
||||
k_EControllerActionOrigin_SteamDeck_L1,
|
||||
k_EControllerActionOrigin_SteamDeck_R1,
|
||||
k_EControllerActionOrigin_SteamDeck_Menu,
|
||||
k_EControllerActionOrigin_SteamDeck_View,
|
||||
k_EControllerActionOrigin_SteamDeck_LeftPad_Touch,
|
||||
k_EControllerActionOrigin_SteamDeck_LeftPad_Swipe,
|
||||
k_EControllerActionOrigin_SteamDeck_LeftPad_Click,
|
||||
k_EControllerActionOrigin_SteamDeck_LeftPad_DPadNorth,
|
||||
k_EControllerActionOrigin_SteamDeck_LeftPad_DPadSouth,
|
||||
k_EControllerActionOrigin_SteamDeck_LeftPad_DPadWest,
|
||||
k_EControllerActionOrigin_SteamDeck_LeftPad_DPadEast,
|
||||
k_EControllerActionOrigin_SteamDeck_RightPad_Touch,
|
||||
k_EControllerActionOrigin_SteamDeck_RightPad_Swipe,
|
||||
k_EControllerActionOrigin_SteamDeck_RightPad_Click,
|
||||
k_EControllerActionOrigin_SteamDeck_RightPad_DPadNorth,
|
||||
k_EControllerActionOrigin_SteamDeck_RightPad_DPadSouth,
|
||||
k_EControllerActionOrigin_SteamDeck_RightPad_DPadWest,
|
||||
k_EControllerActionOrigin_SteamDeck_RightPad_DPadEast,
|
||||
k_EControllerActionOrigin_SteamDeck_L2_SoftPull,
|
||||
k_EControllerActionOrigin_SteamDeck_L2,
|
||||
k_EControllerActionOrigin_SteamDeck_R2_SoftPull,
|
||||
k_EControllerActionOrigin_SteamDeck_R2,
|
||||
k_EControllerActionOrigin_SteamDeck_LeftStick_Move,
|
||||
k_EControllerActionOrigin_SteamDeck_L3,
|
||||
k_EControllerActionOrigin_SteamDeck_LeftStick_DPadNorth,
|
||||
k_EControllerActionOrigin_SteamDeck_LeftStick_DPadSouth,
|
||||
k_EControllerActionOrigin_SteamDeck_LeftStick_DPadWest,
|
||||
k_EControllerActionOrigin_SteamDeck_LeftStick_DPadEast,
|
||||
k_EControllerActionOrigin_SteamDeck_LeftStick_Touch,
|
||||
k_EControllerActionOrigin_SteamDeck_RightStick_Move,
|
||||
k_EControllerActionOrigin_SteamDeck_R3,
|
||||
k_EControllerActionOrigin_SteamDeck_RightStick_DPadNorth,
|
||||
k_EControllerActionOrigin_SteamDeck_RightStick_DPadSouth,
|
||||
k_EControllerActionOrigin_SteamDeck_RightStick_DPadWest,
|
||||
k_EControllerActionOrigin_SteamDeck_RightStick_DPadEast,
|
||||
k_EControllerActionOrigin_SteamDeck_RightStick_Touch,
|
||||
k_EControllerActionOrigin_SteamDeck_L4,
|
||||
k_EControllerActionOrigin_SteamDeck_R4,
|
||||
k_EControllerActionOrigin_SteamDeck_L5,
|
||||
k_EControllerActionOrigin_SteamDeck_R5,
|
||||
k_EControllerActionOrigin_SteamDeck_DPad_Move,
|
||||
k_EControllerActionOrigin_SteamDeck_DPad_North,
|
||||
k_EControllerActionOrigin_SteamDeck_DPad_South,
|
||||
k_EControllerActionOrigin_SteamDeck_DPad_West,
|
||||
k_EControllerActionOrigin_SteamDeck_DPad_East,
|
||||
k_EControllerActionOrigin_SteamDeck_Gyro_Move,
|
||||
k_EControllerActionOrigin_SteamDeck_Gyro_Pitch,
|
||||
k_EControllerActionOrigin_SteamDeck_Gyro_Yaw,
|
||||
k_EControllerActionOrigin_SteamDeck_Gyro_Roll,
|
||||
k_EControllerActionOrigin_SteamDeck_Reserved1,
|
||||
k_EControllerActionOrigin_SteamDeck_Reserved2,
|
||||
k_EControllerActionOrigin_SteamDeck_Reserved3,
|
||||
k_EControllerActionOrigin_SteamDeck_Reserved4,
|
||||
k_EControllerActionOrigin_SteamDeck_Reserved5,
|
||||
k_EControllerActionOrigin_SteamDeck_Reserved6,
|
||||
k_EControllerActionOrigin_SteamDeck_Reserved7,
|
||||
k_EControllerActionOrigin_SteamDeck_Reserved8,
|
||||
k_EControllerActionOrigin_SteamDeck_Reserved9,
|
||||
k_EControllerActionOrigin_SteamDeck_Reserved10,
|
||||
k_EControllerActionOrigin_SteamDeck_Reserved11,
|
||||
k_EControllerActionOrigin_SteamDeck_Reserved12,
|
||||
k_EControllerActionOrigin_SteamDeck_Reserved13,
|
||||
k_EControllerActionOrigin_SteamDeck_Reserved14,
|
||||
k_EControllerActionOrigin_SteamDeck_Reserved15,
|
||||
k_EControllerActionOrigin_SteamDeck_Reserved16,
|
||||
k_EControllerActionOrigin_SteamDeck_Reserved17,
|
||||
k_EControllerActionOrigin_SteamDeck_Reserved18,
|
||||
k_EControllerActionOrigin_SteamDeck_Reserved19,
|
||||
k_EControllerActionOrigin_SteamDeck_Reserved20,
|
||||
|
||||
k_EControllerActionOrigin_Switch_JoyConButton_N, // With a Horizontal JoyCon this will be Y or what would be Dpad Right when vertical
|
||||
k_EControllerActionOrigin_Switch_JoyConButton_E, // X
|
||||
k_EControllerActionOrigin_Switch_JoyConButton_S, // A
|
||||
k_EControllerActionOrigin_Switch_JoyConButton_W, // B
|
||||
|
||||
k_EControllerActionOrigin_PS5_LeftGrip,
|
||||
k_EControllerActionOrigin_PS5_RightGrip,
|
||||
k_EControllerActionOrigin_PS5_LeftFn,
|
||||
k_EControllerActionOrigin_PS5_RightFn,
|
||||
|
||||
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.
|
||||
};
|
||||
|
||||
#ifndef ISTEAMINPUT_H
|
||||
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,
|
||||
};
|
||||
|
||||
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_PS5Controller, // Added in SDK 151
|
||||
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.
|
||||
// This handle will consistently identify a controller, even if it is disconnected and re-connected
|
||||
typedef uint64 ControllerHandle_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 ControllerActionSetHandle_t;
|
||||
typedef uint64 ControllerDigitalActionHandle_t;
|
||||
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
|
||||
#error isteamclient.h must be included
|
||||
#endif
|
||||
struct ControllerAnalogActionData_t
|
||||
{
|
||||
// Type of data coming from this action, this will match what got specified in the action set
|
||||
EControllerSourceMode 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 ControllerDigitalActionData_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 ControllerMotionData_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;
|
||||
};
|
||||
#endif
|
||||
#pragma pack( pop )
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Functions for accessing stats, achievements, and leaderboard information
|
||||
// Purpose: Steam Input API
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamController
|
||||
{
|
||||
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 controllers
|
||||
// handlesOut should point to a STEAM_CONTROLLER_MAX_COUNT sized array of ControllerHandle_t handles
|
||||
// Returns the number of handles written to handlesOut
|
||||
virtual int GetConnectedControllers( STEAM_OUT_ARRAY_COUNT( STEAM_CONTROLLER_MAX_COUNT, Receives list of connected controllers ) ControllerHandle_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 ControllerActionSetHandle_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( 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;
|
||||
// Enumerate currently active layers
|
||||
// handlesOut should point to a STEAM_CONTROLLER_MAX_ACTIVE_LAYERS sized array of ControllerActionSetHandle_t handles.
|
||||
// Returns the number of handles written to handlesOut
|
||||
virtual int GetActiveActionSetLayers( ControllerHandle_t controllerHandle, STEAM_OUT_ARRAY_COUNT( STEAM_CONTROLLER_MAX_ACTIVE_LAYERS, Receives list of active layers ) 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;
|
||||
|
||||
// Returns the current state of the supplied digital game action
|
||||
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. 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, STEAM_OUT_ARRAY_COUNT( STEAM_CONTROLLER_MAX_ORIGINS, Receives list of aciton origins ) 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.
|
||||
virtual ControllerAnalogActionHandle_t GetAnalogActionHandle( const char *pszActionName ) = 0;
|
||||
|
||||
// Returns the current state of these supplied analog game action
|
||||
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. 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, STEAM_OUT_ARRAY_COUNT( STEAM_CONTROLLER_MAX_ORIGINS, Receives list of action origins ) EControllerActionOrigin *originsOut ) = 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;
|
||||
|
||||
// Trigger a pulse with a duty cycle of usDurationMicroSec / usOffMicroSec, unRepeat times.
|
||||
// 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;
|
||||
|
||||
// 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;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Utility functions available 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( ControllerHandle_t controllerHandle ) = 0;
|
||||
|
||||
// Returns the input type for a particular handle - unlike EControllerActionOrigin which update with Steam and may return unrecognized values
|
||||
// ESteamInputType will remain static and only return valid values from your SDK version
|
||||
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.
|
||||
virtual const char *GetStringForXboxOrigin( EXboxOrigin eOrigin ) = 0;
|
||||
|
||||
// Get a local path to art for on-screen glyph for a particular Xbox controller origin.
|
||||
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;
|
||||
|
||||
// Get the binding revision for a given device. Returns false if the handle was not valid or if a mapping is not yet loaded for the device
|
||||
virtual bool GetControllerBindingRevision( ControllerHandle_t controllerHandle, int *pMajor, int *pMinor ) = 0;
|
||||
};
|
||||
|
||||
#define STEAMCONTROLLER_INTERFACE_VERSION "STEAMCONTROLLER_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
|
||||
#endif
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
//-----------------------------------------------------------------------------
|
||||
/*
|
||||
struct ControllerCallback_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamControllerCallbacks + 1 };
|
||||
|
||||
};
|
||||
*/
|
||||
|
||||
|
||||
#pragma pack( pop )
|
||||
#define STEAMCONTROLLER_INTERFACE_VERSION "SteamController008"
|
||||
|
||||
// Global interface accessor
|
||||
inline ISteamController *SteamController();
|
||||
STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamController *, SteamController, STEAMCONTROLLER_INTERFACE_VERSION );
|
||||
|
||||
#endif // ISTEAMCONTROLLER_H
|
||||
|
169
rehlds/public/steam/isteamdualsense.h
Normal file
169
rehlds/public/steam/isteamdualsense.h
Normal file
@ -0,0 +1,169 @@
|
||||
/* SIE CONFIDENTIAL
|
||||
* $PSLibId$
|
||||
* Copyright (C) 2019 Sony Interactive Entertainment Inc.
|
||||
* All Rights Reserved.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _SCE_PAD_TRIGGER_EFFECT_H
|
||||
#define _SCE_PAD_TRIGGER_EFFECT_H
|
||||
|
||||
|
||||
#define SCE_PAD_TRIGGER_EFFECT_TRIGGER_MASK_L2 0x01
|
||||
#define SCE_PAD_TRIGGER_EFFECT_TRIGGER_MASK_R2 0x02
|
||||
|
||||
#define SCE_PAD_TRIGGER_EFFECT_PARAM_INDEX_FOR_L2 0
|
||||
#define SCE_PAD_TRIGGER_EFFECT_PARAM_INDEX_FOR_R2 1
|
||||
|
||||
#define SCE_PAD_TRIGGER_EFFECT_TRIGGER_NUM 2
|
||||
|
||||
/* Definition of control point num */
|
||||
#define SCE_PAD_TRIGGER_EFFECT_CONTROL_POINT_NUM 10
|
||||
|
||||
typedef enum ScePadTriggerEffectMode{
|
||||
SCE_PAD_TRIGGER_EFFECT_MODE_OFF,
|
||||
SCE_PAD_TRIGGER_EFFECT_MODE_FEEDBACK,
|
||||
SCE_PAD_TRIGGER_EFFECT_MODE_WEAPON,
|
||||
SCE_PAD_TRIGGER_EFFECT_MODE_VIBRATION,
|
||||
SCE_PAD_TRIGGER_EFFECT_MODE_MULTIPLE_POSITION_FEEDBACK,
|
||||
SCE_PAD_TRIGGER_EFFECT_MODE_SLOPE_FEEDBACK,
|
||||
SCE_PAD_TRIGGER_EFFECT_MODE_MULTIPLE_POSITION_VIBRATION,
|
||||
} ScePadTriggerEffectMode;
|
||||
|
||||
/**
|
||||
*E
|
||||
* @brief parameter for setting the trigger effect to off mode.
|
||||
* Off Mode: Stop trigger effect.
|
||||
**/
|
||||
typedef struct ScePadTriggerEffectOffParam{
|
||||
uint8_t padding[48];
|
||||
} ScePadTriggerEffectOffParam;
|
||||
|
||||
/**
|
||||
*E
|
||||
* @brief parameter for setting the trigger effect to Feedback mode.
|
||||
* Feedback Mode: The motor arm pushes back trigger.
|
||||
* Trigger obtains stiffness at specified position.
|
||||
**/
|
||||
typedef struct ScePadTriggerEffectFeedbackParam{
|
||||
uint8_t position; /*E position where the strength of target trigger start changing(0~9). */
|
||||
uint8_t strength; /*E strength that the motor arm pushes back target trigger(0~8 (0: Same as Off mode)). */
|
||||
uint8_t padding[46];
|
||||
} ScePadTriggerEffectFeedbackParam;
|
||||
|
||||
/**
|
||||
*E
|
||||
* @brief parameter for setting the trigger effect to Weapon mode.
|
||||
* Weapon Mode: Emulate weapon like gun trigger.
|
||||
**/
|
||||
typedef struct ScePadTriggerEffectWeaponParam{
|
||||
uint8_t startPosition; /*E position where the stiffness of trigger start changing(2~7). */
|
||||
uint8_t endPosition; /*E position where the stiffness of trigger finish changing(startPosition+1~8). */
|
||||
uint8_t strength; /*E strength of gun trigger(0~8 (0: Same as Off mode)). */
|
||||
uint8_t padding[45];
|
||||
} ScePadTriggerEffectWeaponParam;
|
||||
|
||||
/**
|
||||
*E
|
||||
* @brief parameter for setting the trigger effect to Vibration mode.
|
||||
* Vibration Mode: Vibrates motor arm around specified position.
|
||||
**/
|
||||
typedef struct ScePadTriggerEffectVibrationParam{
|
||||
uint8_t position; /*E position where the motor arm start vibrating(0~9). */
|
||||
uint8_t amplitude; /*E vibration amplitude(0~8 (0: Same as Off mode)). */
|
||||
uint8_t frequency; /*E vibration frequency(0~255[Hz] (0: Same as Off mode)). */
|
||||
uint8_t padding[45];
|
||||
} ScePadTriggerEffectVibrationParam;
|
||||
|
||||
/**
|
||||
*E
|
||||
* @brief parameter for setting the trigger effect to ScePadTriggerEffectMultiplePositionFeedbackParam mode.
|
||||
* Multi Position Feedback Mode: The motor arm pushes back trigger.
|
||||
* Trigger obtains specified stiffness at each control point.
|
||||
**/
|
||||
typedef struct ScePadTriggerEffectMultiplePositionFeedbackParam{
|
||||
uint8_t strength[SCE_PAD_TRIGGER_EFFECT_CONTROL_POINT_NUM]; /*E strength that the motor arm pushes back target trigger at position(0~8 (0: Same as Off mode)).
|
||||
* strength[0] means strength of motor arm at position0.
|
||||
* strength[1] means strength of motor arm at position1.
|
||||
* ...
|
||||
* */
|
||||
uint8_t padding[38];
|
||||
} ScePadTriggerEffectMultiplePositionFeedbackParam;
|
||||
|
||||
/**
|
||||
*E
|
||||
* @brief parameter for setting the trigger effect to Feedback3 mode.
|
||||
* Slope Feedback Mode: The motor arm pushes back trigger between two spedified control points.
|
||||
* Stiffness of the trigger is changing depending on the set place.
|
||||
**/
|
||||
typedef struct ScePadTriggerEffectSlopeFeedbackParam{
|
||||
|
||||
uint8_t startPosition; /*E position where the strength of target trigger start changing(0~endPosition). */
|
||||
uint8_t endPosition; /*E position where the strength of target trigger finish changing(startPosition+1~9). */
|
||||
uint8_t startStrength; /*E strength when trigger's position is startPosition(1~8) */
|
||||
uint8_t endStrength; /*E strength when trigger's position is endPosition(1~8) */
|
||||
uint8_t padding[44];
|
||||
} ScePadTriggerEffectSlopeFeedbackParam;
|
||||
|
||||
/**
|
||||
*E
|
||||
* @brief parameter for setting the trigger effect to Vibration2 mode.
|
||||
* Multi Position Vibration Mode: Vibrates motor arm around specified control point.
|
||||
* Trigger vibrates specified amplitude at each control point.
|
||||
**/
|
||||
typedef struct ScePadTriggerEffectMultiplePositionVibrationParam{
|
||||
uint8_t frequency; /*E vibration frequency(0~255 (0: Same as Off mode)) */
|
||||
uint8_t amplitude[SCE_PAD_TRIGGER_EFFECT_CONTROL_POINT_NUM]; /*E vibration amplitude at position(0~8 (0: Same as Off mode)).
|
||||
* amplitude[0] means amplitude of vibration at position0.
|
||||
* amplitude[1] means amplitude of vibration at position1.
|
||||
* ...
|
||||
* */
|
||||
uint8_t padding[37];
|
||||
} ScePadTriggerEffectMultiplePositionVibrationParam;
|
||||
|
||||
/**
|
||||
*E
|
||||
* @brief parameter for setting the trigger effect mode.
|
||||
**/
|
||||
typedef union ScePadTriggerEffectCommandData{
|
||||
ScePadTriggerEffectOffParam offParam;
|
||||
ScePadTriggerEffectFeedbackParam feedbackParam;
|
||||
ScePadTriggerEffectWeaponParam weaponParam;
|
||||
ScePadTriggerEffectVibrationParam vibrationParam;
|
||||
ScePadTriggerEffectMultiplePositionFeedbackParam multiplePositionFeedbackParam;
|
||||
ScePadTriggerEffectSlopeFeedbackParam slopeFeedbackParam;
|
||||
ScePadTriggerEffectMultiplePositionVibrationParam multiplePositionVibrationParam;
|
||||
} ScePadTriggerEffectCommandData;
|
||||
|
||||
/**
|
||||
*E
|
||||
* @brief parameter for setting the trigger effect.
|
||||
**/
|
||||
typedef struct ScePadTriggerEffectCommand{
|
||||
ScePadTriggerEffectMode mode;
|
||||
uint8_t padding[4];
|
||||
ScePadTriggerEffectCommandData commandData;
|
||||
} ScePadTriggerEffectCommand;
|
||||
|
||||
/**
|
||||
*E
|
||||
* @brief parameter for the scePadSetTriggerEffect function.
|
||||
**/
|
||||
typedef struct ScePadTriggerEffectParam{
|
||||
|
||||
uint8_t triggerMask; /*E Set trigger mask to activate trigger effect commands.
|
||||
* SCE_PAD_TRIGGER_EFFECT_TRIGGER_MASK_L2 : 0x01
|
||||
* SCE_PAD_TRIGGER_EFFECT_TRIGGER_MASK_R2 : 0x02
|
||||
* */
|
||||
uint8_t padding[7];
|
||||
|
||||
ScePadTriggerEffectCommand command[SCE_PAD_TRIGGER_EFFECT_TRIGGER_NUM]; /*E command[SCE_PAD_TRIGGER_EFFECT_PARAM_INDEX_FOR_L2] is for L2 trigger setting
|
||||
* and param[SCE_PAD_TRIGGER_EFFECT_PARAM_INDEX_FOR_R2] is for R2 trgger setting.
|
||||
* */
|
||||
} ScePadTriggerEffectParam;
|
||||
|
||||
#if defined(__cplusplus) && __cplusplus >= 201103L
|
||||
static_assert( sizeof( ScePadTriggerEffectParam ) == 120, "ScePadTriggerEffectParam has incorrect size" );
|
||||
#endif
|
||||
|
||||
#endif /* _SCE_PAD_TRIGGER_EFFECT_H */
|
@ -1,4 +1,4 @@
|
||||
//========= Copyright 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
|
||||
@ -20,13 +18,13 @@
|
||||
enum EFriendRelationship
|
||||
{
|
||||
k_EFriendRelationshipNone = 0,
|
||||
k_EFriendRelationshipBlocked = 1,
|
||||
k_EFriendRelationshipBlocked = 1, // this doesn't get stored; the user has just done an Ignore on an friendship invite
|
||||
k_EFriendRelationshipRequestRecipient = 2,
|
||||
k_EFriendRelationshipFriend = 3,
|
||||
k_EFriendRelationshipRequestInitiator = 4,
|
||||
k_EFriendRelationshipIgnored = 5,
|
||||
k_EFriendRelationshipIgnored = 5, // this is stored; the user has explicit blocked this other user from comments/chat/etc
|
||||
k_EFriendRelationshipIgnoredFriend = 6,
|
||||
k_EFriendRelationshipSuggested = 7,
|
||||
k_EFriendRelationshipSuggested_DEPRECATED = 7, // was used by the original implementation of the facebook linking feature, but now unused.
|
||||
|
||||
// keep this updated
|
||||
k_EFriendRelationshipMax = 8,
|
||||
@ -38,6 +36,12 @@ const int k_cchMaxFriendsGroupName = 64;
|
||||
// maximum number of groups a single user is allowed
|
||||
const int k_cFriendsGroupLimit = 100;
|
||||
|
||||
// friends group identifier type
|
||||
typedef int16 FriendsGroupID_t;
|
||||
|
||||
// invalid friends group identifier constant
|
||||
const FriendsGroupID_t k_FriendsGroupID_Invalid = -1;
|
||||
|
||||
const int k_cEnumerateFollowersMax = 50;
|
||||
|
||||
|
||||
@ -53,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,
|
||||
};
|
||||
|
||||
@ -67,14 +72,15 @@ enum EFriendFlags
|
||||
k_EFriendFlagFriendshipRequested = 0x02,
|
||||
k_EFriendFlagImmediate = 0x04, // "regular" friend
|
||||
k_EFriendFlagClanMember = 0x08,
|
||||
k_EFriendFlagOnGameServer = 0x10,
|
||||
k_EFriendFlagOnGameServer = 0x10,
|
||||
// k_EFriendFlagHasPlayedWith = 0x20, // not currently used
|
||||
// k_EFriendFlagFriendOfFriend = 0x40, // not currently used
|
||||
k_EFriendFlagRequestingFriendship = 0x80,
|
||||
k_EFriendFlagRequestingInfo = 0x100,
|
||||
k_EFriendFlagIgnored = 0x200,
|
||||
k_EFriendFlagIgnoredFriend = 0x400,
|
||||
k_EFriendFlagSuggested = 0x800,
|
||||
// k_EFriendFlagSuggested = 0x800, // not used
|
||||
k_EFriendFlagChatMember = 0x1000,
|
||||
k_EFriendFlagAll = 0xFFFF,
|
||||
};
|
||||
|
||||
@ -85,8 +91,8 @@ enum EFriendFlags
|
||||
#elif defined( VALVE_CALLBACK_PACK_LARGE )
|
||||
#pragma pack( push, 8 )
|
||||
#else
|
||||
#error isteamclient.h must be included
|
||||
#endif
|
||||
#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx
|
||||
#endif
|
||||
struct FriendGameInfo_t
|
||||
{
|
||||
CGameID m_gameID;
|
||||
@ -97,6 +103,10 @@ struct FriendGameInfo_t
|
||||
};
|
||||
#pragma pack( pop )
|
||||
|
||||
// special values for FriendGameInfo_t::m_usQueryPort
|
||||
const uint16 k_usFriendGameInfoQueryPort_NotInitialized = 0xFFFF; // We haven't asked the GS for this query port's actual value yet. Was #define QUERY_PORT_NOT_INITIALIZED in older versions of Steamworks SDK.
|
||||
const uint16 k_usFriendGameInfoQueryPort_Error = 0xFFFE; // We were unable to get the query port for this server. Was #define QUERY_PORT_ERROR in older versions of Steamworks SDK.
|
||||
|
||||
// maximum number of characters in a user's name. Two flavors; one for UTF-8 and one for UTF-16.
|
||||
// The UTF-8 version has to be very generous to accomodate characters that get large when encoded
|
||||
// in UTF-8.
|
||||
@ -121,22 +131,11 @@ enum EUserRestriction
|
||||
k_nUserRestrictionTrading = 64, // user cannot participate in trading (console, mobile)
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: information about user sessions
|
||||
//-----------------------------------------------------------------------------
|
||||
struct FriendSessionStateInfo_t
|
||||
{
|
||||
uint32 m_uiOnlineSessionInstances;
|
||||
uint8 m_uiPublishedToFriendsSessionInstance;
|
||||
};
|
||||
|
||||
|
||||
|
||||
// size limit on chat room or member metadata
|
||||
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 };
|
||||
|
||||
@ -148,6 +147,47 @@ 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: See GetProfileItemPropertyString and GetProfileItemPropertyUint
|
||||
//-----------------------------------------------------------------------------
|
||||
enum ECommunityProfileItemType
|
||||
{
|
||||
k_ECommunityProfileItemType_AnimatedAvatar = 0,
|
||||
k_ECommunityProfileItemType_AvatarFrame = 1,
|
||||
k_ECommunityProfileItemType_ProfileModifier = 2,
|
||||
k_ECommunityProfileItemType_ProfileBackground = 3,
|
||||
k_ECommunityProfileItemType_MiniProfileBackground = 4,
|
||||
};
|
||||
enum ECommunityProfileItemProperty
|
||||
{
|
||||
k_ECommunityProfileItemProperty_ImageSmall = 0, // string
|
||||
k_ECommunityProfileItemProperty_ImageLarge = 1, // string
|
||||
k_ECommunityProfileItemProperty_InternalName = 2, // string
|
||||
k_ECommunityProfileItemProperty_Title = 3, // string
|
||||
k_ECommunityProfileItemProperty_Description = 4, // string
|
||||
k_ECommunityProfileItemProperty_AppID = 5, // uint32
|
||||
k_ECommunityProfileItemProperty_TypeID = 6, // uint32
|
||||
k_ECommunityProfileItemProperty_Class = 7, // uint32
|
||||
k_ECommunityProfileItemProperty_MovieWebM = 8, // string
|
||||
k_ECommunityProfileItemProperty_MovieMP4 = 9, // string
|
||||
k_ECommunityProfileItemProperty_MovieWebMSmall = 10, // string
|
||||
k_ECommunityProfileItemProperty_MovieMP4Small = 11, // string
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// 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
|
||||
@ -169,6 +209,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.
|
||||
STEAM_CALL_RESULT( SetPersonaNameResponse_t )
|
||||
virtual SteamAPICall_t SetPersonaName( const char *pchPersonaName ) = 0;
|
||||
|
||||
// gets the status of the current user
|
||||
@ -195,13 +236,31 @@ public:
|
||||
// returns the name another user - guaranteed to not be NULL.
|
||||
// same rules as GetFriendPersonaState() apply as to whether or not the user knowns the name of the other user
|
||||
// note that on first joining a lobby, chat room or game server the local user will not known the name of the other users automatically; that information will arrive asyncronously
|
||||
//
|
||||
//
|
||||
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, FriendGameInfo_t *pFriendGameInfo ) = 0;
|
||||
// returns true if the friend is actually in a game, and fills in pFriendGameInfo with an extra details
|
||||
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
|
||||
// returns the number of friends groups
|
||||
virtual int GetFriendsGroupCount() = 0;
|
||||
// returns the friends group ID for the given index (invalid indices return k_FriendsGroupID_Invalid)
|
||||
virtual FriendsGroupID_t GetFriendsGroupIDByIndex( int iFG ) = 0;
|
||||
// returns the name for the given friends group (NULL in the case of invalid friends group IDs)
|
||||
virtual const char *GetFriendsGroupName( FriendsGroupID_t friendsGroupID ) = 0;
|
||||
// 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, 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
|
||||
@ -214,8 +273,10 @@ public:
|
||||
virtual const char *GetClanTag( CSteamID steamIDClan ) = 0;
|
||||
// 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( CSteamID *psteamIDClans, int cClansToRequest ) = 0;
|
||||
STEAM_CALL_RESULT( DownloadClanActivityCountsResult_t )
|
||||
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
|
||||
@ -230,14 +291,15 @@ public:
|
||||
// User is in a game pressing the talk button (will suppress the microphone for all voice comms from the Steam friends UI)
|
||||
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"
|
||||
// activates the game overlay, with an optional dialog to open
|
||||
// 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
|
||||
// valid options are
|
||||
// "steamid" - opens the overlay web browser to the specified user or groups profile
|
||||
// "chat" - opens a chat window to the specified user, or joins the group chat
|
||||
// "chat" - opens a chat window to the specified user, or joins the group chat
|
||||
// "jointrade" - opens a window to a Steam Trading session that was started with the ISteamEconomy/StartTrade Web API
|
||||
// "stats" - opens the overlay web browser to the specified user's stats
|
||||
// "achievements" - opens the overlay web browser to the specified user's achievements
|
||||
@ -249,13 +311,13 @@ 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;
|
||||
|
||||
// Mark a target user as 'played with'. This is a client-side only feature that requires that the calling user is
|
||||
// in game
|
||||
// Mark a target user as 'played with'. This is a client-side only feature that requires that the calling user is
|
||||
// in game
|
||||
virtual void SetPlayedWith( CSteamID steamIDUserPlayedWith ) = 0;
|
||||
|
||||
// activates game overlay to open the invite dialog. Invitations will be sent for the provided lobby.
|
||||
@ -272,7 +334,7 @@ public:
|
||||
virtual int GetLargeFriendAvatar( CSteamID steamIDFriend ) = 0;
|
||||
|
||||
// requests information about a user - persona name & avatar
|
||||
// if bRequireNameOnly is set, then the avatar of a user isn't downloaded
|
||||
// if bRequireNameOnly is set, then the avatar of a user isn't downloaded
|
||||
// - it's a lot slower to download avatars and churns the local cache, so if you don't need avatars, don't request them
|
||||
// if returns true, it means that data is being requested, and a PersonaStateChanged_t callback will be posted when it's retrieved
|
||||
// if returns false, it means that we already have all the details about that user, and functions can be called immediately
|
||||
@ -284,10 +346,11 @@ 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
|
||||
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
|
||||
|
||||
|
||||
// returns the steamID of the clan owner
|
||||
virtual CSteamID GetClanOwner( CSteamID steamIDClan ) = 0;
|
||||
// returns the number of officers in a clan (including the owner)
|
||||
@ -301,10 +364,16 @@ public:
|
||||
|
||||
// Rich Presence data is automatically shared between friends who are in the same game
|
||||
// Each user has a set of Key/Value pairs
|
||||
// Up to 20 different keys can be set
|
||||
// There are two magic keys:
|
||||
// Note the following limits: k_cchMaxRichPresenceKeys, k_cchMaxRichPresenceKeyLength, k_cchMaxRichPresenceValueLength
|
||||
// There are five magic keys:
|
||||
// "status" - a UTF-8 string that will show up in the 'view game info' dialog in the Steam friends list
|
||||
// "connect" - a UTF-8 string that contains the command-line for how a friend can connect to a game
|
||||
// "steam_display" - Names a rich presence localization token that will be displayed in the viewing user's selected language
|
||||
// in the Steam client UI. For more info: https://partner.steamgames.com/doc/api/ISteamFriends#richpresencelocalization
|
||||
// "steam_player_group" - When set, indicates to the Steam client that the player is a member of a particular group. Players in the same group
|
||||
// may be organized together in various places in the Steam UI.
|
||||
// "steam_player_group_size" - When set, indicates the total number of players in the steam_player_group. The Steam client may use this number to
|
||||
// display additional information about a group when all of the members are not part of a user's friends list.
|
||||
// GetFriendRichPresence() returns an empty string "" if no value is set
|
||||
// SetRichPresence() to a NULL or an empty string deletes the key
|
||||
// You can iterate the current set of keys for a friend with GetFriendRichPresenceKeyCount()
|
||||
@ -317,10 +386,9 @@ 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 your game so that it is passed on the command line instead. This is a deprecated path; ask us if you really need this.)
|
||||
virtual bool InviteUserToGame( CSteamID steamIDFriend, const char *pchConnectString ) = 0;
|
||||
|
||||
// recently-played-with friends iteration
|
||||
@ -335,12 +403,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
|
||||
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 *, CSteamID * ) = 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)
|
||||
@ -355,12 +424,49 @@ public:
|
||||
virtual int GetFriendMessage( CSteamID steamIDFriend, int iMessageID, void *pvData, int cubData, EChatEntryType *peChatEntryType ) = 0;
|
||||
|
||||
// following apis
|
||||
STEAM_CALL_RESULT( FriendsGetFollowerCount_t )
|
||||
virtual SteamAPICall_t GetFollowerCount( CSteamID steamID ) = 0;
|
||||
STEAM_CALL_RESULT( FriendsIsFollowing_t )
|
||||
virtual SteamAPICall_t IsFollowing( CSteamID steamID ) = 0;
|
||||
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;
|
||||
|
||||
// activates game overlay to open the remote play together invite dialog. Invitations will be sent for remote play together
|
||||
virtual void ActivateGameOverlayRemotePlayTogetherInviteDialog( CSteamID steamIDLobby ) = 0;
|
||||
|
||||
// Call this before calling ActivateGameOverlayToWebPage() to have the Steam Overlay Browser block navigations
|
||||
// to your specified protocol (scheme) uris and instead dispatch a OverlayBrowserProtocolNavigation_t callback to your game.
|
||||
// ActivateGameOverlayToWebPage() must have been called with k_EActivateGameOverlayToWebPageMode_Modal
|
||||
virtual bool RegisterProtocolInOverlayBrowser( const char *pchProtocol ) = 0;
|
||||
|
||||
// Activates the game overlay to open an invite dialog that will send the provided Rich Presence connect string to selected friends
|
||||
virtual void ActivateGameOverlayInviteDialogConnectString( const char *pchConnectString ) = 0;
|
||||
|
||||
// Steam Community items equipped by a user on their profile
|
||||
// You can register for EquippedProfileItemsChanged_t to know when a friend has changed their equipped profile items
|
||||
STEAM_CALL_RESULT( EquippedProfileItems_t )
|
||||
virtual SteamAPICall_t RequestEquippedProfileItems( CSteamID steamID ) = 0;
|
||||
virtual bool BHasEquippedProfileItem( CSteamID steamID, ECommunityProfileItemType itemType ) = 0;
|
||||
virtual const char *GetProfileItemPropertyString( CSteamID steamID, ECommunityProfileItemType itemType, ECommunityProfileItemProperty prop ) = 0;
|
||||
virtual uint32 GetProfileItemPropertyUint( CSteamID steamID, ECommunityProfileItemType itemType, ECommunityProfileItemProperty prop ) = 0;
|
||||
};
|
||||
|
||||
#define STEAMFRIENDS_INTERFACE_VERSION "SteamFriends013"
|
||||
#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 )
|
||||
@ -368,8 +474,8 @@ public:
|
||||
#elif defined( VALVE_CALLBACK_PACK_LARGE )
|
||||
#pragma pack( push, 8 )
|
||||
#else
|
||||
#error isteamclient.h must be included
|
||||
#endif
|
||||
#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx
|
||||
#endif
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: called when a friends' status changes
|
||||
@ -377,7 +483,7 @@ public:
|
||||
struct PersonaStateChange_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamFriendsCallbacks + 4 };
|
||||
|
||||
|
||||
uint64 m_ulSteamID; // steamID of the friend who changed
|
||||
int m_nChangeFlags; // what's changed
|
||||
};
|
||||
@ -398,9 +504,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,
|
||||
};
|
||||
|
||||
|
||||
@ -411,7 +518,10 @@ enum EPersonaChange
|
||||
struct GameOverlayActivated_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamFriendsCallbacks + 31 };
|
||||
uint8 m_bActive; // true if it's just been activated, false otherwise
|
||||
uint8 m_bActive; // true if it's just been activated, false otherwise
|
||||
bool m_bUserInitiated; // true if the user asked for the overlay to be activated/deactivated
|
||||
AppId_t m_nAppID; // the appID of the game (should always be the current game)
|
||||
uint32 m_dwOverlayPID; // used internally
|
||||
};
|
||||
|
||||
|
||||
@ -441,7 +551,7 @@ struct GameLobbyJoinRequested_t
|
||||
// On PS3, the friend will be invalid if this was triggered by a PSN invite via the XMB, but
|
||||
// the account type will be console user so you can tell at least that this was from a PSN friend
|
||||
// rather than a Steam friend.
|
||||
CSteamID m_steamIDFriend;
|
||||
CSteamID m_steamIDFriend;
|
||||
};
|
||||
|
||||
|
||||
@ -600,6 +710,47 @@ 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 };
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Dispatched when an overlay browser instance is navigated to a protocol/scheme registered by RegisterProtocolInOverlayBrowser()
|
||||
//-----------------------------------------------------------------------------
|
||||
struct OverlayBrowserProtocolNavigation_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamFriendsCallbacks + 49 };
|
||||
char rgchURI[ 1024 ];
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: A user's equipped profile items have changed
|
||||
//-----------------------------------------------------------------------------
|
||||
struct EquippedProfileItemsChanged_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamFriendsCallbacks + 50 };
|
||||
CSteamID m_steamID;
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
//-----------------------------------------------------------------------------
|
||||
struct EquippedProfileItems_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamFriendsCallbacks + 51 };
|
||||
EResult m_eResult;
|
||||
CSteamID m_steamID;
|
||||
bool m_bHasAnimatedAvatar;
|
||||
bool m_bHasAvatarFrame;
|
||||
bool m_bHasProfileModifier;
|
||||
bool m_bHasProfileBackground;
|
||||
bool m_bHasMiniProfileBackground;
|
||||
};
|
||||
|
||||
#pragma pack( pop )
|
||||
|
||||
|
74
rehlds/public/steam/isteamgamecoordinator.h
Normal file
74
rehlds/public/steam/isteamgamecoordinator.h
Normal file
@ -0,0 +1,74 @@
|
||||
//====== Copyright ©, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: interface to the game coordinator for this application
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMGAMECOORDINATOR
|
||||
#define ISTEAMGAMECOORDINATOR
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "steam_api_common.h"
|
||||
|
||||
|
||||
// list of possible return values from the ISteamGameCoordinator API
|
||||
enum EGCResults
|
||||
{
|
||||
k_EGCResultOK = 0,
|
||||
k_EGCResultNoMessage = 1, // There is no message in the queue
|
||||
k_EGCResultBufferTooSmall = 2, // The buffer is too small for the requested message
|
||||
k_EGCResultNotLoggedOn = 3, // The client is not logged onto Steam
|
||||
k_EGCResultInvalidMessage = 4, // Something was wrong with the message being sent with SendMessage
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Functions for sending and receiving messages from the Game Coordinator
|
||||
// for this application
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamGameCoordinator
|
||||
{
|
||||
public:
|
||||
|
||||
// sends a message to the Game Coordinator
|
||||
virtual EGCResults SendMessage( uint32 unMsgType, const void *pubData, uint32 cubData ) = 0;
|
||||
|
||||
// returns true if there is a message waiting from the game coordinator
|
||||
virtual bool IsMessageAvailable( uint32 *pcubMsgSize ) = 0;
|
||||
|
||||
// fills the provided buffer with the first message in the queue and returns k_EGCResultOK or
|
||||
// returns k_EGCResultNoMessage if there is no message waiting. pcubMsgSize is filled with the message size.
|
||||
// If the provided buffer is not large enough to fit the entire message, k_EGCResultBufferTooSmall is returned
|
||||
// and the message remains at the head of the queue.
|
||||
virtual EGCResults RetrieveMessage( uint32 *punMsgType, void *pubDest, uint32 cubDest, uint32 *pcubMsgSize ) = 0;
|
||||
|
||||
};
|
||||
#define STEAMGAMECOORDINATOR_INTERFACE_VERSION "SteamGameCoordinator001"
|
||||
|
||||
// callbacks
|
||||
#if defined( VALVE_CALLBACK_PACK_SMALL )
|
||||
#pragma pack( push, 4 )
|
||||
#elif defined( VALVE_CALLBACK_PACK_LARGE )
|
||||
#pragma pack( push, 8 )
|
||||
#else
|
||||
#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx
|
||||
#endif
|
||||
|
||||
// callback notification - A new message is available for reading from the message queue
|
||||
struct GCMessageAvailable_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamGameCoordinatorCallbacks + 1 };
|
||||
uint32 m_nMessageSize;
|
||||
};
|
||||
|
||||
// callback notification - A message failed to make it to the GC. It may be down temporarily
|
||||
struct GCMessageFailed_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamGameCoordinatorCallbacks + 2 };
|
||||
};
|
||||
|
||||
#pragma pack( pop )
|
||||
|
||||
#endif // ISTEAMGAMECOORDINATOR
|
@ -1,4 +1,4 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//====== Copyright (c) 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: interface to steam for game servers
|
||||
//
|
||||
@ -10,9 +10,7 @@
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "isteamclient.h"
|
||||
|
||||
#define MASTERSERVERUPDATERPORT_USEGAMESOCKETSHARE ((uint16)-1)
|
||||
#include "steam_api_common.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Functions for authenticating users via Steam to play on a game server
|
||||
@ -27,7 +25,7 @@ public:
|
||||
//
|
||||
|
||||
/// This is called by SteamGameServer_Init, and you will usually not need to call it directly
|
||||
virtual bool InitGameServer( uint32 unIP, uint16 usGamePort, uint16 usQueryPort, uint32 unFlags, AppId_t nGameAppId, const char *pchVersionString ) = 0;
|
||||
STEAM_PRIVATE_API( virtual bool InitGameServer( uint32 unIP, uint16 usGamePort, uint16 usQueryPort, uint32 unFlags, AppId_t nGameAppId, const char *pchVersionString ) = 0; )
|
||||
|
||||
/// Game product identifier. This is currently used by the master server for version checking purposes.
|
||||
/// It's a required field, but will eventually will go away, and the AppID will be used for this purpose.
|
||||
@ -56,10 +54,7 @@ public:
|
||||
/// @see SteamServersConnected_t
|
||||
/// @see SteamServerConnectFailure_t
|
||||
/// @see SteamServersDisconnected_t
|
||||
virtual void LogOn(
|
||||
const char *pszAccountName,
|
||||
const char *pszPassword
|
||||
) = 0;
|
||||
virtual void LogOn( const char *pszToken ) = 0;
|
||||
|
||||
/// Login to a generic, anonymous account.
|
||||
///
|
||||
@ -69,10 +64,10 @@ public:
|
||||
|
||||
/// Begin process of logging game server out of steam
|
||||
virtual void LogOff() = 0;
|
||||
|
||||
|
||||
// status functions
|
||||
virtual bool BLoggedOn() = 0;
|
||||
virtual bool BSecure() = 0;
|
||||
virtual bool BSecure() = 0;
|
||||
virtual CSteamID GetSteamID() = 0;
|
||||
|
||||
/// Returns true if the master server has requested a restart.
|
||||
@ -96,14 +91,23 @@ public:
|
||||
|
||||
/// Set name of map to report in the server browser
|
||||
///
|
||||
/// @see k_cbMaxGameServerName
|
||||
/// @see k_cbMaxGameServerMapName
|
||||
virtual void SetMapName( const char *pszMapName ) = 0;
|
||||
|
||||
/// Let people know if your server will require a password
|
||||
virtual void SetPasswordProtected( bool bPasswordProtected ) = 0;
|
||||
|
||||
/// Spectator server. The default value is zero, meaning the service
|
||||
/// is not used.
|
||||
/// Spectator server port to advertise. The default value is zero, meaning the
|
||||
/// service is not used. If your server receives any info requests on the LAN,
|
||||
/// this is the value that will be placed into the reply for such local queries.
|
||||
///
|
||||
/// This is also the value that will be advertised by the master server.
|
||||
/// The only exception is if your server is using a FakeIP. Then then the second
|
||||
/// fake port number (index 1) assigned to your server will be listed on the master
|
||||
/// server as the spectator port, if you set this value to any nonzero value.
|
||||
///
|
||||
/// This function merely controls the values that are advertised -- it's up to you to
|
||||
/// configure the server to actually listen on this port and handle any spectator traffic
|
||||
virtual void SetSpectatorPort( uint16 unSpectatorPort ) = 0;
|
||||
|
||||
/// Name of the spectator server. (Only used if spectator port is nonzero.)
|
||||
@ -113,7 +117,7 @@ public:
|
||||
|
||||
/// Call this to clear the whole list of key/values that are sent in rules queries.
|
||||
virtual void ClearAllKeyValues() = 0;
|
||||
|
||||
|
||||
/// Call this to add/update a key/value pair.
|
||||
virtual void SetKeyValue( const char *pKey, const char *pValue ) = 0;
|
||||
|
||||
@ -121,58 +125,36 @@ public:
|
||||
/// it allows users to filter in the matchmaking/server-browser interfaces based on the value
|
||||
///
|
||||
/// @see k_cbMaxGameServerTags
|
||||
virtual void SetGameTags( const char *pchGameTags ) = 0;
|
||||
virtual void SetGameTags( const char *pchGameTags ) = 0;
|
||||
|
||||
/// Sets a string defining the "gamedata" for this server, this is optional, but if it is set
|
||||
/// it allows users to filter in the matchmaking/server-browser interfaces based on the value
|
||||
/// don't set this unless it actually changes, its only uploaded to the master once (when
|
||||
/// acknowledged)
|
||||
///
|
||||
/// @see k_cbMaxGameServerGameData
|
||||
virtual void SetGameData( const char *pchGameData) = 0;
|
||||
virtual void SetGameData( const char *pchGameData ) = 0;
|
||||
|
||||
/// Region identifier. This is an optional field, the default value is empty, meaning the "world" region
|
||||
virtual void SetRegion( const char *pszRegion ) = 0;
|
||||
|
||||
/// Indicate whether you wish to be listed on the master server list
|
||||
/// and/or respond to server browser / LAN discovery packets.
|
||||
/// The server starts with this value set to false. You should set all
|
||||
/// relevant server parameters before enabling advertisement on the server.
|
||||
///
|
||||
/// (This function used to be named EnableHeartbeats, so if you are wondering
|
||||
/// where that function went, it's right here. It does the same thing as before,
|
||||
/// the old name was just confusing.)
|
||||
virtual void SetAdvertiseServerActive( bool bActive ) = 0;
|
||||
|
||||
//
|
||||
// Player list management / authentication
|
||||
// Player list management / authentication.
|
||||
//
|
||||
|
||||
// Handles receiving a new connection from a Steam user. This call will ask the Steam
|
||||
// servers to validate the users identity, app ownership, and VAC status. If the Steam servers
|
||||
// are off-line, then it will validate the cached ticket itself which will validate app ownership
|
||||
// and identity. The AuthBlob here should be acquired on the game client using SteamUser()->InitiateGameConnection()
|
||||
// and must then be sent up to the game server for authentication.
|
||||
//
|
||||
// Return Value: returns true if the users ticket passes basic checks. pSteamIDUser will contain the Steam ID of this user. pSteamIDUser must NOT be NULL
|
||||
// If the call succeeds then you should expect a GSClientApprove_t or GSClientDeny_t callback which will tell you whether authentication
|
||||
// for the user has succeeded or failed (the steamid in the callback will match the one returned by this call)
|
||||
virtual bool SendUserConnectAndAuthenticate( uint32 unIPClient, const void *pvAuthBlob, uint32 cubAuthBlobSize, CSteamID *pSteamIDUser ) = 0;
|
||||
|
||||
// Creates a fake user (ie, a bot) which will be listed as playing on the server, but skips validation.
|
||||
//
|
||||
// Return Value: Returns a SteamID for the user to be tracked with, you should call HandleUserDisconnect()
|
||||
// when this user leaves the server just like you would for a real user.
|
||||
virtual CSteamID CreateUnauthenticatedUserConnection() = 0;
|
||||
|
||||
// Should be called whenever a user leaves our game server, this lets Steam internally
|
||||
// track which users are currently on which servers for the purposes of preventing a single
|
||||
// account being logged into multiple servers, showing who is currently on a server, etc.
|
||||
virtual void SendUserDisconnect( CSteamID steamIDUser ) = 0;
|
||||
|
||||
// Update the data to be displayed in the server browser and matchmaking interfaces for a user
|
||||
// currently connected to the server. For regular users you must call this after you receive a
|
||||
// GSUserValidationSuccess callback.
|
||||
//
|
||||
// Return Value: true if successful, false if failure (ie, steamIDUser wasn't for an active player)
|
||||
virtual bool BUpdateUserData( CSteamID steamIDUser, const char *pchPlayerName, uint32 uScore ) = 0;
|
||||
|
||||
// New auth system APIs - do not mix with the old auth system APIs.
|
||||
// ----------------------------------------------------------------
|
||||
|
||||
// Retrieve ticket to be sent to the entity who wishes to authenticate you ( using BeginAuthSession API ).
|
||||
// Retrieve ticket to be sent to the entity who wishes to authenticate you ( using BeginAuthSession API ).
|
||||
// pcbTicket retrieves the length of the actual ticket.
|
||||
virtual HAuthTicket GetAuthSessionTicket( void *pTicket, int cbMaxTicket, uint32 *pcbTicket ) = 0;
|
||||
// SteamNetworkingIdentity is an optional parameter to hold the public IP address of the entity you are connecting to
|
||||
// if an IP address is passed Steam will only allow the ticket to be used by an entity with that IP address
|
||||
virtual HAuthTicket GetAuthSessionTicket( void *pTicket, int cbMaxTicket, uint32 *pcbTicket, const SteamNetworkingIdentity *pSnid ) = 0;
|
||||
|
||||
// Authenticate ticket ( from GetAuthSessionTicket ) from entity steamID to be sure it is valid and isnt reused
|
||||
// Registers for callbacks if the entity goes offline or cancels the ticket ( see ValidateAuthTicketResponse_t callback and EAuthSessionResponse )
|
||||
@ -192,35 +174,28 @@ public:
|
||||
// returns false if we're not connected to the steam servers and thus cannot ask
|
||||
virtual bool RequestUserGroupStatus( CSteamID steamIDUser, CSteamID steamIDGroup ) = 0;
|
||||
|
||||
//
|
||||
// Query steam for server data
|
||||
//
|
||||
|
||||
// Ask for the gameplay stats for the server. Results returned in a callback
|
||||
// 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;
|
||||
STEAM_CALL_RESULT( GSReputation_t )
|
||||
virtual SteamAPICall_t GetServerReputation() = 0;
|
||||
|
||||
// Gets the reputation score for the game server. This API also checks if the server or some
|
||||
// other server on the same IP is banned from the Steam master servers.
|
||||
virtual SteamAPICall_t GetServerReputation( ) = 0;
|
||||
|
||||
// Returns the public IP of the server according to Steam, useful when the server is
|
||||
// Returns the public IP of the server according to Steam, useful when the server is
|
||||
// behind NAT and you want to advertise its IP in a lobby for other clients to directly
|
||||
// connect to
|
||||
virtual uint32 GetPublicIP() = 0;
|
||||
virtual SteamIPAddress_t GetPublicIP() = 0;
|
||||
|
||||
// Server browser related query packet processing for shared socket mode. These are used
|
||||
// when you pass STEAMGAMESERVER_QUERY_PORT_SHARED as the query port to SteamGameServer_Init.
|
||||
// IP address and port are in host order, i.e 127.0.0.1 == 0x7f000001
|
||||
|
||||
// These are in GameSocketShare mode, where instead of ISteamGameServer creating its own
|
||||
// socket to talk to the master server on, it lets the game use its socket to forward messages
|
||||
// back and forth. This prevents us from requiring server ops to open up yet another port
|
||||
// in their firewalls.
|
||||
//
|
||||
// the IP address and port should be in host order, i.e 127.0.0.1 == 0x7f000001
|
||||
|
||||
// These are used when you've elected to multiplex the game server's UDP socket
|
||||
// rather than having the master server updater use its own sockets.
|
||||
//
|
||||
// Source games use this to simplify the job of the server admins, so they
|
||||
//
|
||||
// Source games use this to simplify the job of the server admins, so they
|
||||
// don't have to open up more ports on their firewalls.
|
||||
|
||||
|
||||
// Call this when a packet that starts with 0xFFFFFFFF comes in. That means
|
||||
// it's for us.
|
||||
virtual bool HandleIncomingPacket( const void *pData, int cbData, uint32 srcIP, uint16 srcPort ) = 0;
|
||||
@ -232,43 +207,70 @@ public:
|
||||
virtual int GetNextOutgoingPacket( void *pOut, int cbMaxOut, uint32 *pNetAdr, uint16 *pPort ) = 0;
|
||||
|
||||
//
|
||||
// Control heartbeats / advertisement with master server
|
||||
// Server clan association
|
||||
//
|
||||
|
||||
// Call this as often as you like to tell the master server updater whether or not
|
||||
// you want it to be active (default: off).
|
||||
virtual void EnableHeartbeats( bool bActive ) = 0;
|
||||
|
||||
// You usually don't need to modify this.
|
||||
// Pass -1 to use the default value for iHeartbeatInterval.
|
||||
// Some mods change this.
|
||||
virtual void SetHeartbeatInterval( int iHeartbeatInterval ) = 0;
|
||||
|
||||
// Force a heartbeat to steam at the next opportunity
|
||||
virtual void ForceHeartbeat() = 0;
|
||||
|
||||
// associate this game server with this clan for the purposes of computing player compat
|
||||
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
|
||||
STEAM_CALL_RESULT( ComputeNewPlayerCompatibilityResult_t )
|
||||
virtual SteamAPICall_t ComputeNewPlayerCompatibility( CSteamID steamIDNewPlayer ) = 0;
|
||||
|
||||
|
||||
|
||||
|
||||
// Handles receiving a new connection from a Steam user. This call will ask the Steam
|
||||
// servers to validate the users identity, app ownership, and VAC status. If the Steam servers
|
||||
// are off-line, then it will validate the cached ticket itself which will validate app ownership
|
||||
// and identity. The AuthBlob here should be acquired on the game client using SteamUser()->InitiateGameConnection()
|
||||
// and must then be sent up to the game server for authentication.
|
||||
//
|
||||
// Return Value: returns true if the users ticket passes basic checks. pSteamIDUser will contain the Steam ID of this user. pSteamIDUser must NOT be NULL
|
||||
// If the call succeeds then you should expect a GSClientApprove_t or GSClientDeny_t callback which will tell you whether authentication
|
||||
// for the user has succeeded or failed (the steamid in the callback will match the one returned by this call)
|
||||
//
|
||||
// DEPRECATED! This function will be removed from the SDK in an upcoming version.
|
||||
// Please migrate to BeginAuthSession and related functions.
|
||||
virtual bool SendUserConnectAndAuthenticate( uint32 unIPClient, const void *pvAuthBlob, uint32 cubAuthBlobSize, CSteamID *pSteamIDUser ) = 0;
|
||||
|
||||
// Creates a fake user (ie, a bot) which will be listed as playing on the server, but skips validation.
|
||||
//
|
||||
// Return Value: Returns a SteamID for the user to be tracked with, you should call EndAuthSession()
|
||||
// when this user leaves the server just like you would for a real user.
|
||||
virtual CSteamID CreateUnauthenticatedUserConnection() = 0;
|
||||
|
||||
// Should be called whenever a user leaves our game server, this lets Steam internally
|
||||
// track which users are currently on which servers for the purposes of preventing a single
|
||||
// account being logged into multiple servers, showing who is currently on a server, etc.
|
||||
//
|
||||
// DEPRECATED! This function will be removed from the SDK in an upcoming version.
|
||||
// Please migrate to BeginAuthSession and related functions.
|
||||
virtual void SendUserDisconnect( CSteamID steamIDUser ) = 0;
|
||||
|
||||
// Update the data to be displayed in the server browser and matchmaking interfaces for a user
|
||||
// currently connected to the server. For regular users you must call this after you receive a
|
||||
// GSUserValidationSuccess callback.
|
||||
//
|
||||
// Return Value: true if successful, false if failure (ie, steamIDUser wasn't for an active player)
|
||||
virtual bool BUpdateUserData( CSteamID steamIDUser, const char *pchPlayerName, uint32 uScore ) = 0;
|
||||
|
||||
// Deprecated functions. These will be removed in a future version of the SDK.
|
||||
// If you really need these, please contact us and help us understand what you are
|
||||
// using them for.
|
||||
|
||||
// STEAM_PRIVATE_API(
|
||||
virtual void SetMasterServerHeartbeatInterval( int iHeartbeatInterval ) = 0;
|
||||
virtual void ForceMasterServerHeartbeat() = 0;
|
||||
// )
|
||||
};
|
||||
|
||||
#define STEAMGAMESERVER_INTERFACE_VERSION "SteamGameServer011"
|
||||
|
||||
// game server flags
|
||||
const uint32 k_unServerFlagNone = 0x00;
|
||||
const uint32 k_unServerFlagActive = 0x01; // server has users playing
|
||||
const uint32 k_unServerFlagSecure = 0x02; // server wants to be secure
|
||||
const uint32 k_unServerFlagDedicated = 0x04; // server is dedicated
|
||||
const uint32 k_unServerFlagLinux = 0x08; // linux build
|
||||
const uint32 k_unServerFlagPassworded = 0x10; // password protected
|
||||
const uint32 k_unServerFlagPrivate = 0x20; // server shouldn't list on master server and
|
||||
// won't enforce authentication of users that connect to the server.
|
||||
// Useful when you run a server where the clients may not
|
||||
// be connected to the internet but you want them to play (i.e LANs)
|
||||
#define STEAMGAMESERVER_INTERFACE_VERSION "SteamGameServer015"
|
||||
|
||||
// Global accessor
|
||||
inline ISteamGameServer *SteamGameServer();
|
||||
STEAM_DEFINE_GAMESERVER_INTERFACE_ACCESSOR( ISteamGameServer *, SteamGameServer, STEAMGAMESERVER_INTERFACE_VERSION );
|
||||
|
||||
// callbacks
|
||||
#if defined( VALVE_CALLBACK_PACK_SMALL )
|
||||
@ -276,15 +278,16 @@ 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
|
||||
#endif
|
||||
#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx
|
||||
#endif
|
||||
|
||||
|
||||
// client has been approved to connect to this game server
|
||||
struct GSClientApprove_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamGameServerCallbacks + 1 };
|
||||
CSteamID m_SteamID;
|
||||
CSteamID m_SteamID; // SteamID of approved player
|
||||
CSteamID m_OwnerSteamID; // SteamID of original owner for game license
|
||||
};
|
||||
|
||||
|
||||
@ -306,7 +309,7 @@ struct GSClientKick_t
|
||||
EDenyReason m_eDenyReason;
|
||||
};
|
||||
|
||||
// NOTE: callback values 4 and 5 are skipped because they are used for old deprecated callbacks,
|
||||
// NOTE: callback values 4 and 5 are skipped because they are used for old deprecated callbacks,
|
||||
// do not reuse them here.
|
||||
|
||||
|
||||
@ -356,7 +359,7 @@ struct GSReputation_t
|
||||
bool m_bBanned; // True if the server is banned from the Steam
|
||||
// master servers
|
||||
|
||||
// The following members are only filled out if m_bBanned is true. They will all
|
||||
// The following members are only filled out if m_bBanned is true. They will all
|
||||
// be set to zero otherwise. Master server bans are by IP so it is possible to be
|
||||
// banned even when the score is good high if there is a bad server on another port.
|
||||
// This information can be used to determine which server is bad.
|
||||
|
@ -1,4 +1,4 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//====== Copyright © Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: interface for game servers to steam stats and achievements
|
||||
//
|
||||
@ -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,19 +23,29 @@ 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
|
||||
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()
|
||||
STEAM_FLAT_NAME( GetUserStatInt32 )
|
||||
virtual bool GetUserStat( CSteamID steamIDUser, const char *pchName, int32 *pData ) = 0;
|
||||
|
||||
STEAM_FLAT_NAME( GetUserStatFloat )
|
||||
virtual bool GetUserStat( CSteamID steamIDUser, const char *pchName, float *pData ) = 0;
|
||||
|
||||
virtual bool GetUserAchievement( CSteamID steamIDUser, const char *pchName, bool *pbAchieved ) = 0;
|
||||
|
||||
// Set / update stats and achievements.
|
||||
// Note: These updates will work only on stats game servers are allowed to edit and only for
|
||||
// game servers that have been declared as officially controlled by the game creators.
|
||||
// Set / update stats and achievements.
|
||||
// Note: These updates will work only on stats game servers are allowed to edit and only for
|
||||
// game servers that have been declared as officially controlled by the game creators.
|
||||
// Set the IP range of your official servers on the Steamworks page
|
||||
|
||||
STEAM_FLAT_NAME( SetUserStatInt32 )
|
||||
virtual bool SetUserStat( CSteamID steamIDUser, const char *pchName, int32 nData ) = 0;
|
||||
|
||||
STEAM_FLAT_NAME( SetUserStatFloat )
|
||||
virtual bool SetUserStat( CSteamID steamIDUser, const char *pchName, float fData ) = 0;
|
||||
|
||||
virtual bool UpdateUserAvgRateStat( CSteamID steamIDUser, const char *pchName, float flCountThisSession, double dSessionLength ) = 0;
|
||||
|
||||
virtual bool SetUserAchievement( CSteamID steamIDUser, const char *pchName ) = 0;
|
||||
@ -43,23 +53,28 @@ public:
|
||||
|
||||
// Store the current data on the server, will get a GSStatsStored_t callback when set.
|
||||
//
|
||||
// If the callback has a result of k_EResultInvalidParam, one or more stats
|
||||
// If the callback has a result of k_EResultInvalidParam, one or more stats
|
||||
// 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.
|
||||
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
|
||||
#endif
|
||||
#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx
|
||||
#endif
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: called when the latests stats and achievements have been received
|
||||
|
479
rehlds/public/steam/isteamhtmlsurface.h
Normal file
479
rehlds/public/steam/isteamhtmlsurface.h
Normal file
@ -0,0 +1,479 @@
|
||||
//====== Copyright 1996-2013, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: interface to display html pages in a texture
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMHTMLSURFACE_H
|
||||
#define ISTEAMHTMLSURFACE_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "steam_api_common.h"
|
||||
|
||||
typedef uint32 HHTMLBrowser;
|
||||
const uint32 INVALID_HTMLBROWSER = 0;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Functions for displaying HTML pages and interacting with them
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamHTMLSurface
|
||||
{
|
||||
public:
|
||||
virtual ~ISteamHTMLSurface() {}
|
||||
|
||||
// Must call init and shutdown when starting/ending use of the interface
|
||||
virtual bool Init() = 0;
|
||||
virtual bool Shutdown() = 0;
|
||||
|
||||
// Create a browser object for display of a html page, when creation is complete the call handle
|
||||
// will return a HTML_BrowserReady_t callback for the HHTMLBrowser of your new browser.
|
||||
// The user agent string is a substring to be added to the general user agent string so you can
|
||||
// identify your client on web servers.
|
||||
// The userCSS string lets you apply a CSS style sheet to every displayed page, leave null if
|
||||
// you do not require this functionality.
|
||||
//
|
||||
// YOU MUST HAVE IMPLEMENTED HANDLERS FOR HTML_BrowserReady_t, HTML_StartRequest_t,
|
||||
// HTML_JSAlert_t, HTML_JSConfirm_t, and HTML_FileOpenDialog_t! See the CALLBACKS
|
||||
// section of this interface (AllowStartRequest, etc) for more details. If you do
|
||||
// not implement these callback handlers, the browser may appear to hang instead of
|
||||
// navigating to new pages or triggering javascript popups.
|
||||
//
|
||||
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
|
||||
virtual void RemoveBrowser( HHTMLBrowser unBrowserHandle ) = 0;
|
||||
|
||||
// Navigate to this URL, results in a HTML_StartRequest_t as the request commences
|
||||
virtual void LoadURL( HHTMLBrowser unBrowserHandle, const char *pchURL, const char *pchPostData ) = 0;
|
||||
|
||||
// Tells the surface the size in pixels to display the surface
|
||||
virtual void SetSize( HHTMLBrowser unBrowserHandle, uint32 unWidth, uint32 unHeight ) = 0;
|
||||
|
||||
// Stop the load of the current html page
|
||||
virtual void StopLoad( HHTMLBrowser unBrowserHandle ) = 0;
|
||||
// Reload (most likely from local cache) the current page
|
||||
virtual void Reload( HHTMLBrowser unBrowserHandle ) = 0;
|
||||
// navigate back in the page history
|
||||
virtual void GoBack( HHTMLBrowser unBrowserHandle ) = 0;
|
||||
// navigate forward in the page history
|
||||
virtual void GoForward( HHTMLBrowser unBrowserHandle ) = 0;
|
||||
|
||||
// add this header to any url requests from this browser
|
||||
virtual void AddHeader( HHTMLBrowser unBrowserHandle, const char *pchKey, const char *pchValue ) = 0;
|
||||
// run this javascript script in the currently loaded page
|
||||
virtual void ExecuteJavascript( HHTMLBrowser unBrowserHandle, const char *pchScript ) = 0;
|
||||
|
||||
enum EHTMLMouseButton
|
||||
{
|
||||
eHTMLMouseButton_Left = 0,
|
||||
eHTMLMouseButton_Right = 1,
|
||||
eHTMLMouseButton_Middle = 2,
|
||||
};
|
||||
|
||||
// Mouse click and mouse movement commands
|
||||
virtual void MouseUp( HHTMLBrowser unBrowserHandle, EHTMLMouseButton eMouseButton ) = 0;
|
||||
virtual void MouseDown( HHTMLBrowser unBrowserHandle, EHTMLMouseButton eMouseButton ) = 0;
|
||||
virtual void MouseDoubleClick( HHTMLBrowser unBrowserHandle, EHTMLMouseButton eMouseButton ) = 0;
|
||||
// x and y are relative to the HTML bounds
|
||||
virtual void MouseMove( HHTMLBrowser unBrowserHandle, int x, int y ) = 0;
|
||||
// nDelta is pixels of scroll
|
||||
virtual void MouseWheel( HHTMLBrowser unBrowserHandle, int32 nDelta ) = 0;
|
||||
|
||||
enum EMouseCursor
|
||||
{
|
||||
dc_user = 0,
|
||||
dc_none,
|
||||
dc_arrow,
|
||||
dc_ibeam,
|
||||
dc_hourglass,
|
||||
dc_waitarrow,
|
||||
dc_crosshair,
|
||||
dc_up,
|
||||
dc_sizenw,
|
||||
dc_sizese,
|
||||
dc_sizene,
|
||||
dc_sizesw,
|
||||
dc_sizew,
|
||||
dc_sizee,
|
||||
dc_sizen,
|
||||
dc_sizes,
|
||||
dc_sizewe,
|
||||
dc_sizens,
|
||||
dc_sizeall,
|
||||
dc_no,
|
||||
dc_hand,
|
||||
dc_blank, // don't show any custom cursor, just use your default
|
||||
dc_middle_pan,
|
||||
dc_north_pan,
|
||||
dc_north_east_pan,
|
||||
dc_east_pan,
|
||||
dc_south_east_pan,
|
||||
dc_south_pan,
|
||||
dc_south_west_pan,
|
||||
dc_west_pan,
|
||||
dc_north_west_pan,
|
||||
dc_alias,
|
||||
dc_cell,
|
||||
dc_colresize,
|
||||
dc_copycur,
|
||||
dc_verticaltext,
|
||||
dc_rowresize,
|
||||
dc_zoomin,
|
||||
dc_zoomout,
|
||||
dc_help,
|
||||
dc_custom,
|
||||
|
||||
dc_last, // custom cursors start from this value and up
|
||||
};
|
||||
|
||||
enum EHTMLKeyModifiers
|
||||
{
|
||||
k_eHTMLKeyModifier_None = 0,
|
||||
k_eHTMLKeyModifier_AltDown = 1 << 0,
|
||||
k_eHTMLKeyModifier_CtrlDown = 1 << 1,
|
||||
k_eHTMLKeyModifier_ShiftDown = 1 << 2,
|
||||
};
|
||||
|
||||
// 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;
|
||||
|
||||
// programmatically scroll this many pixels on the page
|
||||
virtual void SetHorizontalScroll( HHTMLBrowser unBrowserHandle, uint32 nAbsolutePixelScroll ) = 0;
|
||||
virtual void SetVerticalScroll( HHTMLBrowser unBrowserHandle, uint32 nAbsolutePixelScroll ) = 0;
|
||||
|
||||
// tell the html control if it has key focus currently, controls showing the I-beam cursor in text controls amongst other things
|
||||
virtual void SetKeyFocus( HHTMLBrowser unBrowserHandle, bool bHasKeyFocus ) = 0;
|
||||
|
||||
// open the current pages html code in the local editor of choice, used for debugging
|
||||
virtual void ViewSource( HHTMLBrowser unBrowserHandle ) = 0;
|
||||
// copy the currently selected text on the html page to the local clipboard
|
||||
virtual void CopyToClipboard( HHTMLBrowser unBrowserHandle ) = 0;
|
||||
// paste from the local clipboard to the current html page
|
||||
virtual void PasteFromClipboard( HHTMLBrowser unBrowserHandle ) = 0;
|
||||
|
||||
// find this string in the browser, if bCurrentlyInFind is true then instead cycle to the next matching element
|
||||
virtual void Find( HHTMLBrowser unBrowserHandle, const char *pchSearchStr, bool bCurrentlyInFind, bool bReverse ) = 0;
|
||||
// cancel a currently running find
|
||||
virtual void StopFind( HHTMLBrowser unBrowserHandle ) = 0;
|
||||
|
||||
// return details about the link at position x,y on the current page
|
||||
virtual void GetLinkAtPosition( HHTMLBrowser unBrowserHandle, int x, int y ) = 0;
|
||||
|
||||
// set a webcookie for the hostname in question
|
||||
virtual void SetCookie( const char *pchHostname, const char *pchKey, const char *pchValue, const char *pchPath = "/", RTime32 nExpires = 0, bool bSecure = false, bool bHTTPOnly = false ) = 0;
|
||||
|
||||
// Zoom the current page by flZoom ( from 0.0 to 2.0, so to zoom to 120% use 1.2 ), zooming around point X,Y in the page (use 0,0 if you don't care)
|
||||
virtual void SetPageScaleFactor( HHTMLBrowser unBrowserHandle, float flZoom, int nPointX, int nPointY ) = 0;
|
||||
|
||||
// Enable/disable low-resource background mode, where javascript and repaint timers are throttled, resources are
|
||||
// more aggressively purged from memory, and audio/video elements are paused. When background mode is enabled,
|
||||
// all HTML5 video and audio objects will execute ".pause()" and gain the property "._steam_background_paused = 1".
|
||||
// When background mode is disabled, any video or audio objects with that property will resume with ".play()".
|
||||
virtual void SetBackgroundMode( HHTMLBrowser unBrowserHandle, bool bBackgroundMode ) = 0;
|
||||
|
||||
// Scale the output display space by this factor, this is useful when displaying content on high dpi devices.
|
||||
// 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
|
||||
//
|
||||
|
||||
// You MUST call this in response to a HTML_StartRequest_t callback
|
||||
// Set bAllowed to true to allow this navigation, false to cancel it and stay
|
||||
// on the current page. You can use this feature to limit the valid pages
|
||||
// allowed in your HTML surface.
|
||||
virtual void AllowStartRequest( HHTMLBrowser unBrowserHandle, bool bAllowed ) = 0;
|
||||
|
||||
// You MUST call this in response to a HTML_JSAlert_t or HTML_JSConfirm_t callback
|
||||
// Set bResult to true for the OK option of a confirm, use false otherwise
|
||||
virtual void JSDialogResponse( HHTMLBrowser unBrowserHandle, bool bResult ) = 0;
|
||||
|
||||
// You MUST call this in response to a HTML_FileOpenDialog_t callback
|
||||
virtual void FileLoadDialogResponse( HHTMLBrowser unBrowserHandle, const char **pchSelectedFiles ) = 0;
|
||||
};
|
||||
|
||||
#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 )
|
||||
#pragma pack( push, 4 )
|
||||
#elif defined( VALVE_CALLBACK_PACK_LARGE )
|
||||
#pragma pack( push, 8 )
|
||||
#else
|
||||
#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx
|
||||
#endif
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: The browser is ready for use
|
||||
//-----------------------------------------------------------------------------
|
||||
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
|
||||
//-----------------------------------------------------------------------------
|
||||
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
|
||||
//-----------------------------------------------------------------------------
|
||||
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)
|
||||
//-----------------------------------------------------------------------------
|
||||
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
|
||||
//-----------------------------------------------------------------------------
|
||||
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
|
||||
//-----------------------------------------------------------------------------
|
||||
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
|
||||
//-----------------------------------------------------------------------------
|
||||
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
|
||||
//-----------------------------------------------------------------------------
|
||||
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
|
||||
//-----------------------------------------------------------------------------
|
||||
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
|
||||
//-----------------------------------------------------------------------------
|
||||
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
|
||||
//-----------------------------------------------------------------------------
|
||||
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
|
||||
//-----------------------------------------------------------------------------
|
||||
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
|
||||
//-----------------------------------------------------------------------------
|
||||
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)
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: show a Javascript alert dialog, call JSDialogResponse
|
||||
// when the user dismisses this dialog (or right away to ignore it)
|
||||
//-----------------------------------------------------------------------------
|
||||
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)
|
||||
//-----------------------------------------------------------------------------
|
||||
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.
|
||||
//-----------------------------------------------------------------------------
|
||||
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 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.
|
||||
//-----------------------------------------------------------------------------
|
||||
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
|
||||
//-----------------------------------------------------------------------------
|
||||
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
|
||||
//-----------------------------------------------------------------------------
|
||||
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
|
||||
//-----------------------------------------------------------------------------
|
||||
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
|
||||
//-----------------------------------------------------------------------------
|
||||
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
|
||||
//-----------------------------------------------------------------------------
|
||||
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
|
||||
//-----------------------------------------------------------------------------
|
||||
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 )
|
||||
|
||||
|
||||
#endif // ISTEAMHTMLSURFACE_H
|
@ -1,6 +1,6 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//====== Copyright © 1996-2009, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: interface to http client
|
||||
// Purpose: interface to http client
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
@ -10,13 +10,16 @@
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "isteamclient.h"
|
||||
#include "steam_api_common.h"
|
||||
#include "steamhttpenums.h"
|
||||
|
||||
// Handle to a HTTP Request handle
|
||||
typedef uint32 HTTPRequestHandle;
|
||||
#define INVALID_HTTPREQUEST_HANDLE 0
|
||||
|
||||
typedef uint32 HTTPCookieContainerHandle;
|
||||
#define INVALID_HTTPCOOKIE_HANDLE 0
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: interface to http client
|
||||
//-----------------------------------------------------------------------------
|
||||
@ -25,8 +28,8 @@ class ISteamHTTP
|
||||
public:
|
||||
|
||||
// Initializes a new HTTP request, returning a handle to use in further operations on it. Requires
|
||||
// the method (GET or POST) and the absolute URL for the request. Only http requests (ie, not https) are
|
||||
// currently supported, so this string must start with http:// or https:// and should look like http://store.steampowered.com/app/250/
|
||||
// the method (GET or POST) and the absolute URL for the request. Both http and https are supported,
|
||||
// so this string must start with http:// or https:// and should look like http://store.steampowered.com/app/250/
|
||||
// or such.
|
||||
virtual HTTPRequestHandle CreateHTTPRequest( EHTTPMethod eHTTPRequestMethod, const char *pchAbsoluteURL ) = 0;
|
||||
|
||||
@ -39,24 +42,24 @@ public:
|
||||
// has already been sent.
|
||||
virtual bool SetHTTPRequestNetworkActivityTimeout( HTTPRequestHandle hRequest, uint32 unTimeoutSeconds ) = 0;
|
||||
|
||||
// Set a request header value for the request, must be called prior to sending the request. Will
|
||||
// Set a request header value for the request, must be called prior to sending the request. Will
|
||||
// return false if the handle is invalid or the request is already sent.
|
||||
virtual bool SetHTTPRequestHeaderValue( HTTPRequestHandle hRequest, const char *pchHeaderName, const char *pchHeaderValue ) = 0;
|
||||
|
||||
// Set a GET or POST parameter value on the request, which is set will depend on the EHTTPMethod specified
|
||||
// when creating the request. Must be called prior to sending the request. Will return false if the
|
||||
// when creating the request. Must be called prior to sending the request. Will return false if the
|
||||
// handle is invalid or the request is already sent.
|
||||
virtual bool SetHTTPRequestGetOrPostParameter( HTTPRequestHandle hRequest, const char *pchParamName, const char *pchParamValue ) = 0;
|
||||
|
||||
// Sends the HTTP request, will return false on a bad handle, otherwise use SteamCallHandle to wait on
|
||||
// asynchronous response via callback.
|
||||
//
|
||||
// Note: If the user is in offline mode in Steam, then this will add a only-if-cached cache-control
|
||||
// Note: If the user is in offline mode in Steam, then this will add a only-if-cached cache-control
|
||||
// header and only do a local cache lookup rather than sending any actual remote request.
|
||||
virtual bool SendHTTPRequest( HTTPRequestHandle hRequest, SteamAPICall_t *pCallHandle ) = 0;
|
||||
|
||||
// Sends the HTTP request, will return false on a bad handle, otherwise use SteamCallHandle to wait on
|
||||
// asynchronous response via callback for completion, and listen for HTTPRequestHeadersReceived_t and
|
||||
// asynchronous response via callback for completion, and listen for HTTPRequestHeadersReceived_t and
|
||||
// HTTPRequestDataReceived_t callbacks while streaming.
|
||||
virtual bool SendHTTPRequestAndStreamResponse( HTTPRequestHandle hRequest, SteamAPICall_t *pCallHandle ) = 0;
|
||||
|
||||
@ -68,27 +71,27 @@ public:
|
||||
// the specified request to the head of the queue. Returns false on invalid handle, or if the request is not yet sent.
|
||||
virtual bool PrioritizeHTTPRequest( HTTPRequestHandle hRequest ) = 0;
|
||||
|
||||
// Checks if a response header is present in a HTTP response given a handle from HTTPRequestCompleted_t, also
|
||||
// Checks if a response header is present in a HTTP response given a handle from HTTPRequestCompleted_t, also
|
||||
// returns the size of the header value if present so the caller and allocate a correctly sized buffer for
|
||||
// GetHTTPResponseHeaderValue.
|
||||
virtual bool GetHTTPResponseHeaderSize( HTTPRequestHandle hRequest, const char *pchHeaderName, uint32 *unResponseHeaderSize ) = 0;
|
||||
|
||||
// Gets header values from a HTTP response given a handle from HTTPRequestCompleted_t, will return false if the
|
||||
// header is not present or if your buffer is too small to contain it's value. You should first call
|
||||
// header is not present or if your buffer is too small to contain it's value. You should first call
|
||||
// BGetHTTPResponseHeaderSize to check for the presence of the header and to find out the size buffer needed.
|
||||
virtual bool GetHTTPResponseHeaderValue( HTTPRequestHandle hRequest, const char *pchHeaderName, uint8 *pHeaderValueBuffer, uint32 unBufferSize ) = 0;
|
||||
|
||||
// Gets the size of the body data from a HTTP response given a handle from HTTPRequestCompleted_t, will return false if the
|
||||
// Gets the size of the body data from a HTTP response given a handle from HTTPRequestCompleted_t, will return false if the
|
||||
// handle is invalid.
|
||||
virtual bool GetHTTPResponseBodySize( HTTPRequestHandle hRequest, uint32 *unBodySize ) = 0;
|
||||
|
||||
// Gets the body data from a HTTP response given a handle from HTTPRequestCompleted_t, will return false if the
|
||||
// Gets the body data from a HTTP response given a handle from HTTPRequestCompleted_t, will return false if the
|
||||
// handle is invalid or is to a streaming response, or if the provided buffer is not the correct size. Use BGetHTTPResponseBodySize first to find out
|
||||
// the correct buffer size to use.
|
||||
virtual bool GetHTTPResponseBodyData( HTTPRequestHandle hRequest, uint8 *pBodyDataBuffer, uint32 unBufferSize ) = 0;
|
||||
|
||||
// Gets the body data from a streaming HTTP response given a handle from HTTPRequestDataReceived_t. Will return false if the
|
||||
// handle is invalid or is to a non-streaming response (meaning it wasn't sent with SendHTTPRequestAndStreamResponse), or if the buffer size and offset
|
||||
// Gets the body data from a streaming HTTP response given a handle from HTTPRequestDataReceived_t. Will return false if the
|
||||
// handle is invalid or is to a non-streaming response (meaning it wasn't sent with SendHTTPRequestAndStreamResponse), or if the buffer size and offset
|
||||
// do not match the size and offset sent in HTTPRequestDataReceived_t.
|
||||
virtual bool GetHTTPStreamingResponseBodyData( HTTPRequestHandle hRequest, uint32 cOffset, uint8 *pBodyDataBuffer, uint32 unBufferSize ) = 0;
|
||||
|
||||
@ -105,9 +108,47 @@ public:
|
||||
// have already been set for the request. Setting this raw body makes it the only contents for the post, the pchContentType
|
||||
// parameter will set the content-type header for the request so the server may know how to interpret the body.
|
||||
virtual bool SetHTTPRequestRawPostBody( HTTPRequestHandle hRequest, const char *pchContentType, uint8 *pubBody, uint32 unBodyLen ) = 0;
|
||||
|
||||
// Creates a cookie container handle which you must later free with ReleaseCookieContainer(). If bAllowResponsesToModify=true
|
||||
// than any response to your requests using this cookie container may add new cookies which may be transmitted with
|
||||
// future requests. If bAllowResponsesToModify=false than only cookies you explicitly set will be sent. This API is just for
|
||||
// during process lifetime, after steam restarts no cookies are persisted and you have no way to access the cookie container across
|
||||
// repeat executions of your process.
|
||||
virtual HTTPCookieContainerHandle CreateCookieContainer( bool bAllowResponsesToModify ) = 0;
|
||||
|
||||
// Release a cookie container you are finished using, freeing it's memory
|
||||
virtual bool ReleaseCookieContainer( HTTPCookieContainerHandle hCookieContainer ) = 0;
|
||||
|
||||
// Adds a cookie to the specified cookie container that will be used with future requests.
|
||||
virtual bool SetCookie( HTTPCookieContainerHandle hCookieContainer, const char *pchHost, const char *pchUrl, const char *pchCookie ) = 0;
|
||||
|
||||
// Set the cookie container to use for a HTTP request
|
||||
virtual bool SetHTTPRequestCookieContainer( HTTPRequestHandle hRequest, HTTPCookieContainerHandle hCookieContainer ) = 0;
|
||||
|
||||
// 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;
|
||||
|
||||
// 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
|
||||
// which can bump everytime we get more data
|
||||
virtual bool SetHTTPRequestAbsoluteTimeoutMS( HTTPRequestHandle hRequest, uint32 unMilliseconds ) = 0;
|
||||
|
||||
// Check if the reason the request failed was because we timed it out (rather than some harder failure)
|
||||
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 )
|
||||
@ -115,12 +156,12 @@ public:
|
||||
#elif defined( VALVE_CALLBACK_PACK_LARGE )
|
||||
#pragma pack( push, 8 )
|
||||
#else
|
||||
#error isteamclient.h must be included
|
||||
#endif
|
||||
#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx
|
||||
#endif
|
||||
|
||||
struct HTTPRequestCompleted_t
|
||||
{
|
||||
enum { k_iCallback = k_iClientHTTPCallbacks + 1 };
|
||||
enum { k_iCallback = k_iSteamHTTPCallbacks + 1 };
|
||||
|
||||
// Handle value for the request that has completed.
|
||||
HTTPRequestHandle m_hRequest;
|
||||
@ -129,19 +170,21 @@ struct HTTPRequestCompleted_t
|
||||
// no context value was set.
|
||||
uint64 m_ulContextValue;
|
||||
|
||||
// This will be true if we actually got any sort of response from the server (even an error).
|
||||
// This will be true if we actually got any sort of response from the server (even an error).
|
||||
// It will be false if we failed due to an internal error or client side network failure.
|
||||
bool m_bRequestSuccessful;
|
||||
|
||||
// Will be the HTTP status code value returned by the server, k_EHTTPStatusCode200OK is the normal
|
||||
// OK response, if you get something else you probably need to treat it as a failure.
|
||||
EHTTPStatusCode m_eStatusCode;
|
||||
|
||||
uint32 m_unBodySize; // Same as GetHTTPResponseBodySize()
|
||||
};
|
||||
|
||||
|
||||
struct HTTPRequestHeadersReceived_t
|
||||
{
|
||||
enum { k_iCallback = k_iClientHTTPCallbacks + 2 };
|
||||
enum { k_iCallback = k_iSteamHTTPCallbacks + 2 };
|
||||
|
||||
// Handle value for the request that has received headers.
|
||||
HTTPRequestHandle m_hRequest;
|
||||
@ -153,7 +196,7 @@ struct HTTPRequestHeadersReceived_t
|
||||
|
||||
struct HTTPRequestDataReceived_t
|
||||
{
|
||||
enum { k_iCallback = k_iClientHTTPCallbacks + 3 };
|
||||
enum { k_iCallback = k_iSteamHTTPCallbacks + 3 };
|
||||
|
||||
// Handle value for the request that has received data.
|
||||
HTTPRequestHandle m_hRequest;
|
||||
|
982
rehlds/public/steam/isteaminput.h
Normal file
982
rehlds/public/steam/isteaminput.h
Normal file
@ -0,0 +1,982 @@
|
||||
//====== 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 24
|
||||
|
||||
#define STEAM_INPUT_MAX_DIGITAL_ACTIONS 256
|
||||
|
||||
#define STEAM_INPUT_MAX_ORIGINS 8
|
||||
|
||||
#define STEAM_INPUT_MAX_ACTIVE_LAYERS 16
|
||||
|
||||
// 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 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_DPad_Move,
|
||||
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_DPad_Move,
|
||||
k_EInputActionOrigin_XBoxOne_LeftGrip_Lower,
|
||||
k_EInputActionOrigin_XBoxOne_LeftGrip_Upper,
|
||||
k_EInputActionOrigin_XBoxOne_RightGrip_Lower,
|
||||
k_EInputActionOrigin_XBoxOne_RightGrip_Upper,
|
||||
k_EInputActionOrigin_XBoxOne_Share, // Xbox Series X controllers only
|
||||
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_DPad_Move,
|
||||
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_DPad_Move,
|
||||
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_JoyConButton_N, // With a Horizontal JoyCon this will be Y or what would be Dpad Right when vertical
|
||||
k_EInputActionOrigin_Switch_JoyConButton_E, // X
|
||||
k_EInputActionOrigin_Switch_JoyConButton_S, // A
|
||||
k_EInputActionOrigin_Switch_JoyConButton_W, // B
|
||||
k_EInputActionOrigin_Switch_Reserved15,
|
||||
k_EInputActionOrigin_Switch_Reserved16,
|
||||
k_EInputActionOrigin_Switch_Reserved17,
|
||||
k_EInputActionOrigin_Switch_Reserved18,
|
||||
k_EInputActionOrigin_Switch_Reserved19,
|
||||
k_EInputActionOrigin_Switch_Reserved20,
|
||||
|
||||
// Added in SDK 1.51
|
||||
k_EInputActionOrigin_PS5_X,
|
||||
k_EInputActionOrigin_PS5_Circle,
|
||||
k_EInputActionOrigin_PS5_Triangle,
|
||||
k_EInputActionOrigin_PS5_Square,
|
||||
k_EInputActionOrigin_PS5_LeftBumper,
|
||||
k_EInputActionOrigin_PS5_RightBumper,
|
||||
k_EInputActionOrigin_PS5_Option, //Start
|
||||
k_EInputActionOrigin_PS5_Create, //Back
|
||||
k_EInputActionOrigin_PS5_Mute,
|
||||
k_EInputActionOrigin_PS5_LeftPad_Touch,
|
||||
k_EInputActionOrigin_PS5_LeftPad_Swipe,
|
||||
k_EInputActionOrigin_PS5_LeftPad_Click,
|
||||
k_EInputActionOrigin_PS5_LeftPad_DPadNorth,
|
||||
k_EInputActionOrigin_PS5_LeftPad_DPadSouth,
|
||||
k_EInputActionOrigin_PS5_LeftPad_DPadWest,
|
||||
k_EInputActionOrigin_PS5_LeftPad_DPadEast,
|
||||
k_EInputActionOrigin_PS5_RightPad_Touch,
|
||||
k_EInputActionOrigin_PS5_RightPad_Swipe,
|
||||
k_EInputActionOrigin_PS5_RightPad_Click,
|
||||
k_EInputActionOrigin_PS5_RightPad_DPadNorth,
|
||||
k_EInputActionOrigin_PS5_RightPad_DPadSouth,
|
||||
k_EInputActionOrigin_PS5_RightPad_DPadWest,
|
||||
k_EInputActionOrigin_PS5_RightPad_DPadEast,
|
||||
k_EInputActionOrigin_PS5_CenterPad_Touch,
|
||||
k_EInputActionOrigin_PS5_CenterPad_Swipe,
|
||||
k_EInputActionOrigin_PS5_CenterPad_Click,
|
||||
k_EInputActionOrigin_PS5_CenterPad_DPadNorth,
|
||||
k_EInputActionOrigin_PS5_CenterPad_DPadSouth,
|
||||
k_EInputActionOrigin_PS5_CenterPad_DPadWest,
|
||||
k_EInputActionOrigin_PS5_CenterPad_DPadEast,
|
||||
k_EInputActionOrigin_PS5_LeftTrigger_Pull,
|
||||
k_EInputActionOrigin_PS5_LeftTrigger_Click,
|
||||
k_EInputActionOrigin_PS5_RightTrigger_Pull,
|
||||
k_EInputActionOrigin_PS5_RightTrigger_Click,
|
||||
k_EInputActionOrigin_PS5_LeftStick_Move,
|
||||
k_EInputActionOrigin_PS5_LeftStick_Click,
|
||||
k_EInputActionOrigin_PS5_LeftStick_DPadNorth,
|
||||
k_EInputActionOrigin_PS5_LeftStick_DPadSouth,
|
||||
k_EInputActionOrigin_PS5_LeftStick_DPadWest,
|
||||
k_EInputActionOrigin_PS5_LeftStick_DPadEast,
|
||||
k_EInputActionOrigin_PS5_RightStick_Move,
|
||||
k_EInputActionOrigin_PS5_RightStick_Click,
|
||||
k_EInputActionOrigin_PS5_RightStick_DPadNorth,
|
||||
k_EInputActionOrigin_PS5_RightStick_DPadSouth,
|
||||
k_EInputActionOrigin_PS5_RightStick_DPadWest,
|
||||
k_EInputActionOrigin_PS5_RightStick_DPadEast,
|
||||
k_EInputActionOrigin_PS5_DPad_North,
|
||||
k_EInputActionOrigin_PS5_DPad_South,
|
||||
k_EInputActionOrigin_PS5_DPad_West,
|
||||
k_EInputActionOrigin_PS5_DPad_East,
|
||||
k_EInputActionOrigin_PS5_Gyro_Move,
|
||||
k_EInputActionOrigin_PS5_Gyro_Pitch,
|
||||
k_EInputActionOrigin_PS5_Gyro_Yaw,
|
||||
k_EInputActionOrigin_PS5_Gyro_Roll,
|
||||
k_EInputActionOrigin_PS5_DPad_Move,
|
||||
k_EInputActionOrigin_PS5_LeftGrip,
|
||||
k_EInputActionOrigin_PS5_RightGrip,
|
||||
k_EInputActionOrigin_PS5_LeftFn,
|
||||
k_EInputActionOrigin_PS5_RightFn,
|
||||
k_EInputActionOrigin_PS5_Reserved5,
|
||||
k_EInputActionOrigin_PS5_Reserved6,
|
||||
k_EInputActionOrigin_PS5_Reserved7,
|
||||
k_EInputActionOrigin_PS5_Reserved8,
|
||||
k_EInputActionOrigin_PS5_Reserved9,
|
||||
k_EInputActionOrigin_PS5_Reserved10,
|
||||
k_EInputActionOrigin_PS5_Reserved11,
|
||||
k_EInputActionOrigin_PS5_Reserved12,
|
||||
k_EInputActionOrigin_PS5_Reserved13,
|
||||
k_EInputActionOrigin_PS5_Reserved14,
|
||||
k_EInputActionOrigin_PS5_Reserved15,
|
||||
k_EInputActionOrigin_PS5_Reserved16,
|
||||
k_EInputActionOrigin_PS5_Reserved17,
|
||||
k_EInputActionOrigin_PS5_Reserved18,
|
||||
k_EInputActionOrigin_PS5_Reserved19,
|
||||
k_EInputActionOrigin_PS5_Reserved20,
|
||||
|
||||
// Added in SDK 1.53
|
||||
k_EInputActionOrigin_SteamDeck_A,
|
||||
k_EInputActionOrigin_SteamDeck_B,
|
||||
k_EInputActionOrigin_SteamDeck_X,
|
||||
k_EInputActionOrigin_SteamDeck_Y,
|
||||
k_EInputActionOrigin_SteamDeck_L1,
|
||||
k_EInputActionOrigin_SteamDeck_R1,
|
||||
k_EInputActionOrigin_SteamDeck_Menu,
|
||||
k_EInputActionOrigin_SteamDeck_View,
|
||||
k_EInputActionOrigin_SteamDeck_LeftPad_Touch,
|
||||
k_EInputActionOrigin_SteamDeck_LeftPad_Swipe,
|
||||
k_EInputActionOrigin_SteamDeck_LeftPad_Click,
|
||||
k_EInputActionOrigin_SteamDeck_LeftPad_DPadNorth,
|
||||
k_EInputActionOrigin_SteamDeck_LeftPad_DPadSouth,
|
||||
k_EInputActionOrigin_SteamDeck_LeftPad_DPadWest,
|
||||
k_EInputActionOrigin_SteamDeck_LeftPad_DPadEast,
|
||||
k_EInputActionOrigin_SteamDeck_RightPad_Touch,
|
||||
k_EInputActionOrigin_SteamDeck_RightPad_Swipe,
|
||||
k_EInputActionOrigin_SteamDeck_RightPad_Click,
|
||||
k_EInputActionOrigin_SteamDeck_RightPad_DPadNorth,
|
||||
k_EInputActionOrigin_SteamDeck_RightPad_DPadSouth,
|
||||
k_EInputActionOrigin_SteamDeck_RightPad_DPadWest,
|
||||
k_EInputActionOrigin_SteamDeck_RightPad_DPadEast,
|
||||
k_EInputActionOrigin_SteamDeck_L2_SoftPull,
|
||||
k_EInputActionOrigin_SteamDeck_L2,
|
||||
k_EInputActionOrigin_SteamDeck_R2_SoftPull,
|
||||
k_EInputActionOrigin_SteamDeck_R2,
|
||||
k_EInputActionOrigin_SteamDeck_LeftStick_Move,
|
||||
k_EInputActionOrigin_SteamDeck_L3,
|
||||
k_EInputActionOrigin_SteamDeck_LeftStick_DPadNorth,
|
||||
k_EInputActionOrigin_SteamDeck_LeftStick_DPadSouth,
|
||||
k_EInputActionOrigin_SteamDeck_LeftStick_DPadWest,
|
||||
k_EInputActionOrigin_SteamDeck_LeftStick_DPadEast,
|
||||
k_EInputActionOrigin_SteamDeck_LeftStick_Touch,
|
||||
k_EInputActionOrigin_SteamDeck_RightStick_Move,
|
||||
k_EInputActionOrigin_SteamDeck_R3,
|
||||
k_EInputActionOrigin_SteamDeck_RightStick_DPadNorth,
|
||||
k_EInputActionOrigin_SteamDeck_RightStick_DPadSouth,
|
||||
k_EInputActionOrigin_SteamDeck_RightStick_DPadWest,
|
||||
k_EInputActionOrigin_SteamDeck_RightStick_DPadEast,
|
||||
k_EInputActionOrigin_SteamDeck_RightStick_Touch,
|
||||
k_EInputActionOrigin_SteamDeck_L4,
|
||||
k_EInputActionOrigin_SteamDeck_R4,
|
||||
k_EInputActionOrigin_SteamDeck_L5,
|
||||
k_EInputActionOrigin_SteamDeck_R5,
|
||||
k_EInputActionOrigin_SteamDeck_DPad_Move,
|
||||
k_EInputActionOrigin_SteamDeck_DPad_North,
|
||||
k_EInputActionOrigin_SteamDeck_DPad_South,
|
||||
k_EInputActionOrigin_SteamDeck_DPad_West,
|
||||
k_EInputActionOrigin_SteamDeck_DPad_East,
|
||||
k_EInputActionOrigin_SteamDeck_Gyro_Move,
|
||||
k_EInputActionOrigin_SteamDeck_Gyro_Pitch,
|
||||
k_EInputActionOrigin_SteamDeck_Gyro_Yaw,
|
||||
k_EInputActionOrigin_SteamDeck_Gyro_Roll,
|
||||
k_EInputActionOrigin_SteamDeck_Reserved1,
|
||||
k_EInputActionOrigin_SteamDeck_Reserved2,
|
||||
k_EInputActionOrigin_SteamDeck_Reserved3,
|
||||
k_EInputActionOrigin_SteamDeck_Reserved4,
|
||||
k_EInputActionOrigin_SteamDeck_Reserved5,
|
||||
k_EInputActionOrigin_SteamDeck_Reserved6,
|
||||
k_EInputActionOrigin_SteamDeck_Reserved7,
|
||||
k_EInputActionOrigin_SteamDeck_Reserved8,
|
||||
k_EInputActionOrigin_SteamDeck_Reserved9,
|
||||
k_EInputActionOrigin_SteamDeck_Reserved10,
|
||||
k_EInputActionOrigin_SteamDeck_Reserved11,
|
||||
k_EInputActionOrigin_SteamDeck_Reserved12,
|
||||
k_EInputActionOrigin_SteamDeck_Reserved13,
|
||||
k_EInputActionOrigin_SteamDeck_Reserved14,
|
||||
k_EInputActionOrigin_SteamDeck_Reserved15,
|
||||
k_EInputActionOrigin_SteamDeck_Reserved16,
|
||||
k_EInputActionOrigin_SteamDeck_Reserved17,
|
||||
k_EInputActionOrigin_SteamDeck_Reserved18,
|
||||
k_EInputActionOrigin_SteamDeck_Reserved19,
|
||||
k_EInputActionOrigin_SteamDeck_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 EControllerHapticLocation
|
||||
{
|
||||
k_EControllerHapticLocation_Left = ( 1 << k_ESteamControllerPad_Left ),
|
||||
k_EControllerHapticLocation_Right = ( 1 << k_ESteamControllerPad_Right ),
|
||||
k_EControllerHapticLocation_Both = ( 1 << k_ESteamControllerPad_Left | 1 << k_ESteamControllerPad_Right ),
|
||||
};
|
||||
|
||||
enum EControllerHapticType
|
||||
{
|
||||
k_EControllerHapticType_Off,
|
||||
k_EControllerHapticType_Tick,
|
||||
k_EControllerHapticType_Click,
|
||||
};
|
||||
|
||||
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_PS5Controller, // Added in SDK 151
|
||||
k_ESteamInputType_SteamDeckController, // Added in SDK 153
|
||||
k_ESteamInputType_Count,
|
||||
k_ESteamInputType_MaximumPossibleValue = 255,
|
||||
};
|
||||
|
||||
// Individual values are used by the GetSessionInputConfigurationSettings bitmask
|
||||
enum ESteamInputConfigurationEnableType
|
||||
{
|
||||
k_ESteamInputConfigurationEnableType_None = 0x0000,
|
||||
k_ESteamInputConfigurationEnableType_Playstation = 0x0001,
|
||||
k_ESteamInputConfigurationEnableType_Xbox = 0x0002,
|
||||
k_ESteamInputConfigurationEnableType_Generic = 0x0004,
|
||||
k_ESteamInputConfigurationEnableType_Switch = 0x0008,
|
||||
};
|
||||
|
||||
// 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
|
||||
};
|
||||
|
||||
// These values are passed into GetGlyphPNGForActionOrigin
|
||||
enum ESteamInputGlyphSize
|
||||
{
|
||||
k_ESteamInputGlyphSize_Small, // 32x32 pixels
|
||||
k_ESteamInputGlyphSize_Medium, // 128x128 pixels
|
||||
k_ESteamInputGlyphSize_Large, // 256x256 pixels
|
||||
k_ESteamInputGlyphSize_Count,
|
||||
};
|
||||
|
||||
enum ESteamInputGlyphStyle
|
||||
{
|
||||
// Base-styles - cannot mix
|
||||
ESteamInputGlyphStyle_Knockout = 0x0, // Face buttons will have colored labels/outlines on a knocked out background
|
||||
// Rest of inputs will have white detail/borders on a knocked out background
|
||||
ESteamInputGlyphStyle_Light = 0x1, // Black detail/borders on a white background
|
||||
ESteamInputGlyphStyle_Dark = 0x2, // White detail/borders on a black background
|
||||
|
||||
// Modifiers
|
||||
// Default ABXY/PS equivalent glyphs have a solid fill w/ color matching the physical buttons on the device
|
||||
ESteamInputGlyphStyle_NeutralColorABXY = 0x10, // ABXY Buttons will match the base style color instead of their normal associated color
|
||||
ESteamInputGlyphStyle_SolidABXY = 0x20, // ABXY Buttons will have a solid fill
|
||||
};
|
||||
|
||||
enum ESteamInputActionEventType
|
||||
{
|
||||
ESteamInputActionEventType_DigitalAction,
|
||||
ESteamInputActionEventType_AnalogAction,
|
||||
};
|
||||
|
||||
// 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 toward average
|
||||
float rotQuatX;
|
||||
float rotQuatY;
|
||||
float rotQuatZ;
|
||||
float rotQuatW;
|
||||
|
||||
// Positional acceleration
|
||||
float posAccelX;
|
||||
float posAccelY;
|
||||
float posAccelZ;
|
||||
|
||||
// Angular velocity
|
||||
float rotVelX;
|
||||
float rotVelY;
|
||||
float rotVelZ;
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: when callbacks are enabled this fires each time a controller action
|
||||
// state changes
|
||||
//-----------------------------------------------------------------------------
|
||||
struct SteamInputActionEvent_t
|
||||
{
|
||||
InputHandle_t controllerHandle;
|
||||
ESteamInputActionEventType eEventType;
|
||||
struct AnalogAction_t {
|
||||
InputAnalogActionHandle_t actionHandle;
|
||||
InputAnalogActionData_t analogActionData;
|
||||
};
|
||||
struct DigitalAction_t {
|
||||
InputDigitalActionHandle_t actionHandle;
|
||||
InputDigitalActionData_t digitalActionData;
|
||||
};
|
||||
union {
|
||||
AnalogAction_t analogAction;
|
||||
DigitalAction_t digitalAction;
|
||||
};
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Forward declaration for ScePadTriggerEffectParam, defined in isteamdualsense.h
|
||||
//-----------------------------------------------------------------------------
|
||||
struct ScePadTriggerEffectParam;
|
||||
|
||||
#pragma pack( pop )
|
||||
|
||||
typedef void ( *SteamInputActionEventCallbackPointer )( SteamInputActionEvent_t * );
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Steam Input API
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamInput
|
||||
{
|
||||
public:
|
||||
|
||||
// Init and Shutdown must be called when starting/ending use of this interface.
|
||||
// if bExplicitlyCallRunFrame is called then you will need to manually call RunFrame
|
||||
// each frame, otherwise Steam Input will updated when SteamAPI_RunCallbacks() is called
|
||||
virtual bool Init( bool bExplicitlyCallRunFrame ) = 0;
|
||||
virtual bool Shutdown() = 0;
|
||||
|
||||
// Set the absolute path to the Input Action Manifest file containing the in-game actions
|
||||
// and file paths to the official configurations. Used in games that bundle Steam Input
|
||||
// configurations inside of the game depot instead of using the Steam Workshop
|
||||
virtual bool SetInputActionManifestFilePath( const char *pchInputActionManifestAbsolutePath ) = 0;
|
||||
|
||||
// Synchronize API state with the latest Steam Input action data available. This
|
||||
// is performed automatically by SteamAPI_RunCallbacks, but for the absolute lowest
|
||||
// possible latency, you call this directly before reading controller state.
|
||||
// Note: This must be called from somewhere before GetConnectedControllers will
|
||||
// return any handles
|
||||
virtual void RunFrame( bool bReservedValue = true ) = 0;
|
||||
|
||||
// Waits on an IPC event from Steam sent when there is new data to be fetched from
|
||||
// the data drop. Returns true when data was recievied before the timeout expires.
|
||||
// Useful for games with a dedicated input thread
|
||||
virtual bool BWaitForData( bool bWaitForever, uint32 unTimeout ) = 0;
|
||||
|
||||
// Returns true if new data has been received since the last time action data was accessed
|
||||
// via GetDigitalActionData or GetAnalogActionData. The game will still need to call
|
||||
// SteamInput()->RunFrame() or SteamAPI_RunCallbacks() before this to update the data stream
|
||||
virtual bool BNewDataAvailable() = 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( STEAM_OUT_ARRAY_COUNT( STEAM_INPUT_MAX_COUNT, Receives list of connected controllers ) InputHandle_t *handlesOut ) = 0;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// CALLBACKS
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
// Controller configuration loaded - these callbacks will always fire if you have
|
||||
// a handler. Note: this is called within either SteamInput()->RunFrame or by SteamAPI_RunCallbacks
|
||||
STEAM_CALL_BACK( SteamInputConfigurationLoaded_t )
|
||||
|
||||
// Enable SteamInputDeviceConnected_t and SteamInputDeviceDisconnected_t callbacks.
|
||||
// Each controller that is already connected will generate a device connected
|
||||
// callback when you enable them
|
||||
virtual void EnableDeviceCallbacks() = 0;
|
||||
|
||||
// Controller Connected - provides info about a single newly connected controller
|
||||
// Note: this is called within either SteamInput()->RunFrame or by SteamAPI_RunCallbacks
|
||||
STEAM_CALL_BACK( SteamInputDeviceConnected_t )
|
||||
|
||||
// Controller Disconnected - provides info about a single disconnected controller
|
||||
// Note: this is called within either SteamInput()->RunFrame or by SteamAPI_RunCallbacks
|
||||
STEAM_CALL_BACK( SteamInputDeviceDisconnected_t )
|
||||
|
||||
// Controllers using Gamepad emulation (XInput, DirectInput, etc) will be seated in the order that
|
||||
// input is sent by the device. This callback will fire on first input for each device and when the
|
||||
// a user has manually changed the order via the Steam overlay. This also has the device type info
|
||||
// so that you can change out glyph sets without making additional API calls
|
||||
STEAM_CALL_BACK( SteamInputGamepadSlotChange_t )
|
||||
|
||||
// Enable SteamInputActionEvent_t callbacks. Directly calls your callback function
|
||||
// for lower latency than standard Steam callbacks. Supports one callback at a time.
|
||||
// Note: this is called within either SteamInput()->RunFrame or by SteamAPI_RunCallbacks
|
||||
virtual void EnableActionEventCallbacks( SteamInputActionEventCallbackPointer pCallback ) = 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;
|
||||
|
||||
// Enumerate currently active layers.
|
||||
// handlesOut should point to a STEAM_INPUT_MAX_ACTIVE_LAYERS sized array of InputActionSetHandle_t handles
|
||||
// Returns the number of handles written to handlesOut
|
||||
virtual int GetActiveActionSetLayers( InputHandle_t inputHandle, STEAM_OUT_ARRAY_COUNT( STEAM_INPUT_MAX_ACTIVE_LAYERS, Receives list of active layers ) 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, STEAM_OUT_ARRAY_COUNT( STEAM_INPUT_MAX_ORIGINS, Receives list of action origins ) EInputActionOrigin *originsOut ) = 0;
|
||||
|
||||
// Returns a localized string (from Steam's language setting) for the user-facing action name corresponding to the specified handle
|
||||
virtual const char *GetStringForDigitalActionName( InputDigitalActionHandle_t eActionHandle ) = 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, STEAM_OUT_ARRAY_COUNT( STEAM_INPUT_MAX_ORIGINS, Receives list of action origins ) EInputActionOrigin *originsOut ) = 0;
|
||||
|
||||
// Get a local path to a PNG file for the provided origin's glyph.
|
||||
virtual const char *GetGlyphPNGForActionOrigin( EInputActionOrigin eOrigin, ESteamInputGlyphSize eSize, uint32 unFlags ) = 0;
|
||||
|
||||
// Get a local path to a SVG file for the provided origin's glyph.
|
||||
virtual const char *GetGlyphSVGForActionOrigin( EInputActionOrigin eOrigin, uint32 unFlags ) = 0;
|
||||
|
||||
// Get a local path to an older, Big Picture Mode-style PNG file for a particular origin
|
||||
virtual const char *GetGlyphForActionOrigin_Legacy( EInputActionOrigin eOrigin ) = 0;
|
||||
|
||||
// Returns a localized string (from Steam's language setting) for the specified origin.
|
||||
virtual const char *GetStringForActionOrigin( EInputActionOrigin eOrigin ) = 0;
|
||||
|
||||
// Returns a localized string (from Steam's language setting) for the user-facing action name corresponding to the specified handle
|
||||
virtual const char *GetStringForAnalogActionName( InputAnalogActionHandle_t eActionHandle ) = 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;
|
||||
|
||||
// Trigger a vibration event on supported controllers including Xbox trigger impulse rumble - Steam will translate these commands into haptic pulses for Steam Controllers
|
||||
virtual void TriggerVibrationExtended( InputHandle_t inputHandle, unsigned short usLeftSpeed, unsigned short usRightSpeed, unsigned short usLeftTriggerSpeed, unsigned short usRightTriggerSpeed ) = 0;
|
||||
|
||||
// Send a haptic pulse, works on Steam Deck and Steam Controller devices
|
||||
virtual void TriggerSimpleHapticEvent( InputHandle_t inputHandle, EControllerHapticLocation eHapticLocation, uint8 nIntensity, char nGainDB, uint8 nOtherIntensity, char nOtherGainDB ) = 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 Legacy_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 Legacy_TriggerRepeatedHapticPulse( InputHandle_t inputHandle, ESteamControllerPad eTargetPad, unsigned short usDurationMicroSec, unsigned short usOffMicroSec, unsigned short unRepeat, unsigned int nFlags ) = 0;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Utility functions available 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 - unlike EInputActionOrigin which update with Steam and may return unrecognized values
|
||||
// ESteamInputType will remain static and only return valid values from your SDK version
|
||||
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.
|
||||
virtual const char *GetStringForXboxOrigin( EXboxOrigin eOrigin ) = 0;
|
||||
|
||||
// Get a local path to art for on-screen glyph for a particular Xbox controller origin
|
||||
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 and the closest origin that your version of the SDK recognized 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;
|
||||
|
||||
// Get the binding revision for a given device. Returns false if the handle was not valid or if a mapping is not yet loaded for the device
|
||||
virtual bool GetDeviceBindingRevision( InputHandle_t inputHandle, int *pMajor, int *pMinor ) = 0;
|
||||
|
||||
// Get the Steam Remote Play session ID associated with a device, or 0 if there is no session associated with it
|
||||
// See isteamremoteplay.h for more information on Steam Remote Play sessions
|
||||
virtual uint32 GetRemotePlaySessionID( InputHandle_t inputHandle ) = 0;
|
||||
|
||||
// Get a bitmask of the Steam Input Configuration types opted in for the current session. Returns ESteamInputConfigurationEnableType values.
|
||||
// Note: user can override the settings from the Steamworks Partner site so the returned values may not exactly match your default configuration
|
||||
virtual uint16 GetSessionInputConfigurationSettings() = 0;
|
||||
|
||||
// Set the trigger effect for a DualSense controller
|
||||
virtual void SetDualSenseTriggerEffect( InputHandle_t inputHandle, const ScePadTriggerEffectParam *pParam ) = 0;
|
||||
};
|
||||
|
||||
#define STEAMINPUT_INTERFACE_VERSION "SteamInput006"
|
||||
|
||||
// Global interface accessor
|
||||
inline ISteamInput *SteamInput();
|
||||
STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamInput *, SteamInput, STEAMINPUT_INTERFACE_VERSION );
|
||||
|
||||
#if defined( VALVE_CALLBACK_PACK_SMALL )
|
||||
#pragma pack( push, 4 )
|
||||
#elif defined( VALVE_CALLBACK_PACK_LARGE )
|
||||
#pragma pack( push, 8 )
|
||||
#else
|
||||
#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx
|
||||
#endif
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: called when a new controller has been connected, will fire once
|
||||
// per controller if multiple new controllers connect in the same frame
|
||||
//-----------------------------------------------------------------------------
|
||||
struct SteamInputDeviceConnected_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamControllerCallbacks + 1 };
|
||||
InputHandle_t m_ulConnectedDeviceHandle; // Handle for device
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: called when a new controller has been connected, will fire once
|
||||
// per controller if multiple new controllers connect in the same frame
|
||||
//-----------------------------------------------------------------------------
|
||||
struct SteamInputDeviceDisconnected_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamControllerCallbacks + 2 };
|
||||
InputHandle_t m_ulDisconnectedDeviceHandle; // Handle for device
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: called when a controller configuration has been loaded, will fire once
|
||||
// per controller per focus change for Steam Input enabled controllers
|
||||
//-----------------------------------------------------------------------------
|
||||
struct SteamInputConfigurationLoaded_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamControllerCallbacks + 3 };
|
||||
AppId_t m_unAppID;
|
||||
InputHandle_t m_ulDeviceHandle; // Handle for device
|
||||
CSteamID m_ulMappingCreator; // May differ from local user when using
|
||||
// an unmodified community or official config
|
||||
uint32 m_unMajorRevision; // Binding revision from In-game Action File.
|
||||
// Same value as queried by GetDeviceBindingRevision
|
||||
uint32 m_unMinorRevision;
|
||||
bool m_bUsesSteamInputAPI; // Does the configuration contain any Analog/Digital actions?
|
||||
bool m_bUsesGamepadAPI; // Does the configuration contain any Xinput bindings?
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: called when controller gamepad slots change - on Linux/macOS these
|
||||
// slots are shared for all running apps.
|
||||
//-----------------------------------------------------------------------------
|
||||
struct SteamInputGamepadSlotChange_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamControllerCallbacks + 4 };
|
||||
AppId_t m_unAppID;
|
||||
InputHandle_t m_ulDeviceHandle; // Handle for device
|
||||
ESteamInputType m_eDeviceType; // Type of device
|
||||
int m_nOldGamepadSlot; // Previous GamepadSlot - can be -1 controller doesn't uses gamepad bindings
|
||||
int m_nNewGamepadSlot; // New Gamepad Slot - can be -1 controller doesn't uses gamepad bindings
|
||||
};
|
||||
|
||||
#pragma pack( pop )
|
||||
|
||||
#endif // ISTEAMINPUT_H
|
435
rehlds/public/steam/isteaminventory.h
Normal file
435
rehlds/public/steam/isteaminventory.h
Normal file
@ -0,0 +1,435 @@
|
||||
//====== Copyright © 1996-2014 Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: interface to Steam Inventory
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMINVENTORY_H
|
||||
#define ISTEAMINVENTORY_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "steam_api_common.h"
|
||||
|
||||
// callbacks
|
||||
#if defined( VALVE_CALLBACK_PACK_SMALL )
|
||||
#pragma pack( push, 4 )
|
||||
#elif defined( VALVE_CALLBACK_PACK_LARGE )
|
||||
#pragma pack( push, 8 )
|
||||
#else
|
||||
#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx
|
||||
#endif
|
||||
|
||||
|
||||
// Every individual instance of an item has a globally-unique ItemInstanceID.
|
||||
// This ID is unique to the combination of (player, specific item instance)
|
||||
// and will not be transferred to another player or re-used for another item.
|
||||
typedef uint64 SteamItemInstanceID_t;
|
||||
|
||||
static const SteamItemInstanceID_t k_SteamItemInstanceIDInvalid = (SteamItemInstanceID_t)~0;
|
||||
|
||||
// Types of items in your game are identified by a 32-bit "item definition number".
|
||||
// Valid definition numbers are between 1 and 999999999; numbers less than or equal to
|
||||
// zero are invalid, and numbers greater than or equal to one billion (1x10^9) are
|
||||
// reserved for internal Steam use.
|
||||
typedef int32 SteamItemDef_t;
|
||||
|
||||
|
||||
enum ESteamItemFlags
|
||||
{
|
||||
// Item status flags - these flags are permanently attached to specific item instances
|
||||
k_ESteamItemNoTrade = 1 << 0, // This item is account-locked and cannot be traded or given away.
|
||||
|
||||
// Action confirmation flags - these flags are set one time only, as part of a result set
|
||||
k_ESteamItemRemoved = 1 << 8, // The item has been destroyed, traded away, expired, or otherwise invalidated
|
||||
k_ESteamItemConsumed = 1 << 9, // The item quantity has been decreased by 1 via ConsumeItem API.
|
||||
|
||||
// All other flag bits are currently reserved for internal Steam use at this time.
|
||||
// Do not assume anything about the state of other flags which are not defined here.
|
||||
};
|
||||
|
||||
struct SteamItemDetails_t
|
||||
{
|
||||
SteamItemInstanceID_t m_itemId;
|
||||
SteamItemDef_t m_iDefinition;
|
||||
uint16 m_unQuantity;
|
||||
uint16 m_unFlags; // see ESteamItemFlags
|
||||
};
|
||||
|
||||
typedef int32 SteamInventoryResult_t;
|
||||
|
||||
static const SteamInventoryResult_t k_SteamInventoryResultInvalid = -1;
|
||||
|
||||
typedef uint64 SteamInventoryUpdateHandle_t;
|
||||
const SteamInventoryUpdateHandle_t k_SteamInventoryUpdateHandleInvalid = 0xffffffffffffffffull;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Steam Inventory query and manipulation API
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamInventory
|
||||
{
|
||||
public:
|
||||
|
||||
// INVENTORY ASYNC RESULT MANAGEMENT
|
||||
//
|
||||
// Asynchronous inventory queries always output a result handle which can be used with
|
||||
// GetResultStatus, GetResultItems, etc. A SteamInventoryResultReady_t callback will
|
||||
// be triggered when the asynchronous result becomes ready (or fails).
|
||||
//
|
||||
|
||||
// Find out the status of an asynchronous inventory result handle. Possible values:
|
||||
// k_EResultPending - still in progress
|
||||
// k_EResultOK - done, result ready
|
||||
// k_EResultExpired - done, result ready, maybe out of date (see DeserializeResult)
|
||||
// k_EResultInvalidParam - ERROR: invalid API call parameters
|
||||
// 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
|
||||
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.
|
||||
virtual bool GetResultItems( SteamInventoryResult_t resultHandle,
|
||||
STEAM_OUT_ARRAY_COUNT( punOutItemsArraySize,Output array) SteamItemDetails_t *pOutItemsArray,
|
||||
uint32 *punOutItemsArraySize ) = 0;
|
||||
|
||||
// In combination with GetResultItems, you can use GetResultItemProperty to retrieve
|
||||
// dynamic string properties for a given item returned in the result set.
|
||||
//
|
||||
// Property names are always composed of ASCII letters, numbers, and/or underscores.
|
||||
//
|
||||
// Pass a NULL pointer for pchPropertyName to get a comma - separated list of available
|
||||
// property names.
|
||||
//
|
||||
// If pchValueBuffer is NULL, *punValueBufferSize will contain the
|
||||
// suggested buffer size. Otherwise it will be the number of bytes actually copied
|
||||
// to pchValueBuffer. If the results do not fit in the given buffer, partial
|
||||
// results may be copied.
|
||||
virtual bool GetResultItemProperty( SteamInventoryResult_t resultHandle,
|
||||
uint32 unItemIndex,
|
||||
const char *pchPropertyName,
|
||||
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.
|
||||
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.
|
||||
virtual bool CheckResultSteamID( SteamInventoryResult_t resultHandle, CSteamID steamIDExpected ) = 0;
|
||||
|
||||
// Destroys a result handle and frees all associated memory.
|
||||
virtual void DestroyResult( SteamInventoryResult_t resultHandle ) = 0;
|
||||
|
||||
|
||||
// INVENTORY ASYNC QUERY
|
||||
//
|
||||
|
||||
// Captures the entire state of the current user's Steam inventory.
|
||||
// You must call DestroyResult on this handle when you are done with it.
|
||||
// Returns false and sets *pResultHandle to zero if inventory is unavailable.
|
||||
// Note: calls to this function are subject to rate limits and may return
|
||||
// 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.
|
||||
virtual bool GetAllItems( SteamInventoryResult_t *pResultHandle ) = 0;
|
||||
|
||||
|
||||
// Captures the state of a subset of the current user's Steam inventory,
|
||||
// identified by an array of item instance IDs. The results from this call
|
||||
// can be serialized and passed to other players to "prove" that the current
|
||||
// user owns specific items, without exposing the user's entire inventory.
|
||||
// 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.
|
||||
virtual bool GetItemsByID( SteamInventoryResult_t *pResultHandle, STEAM_ARRAY_COUNT( unCountInstanceIDs ) const SteamItemInstanceID_t *pInstanceIDs, uint32 unCountInstanceIDs ) = 0;
|
||||
|
||||
|
||||
// RESULT SERIALIZATION AND AUTHENTICATION
|
||||
//
|
||||
// Serialized result sets contain a short signature which can't be forged
|
||||
// or replayed across different game sessions. A result set can be serialized
|
||||
// on the local client, transmitted to other players via your game networking,
|
||||
// and deserialized by the remote players. This is a secure way of preventing
|
||||
// hackers from lying about posessing rare/high-value items.
|
||||
|
||||
// Serializes a result set with signature bytes to an output buffer. Pass
|
||||
// NULL as an output buffer to get the required size via punOutBufferSize.
|
||||
// The size of a serialized result depends on the number items which are being
|
||||
// serialized. When securely transmitting items to other players, it is
|
||||
// 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, 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.
|
||||
// Otherwise returns true and then delivers error codes via GetResultStatus.
|
||||
//
|
||||
// The bRESERVED_MUST_BE_FALSE flag is reserved for future use and should not
|
||||
// be set to true by your game at this time.
|
||||
//
|
||||
// DeserializeResult has a potential soft-failure mode where the handle status
|
||||
// is set to k_EResultExpired. GetResultItems() still succeeds in this mode.
|
||||
// The "expired" result could indicate that the data may be out of date - not
|
||||
// just due to timed expiration (one hour), but also because one of the items
|
||||
// in the result set may have been traded or consumed since the result set was
|
||||
// generated. You could compare the timestamp from GetResultTimestamp() to
|
||||
// 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, STEAM_BUFFER_COUNT(punOutBufferSize) const void *pBuffer, uint32 unBufferSize, bool bRESERVED_MUST_BE_FALSE = false ) = 0;
|
||||
|
||||
|
||||
// INVENTORY ASYNC MODIFICATION
|
||||
//
|
||||
|
||||
// GenerateItems() creates one or more items and then generates a SteamInventoryCallback_t
|
||||
// notification with a matching nCallbackContext parameter. This API is only intended
|
||||
// for prototyping - it is only usable by Steam accounts that belong to the publisher group
|
||||
// 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, 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.
|
||||
virtual bool GrantPromoItems( SteamInventoryResult_t *pResultHandle ) = 0;
|
||||
|
||||
// AddPromoItem() / AddPromoItems() are restricted versions of GrantPromoItems(). Instead of
|
||||
// scanning for all eligible promotional items, the check is restricted to a single item
|
||||
// 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, 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.
|
||||
virtual bool ConsumeItem( SteamInventoryResult_t *pResultHandle, SteamItemInstanceID_t itemConsume, uint32 unQuantity ) = 0;
|
||||
|
||||
// ExchangeItems() is an atomic combination of item generation and consumption.
|
||||
// It can be used to implement crafting recipes or transmutations, or items which unpack
|
||||
// themselves into other items (e.g., a chest).
|
||||
// Exchange recipes are defined in the ItemDef, and explicitly list the required item
|
||||
// types and resulting generated type.
|
||||
// Exchange recipes are evaluated atomically by the Inventory Service; if the supplied
|
||||
// components do not match the recipe, or do not contain sufficient quantity, the
|
||||
// exchange will fail.
|
||||
virtual bool ExchangeItems( SteamInventoryResult_t *pResultHandle,
|
||||
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
|
||||
// quantity greater than one). It can be used to split a stack into two, or to transfer
|
||||
// quantity from one stack into another stack of identical items. To split one stack into
|
||||
// two, pass k_SteamItemInstanceIDInvalid for itemIdDest and a new item will be generated.
|
||||
virtual bool TransferItemQuantity( SteamInventoryResult_t *pResultHandle, SteamItemInstanceID_t itemIdSource, uint32 unQuantity, SteamItemInstanceID_t itemIdDest ) = 0;
|
||||
|
||||
|
||||
// TIMED DROPS AND PLAYTIME CREDIT
|
||||
//
|
||||
|
||||
// Deprecated. Calling this method is not required for proper playtime accounting.
|
||||
virtual void SendItemDropHeartbeat() = 0;
|
||||
|
||||
// Playtime credit must be consumed and turned into item drops by your game. Only item
|
||||
// definitions which are marked as "playtime item generators" can be spawned. The call
|
||||
// will return an empty result set if there is not enough playtime credit for a drop.
|
||||
// Your game should call TriggerItemDrop at an appropriate time for the user to receive
|
||||
// new items, such as between rounds or while the player is dead. Note that players who
|
||||
// hack their clients could modify the value of "dropListDefinition", so do not use it
|
||||
// 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.
|
||||
virtual bool TriggerItemDrop( SteamInventoryResult_t *pResultHandle, SteamItemDef_t dropListDefinition ) = 0;
|
||||
|
||||
|
||||
// Deprecated. This method is not supported.
|
||||
virtual bool TradeItems( SteamInventoryResult_t *pResultHandle, CSteamID steamIDTradePartner,
|
||||
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
|
||||
//
|
||||
// Item definitions are a mapping of "definition IDs" (integers between 1 and 1000000)
|
||||
// to a set of string properties. Some of these properties are required to display items
|
||||
// on the Steam community web site. Other properties can be defined by applications.
|
||||
// Use of these functions is optional; there is no reason to call LoadItemDefinitions
|
||||
// if your game hardcodes the numeric definition IDs (eg, purple face mask = 20, blue
|
||||
// weapon mod = 55) and does not allow for adding new item types without a client patch.
|
||||
//
|
||||
|
||||
// LoadItemDefinitions triggers the automatic load and refresh of item definitions.
|
||||
// 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.
|
||||
virtual bool LoadItemDefinitions() = 0;
|
||||
|
||||
// GetItemDefinitionIDs returns the set of all defined item definition IDs (which are
|
||||
// defined via Steamworks configuration, and not necessarily contiguous integers).
|
||||
// If pItemDefIDs is null, the call will return true and *punItemDefIDsArraySize will
|
||||
// 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(
|
||||
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
|
||||
// on the current Steam language settings (see ISteamApps::GetCurrentGameLanguage).
|
||||
// Property names are always composed of ASCII letters, numbers, and/or underscores.
|
||||
// Pass a NULL pointer for pchPropertyName to get a comma - separated list of available
|
||||
// property names. If pchValueBuffer is NULL, *punValueBufferSize will contain the
|
||||
// suggested buffer size. Otherwise it will be the number of bytes actually copied
|
||||
// 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,
|
||||
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.
|
||||
STEAM_CALL_RESULT( SteamInventoryEligiblePromoItemDefIDs_t )
|
||||
virtual SteamAPICall_t RequestEligiblePromoItemDefinitionsIDs( CSteamID steamID ) = 0;
|
||||
|
||||
// After handling a SteamInventoryEligiblePromoItemDefIDs_t call result, use this
|
||||
// function to pull out the list of item definition ids that the user can be
|
||||
// manually granted via the AddPromoItems() call.
|
||||
virtual bool GetEligiblePromoItemDefinitionIDs(
|
||||
CSteamID steamID,
|
||||
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.
|
||||
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
|
||||
STEAM_CALL_RESULT( SteamInventoryRequestPricesResult_t )
|
||||
virtual SteamAPICall_t RequestPrices() = 0;
|
||||
|
||||
// Returns the number of items with prices. Need to call RequestPrices() first.
|
||||
virtual uint32 GetNumItemsWithPrices() = 0;
|
||||
|
||||
// Returns item definition ids and their prices in the user's local currency.
|
||||
// Need to call RequestPrices() first.
|
||||
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 *pCurrentPrice, uint64 *pBasePrice ) = 0;
|
||||
|
||||
// Create a request to update properties on items
|
||||
virtual SteamInventoryUpdateHandle_t StartUpdateProperties() = 0;
|
||||
// Remove the property on the item
|
||||
virtual bool RemoveProperty( SteamInventoryUpdateHandle_t handle, SteamItemInstanceID_t nItemID, const char *pchPropertyName ) = 0;
|
||||
// Accessor methods to set properties on items
|
||||
|
||||
STEAM_FLAT_NAME( SetPropertyString )
|
||||
virtual bool SetProperty( SteamInventoryUpdateHandle_t handle, SteamItemInstanceID_t nItemID, const char *pchPropertyName, const char *pchPropertyValue ) = 0;
|
||||
|
||||
STEAM_FLAT_NAME( SetPropertyBool )
|
||||
virtual bool SetProperty( SteamInventoryUpdateHandle_t handle, SteamItemInstanceID_t nItemID, const char *pchPropertyName, bool bValue ) = 0;
|
||||
|
||||
STEAM_FLAT_NAME( SetPropertyInt64 )
|
||||
virtual bool SetProperty( SteamInventoryUpdateHandle_t handle, SteamItemInstanceID_t nItemID, const char *pchPropertyName, int64 nValue ) = 0;
|
||||
|
||||
STEAM_FLAT_NAME( SetPropertyFloat )
|
||||
virtual bool SetProperty( SteamInventoryUpdateHandle_t handle, SteamItemInstanceID_t nItemID, const char *pchPropertyName, float flValue ) = 0;
|
||||
|
||||
// Submit the update request by handle
|
||||
virtual bool SubmitUpdateProperties( SteamInventoryUpdateHandle_t handle, SteamInventoryResult_t * pResultHandle ) = 0;
|
||||
|
||||
virtual bool InspectItem( SteamInventoryResult_t *pResultHandle, const char *pchItemToken ) = 0;
|
||||
};
|
||||
|
||||
#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
|
||||
// always be exactly one callback per handle.
|
||||
struct SteamInventoryResultReady_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamInventoryCallbacks + 0 };
|
||||
SteamInventoryResult_t m_handle;
|
||||
EResult m_result;
|
||||
};
|
||||
|
||||
|
||||
// SteamInventoryFullUpdate_t callbacks are triggered when GetAllItems
|
||||
// successfully returns a result which is newer / fresher than the last
|
||||
// known result. (It will not trigger if the inventory hasn't changed,
|
||||
// or if results from two overlapping calls are reversed in flight and
|
||||
// the earlier result is already known to be stale/out-of-date.)
|
||||
// The normal ResultReady callback will still be triggered immediately
|
||||
// afterwards; this is an additional notification for your convenience.
|
||||
struct SteamInventoryFullUpdate_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamInventoryCallbacks + 1 };
|
||||
SteamInventoryResult_t m_handle;
|
||||
};
|
||||
|
||||
|
||||
// A SteamInventoryDefinitionUpdate_t callback is triggered whenever
|
||||
// item definitions have been updated, which could be in response to
|
||||
// LoadItemDefinitions() or any other async request which required
|
||||
// a definition update in order to process results from the server.
|
||||
struct SteamInventoryDefinitionUpdate_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamInventoryCallbacks + 2 };
|
||||
};
|
||||
|
||||
// Returned
|
||||
struct SteamInventoryEligiblePromoItemDefIDs_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamInventoryCallbacks + 3 };
|
||||
EResult m_result;
|
||||
CSteamID m_steamID;
|
||||
int m_numEligiblePromoItemDefs;
|
||||
bool m_bCachedData; // indicates that the data was retrieved from the cache and not the server
|
||||
};
|
||||
|
||||
// Triggered from StartPurchase call
|
||||
struct SteamInventoryStartPurchaseResult_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamInventoryCallbacks + 4 };
|
||||
EResult m_result;
|
||||
uint64 m_ulOrderID;
|
||||
uint64 m_ulTransID;
|
||||
};
|
||||
|
||||
|
||||
// Triggered from RequestPrices
|
||||
struct SteamInventoryRequestPricesResult_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamInventoryCallbacks + 5 };
|
||||
EResult m_result;
|
||||
char m_rgchCurrency[4];
|
||||
};
|
||||
|
||||
#pragma pack( pop )
|
||||
|
||||
|
||||
#endif // ISTEAMCONTROLLER_H
|
@ -1,4 +1,4 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//====== Copyright © 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: interface to steam managing game server/client match making
|
||||
//
|
||||
@ -10,10 +10,8 @@
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "steamtypes.h"
|
||||
#include "steamclientpublic.h"
|
||||
#include "matchmakingtypes.h"
|
||||
#include "isteamclient.h"
|
||||
#include "steam_api_common.h"
|
||||
#include "matchmakingtypes.h"
|
||||
#include "isteamfriends.h"
|
||||
|
||||
// lobby type description
|
||||
@ -22,9 +20,11 @@ enum ELobbyType
|
||||
k_ELobbyTypePrivate = 0, // only way to join the lobby is to invite to someone else
|
||||
k_ELobbyTypeFriendsOnly = 1, // shows for friends or invitees, but not in lobby list
|
||||
k_ELobbyTypePublic = 2, // visible for friends and in lobby list
|
||||
k_ELobbyTypeInvisible = 3, // returned by search, but not visible to other friends
|
||||
k_ELobbyTypeInvisible = 3, // returned by search, but not visible to other friends
|
||||
// useful if you want a user in two lobbies, for example matching groups together
|
||||
// a user can be in only one regular lobby, and up to two invisible lobbies
|
||||
k_ELobbyTypePrivateUnique = 4, // private, unique and does not delete when empty - only one of these may exist per unique keypair set
|
||||
// can only create from webapi
|
||||
};
|
||||
|
||||
// lobby search filter tools
|
||||
@ -62,7 +62,7 @@ public:
|
||||
|
||||
// returns the number of favorites servers the user has stored
|
||||
virtual int GetFavoriteGameCount() = 0;
|
||||
|
||||
|
||||
// returns the details of the game server
|
||||
// iGame is of range [0,GetFavoriteGameCount())
|
||||
// *pnIP, *pnConnPort are filled in the with IP:port of the game server
|
||||
@ -71,10 +71,10 @@ public:
|
||||
virtual bool GetFavoriteGame( int iGame, AppId_t *pnAppID, uint32 *pnIP, uint16 *pnConnPort, uint16 *pnQueryPort, uint32 *punFlags, uint32 *pRTime32LastPlayedOnServer ) = 0;
|
||||
|
||||
// adds the game server to the local list; updates the time played of the server if it already exists in the list
|
||||
virtual int AddFavoriteGame( AppId_t nAppID, uint32 nIP, uint16 nConnPort, uint16 nQueryPort, uint32 unFlags, uint32 rTime32LastPlayedOnServer ) =0;
|
||||
|
||||
virtual int AddFavoriteGame( AppId_t nAppID, uint32 nIP, uint16 nConnPort, uint16 nQueryPort, uint32 unFlags, uint32 rTime32LastPlayedOnServer ) = 0;
|
||||
|
||||
// removes the game server from the local storage; returns true if one was removed
|
||||
virtual bool RemoveFavoriteGame( AppId_t nAppID, uint32 nIP, uint16 nConnPort, uint16 nQueryPort, uint32 unFlags ) = 0;
|
||||
virtual bool RemoveFavoriteGame( AppId_t nAppID, uint32 nIP, uint16 nConnPort, uint16 nQueryPort, uint32 unFlags ) = 0;
|
||||
|
||||
///////
|
||||
// Game lobby functions
|
||||
@ -102,7 +102,8 @@ public:
|
||||
}
|
||||
}
|
||||
*/
|
||||
//
|
||||
//
|
||||
STEAM_CALL_RESULT( LobbyMatchList_t )
|
||||
virtual SteamAPICall_t RequestLobbyList() = 0;
|
||||
// filters for lobbies
|
||||
// this needs to be called before RequestLobbyList() to take effect
|
||||
@ -133,12 +134,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)
|
||||
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
|
||||
STEAM_CALL_RESULT( LobbyEnter_t )
|
||||
virtual SteamAPICall_t JoinLobby( CSteamID steamIDLobby ) = 0;
|
||||
|
||||
// Leave a lobby; this will take effect immediately on the client side
|
||||
@ -157,7 +160,7 @@ public:
|
||||
// only accessible if the lobby user is a member of the specified lobby
|
||||
// persona information for other lobby members (name, avatar, etc.) will be asynchronously received
|
||||
// and accessible via ISteamFriends interface
|
||||
|
||||
|
||||
// returns the number of users in the specified lobby
|
||||
virtual int GetNumLobbyMembers( CSteamID steamIDLobby ) = 0;
|
||||
// returns the CSteamID of a user in the lobby
|
||||
@ -189,7 +192,7 @@ public:
|
||||
virtual const char *GetLobbyMemberData( CSteamID steamIDLobby, CSteamID steamIDUser, const char *pchKey ) = 0;
|
||||
// Sets per-user metadata (for the local user implicitly)
|
||||
virtual void SetLobbyMemberData( CSteamID steamIDLobby, const char *pchKey, const char *pchValue ) = 0;
|
||||
|
||||
|
||||
// Broadcasts a chat message to the all the users in the lobby
|
||||
// users in the lobby (including the local user) will receive a LobbyChatMsg_t callback
|
||||
// returns true if the message is successfully sent
|
||||
@ -201,7 +204,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, 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
|
||||
@ -211,13 +214,13 @@ public:
|
||||
// results will be returned by a LobbyDataUpdate_t callback
|
||||
// if the specified lobby doesn't exist, LobbyDataUpdate_t::m_bSuccess will be set to false
|
||||
virtual bool RequestLobbyData( CSteamID steamIDLobby ) = 0;
|
||||
|
||||
|
||||
// sets the game server associated with the lobby
|
||||
// usually at this point, the users will join the specified game server
|
||||
// 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, 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,6 +259,9 @@ public:
|
||||
};
|
||||
#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)
|
||||
@ -287,22 +293,22 @@ class ISteamMatchmakingServerListResponse
|
||||
{
|
||||
public:
|
||||
// Server has responded ok with updated data
|
||||
virtual void ServerResponded( HServerListRequest hRequest, int iServer ) = 0;
|
||||
virtual void ServerResponded( HServerListRequest hRequest, int iServer ) = 0;
|
||||
|
||||
// Server has failed to respond
|
||||
virtual void ServerFailedToRespond( HServerListRequest hRequest, int iServer ) = 0;
|
||||
virtual void ServerFailedToRespond( HServerListRequest hRequest, int iServer ) = 0;
|
||||
|
||||
// A list refresh you had initiated is now 100% completed
|
||||
virtual void RefreshComplete( HServerListRequest hRequest, EMatchMakingServerResponse response ) = 0;
|
||||
virtual void RefreshComplete( HServerListRequest hRequest, EMatchMakingServerResponse response ) = 0;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Callback interface for receiving responses after pinging an individual server
|
||||
// Purpose: Callback interface for receiving responses after pinging an individual server
|
||||
//
|
||||
// These callbacks all occur in response to querying an individual server
|
||||
// via the ISteamMatchmakingServers()->PingServer() call below. If you are
|
||||
// destructing an object that implements this interface then you should call
|
||||
// via the ISteamMatchmakingServers()->PingServer() call below. If you are
|
||||
// destructing an object that implements this interface then you should call
|
||||
// ISteamMatchmakingServers()->CancelServerQuery() passing in the handle to the query
|
||||
// which is in progress. Failure to cancel in progress queries when destructing
|
||||
// a callback handler may result in a crash when a callback later occurs.
|
||||
@ -323,8 +329,8 @@ public:
|
||||
// who is playing on a particular server.
|
||||
//
|
||||
// These callbacks all occur in response to querying an individual server
|
||||
// via the ISteamMatchmakingServers()->PlayerDetails() call below. If you are
|
||||
// destructing an object that implements this interface then you should call
|
||||
// via the ISteamMatchmakingServers()->PlayerDetails() call below. If you are
|
||||
// destructing an object that implements this interface then you should call
|
||||
// ISteamMatchmakingServers()->CancelServerQuery() passing in the handle to the query
|
||||
// which is in progress. Failure to cancel in progress queries when destructing
|
||||
// a callback handler may result in a crash when a callback later occurs.
|
||||
@ -339,7 +345,7 @@ public:
|
||||
// The server failed to respond to the request for player details
|
||||
virtual void PlayersFailedToRespond() = 0;
|
||||
|
||||
// The server has finished responding to the player details request
|
||||
// The server has finished responding to the player details request
|
||||
// (ie, you won't get anymore AddPlayerToList callbacks)
|
||||
virtual void PlayersRefreshComplete() = 0;
|
||||
};
|
||||
@ -350,8 +356,8 @@ public:
|
||||
// details on a particular server.
|
||||
//
|
||||
// These callbacks all occur in response to querying an individual server
|
||||
// via the ISteamMatchmakingServers()->ServerRules() call below. If you are
|
||||
// destructing an object that implements this interface then you should call
|
||||
// via the ISteamMatchmakingServers()->ServerRules() call below. If you are
|
||||
// destructing an object that implements this interface then you should call
|
||||
// ISteamMatchmakingServers()->CancelServerQuery() passing in the handle to the query
|
||||
// which is in progress. Failure to cancel in progress queries when destructing
|
||||
// a callback handler may result in a crash when a callback later occurs.
|
||||
@ -366,7 +372,7 @@ public:
|
||||
// The server failed to respond to the request for rule details
|
||||
virtual void RulesFailedToRespond() = 0;
|
||||
|
||||
// The server has finished responding to the rule details request
|
||||
// The server has finished responding to the rule details request
|
||||
// (ie, you won't get anymore RulesResponded callbacks)
|
||||
virtual void RulesRefreshComplete() = 0;
|
||||
};
|
||||
@ -387,12 +393,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, 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, MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0;
|
||||
virtual HServerListRequest RequestFavoritesServerList( AppId_t iApp, MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0;
|
||||
virtual HServerListRequest RequestHistoryServerList( AppId_t iApp, MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0;
|
||||
virtual HServerListRequest RequestSpectatorServerList( AppId_t iApp, 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.
|
||||
@ -469,33 +475,33 @@ public:
|
||||
*/
|
||||
|
||||
// Get details on a given server in the list, you can get the valid range of index
|
||||
// values by calling GetServerCount(). You will also receive index values in
|
||||
// values by calling GetServerCount(). You will also receive index values in
|
||||
// ISteamMatchmakingServerListResponse::ServerResponded() callbacks
|
||||
virtual gameserveritem_t *GetServerDetails( HServerListRequest hRequest, int iServer ) = 0;
|
||||
virtual gameserveritem_t *GetServerDetails( HServerListRequest hRequest, int iServer ) = 0;
|
||||
|
||||
// Cancel an request which is operation on the given list type. You should call this to cancel
|
||||
// any in-progress requests before destructing a callback object that may have been passed
|
||||
// any in-progress requests before destructing a callback object that may have been passed
|
||||
// to one of the above list request calls. Not doing so may result in a crash when a callback
|
||||
// occurs on the destructed object.
|
||||
// Canceling a query does not release the allocated request handle.
|
||||
// The request handle must be released using ReleaseRequest( hRequest )
|
||||
virtual void CancelQuery( HServerListRequest hRequest ) = 0;
|
||||
virtual void CancelQuery( HServerListRequest hRequest ) = 0;
|
||||
|
||||
// Ping every server in your list again but don't update the list of servers
|
||||
// Query callback installed when the server list was requested will be used
|
||||
// again to post notifications and RefreshComplete, so the callback must remain
|
||||
// valid until another RefreshComplete is called on it or the request
|
||||
// is released with ReleaseRequest( hRequest )
|
||||
virtual void RefreshQuery( HServerListRequest hRequest ) = 0;
|
||||
virtual void RefreshQuery( HServerListRequest hRequest ) = 0;
|
||||
|
||||
// Returns true if the list is currently refreshing its server list
|
||||
virtual bool IsRefreshing( HServerListRequest hRequest ) = 0;
|
||||
virtual bool IsRefreshing( HServerListRequest hRequest ) = 0;
|
||||
|
||||
// How many servers in the given list, GetServerDetails above takes 0... GetServerCount() - 1
|
||||
virtual int GetServerCount( HServerListRequest hRequest ) = 0;
|
||||
virtual int GetServerCount( HServerListRequest hRequest ) = 0;
|
||||
|
||||
// Refresh a single server inside of a query (rather than all the servers )
|
||||
virtual void RefreshServer( HServerListRequest hRequest, int iServer ) = 0;
|
||||
virtual void RefreshServer( HServerListRequest hRequest, int iServer ) = 0;
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@ -503,21 +509,25 @@ public:
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
// Request updated ping time and other details from a single server
|
||||
virtual HServerQuery PingServer( uint32 unIP, uint16 usPort, ISteamMatchmakingPingResponse *pRequestServersResponse ) = 0;
|
||||
virtual HServerQuery PingServer( uint32 unIP, uint16 usPort, ISteamMatchmakingPingResponse *pRequestServersResponse ) = 0;
|
||||
|
||||
// Request the list of players currently playing on a server
|
||||
virtual HServerQuery PlayerDetails( uint32 unIP, uint16 usPort, ISteamMatchmakingPlayersResponse *pRequestServersResponse ) = 0;
|
||||
|
||||
// Request the list of rules that the server is running (See ISteamGameServer::SetKeyValue() to set the rules server side)
|
||||
virtual HServerQuery ServerRules( uint32 unIP, uint16 usPort, ISteamMatchmakingRulesResponse *pRequestServersResponse ) = 0;
|
||||
virtual HServerQuery ServerRules( uint32 unIP, uint16 usPort, ISteamMatchmakingRulesResponse *pRequestServersResponse ) = 0;
|
||||
|
||||
// Cancel an outstanding Ping/Players/Rules query from above. You should call this to cancel
|
||||
// any in-progress requests before destructing a callback object that may have been passed
|
||||
// any in-progress requests before destructing a callback object that may have been passed
|
||||
// to one of the above calls to avoid crashing when callbacks occur.
|
||||
virtual void CancelServerQuery( HServerQuery hServerQuery ) = 0;
|
||||
virtual void CancelServerQuery( HServerQuery hServerQuery ) = 0;
|
||||
};
|
||||
#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
|
||||
@ -541,15 +551,180 @@ 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
|
||||
#endif
|
||||
#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
|
||||
@ -563,6 +738,7 @@ struct FavoritesListChanged_t
|
||||
uint32 m_nAppID;
|
||||
uint32 m_nFlags;
|
||||
bool m_bAdd; // true if this is adding the entry, otherwise it is a remove
|
||||
AccountID_t m_unAccountId;
|
||||
};
|
||||
|
||||
|
||||
@ -611,7 +787,7 @@ struct LobbyDataUpdate_t
|
||||
|
||||
uint64 m_ulSteamIDLobby; // steamID of the Lobby
|
||||
uint64 m_ulSteamIDMember; // steamID of the member whose data changed, or the room itself
|
||||
uint8 m_bSuccess; // true if we lobby data was successfully changed;
|
||||
uint8 m_bSuccess; // true if we lobby data was successfully changed;
|
||||
// will only be false if RequestLobbyData() was called on a lobby that no longer exists
|
||||
};
|
||||
|
||||
@ -697,7 +873,7 @@ struct LobbyKicked_t
|
||||
struct LobbyCreated_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamMatchmakingCallbacks + 13 };
|
||||
|
||||
|
||||
EResult m_eResult; // k_EResultOK - the lobby was successfully created
|
||||
// k_EResultNoConnection - your Steam client doesn't have a connection to the back-end
|
||||
// k_EResultTimeout - you the message to the Steam servers, but it didn't respond
|
||||
@ -725,6 +901,186 @@ struct PSNGameBootInviteResult_t
|
||||
bool m_bGameBootInviteExists;
|
||||
CSteamID m_steamIDLobby; // Should be valid if m_bGameBootInviteExists == true
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Result of our request to create a Lobby
|
||||
// m_eResult == k_EResultOK on success
|
||||
// at this point, the lobby has been joined and is ready for use
|
||||
// a LobbyEnter_t callback will also be received (since the local user is joining their own lobby)
|
||||
//-----------------------------------------------------------------------------
|
||||
struct FavoritesListAccountsUpdated_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamMatchmakingCallbacks + 16 };
|
||||
|
||||
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 )
|
||||
|
||||
|
||||
|
71
rehlds/public/steam/isteammusic.h
Normal file
71
rehlds/public/steam/isteammusic.h
Normal file
@ -0,0 +1,71 @@
|
||||
//============ Copyright (c) Valve Corporation, All rights reserved. ============
|
||||
|
||||
#ifndef ISTEAMMUSIC_H
|
||||
#define ISTEAMMUSIC_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "steam_api_common.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
//-----------------------------------------------------------------------------
|
||||
enum AudioPlayback_Status
|
||||
{
|
||||
AudioPlayback_Undefined = 0,
|
||||
AudioPlayback_Playing = 1,
|
||||
AudioPlayback_Paused = 2,
|
||||
AudioPlayback_Idle = 3
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Functions to control music playback in the steam client
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamMusic
|
||||
{
|
||||
public:
|
||||
virtual bool BIsEnabled() = 0;
|
||||
virtual bool BIsPlaying() = 0;
|
||||
|
||||
virtual AudioPlayback_Status GetPlaybackStatus() = 0;
|
||||
|
||||
virtual void Play() = 0;
|
||||
virtual void Pause() = 0;
|
||||
virtual void PlayPrevious() = 0;
|
||||
virtual void PlayNext() = 0;
|
||||
|
||||
// volume is between 0.0 and 1.0
|
||||
virtual void SetVolume( float flVolume ) = 0;
|
||||
virtual float GetVolume() = 0;
|
||||
|
||||
};
|
||||
|
||||
#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 steam_api_common.h should define VALVE_CALLBACK_PACK_xxx
|
||||
#endif
|
||||
|
||||
|
||||
STEAM_CALLBACK_BEGIN( PlaybackStatusHasChanged_t, k_iSteamMusicCallbacks + 1 )
|
||||
STEAM_CALLBACK_END(0)
|
||||
|
||||
STEAM_CALLBACK_BEGIN( VolumeHasChanged_t, k_iSteamMusicCallbacks + 2 )
|
||||
STEAM_CALLBACK_MEMBER( 0, float, m_flNewVolume )
|
||||
STEAM_CALLBACK_END(1)
|
||||
|
||||
#pragma pack( pop )
|
||||
|
||||
|
||||
#endif // #define ISTEAMMUSIC_H
|
133
rehlds/public/steam/isteammusicremote.h
Normal file
133
rehlds/public/steam/isteammusicremote.h
Normal file
@ -0,0 +1,133 @@
|
||||
//============ Copyright (c) Valve Corporation, All rights reserved. ============
|
||||
|
||||
#ifndef ISTEAMMUSICREMOTE_H
|
||||
#define ISTEAMMUSICREMOTE_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "steam_api_common.h"
|
||||
#include "isteammusic.h"
|
||||
|
||||
#define k_SteamMusicNameMaxLength 255
|
||||
#define k_SteamMusicPNGMaxLength 65535
|
||||
|
||||
|
||||
class ISteamMusicRemote
|
||||
{
|
||||
public:
|
||||
// Service Definition
|
||||
virtual bool RegisterSteamMusicRemote( const char *pchName ) = 0;
|
||||
virtual bool DeregisterSteamMusicRemote() = 0;
|
||||
virtual bool BIsCurrentMusicRemote() = 0;
|
||||
virtual bool BActivationSuccess( bool bValue ) = 0;
|
||||
|
||||
virtual bool SetDisplayName( const char *pchDisplayName ) = 0;
|
||||
virtual bool SetPNGIcon_64x64( void *pvBuffer, uint32 cbBufferLength ) = 0;
|
||||
|
||||
// Abilities for the user interface
|
||||
virtual bool EnablePlayPrevious(bool bValue) = 0;
|
||||
virtual bool EnablePlayNext( bool bValue ) = 0;
|
||||
virtual bool EnableShuffled( bool bValue ) = 0;
|
||||
virtual bool EnableLooped( bool bValue ) = 0;
|
||||
virtual bool EnableQueue( bool bValue ) = 0;
|
||||
virtual bool EnablePlaylists( bool bValue ) = 0;
|
||||
|
||||
// Status
|
||||
virtual bool UpdatePlaybackStatus( AudioPlayback_Status nStatus ) = 0;
|
||||
virtual bool UpdateShuffled( bool bValue ) = 0;
|
||||
virtual bool UpdateLooped( bool bValue ) = 0;
|
||||
virtual bool UpdateVolume( float flValue ) = 0; // volume is between 0.0 and 1.0
|
||||
|
||||
// Current Entry
|
||||
virtual bool CurrentEntryWillChange() = 0;
|
||||
virtual bool CurrentEntryIsAvailable( bool bAvailable ) = 0;
|
||||
virtual bool UpdateCurrentEntryText( const char *pchText ) = 0;
|
||||
virtual bool UpdateCurrentEntryElapsedSeconds( int nValue ) = 0;
|
||||
virtual bool UpdateCurrentEntryCoverArt( void *pvBuffer, uint32 cbBufferLength ) = 0;
|
||||
virtual bool CurrentEntryDidChange() = 0;
|
||||
|
||||
// Queue
|
||||
virtual bool QueueWillChange() = 0;
|
||||
virtual bool ResetQueueEntries() = 0;
|
||||
virtual bool SetQueueEntry( int nID, int nPosition, const char *pchEntryText ) = 0;
|
||||
virtual bool SetCurrentQueueEntry( int nID ) = 0;
|
||||
virtual bool QueueDidChange() = 0;
|
||||
|
||||
// Playlist
|
||||
virtual bool PlaylistWillChange() = 0;
|
||||
virtual bool ResetPlaylistEntries() = 0;
|
||||
virtual bool SetPlaylistEntry( int nID, int nPosition, const char *pchEntryText ) = 0;
|
||||
virtual bool SetCurrentPlaylistEntry( int nID ) = 0;
|
||||
virtual bool PlaylistDidChange() = 0;
|
||||
};
|
||||
|
||||
#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 steam_api_common.h should define VALVE_CALLBACK_PACK_xxx
|
||||
#endif
|
||||
|
||||
|
||||
STEAM_CALLBACK_BEGIN( MusicPlayerRemoteWillActivate_t, k_iSteamMusicRemoteCallbacks + 1)
|
||||
STEAM_CALLBACK_END(0)
|
||||
|
||||
STEAM_CALLBACK_BEGIN( MusicPlayerRemoteWillDeactivate_t, k_iSteamMusicRemoteCallbacks + 2 )
|
||||
STEAM_CALLBACK_END(0)
|
||||
|
||||
STEAM_CALLBACK_BEGIN( MusicPlayerRemoteToFront_t, k_iSteamMusicRemoteCallbacks + 3 )
|
||||
STEAM_CALLBACK_END(0)
|
||||
|
||||
STEAM_CALLBACK_BEGIN( MusicPlayerWillQuit_t, k_iSteamMusicRemoteCallbacks + 4 )
|
||||
STEAM_CALLBACK_END(0)
|
||||
|
||||
STEAM_CALLBACK_BEGIN( MusicPlayerWantsPlay_t, k_iSteamMusicRemoteCallbacks + 5 )
|
||||
STEAM_CALLBACK_END(0)
|
||||
|
||||
STEAM_CALLBACK_BEGIN( MusicPlayerWantsPause_t, k_iSteamMusicRemoteCallbacks + 6 )
|
||||
STEAM_CALLBACK_END(0)
|
||||
|
||||
STEAM_CALLBACK_BEGIN( MusicPlayerWantsPlayPrevious_t, k_iSteamMusicRemoteCallbacks + 7 )
|
||||
STEAM_CALLBACK_END(0)
|
||||
|
||||
STEAM_CALLBACK_BEGIN( MusicPlayerWantsPlayNext_t, k_iSteamMusicRemoteCallbacks + 8 )
|
||||
STEAM_CALLBACK_END(0)
|
||||
|
||||
STEAM_CALLBACK_BEGIN( MusicPlayerWantsShuffled_t, k_iSteamMusicRemoteCallbacks + 9 )
|
||||
STEAM_CALLBACK_MEMBER( 0, bool, m_bShuffled )
|
||||
STEAM_CALLBACK_END(1)
|
||||
|
||||
STEAM_CALLBACK_BEGIN( MusicPlayerWantsLooped_t, k_iSteamMusicRemoteCallbacks + 10 )
|
||||
STEAM_CALLBACK_MEMBER(0, bool, m_bLooped )
|
||||
STEAM_CALLBACK_END(1)
|
||||
|
||||
STEAM_CALLBACK_BEGIN( MusicPlayerWantsVolume_t, k_iSteamMusicCallbacks + 11 )
|
||||
STEAM_CALLBACK_MEMBER(0, float, m_flNewVolume)
|
||||
STEAM_CALLBACK_END(1)
|
||||
|
||||
STEAM_CALLBACK_BEGIN( MusicPlayerSelectsQueueEntry_t, k_iSteamMusicCallbacks + 12 )
|
||||
STEAM_CALLBACK_MEMBER(0, int, nID )
|
||||
STEAM_CALLBACK_END(1)
|
||||
|
||||
STEAM_CALLBACK_BEGIN( MusicPlayerSelectsPlaylistEntry_t, k_iSteamMusicCallbacks + 13 )
|
||||
STEAM_CALLBACK_MEMBER(0, int, nID )
|
||||
STEAM_CALLBACK_END(1)
|
||||
|
||||
STEAM_CALLBACK_BEGIN( MusicPlayerWantsPlayingRepeatStatus_t, k_iSteamMusicRemoteCallbacks + 14 )
|
||||
STEAM_CALLBACK_MEMBER(0, int, m_nPlayingRepeatStatus )
|
||||
STEAM_CALLBACK_END(1)
|
||||
|
||||
#pragma pack( pop )
|
||||
|
||||
|
||||
|
||||
#endif // #define ISTEAMMUSICREMOTE_H
|
@ -1,4 +1,4 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//====== Copyright © 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: interface to steam managing network connections between game clients & servers
|
||||
//
|
||||
@ -10,21 +10,23 @@
|
||||
#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
|
||||
enum EP2PSessionError
|
||||
{
|
||||
k_EP2PSessionErrorNone = 0,
|
||||
k_EP2PSessionErrorNotRunningApp = 1, // target is not running the same game
|
||||
k_EP2PSessionErrorNoRightsToApp = 2, // local user doesn't own the app that is running
|
||||
k_EP2PSessionErrorDestinationNotLoggedIn = 3, // target user isn't connected to Steam
|
||||
k_EP2PSessionErrorTimeout = 4, // target isn't responding, perhaps not calling AcceptP2PSessionWithUser()
|
||||
// corporate firewalls can also block this (NAT traversal is not firewall traversal)
|
||||
// make sure that UDP ports 3478, 4379, and 4380 are open in an outbound direction
|
||||
|
||||
// The following error codes were removed and will never be sent.
|
||||
// For privacy reasons, there is no reply if the user is offline or playing another game.
|
||||
k_EP2PSessionErrorNotRunningApp_DELETED = 1,
|
||||
k_EP2PSessionErrorDestinationNotLoggedIn_DELETED = 3,
|
||||
|
||||
k_EP2PSessionErrorMax = 5
|
||||
};
|
||||
|
||||
@ -42,12 +44,12 @@ enum EP2PSend
|
||||
// This is only really useful for kinds of data that should never buffer up, i.e. voice payload packets
|
||||
k_EP2PSendUnreliableNoDelay = 1,
|
||||
|
||||
// Reliable message send. Can send up to 1MB of data 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.
|
||||
// Reliable message send. Can send up to 1MB of data 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.
|
||||
k_EP2PSendReliable = 2,
|
||||
|
||||
// As above, but applies the Nagle algorithm to the send - sends will accumulate
|
||||
// until the current MTU size (typically ~1200 bytes, but can change) or ~200ms has passed (Nagle algorithm).
|
||||
// As above, but applies the Nagle algorithm to the send - sends will accumulate
|
||||
// until the current MTU size (typically ~1200 bytes, but can change) or ~200ms has passed (Nagle algorithm).
|
||||
// Useful if you want to send a set of smaller messages but have the coalesced into a single packet
|
||||
// Since the reliable stream is all ordered, you can do several small message sends with k_EP2PSendReliableWithBuffering and then
|
||||
// do a normal k_EP2PSendReliable to force all the buffered data to be sent.
|
||||
@ -63,8 +65,8 @@ enum EP2PSend
|
||||
#elif defined( VALVE_CALLBACK_PACK_LARGE )
|
||||
#pragma pack( push, 8 )
|
||||
#else
|
||||
#error isteamclient.h must be included
|
||||
#endif
|
||||
#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx
|
||||
#endif
|
||||
struct P2PSessionState_t
|
||||
{
|
||||
uint8 m_bConnectionActive; // true if we've got an active open connection
|
||||
@ -73,7 +75,7 @@ struct P2PSessionState_t
|
||||
uint8 m_bUsingRelay; // true if it's going through a relay server (TURN)
|
||||
int32 m_nBytesQueuedForSend;
|
||||
int32 m_nPacketsQueuedForSend;
|
||||
uint32 m_nRemoteIP; // potential IP:Port of remote host. Could be TURN server.
|
||||
uint32 m_nRemoteIP; // potential IP:Port of remote host. Could be TURN server.
|
||||
uint16 m_nRemotePort; // Only exists for compatibility with older authentication api's
|
||||
};
|
||||
#pragma pack( pop )
|
||||
@ -86,11 +88,11 @@ typedef uint32 SNetListenSocket_t; // CreateListenSocket()
|
||||
// connection progress indicators, used by CreateP2PConnectionSocket()
|
||||
enum ESNetSocketState
|
||||
{
|
||||
k_ESNetSocketStateInvalid = 0,
|
||||
k_ESNetSocketStateInvalid = 0,
|
||||
|
||||
// communication is valid
|
||||
k_ESNetSocketStateConnected = 1,
|
||||
|
||||
k_ESNetSocketStateConnected = 1,
|
||||
|
||||
// states while establishing a connection
|
||||
k_ESNetSocketStateInitiated = 10, // the connection state machine has started
|
||||
|
||||
@ -102,7 +104,7 @@ enum ESNetSocketState
|
||||
k_ESNetSocketStateChallengeHandshake = 15, // we've received a challenge packet from the server
|
||||
|
||||
// failure states
|
||||
k_ESNetSocketStateDisconnecting = 21, // the API shut it down, and we're in the process of telling the other end
|
||||
k_ESNetSocketStateDisconnecting = 21, // the API shut it down, and we're in the process of telling the other end
|
||||
k_ESNetSocketStateLocalDisconnect = 22, // the API shut it down, and we've completed shutdown
|
||||
k_ESNetSocketStateTimeoutDuringConnect = 23, // we timed out while trying to creating the connection
|
||||
k_ESNetSocketStateRemoteEndDisconnected = 24, // the remote end has disconnected from us
|
||||
@ -122,13 +124,26 @@ enum ESNetSocketConnectionType
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Functions for making connections and sending data between clients,
|
||||
// traversing NAT's where possible
|
||||
//
|
||||
// NOTE: This interface is deprecated and may be removed in a future release of
|
||||
/// the Steamworks SDK. Please see ISteamNetworkingSockets and
|
||||
/// ISteamNetworkingMessages
|
||||
//-----------------------------------------------------------------------------
|
||||
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
|
||||
//
|
||||
// These APIs are deprecated, and may be removed in a future version of the Steamworks
|
||||
// SDK. See ISteamNetworkingMessages.
|
||||
|
||||
// Sends a P2P packet to the specified user
|
||||
// UDP-like, unreliable and a max packet size of 1200 bytes
|
||||
@ -136,7 +151,7 @@ public:
|
||||
// if we can't get through to the user, an error will be posted via the callback P2PSessionConnectFail_t
|
||||
// see EP2PSend enum above for the descriptions of the different ways of sending packets
|
||||
//
|
||||
// nChannel is a routing number you can use to help route message to different systems - you'll have to call ReadP2PPacket()
|
||||
// nChannel is a routing number you can use to help route message to different systems - you'll have to call ReadP2PPacket()
|
||||
// with the same channel number in order to retrieve the data on the other end
|
||||
// using different channels to talk to the same user will still use the same underlying p2p connection, saving on resources
|
||||
virtual bool SendP2PPacket( CSteamID steamIDRemote, const void *pubData, uint32 cubData, EP2PSend eP2PSendType, int nChannel = 0 ) = 0;
|
||||
@ -177,15 +192,29 @@ public:
|
||||
// or to existing connections that need to automatically reconnect after this value is set.
|
||||
//
|
||||
// P2P packet relay is allowed by default
|
||||
//
|
||||
// NOTE: This function is deprecated and may be removed in a future version of the SDK. For
|
||||
// security purposes, we may decide to relay the traffic to certain peers, even if you pass false
|
||||
// to this function, to prevent revealing the client's IP address top another peer.
|
||||
virtual bool AllowP2PPacketRelay( bool bAllow ) = 0;
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// 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.
|
||||
//
|
||||
// These APIs are deprecated, and may be removed in a future version of the Steamworks
|
||||
// SDK. See ISteamNetworkingSockets.
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@ -198,14 +227,14 @@ public:
|
||||
// pass in 0 if you just want the default local IP
|
||||
// unPort is the port to use
|
||||
// pass in 0 if you don't want users to be able to connect via IP/Port, but expect to be always peer-to-peer connections only
|
||||
virtual SNetListenSocket_t CreateListenSocket( int nVirtualP2PPort, uint32 nIP, uint16 nPort, bool bAllowUseOfPacketRelay ) = 0;
|
||||
virtual SNetListenSocket_t CreateListenSocket( int nVirtualP2PPort, SteamIPAddress_t nIP, uint16 nPort, bool bAllowUseOfPacketRelay ) = 0;
|
||||
|
||||
// creates a socket and begin connection to a remote destination
|
||||
// can connect via a known steamID (client or game server), or directly to an IP
|
||||
// on success will trigger a SocketStatusCallback_t callback
|
||||
// on failure or timeout will trigger a SocketStatusCallback_t callback with a failure code in m_eSNetSocketState
|
||||
virtual SNetSocket_t CreateP2PConnectionSocket( CSteamID steamIDTarget, int nVirtualPort, int nTimeoutSec, bool bAllowUseOfPacketRelay ) = 0;
|
||||
virtual SNetSocket_t CreateConnectionSocket( uint32 nIP, uint16 nPort, int nTimeoutSec ) = 0;
|
||||
virtual SNetSocket_t CreateConnectionSocket( SteamIPAddress_t nIP, uint16 nPort, int nTimeoutSec ) = 0;
|
||||
|
||||
// disconnects the connection to the socket, if any, and invalidates the handle
|
||||
// any unread data on the socket will be thrown away
|
||||
@ -224,13 +253,13 @@ public:
|
||||
// receiving data
|
||||
// returns false if there is no data remaining
|
||||
// fills out *pcubMsgSize with the size of the next message, in bytes
|
||||
virtual bool IsDataAvailableOnSocket( SNetSocket_t hSocket, uint32 *pcubMsgSize ) = 0;
|
||||
virtual bool IsDataAvailableOnSocket( SNetSocket_t hSocket, uint32 *pcubMsgSize ) = 0;
|
||||
|
||||
// fills in pubDest with the contents of the message
|
||||
// messages are always complete, of the same size as was sent (i.e. packetized, not streaming)
|
||||
// if *pcubMsgSize < cubDest, only partial data is written
|
||||
// returns false if no data is available
|
||||
virtual bool RetrieveDataFromSocket( SNetSocket_t hSocket, void *pubDest, uint32 cubDest, uint32 *pcubMsgSize ) = 0;
|
||||
virtual bool RetrieveDataFromSocket( SNetSocket_t hSocket, void *pubDest, uint32 cubDest, uint32 *pcubMsgSize ) = 0;
|
||||
|
||||
// checks for data from any socket that has been connected off this listen socket
|
||||
// returns false if there is no data remaining
|
||||
@ -247,11 +276,11 @@ public:
|
||||
virtual bool RetrieveData( SNetListenSocket_t hListenSocket, void *pubDest, uint32 cubDest, uint32 *pcubMsgSize, SNetSocket_t *phSocket ) = 0;
|
||||
|
||||
// returns information about the specified socket, filling out the contents of the pointers
|
||||
virtual bool GetSocketInfo( SNetSocket_t hSocket, CSteamID *pSteamIDRemote, int *peSocketStatus, uint32 *punIPRemote, uint16 *punPortRemote ) = 0;
|
||||
virtual bool GetSocketInfo( SNetSocket_t hSocket, CSteamID *pSteamIDRemote, int *peSocketStatus, SteamIPAddress_t *punIPRemote, uint16 *punPortRemote ) = 0;
|
||||
|
||||
// returns which local port the listen socket is bound to
|
||||
// *pnIP and *pnPort will be 0 if the socket is set to listen for P2P connections only
|
||||
virtual bool GetListenSocketInfo( SNetListenSocket_t hListenSocket, uint32 *pnIP, uint16 *pnPort ) = 0;
|
||||
virtual bool GetListenSocketInfo( SNetListenSocket_t hListenSocket, SteamIPAddress_t *pnIP, uint16 *pnPort ) = 0;
|
||||
|
||||
// returns true to describe how the socket ended up connecting
|
||||
virtual ESNetSocketConnectionType GetSocketConnectionType( SNetSocket_t hSocket ) = 0;
|
||||
@ -259,7 +288,15 @@ public:
|
||||
// max packet size, in bytes
|
||||
virtual int GetMaxPacketSize( SNetSocket_t hSocket ) = 0;
|
||||
};
|
||||
#define STEAMNETWORKING_INTERFACE_VERSION "SteamNetworking005"
|
||||
#define STEAMNETWORKING_INTERFACE_VERSION "SteamNetworking006"
|
||||
|
||||
// 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 )
|
||||
@ -267,13 +304,13 @@ public:
|
||||
#elif defined( VALVE_CALLBACK_PACK_LARGE )
|
||||
#pragma pack( push, 8 )
|
||||
#else
|
||||
#error isteamclient.h must be included
|
||||
#endif
|
||||
#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
|
||||
// in response, a call to AcceptP2PPacketsFromUser() needs to be made, if you want to talk with them
|
||||
struct P2PSessionRequest_t
|
||||
{
|
||||
{
|
||||
enum { k_iCallback = k_iSteamNetworkingCallbacks + 2 };
|
||||
CSteamID m_steamIDRemote; // user who wants to talk to us
|
||||
};
|
||||
@ -283,7 +320,7 @@ struct P2PSessionRequest_t
|
||||
// all packets queued packets unsent at this point will be dropped
|
||||
// further attempts to send will retry making the connection (but will be dropped if we fail again)
|
||||
struct P2PSessionConnectFail_t
|
||||
{
|
||||
{
|
||||
enum { k_iCallback = k_iSteamNetworkingCallbacks + 3 };
|
||||
CSteamID m_steamIDRemote; // user we were sending packets to
|
||||
uint8 m_eP2PSessionError; // EP2PSessionError indicating why we're having trouble
|
||||
@ -291,9 +328,9 @@ struct P2PSessionConnectFail_t
|
||||
|
||||
|
||||
// callback notification - status of a socket has changed
|
||||
// used as part of the CreateListenSocket() / CreateP2PConnectionSocket()
|
||||
// used as part of the CreateListenSocket() / CreateP2PConnectionSocket()
|
||||
struct SocketStatusCallback_t
|
||||
{
|
||||
{
|
||||
enum { k_iCallback = k_iSteamNetworkingCallbacks + 1 };
|
||||
SNetSocket_t m_hSocket; // the socket used to send/receive data to the remote host
|
||||
SNetListenSocket_t m_hListenSocket; // this is the server socket that we were listening on; NULL if this was an outgoing connection
|
||||
|
198
rehlds/public/steam/isteamnetworkingmessages.h
Normal file
198
rehlds/public/steam/isteamnetworkingmessages.h
Normal file
@ -0,0 +1,198 @@
|
||||
//====== Copyright Valve Corporation, All rights reserved. ====================
|
||||
|
||||
#ifndef ISTEAMNETWORKINGMESSAGES
|
||||
#define ISTEAMNETWORKINGMESSAGES
|
||||
#pragma once
|
||||
|
||||
#include "steamnetworkingtypes.h"
|
||||
#include "steam_api_common.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/// The non-connection-oriented interface to send and receive messages
|
||||
/// (whether they be "clients" or "servers").
|
||||
///
|
||||
/// ISteamNetworkingSockets is connection-oriented (like TCP), meaning you
|
||||
/// need to listen and connect, and then you send messages using a connection
|
||||
/// handle. ISteamNetworkingMessages is more like UDP, in that you can just send
|
||||
/// messages to arbitrary peers at any time. The underlying connections are
|
||||
/// established implicitly.
|
||||
///
|
||||
/// Under the hood ISteamNetworkingMessages works on top of the ISteamNetworkingSockets
|
||||
/// code, so you get the same routing and messaging efficiency. The difference is
|
||||
/// mainly in your responsibility to explicitly establish a connection and
|
||||
/// the type of feedback you get about the state of the connection. Both
|
||||
/// interfaces can do "P2P" communications, and both support both unreliable
|
||||
/// and reliable messages, fragmentation and reassembly.
|
||||
///
|
||||
/// The primary purpose of this interface is to be "like UDP", so that UDP-based code
|
||||
/// can be ported easily to take advantage of relayed connections. If you find
|
||||
/// yourself needing more low level information or control, or to be able to better
|
||||
/// handle failure, then you probably need to use ISteamNetworkingSockets directly.
|
||||
/// Also, note that if your main goal is to obtain a connection between two peers
|
||||
/// without concerning yourself with assigning roles of "client" and "server",
|
||||
/// you may find the symmetric connection mode of ISteamNetworkingSockets useful.
|
||||
/// (See k_ESteamNetworkingConfig_SymmetricConnect.)
|
||||
///
|
||||
class ISteamNetworkingMessages
|
||||
{
|
||||
public:
|
||||
/// Sends a message to the specified host. If we don't already have a session with that user,
|
||||
/// a session is implicitly created. There might be some handshaking that needs to happen
|
||||
/// before we can actually begin sending message data. If this handshaking fails and we can't
|
||||
/// get through, an error will be posted via the callback SteamNetworkingMessagesSessionFailed_t.
|
||||
/// There is no notification when the operation succeeds. (You should have the peer send a reply
|
||||
/// for this purpose.)
|
||||
///
|
||||
/// Sending a message to a host will also implicitly accept any incoming connection from that host.
|
||||
///
|
||||
/// nSendFlags is a bitmask of k_nSteamNetworkingSend_xxx options
|
||||
///
|
||||
/// nRemoteChannel is a routing number you can use to help route message to different systems.
|
||||
/// You'll have to call ReceiveMessagesOnChannel() with the same channel number in order to retrieve
|
||||
/// the data on the other end.
|
||||
///
|
||||
/// Using different channels to talk to the same user will still use the same underlying
|
||||
/// connection, saving on resources. If you don't need this feature, use 0.
|
||||
/// Otherwise, small integers are the most efficient.
|
||||
///
|
||||
/// It is guaranteed that reliable messages to the same host on the same channel
|
||||
/// will be be received by the remote host (if they are received at all) exactly once,
|
||||
/// and in the same order that they were sent.
|
||||
///
|
||||
/// NO other order guarantees exist! In particular, unreliable messages may be dropped,
|
||||
/// received out of order with respect to each other and with respect to reliable data,
|
||||
/// or may be received multiple times. Messages on different channels are *not* guaranteed
|
||||
/// to be received in the order they were sent.
|
||||
///
|
||||
/// A note for those familiar with TCP/IP ports, or converting an existing codebase that
|
||||
/// opened multiple sockets: You might notice that there is only one channel, and with
|
||||
/// TCP/IP each endpoint has a port number. You can think of the channel number as the
|
||||
/// *destination* port. If you need each message to also include a "source port" (so the
|
||||
/// recipient can route the reply), then just put that in your message. That is essentially
|
||||
/// how UDP works!
|
||||
///
|
||||
/// Returns:
|
||||
/// - k_EREsultOK on success.
|
||||
/// - k_EResultNoConnection, if the session has failed or was closed by the peer and
|
||||
/// k_nSteamNetworkingSend_AutoRestartBrokenSession was not specified. (You can
|
||||
/// use GetSessionConnectionInfo to get the details.) In order to acknowledge the
|
||||
/// broken session and start a new one, you must call CloseSessionWithUser, or you may
|
||||
/// repeat the call with k_nSteamNetworkingSend_AutoRestartBrokenSession. See
|
||||
/// k_nSteamNetworkingSend_AutoRestartBrokenSession for more details.
|
||||
/// - See ISteamNetworkingSockets::SendMessageToConnection for more possible return values
|
||||
virtual EResult SendMessageToUser( const SteamNetworkingIdentity &identityRemote, const void *pubData, uint32 cubData, int nSendFlags, int nRemoteChannel ) = 0;
|
||||
|
||||
/// Reads the next message that has been sent from another user via SendMessageToUser() on the given channel.
|
||||
/// Returns number of messages returned into your list. (0 if no message are available on that channel.)
|
||||
///
|
||||
/// When you're done with the message object(s), make sure and call SteamNetworkingMessage_t::Release()!
|
||||
virtual int ReceiveMessagesOnChannel( int nLocalChannel, SteamNetworkingMessage_t **ppOutMessages, int nMaxMessages ) = 0;
|
||||
|
||||
/// Call this in response to a SteamNetworkingMessagesSessionRequest_t callback.
|
||||
/// SteamNetworkingMessagesSessionRequest_t are posted when a user tries to send you a message,
|
||||
/// and you haven't tried to talk to them first. If you don't want to talk to them, just ignore
|
||||
/// the request. If the user continues to send you messages, SteamNetworkingMessagesSessionRequest_t
|
||||
/// callbacks will continue to be posted periodically.
|
||||
///
|
||||
/// Returns false if there is no session with the user pending or otherwise. If there is an
|
||||
/// existing active session, this function will return true, even if it is not pending.
|
||||
///
|
||||
/// Calling SendMessageToUser() will implicitly accepts any pending session request to that user.
|
||||
virtual bool AcceptSessionWithUser( const SteamNetworkingIdentity &identityRemote ) = 0;
|
||||
|
||||
/// Call this when you're done talking to a user to immediately free up resources under-the-hood.
|
||||
/// If the remote user tries to send data to you again, another SteamNetworkingMessagesSessionRequest_t
|
||||
/// callback will be posted.
|
||||
///
|
||||
/// Note that sessions that go unused for a few minutes are automatically timed out.
|
||||
virtual bool CloseSessionWithUser( const SteamNetworkingIdentity &identityRemote ) = 0;
|
||||
|
||||
/// Call this when you're done talking to a user on a specific channel. Once all
|
||||
/// open channels to a user have been closed, the open session to the user will be
|
||||
/// closed, and any new data from this user will trigger a
|
||||
/// SteamSteamNetworkingMessagesSessionRequest_t callback
|
||||
virtual bool CloseChannelWithUser( const SteamNetworkingIdentity &identityRemote, int nLocalChannel ) = 0;
|
||||
|
||||
/// Returns information about the latest state of a connection, if any, with the given peer.
|
||||
/// Primarily intended for debugging purposes, but can also be used to get more detailed
|
||||
/// failure information. (See SendMessageToUser and k_nSteamNetworkingSend_AutoRestartBrokenSession.)
|
||||
///
|
||||
/// Returns the value of SteamNetConnectionInfo_t::m_eState, or k_ESteamNetworkingConnectionState_None
|
||||
/// if no connection exists with specified peer. You may pass nullptr for either parameter if
|
||||
/// you do not need the corresponding details. Note that sessions time out after a while,
|
||||
/// so if a connection fails, or SendMessageToUser returns k_EResultNoConnection, you cannot wait
|
||||
/// indefinitely to obtain the reason for failure.
|
||||
virtual ESteamNetworkingConnectionState GetSessionConnectionInfo( const SteamNetworkingIdentity &identityRemote, SteamNetConnectionInfo_t *pConnectionInfo, SteamNetConnectionRealTimeStatus_t *pQuickStatus ) = 0;
|
||||
};
|
||||
#define STEAMNETWORKINGMESSAGES_INTERFACE_VERSION "SteamNetworkingMessages002"
|
||||
|
||||
//
|
||||
// Callbacks
|
||||
//
|
||||
|
||||
#pragma pack( push, 1 )
|
||||
|
||||
/// Posted when a remote host is sending us a message, and we do not already have a session with them
|
||||
struct SteamNetworkingMessagesSessionRequest_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamNetworkingMessagesCallbacks + 1 };
|
||||
SteamNetworkingIdentity m_identityRemote; // user who wants to talk to us
|
||||
};
|
||||
|
||||
/// Posted when we fail to establish a connection, or we detect that communications
|
||||
/// have been disrupted it an unusual way. There is no notification when a peer proactively
|
||||
/// closes the session. ("Closed by peer" is not a concept of UDP-style communications, and
|
||||
/// SteamNetworkingMessages is primarily intended to make porting UDP code easy.)
|
||||
///
|
||||
/// Remember: callbacks are asynchronous. See notes on SendMessageToUser,
|
||||
/// and k_nSteamNetworkingSend_AutoRestartBrokenSession in particular.
|
||||
///
|
||||
/// Also, if a session times out due to inactivity, no callbacks will be posted. The only
|
||||
/// way to detect that this is happening is that querying the session state may return
|
||||
/// none, connecting, and findingroute again.
|
||||
struct SteamNetworkingMessagesSessionFailed_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamNetworkingMessagesCallbacks + 2 };
|
||||
|
||||
/// Detailed info about the session that failed.
|
||||
/// SteamNetConnectionInfo_t::m_identityRemote indicates who this session
|
||||
/// was with.
|
||||
SteamNetConnectionInfo_t m_info;
|
||||
};
|
||||
|
||||
#pragma pack(pop)
|
||||
|
||||
// Global accessors
|
||||
|
||||
// Using standalone lib
|
||||
#ifdef STEAMNETWORKINGSOCKETS_STANDALONELIB
|
||||
|
||||
static_assert( STEAMNETWORKINGMESSAGES_INTERFACE_VERSION[25] == '2', "Version mismatch" );
|
||||
|
||||
STEAMNETWORKINGSOCKETS_INTERFACE ISteamNetworkingMessages *SteamNetworkingMessages_LibV2();
|
||||
inline ISteamNetworkingMessages *SteamNetworkingMessages_Lib() { return SteamNetworkingMessages_LibV2(); }
|
||||
|
||||
// If running in context of steam, we also define a gameserver instance.
|
||||
STEAMNETWORKINGSOCKETS_INTERFACE ISteamNetworkingMessages *SteamGameServerNetworkingMessages_LibV2();
|
||||
inline ISteamNetworkingMessages *SteamGameServerNetworkingMessages_Lib() { return SteamGameServerNetworkingMessages_LibV2(); }
|
||||
|
||||
#ifndef STEAMNETWORKINGSOCKETS_STEAMAPI
|
||||
inline ISteamNetworkingMessages *SteamNetworkingMessages() { return SteamNetworkingMessages_LibV2(); }
|
||||
inline ISteamNetworkingMessages *SteamGameServerNetworkingMessages() { return SteamGameServerNetworkingMessages_LibV2(); }
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Using Steamworks SDK
|
||||
#ifdef STEAMNETWORKINGSOCKETS_STEAMAPI
|
||||
|
||||
// Steamworks SDK
|
||||
STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamNetworkingMessages *, SteamNetworkingMessages_SteamAPI, STEAMNETWORKINGMESSAGES_INTERFACE_VERSION );
|
||||
STEAM_DEFINE_GAMESERVER_INTERFACE_ACCESSOR( ISteamNetworkingMessages *, SteamGameServerNetworkingMessages_SteamAPI, STEAMNETWORKINGMESSAGES_INTERFACE_VERSION );
|
||||
|
||||
#ifndef STEAMNETWORKINGSOCKETS_STANDALONELIB
|
||||
inline ISteamNetworkingMessages *SteamNetworkingMessages() { return SteamNetworkingMessages_SteamAPI(); }
|
||||
inline ISteamNetworkingMessages *SteamGameServerNetworkingMessages() { return SteamGameServerNetworkingMessages_SteamAPI(); }
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif // ISTEAMNETWORKINGMESSAGES
|
1030
rehlds/public/steam/isteamnetworkingsockets.h
Normal file
1030
rehlds/public/steam/isteamnetworkingsockets.h
Normal file
File diff suppressed because it is too large
Load Diff
500
rehlds/public/steam/isteamnetworkingutils.h
Normal file
500
rehlds/public/steam/isteamnetworkingutils.h
Normal file
@ -0,0 +1,500 @@
|
||||
//====== Copyright Valve Corporation, All rights reserved. ====================
|
||||
//
|
||||
// Purpose: misc networking utilities
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMNETWORKINGUTILS
|
||||
#define ISTEAMNETWORKINGUTILS
|
||||
#pragma once
|
||||
|
||||
#include "steamnetworkingtypes.h"
|
||||
#include "steam_api_common.h"
|
||||
|
||||
struct SteamDatagramRelayAuthTicket;
|
||||
struct SteamRelayNetworkStatus_t;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/// Misc networking utilities for checking the local networking environment
|
||||
/// and estimating pings.
|
||||
class ISteamNetworkingUtils
|
||||
{
|
||||
public:
|
||||
//
|
||||
// Efficient message sending
|
||||
//
|
||||
|
||||
/// Allocate and initialize a message object. Usually the reason
|
||||
/// you call this is to pass it to ISteamNetworkingSockets::SendMessages.
|
||||
/// The returned object will have all of the relevant fields cleared to zero.
|
||||
///
|
||||
/// Optionally you can also request that this system allocate space to
|
||||
/// hold the payload itself. If cbAllocateBuffer is nonzero, the system
|
||||
/// will allocate memory to hold a payload of at least cbAllocateBuffer bytes.
|
||||
/// m_pData will point to the allocated buffer, m_cbSize will be set to the
|
||||
/// size, and m_pfnFreeData will be set to the proper function to free up
|
||||
/// the buffer.
|
||||
///
|
||||
/// If cbAllocateBuffer=0, then no buffer is allocated. m_pData will be NULL,
|
||||
/// m_cbSize will be zero, and m_pfnFreeData will be NULL. You will need to
|
||||
/// set each of these.
|
||||
virtual SteamNetworkingMessage_t *AllocateMessage( int cbAllocateBuffer ) = 0;
|
||||
|
||||
//
|
||||
// Access to Steam Datagram Relay (SDR) network
|
||||
//
|
||||
|
||||
//
|
||||
// Initialization and status check
|
||||
//
|
||||
|
||||
/// If you know that you are going to be using the relay network (for example,
|
||||
/// because you anticipate making P2P connections), call this to initialize the
|
||||
/// relay network. If you do not call this, the initialization will
|
||||
/// be delayed until the first time you use a feature that requires access
|
||||
/// to the relay network, which will delay that first access.
|
||||
///
|
||||
/// You can also call this to force a retry if the previous attempt has failed.
|
||||
/// Performing any action that requires access to the relay network will also
|
||||
/// trigger a retry, and so calling this function is never strictly necessary,
|
||||
/// but it can be useful to call it a program launch time, if access to the
|
||||
/// relay network is anticipated.
|
||||
///
|
||||
/// Use GetRelayNetworkStatus or listen for SteamRelayNetworkStatus_t
|
||||
/// callbacks to know when initialization has completed.
|
||||
/// Typically initialization completes in a few seconds.
|
||||
///
|
||||
/// Note: dedicated servers hosted in known data centers 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 void InitRelayNetworkAccess();
|
||||
|
||||
/// Fetch current status of the relay network.
|
||||
///
|
||||
/// SteamRelayNetworkStatus_t is also a callback. It will be triggered on
|
||||
/// both the user and gameserver interfaces any time the status changes, or
|
||||
/// ping measurement starts or stops.
|
||||
///
|
||||
/// SteamRelayNetworkStatus_t::m_eAvail is returned. If you want
|
||||
/// more details, you can pass a non-NULL value.
|
||||
virtual ESteamNetworkingAvailability GetRelayNetworkStatus( SteamRelayNetworkStatus_t *pDetails ) = 0;
|
||||
|
||||
//
|
||||
// "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 app's matchmaking/coordinating
|
||||
// server to manipulate these objects. (See steamdatagram_gamecoordinator.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 InitRelayNetworkAccess,
|
||||
/// 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 "game coordinator" 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;
|
||||
|
||||
/// 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.)
|
||||
///
|
||||
/// You can use GetRelayNetworkStatus or listen for SteamRelayNetworkStatus_t
|
||||
/// to know when ping measurement completes.
|
||||
virtual bool CheckPingDataUpToDate( float flMaxAgeSeconds ) = 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;
|
||||
|
||||
//
|
||||
// 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.
|
||||
///
|
||||
/// The value here controls the detail level for most messages. You can control the
|
||||
/// detail level for various subsystems (perhaps only for certain connections) by
|
||||
/// adjusting the configuration values k_ESteamNetworkingConfig_LogLevel_Xxxxx.
|
||||
///
|
||||
/// 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. This incurs
|
||||
/// all of the expense of formatting the messages, which are then discarded. Setting a high
|
||||
/// priority value (low numeric value) here allows the library to avoid doing this work.
|
||||
///
|
||||
/// 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;
|
||||
|
||||
//
|
||||
// Fake IP
|
||||
//
|
||||
// Useful for interfacing with code that assumes peers are identified using an IPv4 address
|
||||
//
|
||||
|
||||
/// Return true if an IPv4 address is one that might be used as a "fake" one.
|
||||
/// This function is fast; it just does some logical tests on the IP and does
|
||||
/// not need to do any lookup operations.
|
||||
inline bool IsFakeIPv4( uint32 nIPv4 ) { return GetIPv4FakeIPType( nIPv4 ) > k_ESteamNetworkingFakeIPType_NotFake; }
|
||||
virtual ESteamNetworkingFakeIPType GetIPv4FakeIPType( uint32 nIPv4 ) = 0;
|
||||
|
||||
/// Get the real identity associated with a given FakeIP.
|
||||
///
|
||||
/// On failure, returns:
|
||||
/// - k_EResultInvalidParam: the IP is not a FakeIP.
|
||||
/// - k_EResultNoMatch: we don't recognize that FakeIP and don't know the corresponding identity.
|
||||
///
|
||||
/// FakeIP's used by active connections, or the FakeIPs assigned to local identities,
|
||||
/// will always work. FakeIPs for recently destroyed connections will continue to
|
||||
/// return results for a little while, but not forever. At some point, we will forget
|
||||
/// FakeIPs to save space. It's reasonably safe to assume that you can read back the
|
||||
/// real identity of a connection very soon after it is destroyed. But do not wait
|
||||
/// indefinitely.
|
||||
virtual EResult GetRealIdentityForFakeIP( const SteamNetworkingIPAddr &fakeIP, SteamNetworkingIdentity *pOutRealIdentity ) = 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 SetGlobalConfigValuePtr( ESteamNetworkingConfigValue eValue, void *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 global callbacks. If you do not want to use Steam's callback dispatch mechanism and you
|
||||
// want to use the same callback on all (or most) listen sockets and connections, then
|
||||
// simply install these callbacks first thing, and you are good to go.
|
||||
// See ISteamNetworkingSockets::RunCallbacks
|
||||
//
|
||||
bool SetGlobalCallback_SteamNetConnectionStatusChanged( FnSteamNetConnectionStatusChanged fnCallback );
|
||||
bool SetGlobalCallback_SteamNetAuthenticationStatusChanged( FnSteamNetAuthenticationStatusChanged fnCallback );
|
||||
bool SetGlobalCallback_SteamRelayNetworkStatusChanged( FnSteamRelayNetworkStatusChanged fnCallback );
|
||||
bool SetGlobalCallback_FakeIPResult( FnSteamNetworkingFakeIPResult fnCallback );
|
||||
bool SetGlobalCallback_MessagesSessionRequest( FnSteamNetworkingMessagesSessionRequest fnCallback );
|
||||
bool SetGlobalCallback_MessagesSessionFailed( FnSteamNetworkingMessagesSessionFailed fnCallback );
|
||||
|
||||
/// 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 setting 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 pointers (e.g. 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;
|
||||
|
||||
/// Set a configuration value, using a struct to pass the value.
|
||||
/// (This is just a convenience shortcut; see below for the implementation and
|
||||
/// a little insight into how SteamNetworkingConfigValue_t is used when
|
||||
/// setting config options during listen socket and connection creation.)
|
||||
bool SetConfigValueStruct( const SteamNetworkingConfigValue_t &opt, ESteamNetworkingConfigScope eScopeType, intptr_t scopeObj );
|
||||
|
||||
/// 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;
|
||||
|
||||
/// Get info about a configuration value. Returns the name of the value,
|
||||
/// or NULL if the value doesn't exist. Other output parameters can be NULL
|
||||
/// if you do not need them.
|
||||
virtual const char *GetConfigValueInfo( ESteamNetworkingConfigValue eValue, ESteamNetworkingConfigDataType *pOutDataType,
|
||||
ESteamNetworkingConfigScope *pOutScope ) = 0;
|
||||
|
||||
/// Iterate the list of all configuration values in the current environment that it might
|
||||
/// be possible to display or edit using a generic UI. To get the first iterable value,
|
||||
/// pass k_ESteamNetworkingConfig_Invalid. Returns k_ESteamNetworkingConfig_Invalid
|
||||
/// to signal end of list.
|
||||
///
|
||||
/// The bEnumerateDevVars argument can be used to include "dev" vars. These are vars that
|
||||
/// are recommended to only be editable in "debug" or "dev" mode and typically should not be
|
||||
/// shown in a retail environment where a malicious local user might use this to cheat.
|
||||
virtual ESteamNetworkingConfigValue IterateGenericEditableConfigValues( ESteamNetworkingConfigValue eCurrent, bool bEnumerateDevVars ) = 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 ESteamNetworkingFakeIPType SteamNetworkingIPAddr_GetFakeIPType( const SteamNetworkingIPAddr &addr ) = 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 "SteamNetworkingUtils004"
|
||||
|
||||
// Global accessors
|
||||
// Using standalone lib
|
||||
#ifdef STEAMNETWORKINGSOCKETS_STANDALONELIB
|
||||
|
||||
// Standalone lib
|
||||
static_assert( STEAMNETWORKINGUTILS_INTERFACE_VERSION[22] == '4', "Version mismatch" );
|
||||
STEAMNETWORKINGSOCKETS_INTERFACE ISteamNetworkingUtils *SteamNetworkingUtils_LibV4();
|
||||
inline ISteamNetworkingUtils *SteamNetworkingUtils_Lib() { return SteamNetworkingUtils_LibV4(); }
|
||||
|
||||
#ifndef STEAMNETWORKINGSOCKETS_STEAMAPI
|
||||
inline ISteamNetworkingUtils *SteamNetworkingUtils() { return SteamNetworkingUtils_LibV4(); }
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Using Steamworks SDK
|
||||
#ifdef STEAMNETWORKINGSOCKETS_STEAMAPI
|
||||
STEAM_DEFINE_INTERFACE_ACCESSOR( ISteamNetworkingUtils *, SteamNetworkingUtils_SteamAPI,
|
||||
/* Prefer user version of the interface. But if it isn't found, then use
|
||||
gameserver one. Yes, this is a completely terrible hack */
|
||||
SteamInternal_FindOrCreateUserInterface( 0, STEAMNETWORKINGUTILS_INTERFACE_VERSION ) ?
|
||||
SteamInternal_FindOrCreateUserInterface( 0, STEAMNETWORKINGUTILS_INTERFACE_VERSION ) :
|
||||
SteamInternal_FindOrCreateGameServerInterface( 0, STEAMNETWORKINGUTILS_INTERFACE_VERSION ),
|
||||
"global",
|
||||
STEAMNETWORKINGUTILS_INTERFACE_VERSION
|
||||
)
|
||||
|
||||
#ifndef STEAMNETWORKINGSOCKETS_STANDALONELIB
|
||||
inline ISteamNetworkingUtils *SteamNetworkingUtils() { return SteamNetworkingUtils_SteamAPI(); }
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/// A struct used to describe our readiness to use the relay network.
|
||||
/// To do this we first need to fetch the network configuration,
|
||||
/// which describes what POPs are available.
|
||||
struct SteamRelayNetworkStatus_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamNetworkingUtilsCallbacks + 1 };
|
||||
|
||||
/// Summary status. When this is "current", initialization has
|
||||
/// completed. Anything else means you are not ready yet, or
|
||||
/// there is a significant problem.
|
||||
ESteamNetworkingAvailability m_eAvail;
|
||||
|
||||
/// Nonzero if latency measurement is in progress (or pending,
|
||||
/// awaiting a prerequisite).
|
||||
int m_bPingMeasurementInProgress;
|
||||
|
||||
/// Status obtaining the network config. This is a prerequisite
|
||||
/// for relay network access.
|
||||
///
|
||||
/// Failure to obtain the network config almost always indicates
|
||||
/// a problem with the local internet connection.
|
||||
ESteamNetworkingAvailability m_eAvailNetworkConfig;
|
||||
|
||||
/// Current ability to communicate with ANY relay. Note that
|
||||
/// the complete failure to communicate with any relays almost
|
||||
/// always indicates a problem with the local Internet connection.
|
||||
/// (However, just because you can reach a single relay doesn't
|
||||
/// mean that the local connection is in perfect health.)
|
||||
ESteamNetworkingAvailability m_eAvailAnyRelay;
|
||||
|
||||
/// Non-localized English language status. For diagnostic/debugging
|
||||
/// purposes only.
|
||||
char m_debugMsg[ 256 ];
|
||||
};
|
||||
|
||||
#ifndef API_GEN
|
||||
|
||||
/// Utility class for printing a SteamNetworkingIdentity.
|
||||
/// E.g. printf( "Identity is '%s'\n", SteamNetworkingIdentityRender( identity ).c_str() );
|
||||
struct SteamNetworkingIdentityRender
|
||||
{
|
||||
SteamNetworkingIdentityRender( const SteamNetworkingIdentity &x ) { x.ToString( buf, sizeof(buf) ); }
|
||||
inline const char *c_str() const { return buf; }
|
||||
private:
|
||||
char buf[ SteamNetworkingIdentity::k_cchMaxString ];
|
||||
};
|
||||
|
||||
/// Utility class for printing a SteamNetworkingIPAddrRender.
|
||||
struct SteamNetworkingIPAddrRender
|
||||
{
|
||||
SteamNetworkingIPAddrRender( const SteamNetworkingIPAddr &x, bool bWithPort = true ) { x.ToString( buf, sizeof(buf), bWithPort ); }
|
||||
inline const char *c_str() const { return buf; }
|
||||
private:
|
||||
char buf[ SteamNetworkingIPAddr::k_cchMaxString ];
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Internal stuff
|
||||
|
||||
inline void ISteamNetworkingUtils::InitRelayNetworkAccess() { CheckPingDataUpToDate( 1e10f ); }
|
||||
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::SetGlobalConfigValuePtr( ESteamNetworkingConfigValue eValue, void *val ) { return SetConfigValue( eValue, k_ESteamNetworkingConfig_Global, 0, k_ESteamNetworkingConfig_Ptr, &val ); } // Note: passing pointer to pointer.
|
||||
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 ); }
|
||||
inline bool ISteamNetworkingUtils::SetGlobalCallback_SteamNetConnectionStatusChanged( FnSteamNetConnectionStatusChanged fnCallback ) { return SetGlobalConfigValuePtr( k_ESteamNetworkingConfig_Callback_ConnectionStatusChanged, (void*)fnCallback ); }
|
||||
inline bool ISteamNetworkingUtils::SetGlobalCallback_SteamNetAuthenticationStatusChanged( FnSteamNetAuthenticationStatusChanged fnCallback ) { return SetGlobalConfigValuePtr( k_ESteamNetworkingConfig_Callback_AuthStatusChanged, (void*)fnCallback ); }
|
||||
inline bool ISteamNetworkingUtils::SetGlobalCallback_SteamRelayNetworkStatusChanged( FnSteamRelayNetworkStatusChanged fnCallback ) { return SetGlobalConfigValuePtr( k_ESteamNetworkingConfig_Callback_RelayNetworkStatusChanged, (void*)fnCallback ); }
|
||||
inline bool ISteamNetworkingUtils::SetGlobalCallback_FakeIPResult( FnSteamNetworkingFakeIPResult fnCallback ) { return SetGlobalConfigValuePtr( k_ESteamNetworkingConfig_Callback_FakeIPResult, (void*)fnCallback ); }
|
||||
inline bool ISteamNetworkingUtils::SetGlobalCallback_MessagesSessionRequest( FnSteamNetworkingMessagesSessionRequest fnCallback ) { return SetGlobalConfigValuePtr( k_ESteamNetworkingConfig_Callback_MessagesSessionRequest, (void*)fnCallback ); }
|
||||
inline bool ISteamNetworkingUtils::SetGlobalCallback_MessagesSessionFailed( FnSteamNetworkingMessagesSessionFailed fnCallback ) { return SetGlobalConfigValuePtr( k_ESteamNetworkingConfig_Callback_MessagesSessionFailed, (void*)fnCallback ); }
|
||||
|
||||
inline bool ISteamNetworkingUtils::SetConfigValueStruct( const SteamNetworkingConfigValue_t &opt, ESteamNetworkingConfigScope eScopeType, intptr_t scopeObj )
|
||||
{
|
||||
// Locate the argument. Strings are a special case, since the
|
||||
// "value" (the whole string buffer) doesn't fit in the struct
|
||||
// NOTE: for pointer values, we pass a pointer to the pointer,
|
||||
// we do not pass the pointer directly.
|
||||
const void *pVal = ( opt.m_eDataType == k_ESteamNetworkingConfig_String ) ? (const void *)opt.m_val.m_string : (const void *)&opt.m_val;
|
||||
return SetConfigValue( opt.m_eValue, eScopeType, scopeObj, opt.m_eDataType, pVal );
|
||||
}
|
||||
|
||||
// How to get helper functions.
|
||||
#if defined( STEAMNETWORKINGSOCKETS_STATIC_LINK ) || defined(STEAMNETWORKINGSOCKETS_FOREXPORT) || defined( STEAMNETWORKINGSOCKETS_STANDALONELIB )
|
||||
|
||||
// Call direct to static functions
|
||||
STEAMNETWORKINGSOCKETS_INTERFACE void SteamNetworkingIPAddr_ToString( const SteamNetworkingIPAddr *pAddr, char *buf, size_t cbBuf, bool bWithPort );
|
||||
STEAMNETWORKINGSOCKETS_INTERFACE bool SteamNetworkingIPAddr_ParseString( SteamNetworkingIPAddr *pAddr, const char *pszStr );
|
||||
STEAMNETWORKINGSOCKETS_INTERFACE ESteamNetworkingFakeIPType SteamNetworkingIPAddr_GetFakeIPType( const SteamNetworkingIPAddr *pAddr );
|
||||
STEAMNETWORKINGSOCKETS_INTERFACE void SteamNetworkingIdentity_ToString( const SteamNetworkingIdentity *pIdentity, char *buf, size_t cbBuf );
|
||||
STEAMNETWORKINGSOCKETS_INTERFACE bool SteamNetworkingIdentity_ParseString( SteamNetworkingIdentity *pIdentity, size_t sizeofIdentity, const char *pszStr );
|
||||
inline void SteamNetworkingIPAddr::ToString( char *buf, size_t cbBuf, bool bWithPort ) const { SteamNetworkingIPAddr_ToString( this, buf, cbBuf, bWithPort ); }
|
||||
inline bool SteamNetworkingIPAddr::ParseString( const char *pszStr ) { return SteamNetworkingIPAddr_ParseString( this, pszStr ); }
|
||||
inline ESteamNetworkingFakeIPType SteamNetworkingIPAddr::GetFakeIPType() const { return SteamNetworkingIPAddr_GetFakeIPType( this ); }
|
||||
inline void SteamNetworkingIdentity::ToString( char *buf, size_t cbBuf ) const { SteamNetworkingIdentity_ToString( this, buf, cbBuf ); }
|
||||
inline bool SteamNetworkingIdentity::ParseString( const char *pszStr ) { return SteamNetworkingIdentity_ParseString( this, sizeof(*this), pszStr ); }
|
||||
|
||||
#elif defined( STEAMNETWORKINGSOCKETS_STEAMAPI )
|
||||
// Using steamworks SDK - go through SteamNetworkingUtils()
|
||||
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 ESteamNetworkingFakeIPType SteamNetworkingIPAddr::GetFakeIPType() const { return SteamNetworkingUtils()->SteamNetworkingIPAddr_GetFakeIPType( *this ); }
|
||||
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 ); }
|
||||
#else
|
||||
#error "Invalid config"
|
||||
#endif
|
||||
|
||||
#endif // ISTEAMNETWORKINGUTILS
|
65
rehlds/public/steam/isteamparentalsettings.h
Normal file
65
rehlds/public/steam/isteamparentalsettings.h
Normal file
@ -0,0 +1,65 @@
|
||||
//====== Copyright <20> 2013-, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: Interface to Steam parental settings (Family View)
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMPARENTALSETTINGS_H
|
||||
#define ISTEAMPARENTALSETTINGS_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "steam_api_common.h"
|
||||
|
||||
// Feature types for parental settings
|
||||
enum EParentalFeature
|
||||
{
|
||||
k_EFeatureInvalid = 0,
|
||||
k_EFeatureStore = 1,
|
||||
k_EFeatureCommunity = 2,
|
||||
k_EFeatureProfile = 3,
|
||||
k_EFeatureFriends = 4,
|
||||
k_EFeatureNews = 5,
|
||||
k_EFeatureTrading = 6,
|
||||
k_EFeatureSettings = 7,
|
||||
k_EFeatureConsole = 8,
|
||||
k_EFeatureBrowser = 9,
|
||||
k_EFeatureParentalSetup = 10,
|
||||
k_EFeatureLibrary = 11,
|
||||
k_EFeatureTest = 12,
|
||||
k_EFeatureSiteLicense = 13,
|
||||
k_EFeatureKioskMode_Deprecated = 14,
|
||||
k_EFeatureBlockAlways = 15,
|
||||
k_EFeatureMax
|
||||
};
|
||||
|
||||
class ISteamParentalSettings
|
||||
{
|
||||
public:
|
||||
virtual bool BIsParentalLockEnabled() = 0;
|
||||
virtual bool BIsParentalLockLocked() = 0;
|
||||
|
||||
virtual bool BIsAppBlocked( AppId_t nAppID ) = 0;
|
||||
virtual bool BIsAppInBlockList( AppId_t nAppID ) = 0;
|
||||
|
||||
virtual bool BIsFeatureBlocked( EParentalFeature eFeature ) = 0;
|
||||
virtual bool BIsFeatureInBlockList( EParentalFeature eFeature ) = 0;
|
||||
};
|
||||
|
||||
#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
|
||||
//-----------------------------------------------------------------------------
|
||||
struct SteamParentalSettingsChanged_t
|
||||
{
|
||||
enum { k_iCallback = k_ISteamParentalSettingsCallbacks + 1 };
|
||||
};
|
||||
|
||||
|
||||
#endif // ISTEAMPARENTALSETTINGS_H
|
99
rehlds/public/steam/isteamremoteplay.h
Normal file
99
rehlds/public/steam/isteamremoteplay.h
Normal file
@ -0,0 +1,99 @@
|
||||
//============ Copyright (c) Valve Corporation, All rights reserved. ============
|
||||
|
||||
#ifndef ISTEAMREMOTEPLAY_H
|
||||
#define ISTEAMREMOTEPLAY_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "steam_api_common.h"
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: The form factor of a device
|
||||
//-----------------------------------------------------------------------------
|
||||
enum ESteamDeviceFormFactor
|
||||
{
|
||||
k_ESteamDeviceFormFactorUnknown = 0,
|
||||
k_ESteamDeviceFormFactorPhone = 1,
|
||||
k_ESteamDeviceFormFactorTablet = 2,
|
||||
k_ESteamDeviceFormFactorComputer = 3,
|
||||
k_ESteamDeviceFormFactorTV = 4,
|
||||
k_ESteamDeviceFormFactorVRHeadset = 5,
|
||||
};
|
||||
|
||||
// Steam Remote Play session ID
|
||||
typedef uint32 RemotePlaySessionID_t;
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Functions to provide information about Steam Remote Play sessions
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamRemotePlay
|
||||
{
|
||||
public:
|
||||
// Get the number of currently connected Steam Remote Play sessions
|
||||
virtual uint32 GetSessionCount() = 0;
|
||||
|
||||
// Get the currently connected Steam Remote Play session ID at the specified index. Returns zero if index is out of bounds.
|
||||
virtual RemotePlaySessionID_t GetSessionID( int iSessionIndex ) = 0;
|
||||
|
||||
// Get the SteamID of the connected user
|
||||
virtual CSteamID GetSessionSteamID( RemotePlaySessionID_t unSessionID ) = 0;
|
||||
|
||||
// Get the name of the session client device
|
||||
// This returns NULL if the sessionID is not valid
|
||||
virtual const char *GetSessionClientName( RemotePlaySessionID_t unSessionID ) = 0;
|
||||
|
||||
// Get the form factor of the session client device
|
||||
virtual ESteamDeviceFormFactor GetSessionClientFormFactor( RemotePlaySessionID_t unSessionID ) = 0;
|
||||
|
||||
// Get the resolution, in pixels, of the session client device
|
||||
// This is set to 0x0 if the resolution is not available
|
||||
virtual bool BGetSessionClientResolution( RemotePlaySessionID_t unSessionID, int *pnResolutionX, int *pnResolutionY ) = 0;
|
||||
|
||||
// Start Remote Play Together and optionally show the UI in the overlay
|
||||
// This returns false if Remote Play Together can't be started or your game is not configured for Remote Play Together
|
||||
virtual bool BStartRemotePlayTogether( bool bShowOverlay = true ) = 0;
|
||||
|
||||
// Invite a friend to Remote Play Together, or create a guest invite if steamIDFriend is empty
|
||||
// This will automatically start Remote Play Together if it hasn't already been started
|
||||
// This returns false if the invite can't be sent or your game is not configured for Remote Play Together
|
||||
virtual bool BSendRemotePlayTogetherInvite( CSteamID steamIDFriend ) = 0;
|
||||
};
|
||||
|
||||
#define STEAMREMOTEPLAY_INTERFACE_VERSION "STEAMREMOTEPLAY_INTERFACE_VERSION002"
|
||||
|
||||
// Global interface accessor
|
||||
inline ISteamRemotePlay *SteamRemotePlay();
|
||||
STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamRemotePlay *, SteamRemotePlay, STEAMREMOTEPLAY_INTERFACE_VERSION );
|
||||
|
||||
// callbacks
|
||||
#if defined( VALVE_CALLBACK_PACK_SMALL )
|
||||
#pragma pack( push, 4 )
|
||||
#elif defined( VALVE_CALLBACK_PACK_LARGE )
|
||||
#pragma pack( push, 8 )
|
||||
#else
|
||||
#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx
|
||||
#endif
|
||||
|
||||
|
||||
STEAM_CALLBACK_BEGIN( SteamRemotePlaySessionConnected_t, k_iSteamRemotePlayCallbacks + 1 )
|
||||
STEAM_CALLBACK_MEMBER( 0, RemotePlaySessionID_t, m_unSessionID )
|
||||
STEAM_CALLBACK_END( 0 )
|
||||
|
||||
|
||||
STEAM_CALLBACK_BEGIN( SteamRemotePlaySessionDisconnected_t, k_iSteamRemotePlayCallbacks + 2 )
|
||||
STEAM_CALLBACK_MEMBER( 0, RemotePlaySessionID_t, m_unSessionID )
|
||||
STEAM_CALLBACK_END( 0 )
|
||||
|
||||
|
||||
STEAM_CALLBACK_BEGIN( SteamRemotePlayTogetherGuestInvite_t, k_iSteamRemotePlayCallbacks + 3 )
|
||||
STEAM_CALLBACK_MEMBER_ARRAY( 0, char, m_szConnectURL, 1024 )
|
||||
STEAM_CALLBACK_END( 0 )
|
||||
|
||||
|
||||
#pragma pack( pop )
|
||||
|
||||
|
||||
#endif // #define ISTEAMREMOTEPLAY_H
|
@ -1,4 +1,4 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//====== Copyright <20> 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: public interface to user remote file storage in Steam
|
||||
//
|
||||
@ -10,7 +10,7 @@
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "isteamclient.h"
|
||||
#include "steam_api_common.h"
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@ -28,8 +28,8 @@ const uint32 k_unMaxCloudFileChunkSize = 100 * 1024 * 1024;
|
||||
#elif defined( VALVE_CALLBACK_PACK_LARGE )
|
||||
#pragma pack( push, 8 )
|
||||
#else
|
||||
#error isteamclient.h must be included
|
||||
#endif
|
||||
#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx
|
||||
#endif
|
||||
struct SteamParamStringArray_t
|
||||
{
|
||||
const char ** m_ppStrings;
|
||||
@ -41,6 +41,7 @@ struct SteamParamStringArray_t
|
||||
typedef uint64 UGCHandle_t;
|
||||
typedef uint64 PublishedFileUpdateHandle_t;
|
||||
typedef uint64 PublishedFileId_t;
|
||||
const PublishedFileId_t k_PublishedFileIdInvalid = 0;
|
||||
const UGCHandle_t k_UGCHandleInvalid = 0xffffffffffffffffull;
|
||||
const PublishedFileUpdateHandle_t k_PublishedFileUpdateHandleInvalid = 0xffffffffffffffffull;
|
||||
|
||||
@ -56,12 +57,6 @@ const uint32 k_cchTagListMax = 1024 + 1;
|
||||
const uint32 k_cchFilenameMax = 260;
|
||||
const uint32 k_cchPublishedFileURLMax = 256;
|
||||
|
||||
// Ways to handle a synchronization conflict
|
||||
enum EResolveConflict
|
||||
{
|
||||
k_EResolveConflictKeepClient = 1, // The local version of each file will be used to overwrite the server version
|
||||
k_EResolveConflictKeepServer = 2, // The server version of each file will be used to overwrite the local version
|
||||
};
|
||||
|
||||
enum ERemoteStoragePlatform
|
||||
{
|
||||
@ -70,7 +65,10 @@ enum ERemoteStoragePlatform
|
||||
k_ERemoteStoragePlatformOSX = (1 << 1),
|
||||
k_ERemoteStoragePlatformPS3 = (1 << 2),
|
||||
k_ERemoteStoragePlatformLinux = (1 << 3),
|
||||
k_ERemoteStoragePlatformReserved2 = (1 << 4),
|
||||
k_ERemoteStoragePlatformSwitch = (1 << 4),
|
||||
k_ERemoteStoragePlatformAndroid = (1 << 5),
|
||||
k_ERemoteStoragePlatformIOS = (1 << 6),
|
||||
// NB we get one more before we need to widen some things
|
||||
|
||||
k_ERemoteStoragePlatformAll = 0xffffffff
|
||||
};
|
||||
@ -80,6 +78,7 @@ enum ERemoteStoragePublishedFileVisibility
|
||||
k_ERemoteStoragePublishedFileVisibilityPublic = 0,
|
||||
k_ERemoteStoragePublishedFileVisibilityFriendsOnly = 1,
|
||||
k_ERemoteStoragePublishedFileVisibilityPrivate = 2,
|
||||
k_ERemoteStoragePublishedFileVisibilityUnlisted = 3,
|
||||
};
|
||||
|
||||
|
||||
@ -87,22 +86,27 @@ enum EWorkshopFileType
|
||||
{
|
||||
k_EWorkshopFileTypeFirst = 0,
|
||||
|
||||
k_EWorkshopFileTypeCommunity = 0,
|
||||
k_EWorkshopFileTypeMicrotransaction = 1,
|
||||
k_EWorkshopFileTypeCollection = 2,
|
||||
k_EWorkshopFileTypeArt = 3,
|
||||
k_EWorkshopFileTypeVideo = 4,
|
||||
k_EWorkshopFileTypeScreenshot = 5,
|
||||
k_EWorkshopFileTypeGame = 6,
|
||||
k_EWorkshopFileTypeSoftware = 7,
|
||||
k_EWorkshopFileTypeConcept = 8,
|
||||
k_EWorkshopFileTypeWebGuide = 9,
|
||||
k_EWorkshopFileTypeIntegratedGuide = 10,
|
||||
k_EWorkshopFileTypeMerch = 11,
|
||||
k_EWorkshopFileTypeCommunity = 0, // normal Workshop item that can be subscribed to
|
||||
k_EWorkshopFileTypeMicrotransaction = 1, // Workshop item that is meant to be voted on for the purpose of selling in-game
|
||||
k_EWorkshopFileTypeCollection = 2, // a collection of Workshop or Greenlight items
|
||||
k_EWorkshopFileTypeArt = 3, // artwork
|
||||
k_EWorkshopFileTypeVideo = 4, // external video
|
||||
k_EWorkshopFileTypeScreenshot = 5, // screenshot
|
||||
k_EWorkshopFileTypeGame = 6, // Greenlight game entry
|
||||
k_EWorkshopFileTypeSoftware = 7, // Greenlight software entry
|
||||
k_EWorkshopFileTypeConcept = 8, // Greenlight concept
|
||||
k_EWorkshopFileTypeWebGuide = 9, // Steam web guide
|
||||
k_EWorkshopFileTypeIntegratedGuide = 10, // application integrated guide
|
||||
k_EWorkshopFileTypeMerch = 11, // Workshop merchandise meant to be voted on for the purpose of being sold
|
||||
k_EWorkshopFileTypeControllerBinding = 12, // Steam Controller bindings
|
||||
k_EWorkshopFileTypeSteamworksAccessInvite = 13, // internal
|
||||
k_EWorkshopFileTypeSteamVideo = 14, // Steam video
|
||||
k_EWorkshopFileTypeGameManagedItem = 15, // managed completely by the game, not the user, and not shown on the web
|
||||
k_EWorkshopFileTypeClip = 16, // internal
|
||||
|
||||
// Update k_EWorkshopFileTypeMax if you add values.
|
||||
k_EWorkshopFileTypeMax = 17
|
||||
|
||||
// Update k_EWorkshopFileTypeMax if you add values
|
||||
k_EWorkshopFileTypeMax = 12
|
||||
|
||||
};
|
||||
|
||||
enum EWorkshopVote
|
||||
@ -110,6 +114,7 @@ enum EWorkshopVote
|
||||
k_EWorkshopVoteUnvoted = 0,
|
||||
k_EWorkshopVoteFor = 1,
|
||||
k_EWorkshopVoteAgainst = 2,
|
||||
k_EWorkshopVoteLater = 3,
|
||||
};
|
||||
|
||||
enum EWorkshopFileAction
|
||||
@ -135,8 +140,48 @@ enum EWorkshopVideoProvider
|
||||
k_EWorkshopVideoProviderYoutube = 1
|
||||
};
|
||||
|
||||
|
||||
enum EUGCReadAction
|
||||
{
|
||||
// Keeps the file handle open unless the last byte is read. You can use this when reading large files (over 100MB) in sequential chunks.
|
||||
// If the last byte is read, this will behave the same as k_EUGCRead_Close. Otherwise, it behaves the same as k_EUGCRead_ContinueReading.
|
||||
// This value maintains the same behavior as before the EUGCReadAction parameter was introduced.
|
||||
k_EUGCRead_ContinueReadingUntilFinished = 0,
|
||||
|
||||
// Keeps the file handle open. Use this when using UGCRead to seek to different parts of the file.
|
||||
// When you are done seeking around the file, make a final call with k_EUGCRead_Close to close it.
|
||||
k_EUGCRead_ContinueReading = 1,
|
||||
|
||||
// Frees the file handle. Use this when you're done reading the content.
|
||||
// To read the file from Steam again you will need to call UGCDownload again.
|
||||
k_EUGCRead_Close = 2,
|
||||
};
|
||||
|
||||
enum ERemoteStorageLocalFileChange
|
||||
{
|
||||
k_ERemoteStorageLocalFileChange_Invalid = 0,
|
||||
|
||||
// The file was updated from another device
|
||||
k_ERemoteStorageLocalFileChange_FileUpdated = 1,
|
||||
|
||||
// The file was deleted by another device
|
||||
k_ERemoteStorageLocalFileChange_FileDeleted = 2,
|
||||
};
|
||||
|
||||
enum ERemoteStorageFilePathType
|
||||
{
|
||||
k_ERemoteStorageFilePathType_Invalid = 0,
|
||||
|
||||
// The file is directly accessed by the game and this is the full path
|
||||
k_ERemoteStorageFilePathType_Absolute = 1,
|
||||
|
||||
// The file is accessed via the ISteamRemoteStorage API and this is the filename
|
||||
k_ERemoteStorageFilePathType_APIFilename = 2,
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Functions for accessing, reading and writing files stored remotely
|
||||
// Purpose: Functions for accessing, reading and writing files stored remotely
|
||||
// and cached locally
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamRemoteStorage
|
||||
@ -152,8 +197,17 @@ class ISteamRemoteStorage
|
||||
// file operations
|
||||
virtual bool FileWrite( const char *pchFile, const void *pvData, int32 cubData ) = 0;
|
||||
virtual int32 FileRead( const char *pchFile, void *pvData, int32 cubDataToRead ) = 0;
|
||||
|
||||
STEAM_CALL_RESULT( RemoteStorageFileWriteAsyncComplete_t )
|
||||
virtual SteamAPICall_t FileWriteAsync( const char *pchFile, const void *pvData, uint32 cubData ) = 0;
|
||||
|
||||
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;
|
||||
STEAM_CALL_RESULT( RemoteStorageFileShareResult_t )
|
||||
virtual SteamAPICall_t FileShare( const char *pchFile ) = 0;
|
||||
virtual bool SetSyncPlatforms( const char *pchFile, ERemoteStoragePlatform eRemoteStoragePlatform ) = 0;
|
||||
|
||||
@ -175,7 +229,7 @@ class ISteamRemoteStorage
|
||||
virtual const char *GetFileNameAndSize( int iFile, int32 *pnFileSizeInBytes ) = 0;
|
||||
|
||||
// configuration management
|
||||
virtual bool GetQuota( int32 *pnTotalBytes, int32 *puAvailableBytes ) = 0;
|
||||
virtual bool GetQuota( uint64 *pnTotalBytes, uint64 *puAvailableBytes ) = 0;
|
||||
virtual bool IsCloudEnabledForAccount() = 0;
|
||||
virtual bool IsCloudEnabledForApp() = 0;
|
||||
virtual void SetCloudEnabledForApp( bool bEnabled ) = 0;
|
||||
@ -185,46 +239,30 @@ 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.
|
||||
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
|
||||
// or if the transfer hasn't started yet, so be careful to check for that before dividing to get a percentage
|
||||
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, char **ppchName, int32 *pnFileSizeInBytes, 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.
|
||||
// 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.
|
||||
// Larger files can be read in chunks to reduce memory usage (since both sides of the IPC client and the game itself must allocate
|
||||
// enough memory for each chunk). Once the last byte is read, the file is implicitly closed and further calls to UGCRead will fail
|
||||
// unless UGCDownload is called again.
|
||||
// For especially large files (anything over 100MB) it is a requirement that the file is read in chunks.
|
||||
virtual int32 UGCRead( UGCHandle_t hContent, void *pvData, int32 cubDataToRead, uint32 cOffset ) = 0;
|
||||
virtual int32 UGCRead( UGCHandle_t hContent, void *pvData, int32 cubDataToRead, uint32 cOffset, EUGCReadAction eAction ) = 0;
|
||||
|
||||
// Functions to iterate through UGC that has finished downloading but has not yet been read via UGCRead()
|
||||
virtual int32 GetCachedUGCCount() = 0;
|
||||
virtual UGCHandle_t GetCachedUGCHandle( int32 iCachedContent ) = 0;
|
||||
|
||||
// The following functions are only necessary on the Playstation 3. On PC & Mac, the Steam client will handle these operations for you
|
||||
// On Playstation 3, the game controls which files are stored in the cloud, via FilePersist, FileFetch, and FileForget.
|
||||
|
||||
#if defined(_PS3) || defined(_SERVER)
|
||||
// Connect to Steam and get a list of files in the Cloud - results in a RemoteStorageAppSyncStatusCheck_t callback
|
||||
virtual void GetFileListFromServer() = 0;
|
||||
// Indicate this file should be downloaded in the next sync
|
||||
virtual bool FileFetch( const char *pchFile ) = 0;
|
||||
// Indicate this file should be persisted in the next sync
|
||||
virtual bool FilePersist( const char *pchFile ) = 0;
|
||||
// Pull any requested files down from the Cloud - results in a RemoteStorageAppSyncedClient_t callback
|
||||
virtual bool SynchronizeToClient() = 0;
|
||||
// Upload any requested files to the Cloud - results in a RemoteStorageAppSyncedServer_t callback
|
||||
virtual bool SynchronizeToServer() = 0;
|
||||
// Reset any fetch/persist/etc requests
|
||||
virtual bool ResetFileRequestState() = 0;
|
||||
#endif
|
||||
|
||||
// publishing UGC
|
||||
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;
|
||||
@ -233,33 +271,61 @@ 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;
|
||||
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 -1 will use cached data if it exists, no matter how old it is.
|
||||
// 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.
|
||||
STEAM_CALL_RESULT( RemoteStorageGetPublishedFileDetailsResult_t )
|
||||
virtual SteamAPICall_t GetPublishedFileDetails( PublishedFileId_t unPublishedFileId, uint32 unMaxSecondsOld ) = 0;
|
||||
STEAM_CALL_RESULT( RemoteStorageDeletePublishedFileResult_t )
|
||||
virtual SteamAPICall_t DeletePublishedFile( PublishedFileId_t unPublishedFileId ) = 0;
|
||||
// enumerate the files that the current user published with this app
|
||||
STEAM_CALL_RESULT( RemoteStorageEnumerateUserPublishedFilesResult_t )
|
||||
virtual SteamAPICall_t EnumerateUserPublishedFiles( uint32 unStartIndex ) = 0;
|
||||
STEAM_CALL_RESULT( RemoteStorageSubscribePublishedFileResult_t )
|
||||
virtual SteamAPICall_t SubscribePublishedFile( PublishedFileId_t unPublishedFileId ) = 0;
|
||||
STEAM_CALL_RESULT( RemoteStorageEnumerateUserSubscribedFilesResult_t )
|
||||
virtual SteamAPICall_t EnumerateUserSubscribedFiles( uint32 unStartIndex ) = 0;
|
||||
STEAM_CALL_RESULT( RemoteStorageUnsubscribePublishedFileResult_t )
|
||||
virtual SteamAPICall_t UnsubscribePublishedFile( PublishedFileId_t unPublishedFileId ) = 0;
|
||||
virtual bool UpdatePublishedFileSetChangeDescription( PublishedFileUpdateHandle_t updateHandle, const char *pchChangeDescription ) = 0;
|
||||
STEAM_CALL_RESULT( RemoteStorageGetPublishedItemVoteDetailsResult_t )
|
||||
virtual SteamAPICall_t GetPublishedItemVoteDetails( PublishedFileId_t unPublishedFileId ) = 0;
|
||||
STEAM_CALL_RESULT( RemoteStorageUpdateUserPublishedItemVoteResult_t )
|
||||
virtual SteamAPICall_t UpdateUserPublishedItemVote( PublishedFileId_t unPublishedFileId, bool bVoteUp ) = 0;
|
||||
STEAM_CALL_RESULT( RemoteStorageGetPublishedItemVoteDetailsResult_t )
|
||||
virtual SteamAPICall_t GetUserPublishedItemVoteDetails( PublishedFileId_t unPublishedFileId ) = 0;
|
||||
STEAM_CALL_RESULT( RemoteStorageEnumerateUserPublishedFilesResult_t )
|
||||
virtual SteamAPICall_t EnumerateUserSharedWorkshopFiles( CSteamID steamId, uint32 unStartIndex, SteamParamStringArray_t *pRequiredTags, SteamParamStringArray_t *pExcludedTags ) = 0;
|
||||
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;
|
||||
STEAM_CALL_RESULT( RemoteStorageSetUserPublishedFileActionResult_t )
|
||||
virtual SteamAPICall_t SetUserPublishedFileAction( PublishedFileId_t unPublishedFileId, EWorkshopFileAction eAction ) = 0;
|
||||
STEAM_CALL_RESULT( RemoteStorageEnumeratePublishedFilesByUserActionResult_t )
|
||||
virtual SteamAPICall_t EnumeratePublishedFilesByUserAction( EWorkshopFileAction eAction, uint32 unStartIndex ) = 0;
|
||||
// this method enumerates the public view of workshop files
|
||||
STEAM_CALL_RESULT( RemoteStorageEnumerateWorkshopFilesResult_t )
|
||||
virtual SteamAPICall_t EnumeratePublishedWorkshopFiles( EWorkshopEnumerationType eEnumerationType, uint32 unStartIndex, uint32 unCount, uint32 unDays, SteamParamStringArray_t *pTags, SteamParamStringArray_t *pUserTags ) = 0;
|
||||
|
||||
STEAM_CALL_RESULT( RemoteStorageDownloadUGCResult_t )
|
||||
virtual SteamAPICall_t UGCDownloadToLocation( UGCHandle_t hContent, const char *pchLocation, uint32 unPriority ) = 0;
|
||||
|
||||
// Cloud dynamic state change notification
|
||||
virtual int32 GetLocalFileChangeCount() = 0;
|
||||
virtual const char *GetLocalFileChange( int iFile, ERemoteStorageLocalFileChange *pEChangeType, ERemoteStorageFilePathType *pEFilePathType ) = 0;
|
||||
|
||||
// Indicate to Steam the beginning / end of a set of local file
|
||||
// operations - for example, writing a game save that requires updating two files.
|
||||
virtual bool BeginFileWriteBatch() = 0;
|
||||
virtual bool EndFileWriteBatch() = 0;
|
||||
};
|
||||
|
||||
#define STEAMREMOTESTORAGE_INTERFACE_VERSION "STEAMREMOTESTORAGE_INTERFACE_VERSION011"
|
||||
#define STEAMREMOTESTORAGE_INTERFACE_VERSION "STEAMREMOTESTORAGE_INTERFACE_VERSION016"
|
||||
|
||||
// Global interface accessor
|
||||
inline ISteamRemoteStorage *SteamRemoteStorage();
|
||||
STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamRemoteStorage *, SteamRemoteStorage, STEAMREMOTESTORAGE_INTERFACE_VERSION );
|
||||
|
||||
// callbacks
|
||||
#if defined( VALVE_CALLBACK_PACK_SMALL )
|
||||
@ -267,85 +333,25 @@ class ISteamRemoteStorage
|
||||
#elif defined( VALVE_CALLBACK_PACK_LARGE )
|
||||
#pragma pack( push, 8 )
|
||||
#else
|
||||
#error isteamclient.h must be included
|
||||
#endif
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: sent when the local file cache is fully synced with the server for an app
|
||||
// That means that an application can be started and has all latest files
|
||||
//-----------------------------------------------------------------------------
|
||||
struct RemoteStorageAppSyncedClient_t
|
||||
{
|
||||
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 1 };
|
||||
AppId_t m_nAppID;
|
||||
EResult m_eResult;
|
||||
int m_unNumDownloads;
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: sent when the server is fully synced with the local file cache for an app
|
||||
// That means that we can shutdown Steam and our data is stored on the server
|
||||
//-----------------------------------------------------------------------------
|
||||
struct RemoteStorageAppSyncedServer_t
|
||||
{
|
||||
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 2 };
|
||||
AppId_t m_nAppID;
|
||||
EResult m_eResult;
|
||||
int m_unNumUploads;
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Status of up and downloads during a sync session
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
struct RemoteStorageAppSyncProgress_t
|
||||
{
|
||||
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 3 };
|
||||
char m_rgchCurrentFile[k_cchFilenameMax]; // Current file being transferred
|
||||
AppId_t m_nAppID; // App this info relates to
|
||||
uint32 m_uBytesTransferredThisChunk; // Bytes transferred this chunk
|
||||
double m_dAppPercentComplete; // Percent complete that this app's transfers are
|
||||
bool m_bUploading; // if false, downloading
|
||||
};
|
||||
|
||||
//
|
||||
// IMPORTANT! k_iClientRemoteStorageCallbacks + 4 is used, see iclientremotestorage.h
|
||||
//
|
||||
#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx
|
||||
#endif
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Sent after we've determined the list of files that are out of sync
|
||||
// with the server.
|
||||
//-----------------------------------------------------------------------------
|
||||
struct RemoteStorageAppSyncStatusCheck_t
|
||||
{
|
||||
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 5 };
|
||||
AppId_t m_nAppID;
|
||||
EResult m_eResult;
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Sent after a conflict resolution attempt.
|
||||
//-----------------------------------------------------------------------------
|
||||
struct RemoteStorageConflictResolution_t
|
||||
{
|
||||
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 6 };
|
||||
AppId_t m_nAppID;
|
||||
EResult m_eResult;
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: The result of a call to FileShare()
|
||||
//-----------------------------------------------------------------------------
|
||||
struct RemoteStorageFileShareResult_t
|
||||
{
|
||||
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 7 };
|
||||
enum { k_iCallback = k_iSteamRemoteStorageCallbacks + 7 };
|
||||
EResult m_eResult; // The result of the operation
|
||||
UGCHandle_t m_hFile; // The handle that can be shared with users and features
|
||||
char m_rgchFilename[k_cchFilenameMax]; // The name of the file that was shared
|
||||
};
|
||||
|
||||
|
||||
// k_iClientRemoteStorageCallbacks + 8 is deprecated! Do not reuse
|
||||
// k_iSteamRemoteStorageCallbacks + 8 is deprecated! Do not reuse
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@ -353,19 +359,22 @@ struct RemoteStorageFileShareResult_t
|
||||
//-----------------------------------------------------------------------------
|
||||
struct RemoteStoragePublishFileResult_t
|
||||
{
|
||||
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 9 };
|
||||
enum { k_iCallback = k_iSteamRemoteStorageCallbacks + 9 };
|
||||
EResult m_eResult; // The result of the operation.
|
||||
PublishedFileId_t m_nPublishedFileId;
|
||||
bool m_bUserNeedsToAcceptWorkshopLegalAgreement;
|
||||
};
|
||||
|
||||
// k_iSteamRemoteStorageCallbacks + 10 is deprecated! Do not reuse
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: The result of a call to DeletePublishedFile()
|
||||
//-----------------------------------------------------------------------------
|
||||
struct RemoteStorageDeletePublishedFileResult_t
|
||||
{
|
||||
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 11 };
|
||||
enum { k_iCallback = k_iSteamRemoteStorageCallbacks + 11 };
|
||||
EResult m_eResult; // The result of the operation.
|
||||
PublishedFileId_t m_nPublishedFileId;
|
||||
};
|
||||
@ -376,7 +385,7 @@ struct RemoteStorageDeletePublishedFileResult_t
|
||||
//-----------------------------------------------------------------------------
|
||||
struct RemoteStorageEnumerateUserPublishedFilesResult_t
|
||||
{
|
||||
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 12 };
|
||||
enum { k_iCallback = k_iSteamRemoteStorageCallbacks + 12 };
|
||||
EResult m_eResult; // The result of the operation.
|
||||
int32 m_nResultsReturned;
|
||||
int32 m_nTotalResultCount;
|
||||
@ -389,7 +398,7 @@ struct RemoteStorageEnumerateUserPublishedFilesResult_t
|
||||
//-----------------------------------------------------------------------------
|
||||
struct RemoteStorageSubscribePublishedFileResult_t
|
||||
{
|
||||
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 13 };
|
||||
enum { k_iCallback = k_iSteamRemoteStorageCallbacks + 13 };
|
||||
EResult m_eResult; // The result of the operation.
|
||||
PublishedFileId_t m_nPublishedFileId;
|
||||
};
|
||||
@ -400,7 +409,7 @@ struct RemoteStorageSubscribePublishedFileResult_t
|
||||
//-----------------------------------------------------------------------------
|
||||
struct RemoteStorageEnumerateUserSubscribedFilesResult_t
|
||||
{
|
||||
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 14 };
|
||||
enum { k_iCallback = k_iSteamRemoteStorageCallbacks + 14 };
|
||||
EResult m_eResult; // The result of the operation.
|
||||
int32 m_nResultsReturned;
|
||||
int32 m_nTotalResultCount;
|
||||
@ -413,7 +422,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
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@ -421,7 +430,7 @@ struct RemoteStorageEnumerateUserSubscribedFilesResult_t
|
||||
//-----------------------------------------------------------------------------
|
||||
struct RemoteStorageUnsubscribePublishedFileResult_t
|
||||
{
|
||||
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 15 };
|
||||
enum { k_iCallback = k_iSteamRemoteStorageCallbacks + 15 };
|
||||
EResult m_eResult; // The result of the operation.
|
||||
PublishedFileId_t m_nPublishedFileId;
|
||||
};
|
||||
@ -432,7 +441,7 @@ struct RemoteStorageUnsubscribePublishedFileResult_t
|
||||
//-----------------------------------------------------------------------------
|
||||
struct RemoteStorageUpdatePublishedFileResult_t
|
||||
{
|
||||
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 16 };
|
||||
enum { k_iCallback = k_iSteamRemoteStorageCallbacks + 16 };
|
||||
EResult m_eResult; // The result of the operation.
|
||||
PublishedFileId_t m_nPublishedFileId;
|
||||
bool m_bUserNeedsToAcceptWorkshopLegalAgreement;
|
||||
@ -444,12 +453,12 @@ struct RemoteStorageUpdatePublishedFileResult_t
|
||||
//-----------------------------------------------------------------------------
|
||||
struct RemoteStorageDownloadUGCResult_t
|
||||
{
|
||||
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 17 };
|
||||
enum { k_iCallback = k_iSteamRemoteStorageCallbacks + 17 };
|
||||
EResult m_eResult; // The result of the operation.
|
||||
UGCHandle_t m_hFile; // The handle to the file that was attempted to be downloaded.
|
||||
AppId_t m_nAppID; // ID of the app that created this file.
|
||||
int32 m_nSizeInBytes; // The size of the file that was downloaded, in bytes.
|
||||
char m_pchFileName[k_cchFilenameMax]; // The name of the file that was downloaded.
|
||||
char m_pchFileName[k_cchFilenameMax]; // The name of the file that was downloaded.
|
||||
uint64 m_ulSteamIDOwner; // Steam ID of the user who created this content.
|
||||
};
|
||||
|
||||
@ -459,7 +468,7 @@ struct RemoteStorageDownloadUGCResult_t
|
||||
//-----------------------------------------------------------------------------
|
||||
struct RemoteStorageGetPublishedFileDetailsResult_t
|
||||
{
|
||||
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 18 };
|
||||
enum { k_iCallback = k_iSteamRemoteStorageCallbacks + 18 };
|
||||
EResult m_eResult; // The result of the operation.
|
||||
PublishedFileId_t m_nPublishedFileId;
|
||||
AppId_t m_nCreatorAppID; // ID of the app that created this file.
|
||||
@ -480,17 +489,20 @@ struct RemoteStorageGetPublishedFileDetailsResult_t
|
||||
int32 m_nPreviewFileSize; // Size of the preview file
|
||||
char m_rgchURL[k_cchPublishedFileURLMax]; // URL (for a video or a website)
|
||||
EWorkshopFileType m_eFileType; // Type of the file
|
||||
bool m_bAcceptedForUse; // developer has specifically flagged this item as accepted in the Workshop
|
||||
};
|
||||
|
||||
|
||||
struct RemoteStorageEnumerateWorkshopFilesResult_t
|
||||
{
|
||||
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 19 };
|
||||
enum { k_iCallback = k_iSteamRemoteStorageCallbacks + 19 };
|
||||
EResult m_eResult;
|
||||
int32 m_nResultsReturned;
|
||||
int32 m_nTotalResultCount;
|
||||
PublishedFileId_t m_rgPublishedFileId[ k_unEnumeratePublishedFilesMaxResults ];
|
||||
float m_rgScore[ k_unEnumeratePublishedFilesMaxResults ];
|
||||
AppId_t m_nAppId;
|
||||
uint32 m_unStartIndex;
|
||||
};
|
||||
|
||||
|
||||
@ -499,7 +511,7 @@ struct RemoteStorageEnumerateWorkshopFilesResult_t
|
||||
//-----------------------------------------------------------------------------
|
||||
struct RemoteStorageGetPublishedItemVoteDetailsResult_t
|
||||
{
|
||||
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 20 };
|
||||
enum { k_iCallback = k_iSteamRemoteStorageCallbacks + 20 };
|
||||
EResult m_eResult;
|
||||
PublishedFileId_t m_unPublishedFileId;
|
||||
int32 m_nVotesFor;
|
||||
@ -514,7 +526,7 @@ struct RemoteStorageGetPublishedItemVoteDetailsResult_t
|
||||
//-----------------------------------------------------------------------------
|
||||
struct RemoteStoragePublishedFileSubscribed_t
|
||||
{
|
||||
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 21 };
|
||||
enum { k_iCallback = k_iSteamRemoteStorageCallbacks + 21 };
|
||||
PublishedFileId_t m_nPublishedFileId; // The published file id
|
||||
AppId_t m_nAppID; // ID of the app that will consume this file.
|
||||
};
|
||||
@ -524,7 +536,7 @@ struct RemoteStoragePublishedFileSubscribed_t
|
||||
//-----------------------------------------------------------------------------
|
||||
struct RemoteStoragePublishedFileUnsubscribed_t
|
||||
{
|
||||
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 22 };
|
||||
enum { k_iCallback = k_iSteamRemoteStorageCallbacks + 22 };
|
||||
PublishedFileId_t m_nPublishedFileId; // The published file id
|
||||
AppId_t m_nAppID; // ID of the app that will consume this file.
|
||||
};
|
||||
@ -535,7 +547,7 @@ struct RemoteStoragePublishedFileUnsubscribed_t
|
||||
//-----------------------------------------------------------------------------
|
||||
struct RemoteStoragePublishedFileDeleted_t
|
||||
{
|
||||
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 23 };
|
||||
enum { k_iCallback = k_iSteamRemoteStorageCallbacks + 23 };
|
||||
PublishedFileId_t m_nPublishedFileId; // The published file id
|
||||
AppId_t m_nAppID; // ID of the app that will consume this file.
|
||||
};
|
||||
@ -546,7 +558,7 @@ struct RemoteStoragePublishedFileDeleted_t
|
||||
//-----------------------------------------------------------------------------
|
||||
struct RemoteStorageUpdateUserPublishedItemVoteResult_t
|
||||
{
|
||||
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 24 };
|
||||
enum { k_iCallback = k_iSteamRemoteStorageCallbacks + 24 };
|
||||
EResult m_eResult; // The result of the operation.
|
||||
PublishedFileId_t m_nPublishedFileId; // The published file id
|
||||
};
|
||||
@ -557,7 +569,7 @@ struct RemoteStorageUpdateUserPublishedItemVoteResult_t
|
||||
//-----------------------------------------------------------------------------
|
||||
struct RemoteStorageUserVoteDetails_t
|
||||
{
|
||||
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 25 };
|
||||
enum { k_iCallback = k_iSteamRemoteStorageCallbacks + 25 };
|
||||
EResult m_eResult; // The result of the operation.
|
||||
PublishedFileId_t m_nPublishedFileId; // The published file id
|
||||
EWorkshopVote m_eVote; // what the user voted
|
||||
@ -565,7 +577,7 @@ struct RemoteStorageUserVoteDetails_t
|
||||
|
||||
struct RemoteStorageEnumerateUserSharedWorkshopFilesResult_t
|
||||
{
|
||||
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 26 };
|
||||
enum { k_iCallback = k_iSteamRemoteStorageCallbacks + 26 };
|
||||
EResult m_eResult; // The result of the operation.
|
||||
int32 m_nResultsReturned;
|
||||
int32 m_nTotalResultCount;
|
||||
@ -574,7 +586,7 @@ struct RemoteStorageEnumerateUserSharedWorkshopFilesResult_t
|
||||
|
||||
struct RemoteStorageSetUserPublishedFileActionResult_t
|
||||
{
|
||||
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 27 };
|
||||
enum { k_iCallback = k_iSteamRemoteStorageCallbacks + 27 };
|
||||
EResult m_eResult; // The result of the operation.
|
||||
PublishedFileId_t m_nPublishedFileId; // The published file id
|
||||
EWorkshopFileAction m_eAction; // the action that was attempted
|
||||
@ -582,7 +594,7 @@ struct RemoteStorageSetUserPublishedFileActionResult_t
|
||||
|
||||
struct RemoteStorageEnumeratePublishedFilesByUserActionResult_t
|
||||
{
|
||||
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 28 };
|
||||
enum { k_iCallback = k_iSteamRemoteStorageCallbacks + 28 };
|
||||
EResult m_eResult; // The result of the operation.
|
||||
EWorkshopFileAction m_eAction; // the action that was filtered on
|
||||
int32 m_nResultsReturned;
|
||||
@ -597,12 +609,51 @@ struct RemoteStorageEnumeratePublishedFilesByUserActionResult_t
|
||||
//-----------------------------------------------------------------------------
|
||||
struct RemoteStoragePublishFileProgress_t
|
||||
{
|
||||
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 29 };
|
||||
enum { k_iCallback = k_iSteamRemoteStorageCallbacks + 29 };
|
||||
double m_dPercentFile;
|
||||
bool m_bPreview;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Called when the content for a published file is updated
|
||||
//-----------------------------------------------------------------------------
|
||||
struct RemoteStoragePublishedFileUpdated_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamRemoteStorageCallbacks + 30 };
|
||||
PublishedFileId_t m_nPublishedFileId; // The published file id
|
||||
AppId_t m_nAppID; // ID of the app that will consume this file.
|
||||
uint64 m_ulUnused; // not used anymore
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Called when a FileWriteAsync completes
|
||||
//-----------------------------------------------------------------------------
|
||||
struct RemoteStorageFileWriteAsyncComplete_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamRemoteStorageCallbacks + 31 };
|
||||
EResult m_eResult; // result
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Called when a FileReadAsync completes
|
||||
//-----------------------------------------------------------------------------
|
||||
struct RemoteStorageFileReadAsyncComplete_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamRemoteStorageCallbacks + 32 };
|
||||
SteamAPICall_t m_hFileReadAsync; // call handle of the async read which was made
|
||||
EResult m_eResult; // result
|
||||
uint32 m_nOffset; // offset in the file this read was at
|
||||
uint32 m_cubRead; // amount read - will the <= the amount requested
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: one or more files for this app have changed locally after syncing
|
||||
// to remote session changes
|
||||
// Note: only posted if this happens DURING the local app session
|
||||
//-----------------------------------------------------------------------------
|
||||
STEAM_CALLBACK_BEGIN( RemoteStorageLocalFileChange_t, k_iSteamRemoteStorageCallbacks + 33 )
|
||||
STEAM_CALLBACK_END( 0 )
|
||||
|
||||
#pragma pack( pop )
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//====== Copyright <20> 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: public interface to user remote file storage in Steam
|
||||
//
|
||||
@ -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;
|
||||
@ -22,9 +22,19 @@ const int k_cubUFSTagValueMax = 255;
|
||||
const int k_ScreenshotThumbWidth = 200;
|
||||
|
||||
// Handle is valid for the lifetime of your process and no longer
|
||||
typedef uint32 ScreenshotHandle;
|
||||
typedef uint32 ScreenshotHandle;
|
||||
#define INVALID_SCREENSHOT_HANDLE 0
|
||||
|
||||
enum EVRScreenshotType
|
||||
{
|
||||
k_EVRScreenshotType_None = 0,
|
||||
k_EVRScreenshotType_Mono = 1,
|
||||
k_EVRScreenshotType_Stereo = 2,
|
||||
k_EVRScreenshotType_MonoCubemap = 3,
|
||||
k_EVRScreenshotType_MonoPanorama = 4,
|
||||
k_EVRScreenshotType_StereoPanorama = 5
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Functions for adding screenshots to the user's screenshot library
|
||||
//-----------------------------------------------------------------------------
|
||||
@ -41,7 +51,7 @@ public:
|
||||
// JPEG, TGA, and PNG formats are supported.
|
||||
virtual ScreenshotHandle AddScreenshotToLibrary( const char *pchFilename, const char *pchThumbnailFilename, int nWidth, int nHeight ) = 0;
|
||||
|
||||
// Causes the Steam overlay to take a screenshot. If screenshots are being hooked by the game then a ScreenshotRequested_t callback is sent back to the game instead.
|
||||
// Causes the Steam overlay to take a screenshot. If screenshots are being hooked by the game then a ScreenshotRequested_t callback is sent back to the game instead.
|
||||
virtual void TriggerScreenshot() = 0;
|
||||
|
||||
// Toggles whether the overlay handles screenshots when the user presses the screenshot hotkey, or the game handles them. If the game is hooking screenshots,
|
||||
@ -51,15 +61,29 @@ public:
|
||||
|
||||
// Sets metadata about a screenshot's location (for example, the name of the map)
|
||||
virtual bool SetLocation( ScreenshotHandle hScreenshot, const char *pchLocation ) = 0;
|
||||
|
||||
|
||||
// Tags a user as being visible in the screenshot
|
||||
virtual bool TagUser( ScreenshotHandle hScreenshot, CSteamID steamID ) = 0;
|
||||
|
||||
// Tags a published file as being visible in the screenshot
|
||||
virtual bool TagPublishedFile( ScreenshotHandle hScreenshot, PublishedFileId_t unPublishedFileID ) = 0;
|
||||
|
||||
// Returns true if the app has hooked the screenshot
|
||||
virtual bool IsScreenshotsHooked() = 0;
|
||||
|
||||
// Adds a VR screenshot to the user's screenshot library from disk in the supported type.
|
||||
// pchFilename should be the normal 2D image used in the library view
|
||||
// pchVRFilename should contain the image that matches the correct type
|
||||
// The return value is a handle that is valid for the duration of the game process and can be used to apply tags.
|
||||
// JPEG, TGA, and PNG formats are supported.
|
||||
virtual ScreenshotHandle AddVRScreenshotToLibrary( EVRScreenshotType eType, const char *pchFilename, const char *pchVRFilename ) = 0;
|
||||
};
|
||||
|
||||
#define STEAMSCREENSHOTS_INTERFACE_VERSION "STEAMSCREENSHOTS_INTERFACE_VERSION002"
|
||||
#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 )
|
||||
@ -67,8 +91,8 @@ public:
|
||||
#elif defined( VALVE_CALLBACK_PACK_LARGE )
|
||||
#pragma pack( push, 8 )
|
||||
#else
|
||||
#error isteamclient.h must be included
|
||||
#endif
|
||||
#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx
|
||||
#endif
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Screenshot successfully written or otherwise added to the library
|
||||
// and can now be tagged
|
||||
@ -92,5 +116,5 @@ struct ScreenshotRequested_t
|
||||
|
||||
#pragma pack( pop )
|
||||
|
||||
|
||||
#endif // ISTEAMSCREENSHOTS_H
|
||||
|
||||
|
118
rehlds/public/steam/isteamtimeline.h
Normal file
118
rehlds/public/steam/isteamtimeline.h
Normal file
@ -0,0 +1,118 @@
|
||||
//====== Copyright © Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: interface to Steam Timeline
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMTIMELINE_H
|
||||
#define ISTEAMTIMELINE_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "steam_api_common.h"
|
||||
|
||||
// callbacks
|
||||
#if defined( VALVE_CALLBACK_PACK_SMALL )
|
||||
#pragma pack( push, 4 )
|
||||
#elif defined( VALVE_CALLBACK_PACK_LARGE )
|
||||
#pragma pack( push, 8 )
|
||||
#else
|
||||
#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx
|
||||
#endif
|
||||
|
||||
// Controls the color of the timeline bar segments. The value names listed here map to a multiplayer game, where
|
||||
// the user starts a game (in menus), then joins a multiplayer session that first has a character selection lobby
|
||||
// then finally the multiplayer session starts. However, you can also map these values to any type of game. In a single
|
||||
// player game where you visit towns & dungeons, you could set k_ETimelineGameMode_Menus when the player is in a town
|
||||
// buying items, k_ETimelineGameMode_Staging for when a dungeon is loading and k_ETimelineGameMode_Playing for when
|
||||
// inside the dungeon fighting monsters.
|
||||
enum ETimelineGameMode
|
||||
{
|
||||
k_ETimelineGameMode_Invalid = 0,
|
||||
k_ETimelineGameMode_Playing = 1,
|
||||
k_ETimelineGameMode_Staging = 2,
|
||||
k_ETimelineGameMode_Menus = 3,
|
||||
k_ETimelineGameMode_LoadingScreen = 4,
|
||||
|
||||
k_ETimelineGameMode_Max, // one past the last valid value
|
||||
};
|
||||
|
||||
// Used in AddTimelineEvent, where Featured events will be offered before Standard events
|
||||
enum ETimelineEventClipPriority
|
||||
{
|
||||
k_ETimelineEventClipPriority_Invalid = 0,
|
||||
k_ETimelineEventClipPriority_None = 1,
|
||||
k_ETimelineEventClipPriority_Standard = 2,
|
||||
k_ETimelineEventClipPriority_Featured = 3,
|
||||
};
|
||||
|
||||
const uint32 k_unMaxTimelinePriority = 1000;
|
||||
const float k_flMaxTimelineEventDuration = 600.f;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Steam Timeline API
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamTimeline
|
||||
{
|
||||
public:
|
||||
|
||||
// Sets a description for the current game state in the timeline. These help the user to find specific
|
||||
// moments in the timeline when saving clips. Setting a new state description replaces any previous
|
||||
// description.
|
||||
//
|
||||
// Examples could include:
|
||||
// * Where the user is in the world in a single player game
|
||||
// * Which round is happening in a multiplayer game
|
||||
// * The current score for a sports game
|
||||
//
|
||||
// Parameters:
|
||||
// - pchDescription: provide a localized string in the language returned by SteamUtils()->GetSteamUILanguage()
|
||||
// - flTimeDelta: The time offset in seconds to apply to this event. Negative times indicate an
|
||||
// event that happened in the past.
|
||||
virtual void SetTimelineStateDescription( const char *pchDescription, float flTimeDelta ) = 0;
|
||||
virtual void ClearTimelineStateDescription( float flTimeDelta ) = 0;
|
||||
|
||||
// Use this to mark an event on the Timeline. The event can be instantaneous or take some amount of time
|
||||
// to complete, depending on the value passed in flDurationSeconds
|
||||
//
|
||||
// Examples could include:
|
||||
// * a boss battle
|
||||
// * a cut scene
|
||||
// * a large team fight
|
||||
// * picking up a new weapon or ammunition
|
||||
// * scoring a goal
|
||||
//
|
||||
// Parameters:
|
||||
//
|
||||
// - pchIcon: specify the name of the icon uploaded through the Steamworks Partner Site for your title
|
||||
// or one of the provided icons that start with steam_
|
||||
// - pchTitle & pchDescription: provide a localized string in the language returned by
|
||||
// SteamUtils()->GetSteamUILanguage()
|
||||
// - unPriority: specify how important this range is compared to other markers provided by the game.
|
||||
// Ranges with larger priority values will be displayed more prominently in the UI. This value
|
||||
// may be between 0 and k_unMaxTimelinePriority.
|
||||
// - flStartOffsetSeconds: The time that this range started relative to now. Negative times
|
||||
// indicate an event that happened in the past.
|
||||
// - flDurationSeconds: How long the time range should be in seconds. For instantaneous events, this
|
||||
// should be 0
|
||||
// - ePossibleClip: By setting this parameter to Featured or Standard, the game indicates to Steam that it
|
||||
// would be appropriate to offer this range as a clip to the user. For instantaneous events, the
|
||||
// suggested clip will be for a short time before and after the event itself.
|
||||
virtual void AddTimelineEvent( const char *pchIcon, const char *pchTitle, const char *pchDescription, uint32 unPriority, float flStartOffsetSeconds, float flDurationSeconds, ETimelineEventClipPriority ePossibleClip ) = 0;
|
||||
|
||||
// Changes the color of the timeline bar. See ETimelineGameMode comments for how to use each value
|
||||
virtual void SetTimelineGameMode( ETimelineGameMode eMode ) = 0;
|
||||
};
|
||||
|
||||
#define STEAMTIMELINE_INTERFACE_VERSION "STEAMTIMELINE_INTERFACE_V001"
|
||||
|
||||
// Global interface accessor
|
||||
inline ISteamTimeline *SteamTimeline();
|
||||
STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamTimeline *, SteamTimeline, STEAMTIMELINE_INTERFACE_VERSION );
|
||||
|
||||
|
||||
#pragma pack( pop )
|
||||
|
||||
|
||||
#endif // ISTEAMTIMELINE_H
|
632
rehlds/public/steam/isteamugc.h
Normal file
632
rehlds/public/steam/isteamugc.h
Normal file
@ -0,0 +1,632 @@
|
||||
//====== Copyright 1996-2013, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: interface to steam ugc
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMUGC_H
|
||||
#define ISTEAMUGC_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "steam_api_common.h"
|
||||
#include "isteamremotestorage.h"
|
||||
|
||||
// callbacks
|
||||
#if defined( VALVE_CALLBACK_PACK_SMALL )
|
||||
#pragma pack( push, 4 )
|
||||
#elif defined( VALVE_CALLBACK_PACK_LARGE )
|
||||
#pragma pack( push, 8 )
|
||||
#else
|
||||
#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx
|
||||
#endif
|
||||
|
||||
|
||||
typedef uint64 UGCQueryHandle_t;
|
||||
typedef uint64 UGCUpdateHandle_t;
|
||||
|
||||
|
||||
const UGCQueryHandle_t k_UGCQueryHandleInvalid = 0xffffffffffffffffull;
|
||||
const UGCUpdateHandle_t k_UGCUpdateHandleInvalid = 0xffffffffffffffffull;
|
||||
|
||||
|
||||
// Matching UGC types for queries
|
||||
enum EUGCMatchingUGCType
|
||||
{
|
||||
k_EUGCMatchingUGCType_Items = 0, // both mtx items and ready-to-use items
|
||||
k_EUGCMatchingUGCType_Items_Mtx = 1,
|
||||
k_EUGCMatchingUGCType_Items_ReadyToUse = 2,
|
||||
k_EUGCMatchingUGCType_Collections = 3,
|
||||
k_EUGCMatchingUGCType_Artwork = 4,
|
||||
k_EUGCMatchingUGCType_Videos = 5,
|
||||
k_EUGCMatchingUGCType_Screenshots = 6,
|
||||
k_EUGCMatchingUGCType_AllGuides = 7, // both web guides and integrated guides
|
||||
k_EUGCMatchingUGCType_WebGuides = 8,
|
||||
k_EUGCMatchingUGCType_IntegratedGuides = 9,
|
||||
k_EUGCMatchingUGCType_UsableInGame = 10, // ready-to-use items and integrated guides
|
||||
k_EUGCMatchingUGCType_ControllerBindings = 11,
|
||||
k_EUGCMatchingUGCType_GameManagedItems = 12, // game managed items (not managed by users)
|
||||
k_EUGCMatchingUGCType_All = ~0, // @note: will only be valid for CreateQueryUserUGCRequest requests
|
||||
};
|
||||
|
||||
// Different lists of published UGC for a user.
|
||||
// If the current logged in user is different than the specified user, then some options may not be allowed.
|
||||
enum EUserUGCList
|
||||
{
|
||||
k_EUserUGCList_Published,
|
||||
k_EUserUGCList_VotedOn,
|
||||
k_EUserUGCList_VotedUp,
|
||||
k_EUserUGCList_VotedDown,
|
||||
k_EUserUGCList_WillVoteLater,
|
||||
k_EUserUGCList_Favorited,
|
||||
k_EUserUGCList_Subscribed,
|
||||
k_EUserUGCList_UsedOrPlayed,
|
||||
k_EUserUGCList_Followed,
|
||||
};
|
||||
|
||||
// Sort order for user published UGC lists (defaults to creation order descending)
|
||||
enum EUserUGCListSortOrder
|
||||
{
|
||||
k_EUserUGCListSortOrder_CreationOrderDesc,
|
||||
k_EUserUGCListSortOrder_CreationOrderAsc,
|
||||
k_EUserUGCListSortOrder_TitleAsc,
|
||||
k_EUserUGCListSortOrder_LastUpdatedDesc,
|
||||
k_EUserUGCListSortOrder_SubscriptionDateDesc,
|
||||
k_EUserUGCListSortOrder_VoteScoreDesc,
|
||||
k_EUserUGCListSortOrder_ForModeration,
|
||||
};
|
||||
|
||||
// Combination of sorting and filtering for queries across all UGC
|
||||
enum EUGCQuery
|
||||
{
|
||||
k_EUGCQuery_RankedByVote = 0,
|
||||
k_EUGCQuery_RankedByPublicationDate = 1,
|
||||
k_EUGCQuery_AcceptedForGameRankedByAcceptanceDate = 2,
|
||||
k_EUGCQuery_RankedByTrend = 3,
|
||||
k_EUGCQuery_FavoritedByFriendsRankedByPublicationDate = 4,
|
||||
k_EUGCQuery_CreatedByFriendsRankedByPublicationDate = 5,
|
||||
k_EUGCQuery_RankedByNumTimesReported = 6,
|
||||
k_EUGCQuery_CreatedByFollowedUsersRankedByPublicationDate = 7,
|
||||
k_EUGCQuery_NotYetRated = 8,
|
||||
k_EUGCQuery_RankedByTotalVotesAsc = 9,
|
||||
k_EUGCQuery_RankedByVotesUp = 10,
|
||||
k_EUGCQuery_RankedByTextSearch = 11,
|
||||
k_EUGCQuery_RankedByTotalUniqueSubscriptions = 12,
|
||||
k_EUGCQuery_RankedByPlaytimeTrend = 13,
|
||||
k_EUGCQuery_RankedByTotalPlaytime = 14,
|
||||
k_EUGCQuery_RankedByAveragePlaytimeTrend = 15,
|
||||
k_EUGCQuery_RankedByLifetimeAveragePlaytime = 16,
|
||||
k_EUGCQuery_RankedByPlaytimeSessionsTrend = 17,
|
||||
k_EUGCQuery_RankedByLifetimePlaytimeSessions = 18,
|
||||
k_EUGCQuery_RankedByLastUpdatedDate = 19,
|
||||
};
|
||||
|
||||
enum EItemUpdateStatus
|
||||
{
|
||||
k_EItemUpdateStatusInvalid = 0, // The item update handle was invalid, job might be finished, listen too SubmitItemUpdateResult_t
|
||||
k_EItemUpdateStatusPreparingConfig = 1, // The item update is processing configuration data
|
||||
k_EItemUpdateStatusPreparingContent = 2, // The item update is reading and processing content files
|
||||
k_EItemUpdateStatusUploadingContent = 3, // The item update is uploading content changes to Steam
|
||||
k_EItemUpdateStatusUploadingPreviewFile = 4, // The item update is uploading new preview file image
|
||||
k_EItemUpdateStatusCommittingChanges = 5 // The item update is committing all changes
|
||||
};
|
||||
|
||||
enum EItemState
|
||||
{
|
||||
k_EItemStateNone = 0, // item not tracked on client
|
||||
k_EItemStateSubscribed = 1, // current user is subscribed to this item. Not just cached.
|
||||
k_EItemStateLegacyItem = 2, // item was created with ISteamRemoteStorage
|
||||
k_EItemStateInstalled = 4, // item is installed and usable (but maybe out of date)
|
||||
k_EItemStateNeedsUpdate = 8, // items needs an update. Either because it's not installed yet or creator updated content
|
||||
k_EItemStateDownloading = 16, // item update is currently downloading
|
||||
k_EItemStateDownloadPending = 32, // DownloadItem() was called for this item, content isn't available until DownloadItemResult_t is fired
|
||||
k_EItemStateDisabledLocally = 64, // Item is disabled locally, so it shouldn't be considered subscribed
|
||||
};
|
||||
|
||||
enum EItemStatistic
|
||||
{
|
||||
k_EItemStatistic_NumSubscriptions = 0,
|
||||
k_EItemStatistic_NumFavorites = 1,
|
||||
k_EItemStatistic_NumFollowers = 2,
|
||||
k_EItemStatistic_NumUniqueSubscriptions = 3,
|
||||
k_EItemStatistic_NumUniqueFavorites = 4,
|
||||
k_EItemStatistic_NumUniqueFollowers = 5,
|
||||
k_EItemStatistic_NumUniqueWebsiteViews = 6,
|
||||
k_EItemStatistic_ReportScore = 7,
|
||||
k_EItemStatistic_NumSecondsPlayed = 8,
|
||||
k_EItemStatistic_NumPlaytimeSessions = 9,
|
||||
k_EItemStatistic_NumComments = 10,
|
||||
k_EItemStatistic_NumSecondsPlayedDuringTimePeriod = 11,
|
||||
k_EItemStatistic_NumPlaytimeSessionsDuringTimePeriod = 12,
|
||||
};
|
||||
|
||||
enum EItemPreviewType
|
||||
{
|
||||
k_EItemPreviewType_Image = 0, // standard image file expected (e.g. jpg, png, gif, etc.)
|
||||
k_EItemPreviewType_YouTubeVideo = 1, // video id is stored
|
||||
k_EItemPreviewType_Sketchfab = 2, // model id is stored
|
||||
k_EItemPreviewType_EnvironmentMap_HorizontalCross = 3, // standard image file expected - cube map in the layout
|
||||
// +---+---+-------+
|
||||
// | |Up | |
|
||||
// +---+---+---+---+
|
||||
// | L | F | R | B |
|
||||
// +---+---+---+---+
|
||||
// | |Dn | |
|
||||
// +---+---+---+---+
|
||||
k_EItemPreviewType_EnvironmentMap_LatLong = 4, // standard image file expected
|
||||
k_EItemPreviewType_Clip = 5, // clip id is stored
|
||||
k_EItemPreviewType_ReservedMax = 255, // you can specify your own types above this value
|
||||
};
|
||||
|
||||
enum EUGCContentDescriptorID
|
||||
{
|
||||
k_EUGCContentDescriptor_NudityOrSexualContent = 1,
|
||||
k_EUGCContentDescriptor_FrequentViolenceOrGore = 2,
|
||||
k_EUGCContentDescriptor_AdultOnlySexualContent = 3,
|
||||
k_EUGCContentDescriptor_GratuitousSexualContent = 4,
|
||||
k_EUGCContentDescriptor_AnyMatureContent = 5,
|
||||
};
|
||||
|
||||
const uint32 kNumUGCResultsPerPage = 50;
|
||||
const uint32 k_cchDeveloperMetadataMax = 5000;
|
||||
|
||||
// Details for a single published file/UGC
|
||||
struct SteamUGCDetails_t
|
||||
{
|
||||
PublishedFileId_t m_nPublishedFileId;
|
||||
EResult m_eResult; // The result of the operation.
|
||||
EWorkshopFileType m_eFileType; // Type of the file
|
||||
AppId_t m_nCreatorAppID; // ID of the app that created this file.
|
||||
AppId_t m_nConsumerAppID; // ID of the app that will consume this file.
|
||||
char m_rgchTitle[k_cchPublishedDocumentTitleMax]; // title of document
|
||||
char m_rgchDescription[k_cchPublishedDocumentDescriptionMax]; // description of document
|
||||
uint64 m_ulSteamIDOwner; // Steam ID of the user who created this content.
|
||||
uint32 m_rtimeCreated; // time when the published file was created
|
||||
uint32 m_rtimeUpdated; // time when the published file was last updated
|
||||
uint32 m_rtimeAddedToUserList; // time when the user added the published file to their list (not always applicable)
|
||||
ERemoteStoragePublishedFileVisibility m_eVisibility; // visibility
|
||||
bool m_bBanned; // whether the file was banned
|
||||
bool m_bAcceptedForUse; // developer has specifically flagged this item as accepted in the Workshop
|
||||
bool m_bTagsTruncated; // whether the list of tags was too long to be returned in the provided buffer
|
||||
char m_rgchTags[k_cchTagListMax]; // comma separated list of all tags associated with this file
|
||||
// file/url information
|
||||
UGCHandle_t m_hFile; // The handle of the primary file
|
||||
UGCHandle_t m_hPreviewFile; // The handle of the preview file
|
||||
char m_pchFileName[k_cchFilenameMax]; // The cloud filename of the primary file
|
||||
int32 m_nFileSize; // Size of the primary file (for legacy items which only support one file). This may not be accurate for non-legacy items which can be greater than 4gb in size.
|
||||
int32 m_nPreviewFileSize; // Size of the preview file
|
||||
char m_rgchURL[k_cchPublishedFileURLMax]; // URL (for a video or a website)
|
||||
// voting information
|
||||
uint32 m_unVotesUp; // number of votes up
|
||||
uint32 m_unVotesDown; // number of votes down
|
||||
float m_flScore; // calculated score
|
||||
// collection details
|
||||
uint32 m_unNumChildren;
|
||||
uint64 m_ulTotalFilesSize; // Total size of all files (non-legacy), excluding the preview file
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Steam UGC support API
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamUGC
|
||||
{
|
||||
public:
|
||||
|
||||
// Query UGC associated with a user. 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 CreateQueryUserUGCRequest( AccountID_t unAccountID, EUserUGCList eListType, EUGCMatchingUGCType eMatchingUGCType, EUserUGCListSortOrder eSortOrder, AppId_t nCreatorAppID, AppId_t nConsumerAppID, uint32 unPage ) = 0;
|
||||
|
||||
// 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.
|
||||
STEAM_FLAT_NAME( CreateQueryAllUGCRequestPage )
|
||||
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.
|
||||
STEAM_FLAT_NAME( CreateQueryAllUGCRequestCursor )
|
||||
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
|
||||
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 uint32 GetQueryUGCNumTags( UGCQueryHandle_t handle, uint32 index ) = 0;
|
||||
virtual bool GetQueryUGCTag( UGCQueryHandle_t handle, uint32 index, uint32 indexTag, STEAM_OUT_STRING_COUNT( cchValueSize ) char* pchValue, uint32 cchValueSize ) = 0;
|
||||
virtual bool GetQueryUGCTagDisplayName( UGCQueryHandle_t handle, uint32 index, uint32 indexTag, STEAM_OUT_STRING_COUNT( cchValueSize ) char* pchValue, uint32 cchValueSize ) = 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, 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, STEAM_OUT_STRING_COUNT(cchKeySize) char *pchKey, uint32 cchKeySize, STEAM_OUT_STRING_COUNT(cchValueSize) char *pchValue, uint32 cchValueSize ) = 0;
|
||||
|
||||
// Return the first value matching the pchKey. Note that a key may map to multiple values. Returns false if there was an error or no matching value was found.
|
||||
STEAM_FLAT_NAME( GetQueryFirstUGCKeyValueTag )
|
||||
virtual bool GetQueryUGCKeyValueTag( UGCQueryHandle_t handle, uint32 index, const char *pchKey, STEAM_OUT_STRING_COUNT(cchValueSize) char *pchValue, uint32 cchValueSize ) = 0;
|
||||
|
||||
// Some items can specify that they have a version that is valid for a range of game versions (Steam branch)
|
||||
virtual uint32 GetNumSupportedGameVersions( UGCQueryHandle_t handle, uint32 index ) = 0;
|
||||
virtual bool GetSupportedGameVersionData( UGCQueryHandle_t handle, uint32 index, uint32 versionIndex, STEAM_OUT_STRING_COUNT( cchGameBranchSize ) char *pchGameBranchMin, STEAM_OUT_STRING_COUNT( cchGameBranchSize ) char *pchGameBranchMax, uint32 cchGameBranchSize ) = 0;
|
||||
|
||||
virtual uint32 GetQueryUGCContentDescriptors( UGCQueryHandle_t handle, uint32 index, EUGCContentDescriptorID *pvecDescriptors, uint32 cMaxEntries ) = 0;
|
||||
|
||||
// Release the request to free up memory, after retrieving results
|
||||
virtual bool ReleaseQueryUGCRequest( UGCQueryHandle_t handle ) = 0;
|
||||
|
||||
// Options to set for querying UGC
|
||||
virtual bool AddRequiredTag( UGCQueryHandle_t handle, const char *pTagName ) = 0;
|
||||
virtual bool AddRequiredTagGroup( UGCQueryHandle_t handle, const SteamParamStringArray_t *pTagGroups ) = 0; // match any of the tags in this group
|
||||
virtual bool AddExcludedTag( UGCQueryHandle_t handle, const char *pTagName ) = 0;
|
||||
virtual bool SetReturnOnlyIDs( UGCQueryHandle_t handle, bool bReturnOnlyIDs ) = 0;
|
||||
virtual bool SetReturnKeyValueTags( UGCQueryHandle_t handle, bool bReturnKeyValueTags ) = 0;
|
||||
virtual bool SetReturnLongDescription( UGCQueryHandle_t handle, bool bReturnLongDescription ) = 0;
|
||||
virtual bool SetReturnMetadata( UGCQueryHandle_t handle, bool bReturnMetadata ) = 0;
|
||||
virtual bool SetReturnChildren( UGCQueryHandle_t handle, bool bReturnChildren ) = 0;
|
||||
virtual bool SetReturnAdditionalPreviews( UGCQueryHandle_t handle, bool bReturnAdditionalPreviews ) = 0;
|
||||
virtual bool SetReturnTotalOnly( UGCQueryHandle_t handle, bool bReturnTotalOnly ) = 0;
|
||||
virtual bool SetReturnPlaytimeStats( UGCQueryHandle_t handle, uint32 unDays ) = 0;
|
||||
virtual bool SetLanguage( UGCQueryHandle_t handle, const char *pchLanguage ) = 0;
|
||||
virtual bool SetAllowCachedResponse( UGCQueryHandle_t handle, uint32 unMaxAgeSeconds ) = 0;
|
||||
virtual bool SetAdminQuery( UGCUpdateHandle_t handle, bool bAdminQuery ) = 0; // admin queries return hidden items
|
||||
|
||||
// Options only for querying user UGC
|
||||
virtual bool SetCloudFileNameFilter( UGCQueryHandle_t handle, const char *pMatchCloudFileName ) = 0;
|
||||
|
||||
// Options only for querying all UGC
|
||||
virtual bool SetMatchAnyTag( UGCQueryHandle_t handle, bool bMatchAnyTag ) = 0;
|
||||
virtual bool SetSearchText( UGCQueryHandle_t handle, const char *pSearchText ) = 0;
|
||||
virtual bool SetRankedByTrendDays( UGCQueryHandle_t handle, uint32 unDays ) = 0;
|
||||
virtual bool SetTimeCreatedDateRange( UGCQueryHandle_t handle, RTime32 rtStart, RTime32 rtEnd ) = 0;
|
||||
virtual bool SetTimeUpdatedDateRange( UGCQueryHandle_t handle, RTime32 rtStart, RTime32 rtEnd ) = 0;
|
||||
virtual bool AddRequiredKeyValueTag( UGCQueryHandle_t handle, const char *pKey, const char *pValue ) = 0;
|
||||
|
||||
// DEPRECATED - Use CreateQueryUGCDetailsRequest call above instead!
|
||||
STEAM_CALL_RESULT( SteamUGCRequestUGCDetailsResult_t )
|
||||
virtual SteamAPICall_t RequestUGCDetails( PublishedFileId_t nPublishedFileID, uint32 unMaxAgeSeconds ) = 0;
|
||||
|
||||
// Steam Workshop Creator API
|
||||
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()
|
||||
|
||||
virtual bool SetItemTitle( UGCUpdateHandle_t handle, const char *pchTitle ) = 0; // change the title of an UGC item
|
||||
virtual bool SetItemDescription( UGCUpdateHandle_t handle, const char *pchDescription ) = 0; // change the description of an UGC item
|
||||
virtual bool SetItemUpdateLanguage( UGCUpdateHandle_t handle, const char *pchLanguage ) = 0; // specify the language of the title or description that will be set
|
||||
virtual bool SetItemMetadata( UGCUpdateHandle_t handle, const char *pchMetaData ) = 0; // change the metadata of an UGC item (max = k_cchDeveloperMetadataMax)
|
||||
virtual bool SetItemVisibility( UGCUpdateHandle_t handle, ERemoteStoragePublishedFileVisibility eVisibility ) = 0; // change the visibility of an UGC item
|
||||
virtual bool SetItemTags( UGCUpdateHandle_t updateHandle, const SteamParamStringArray_t *pTags, bool bAllowAdminTags = false ) = 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 RemoveAllItemKeyValueTags( UGCUpdateHandle_t handle ) = 0; // remove all existing key-value tags (you can add new ones via the AddItemKeyValueTag function)
|
||||
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
|
||||
virtual bool AddItemPreviewVideo( UGCUpdateHandle_t handle, const char *pszVideoID ) = 0; // add preview video for this item
|
||||
virtual bool UpdateItemPreviewFile( UGCUpdateHandle_t handle, uint32 index, const char *pszPreviewFile ) = 0; // updates an existing preview file for this item. pszPreviewFile points to local file, which must be under 1MB in size
|
||||
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)
|
||||
virtual bool AddContentDescriptor( UGCUpdateHandle_t handle, EUGCContentDescriptorID descid ) = 0;
|
||||
virtual bool RemoveContentDescriptor( UGCUpdateHandle_t handle, EUGCContentDescriptorID descid ) = 0;
|
||||
virtual bool SetRequiredGameVersions( UGCUpdateHandle_t handle, const char *pszGameBranchMin, const char *pszGameBranchMax ) = 0; // an empty string for either parameter means that it will match any version on that end of the range. This will only be applied if the actual content has been changed.
|
||||
|
||||
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
|
||||
STEAM_CALL_RESULT( SetUserItemVoteResult_t )
|
||||
virtual SteamAPICall_t SetUserItemVote( PublishedFileId_t nPublishedFileID, bool bVoteUp ) = 0;
|
||||
STEAM_CALL_RESULT( GetUserItemVoteResult_t )
|
||||
virtual SteamAPICall_t GetUserItemVote( PublishedFileId_t nPublishedFileID ) = 0;
|
||||
STEAM_CALL_RESULT( UserFavoriteItemsListChanged_t )
|
||||
virtual SteamAPICall_t AddItemToFavorites( AppId_t nAppId, PublishedFileId_t nPublishedFileID ) = 0;
|
||||
STEAM_CALL_RESULT( UserFavoriteItemsListChanged_t )
|
||||
virtual SteamAPICall_t RemoveItemFromFavorites( AppId_t nAppId, PublishedFileId_t nPublishedFileID ) = 0;
|
||||
STEAM_CALL_RESULT( RemoteStorageSubscribePublishedFileResult_t )
|
||||
virtual SteamAPICall_t SubscribeItem( PublishedFileId_t nPublishedFileID ) = 0; // subscribe to this item, will be installed ASAP
|
||||
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
|
||||
|
||||
// get EItemState flags about item on this client
|
||||
virtual uint32 GetItemState( PublishedFileId_t nPublishedFileID ) = 0;
|
||||
|
||||
// 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, 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;
|
||||
|
||||
// download new or update already installed item. If function returns true, wait for DownloadItemResult_t. If the item is already installed,
|
||||
// then files on disk should not be used until callback received. If item is not subscribed to, it will be cached for some time.
|
||||
// If bHighPriority is set, any other item download will be suspended and this item downloaded ASAP.
|
||||
virtual bool DownloadItem( PublishedFileId_t nPublishedFileID, bool bHighPriority ) = 0;
|
||||
|
||||
// game servers can set a specific workshop folder before issuing any UGC commands.
|
||||
// This is helpful if you want to support multiple game servers running out of the same install folder
|
||||
virtual bool BInitWorkshopForGameServer( DepotId_t unWorkshopDepotID, const char *pszFolder ) = 0;
|
||||
|
||||
// SuspendDownloads( true ) will suspend all workshop downloads until SuspendDownloads( false ) is called or the game ends
|
||||
virtual void SuspendDownloads( bool bSuspend ) = 0;
|
||||
|
||||
// usage tracking
|
||||
STEAM_CALL_RESULT( StartPlaytimeTrackingResult_t )
|
||||
virtual SteamAPICall_t StartPlaytimeTracking( PublishedFileId_t *pvecPublishedFileID, uint32 unNumPublishedFileIDs ) = 0;
|
||||
STEAM_CALL_RESULT( StopPlaytimeTrackingResult_t )
|
||||
virtual SteamAPICall_t StopPlaytimeTracking( PublishedFileId_t *pvecPublishedFileID, uint32 unNumPublishedFileIDs ) = 0;
|
||||
STEAM_CALL_RESULT( StopPlaytimeTrackingResult_t )
|
||||
virtual SteamAPICall_t StopPlaytimeTrackingForAllItems() = 0;
|
||||
|
||||
// parent-child relationship or dependency management
|
||||
STEAM_CALL_RESULT( AddUGCDependencyResult_t )
|
||||
virtual SteamAPICall_t AddDependency( PublishedFileId_t nParentPublishedFileID, PublishedFileId_t nChildPublishedFileID ) = 0;
|
||||
STEAM_CALL_RESULT( RemoveUGCDependencyResult_t )
|
||||
virtual SteamAPICall_t RemoveDependency( PublishedFileId_t nParentPublishedFileID, PublishedFileId_t nChildPublishedFileID ) = 0;
|
||||
|
||||
// add/remove app dependence/requirements (usually DLC)
|
||||
STEAM_CALL_RESULT( AddAppDependencyResult_t )
|
||||
virtual SteamAPICall_t AddAppDependency( PublishedFileId_t nPublishedFileID, AppId_t nAppID ) = 0;
|
||||
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
|
||||
STEAM_CALL_RESULT( GetAppDependenciesResult_t )
|
||||
virtual SteamAPICall_t GetAppDependencies( PublishedFileId_t nPublishedFileID ) = 0;
|
||||
|
||||
// delete the item without prompting the user
|
||||
STEAM_CALL_RESULT( DeleteItemResult_t )
|
||||
virtual SteamAPICall_t DeleteItem( PublishedFileId_t nPublishedFileID ) = 0;
|
||||
|
||||
// Show the app's latest Workshop EULA to the user in an overlay window, where they can accept it or not
|
||||
virtual bool ShowWorkshopEULA() = 0;
|
||||
// Retrieve information related to the user's acceptance or not of the app's specific Workshop EULA
|
||||
STEAM_CALL_RESULT( WorkshopEULAStatus_t )
|
||||
virtual SteamAPICall_t GetWorkshopEULAStatus() = 0;
|
||||
|
||||
// Return the user's community content descriptor preferences
|
||||
virtual uint32 GetUserContentDescriptorPreferences( EUGCContentDescriptorID *pvecDescriptors, uint32 cMaxEntries ) = 0;
|
||||
};
|
||||
|
||||
#define STEAMUGC_INTERFACE_VERSION "STEAMUGC_INTERFACE_VERSION020"
|
||||
|
||||
// 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
|
||||
//-----------------------------------------------------------------------------
|
||||
struct SteamUGCQueryCompleted_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUGCCallbacks + 1 };
|
||||
UGCQueryHandle_t m_handle;
|
||||
EResult m_eResult;
|
||||
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.
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Callback for requesting details on one piece of UGC
|
||||
//-----------------------------------------------------------------------------
|
||||
struct SteamUGCRequestUGCDetailsResult_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUGCCallbacks + 2 };
|
||||
SteamUGCDetails_t m_details;
|
||||
bool m_bCachedData; // indicates whether this data was retrieved from the local on-disk cache
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: result for ISteamUGC::CreateItem()
|
||||
//-----------------------------------------------------------------------------
|
||||
struct CreateItemResult_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUGCCallbacks + 3 };
|
||||
EResult m_eResult;
|
||||
PublishedFileId_t m_nPublishedFileId; // new item got this UGC PublishFileID
|
||||
bool m_bUserNeedsToAcceptWorkshopLegalAgreement;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: result for ISteamUGC::SubmitItemUpdate()
|
||||
//-----------------------------------------------------------------------------
|
||||
struct SubmitItemUpdateResult_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUGCCallbacks + 4 };
|
||||
EResult m_eResult;
|
||||
bool m_bUserNeedsToAcceptWorkshopLegalAgreement;
|
||||
PublishedFileId_t m_nPublishedFileId;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: a Workshop item has been installed or updated
|
||||
//-----------------------------------------------------------------------------
|
||||
struct ItemInstalled_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUGCCallbacks + 5 };
|
||||
AppId_t m_unAppID;
|
||||
PublishedFileId_t m_nPublishedFileId;
|
||||
UGCHandle_t m_hLegacyContent;
|
||||
uint64 m_unManifestID;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: result of DownloadItem(), existing item files can be accessed again
|
||||
//-----------------------------------------------------------------------------
|
||||
struct DownloadItemResult_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUGCCallbacks + 6 };
|
||||
AppId_t m_unAppID;
|
||||
PublishedFileId_t m_nPublishedFileId;
|
||||
EResult m_eResult;
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: result of AddItemToFavorites() or RemoveItemFromFavorites()
|
||||
//-----------------------------------------------------------------------------
|
||||
struct UserFavoriteItemsListChanged_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUGCCallbacks + 7 };
|
||||
PublishedFileId_t m_nPublishedFileId;
|
||||
EResult m_eResult;
|
||||
bool m_bWasAddRequest;
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: The result of a call to SetUserItemVote()
|
||||
//-----------------------------------------------------------------------------
|
||||
struct SetUserItemVoteResult_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUGCCallbacks + 8 };
|
||||
PublishedFileId_t m_nPublishedFileId;
|
||||
EResult m_eResult;
|
||||
bool m_bVoteUp;
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: The result of a call to GetUserItemVote()
|
||||
//-----------------------------------------------------------------------------
|
||||
struct GetUserItemVoteResult_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUGCCallbacks + 9 };
|
||||
PublishedFileId_t m_nPublishedFileId;
|
||||
EResult m_eResult;
|
||||
bool m_bVotedUp;
|
||||
bool m_bVotedDown;
|
||||
bool m_bVoteSkipped;
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: The result of a call to StartPlaytimeTracking()
|
||||
//-----------------------------------------------------------------------------
|
||||
struct StartPlaytimeTrackingResult_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUGCCallbacks + 10 };
|
||||
EResult m_eResult;
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: The result of a call to StopPlaytimeTracking()
|
||||
//-----------------------------------------------------------------------------
|
||||
struct StopPlaytimeTrackingResult_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUGCCallbacks + 11 };
|
||||
EResult m_eResult;
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: The result of a call to AddDependency
|
||||
//-----------------------------------------------------------------------------
|
||||
struct AddUGCDependencyResult_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUGCCallbacks + 12 };
|
||||
EResult m_eResult;
|
||||
PublishedFileId_t m_nPublishedFileId;
|
||||
PublishedFileId_t m_nChildPublishedFileId;
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: The result of a call to RemoveDependency
|
||||
//-----------------------------------------------------------------------------
|
||||
struct RemoveUGCDependencyResult_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUGCCallbacks + 13 };
|
||||
EResult m_eResult;
|
||||
PublishedFileId_t m_nPublishedFileId;
|
||||
PublishedFileId_t m_nChildPublishedFileId;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: The result of a call to AddAppDependency
|
||||
//-----------------------------------------------------------------------------
|
||||
struct AddAppDependencyResult_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUGCCallbacks + 14 };
|
||||
EResult m_eResult;
|
||||
PublishedFileId_t m_nPublishedFileId;
|
||||
AppId_t m_nAppID;
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: The result of a call to RemoveAppDependency
|
||||
//-----------------------------------------------------------------------------
|
||||
struct RemoveAppDependencyResult_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUGCCallbacks + 15 };
|
||||
EResult m_eResult;
|
||||
PublishedFileId_t m_nPublishedFileId;
|
||||
AppId_t m_nAppID;
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: The result of a call to GetAppDependencies. Callback may be called
|
||||
// multiple times until all app dependencies have been returned.
|
||||
//-----------------------------------------------------------------------------
|
||||
struct GetAppDependenciesResult_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUGCCallbacks + 16 };
|
||||
EResult m_eResult;
|
||||
PublishedFileId_t m_nPublishedFileId;
|
||||
AppId_t m_rgAppIDs[32];
|
||||
uint32 m_nNumAppDependencies; // number returned in this struct
|
||||
uint32 m_nTotalNumAppDependencies; // total found
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: The result of a call to DeleteItem
|
||||
//-----------------------------------------------------------------------------
|
||||
struct DeleteItemResult_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUGCCallbacks + 17 };
|
||||
EResult m_eResult;
|
||||
PublishedFileId_t m_nPublishedFileId;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: signal that the list of subscribed items changed
|
||||
//-----------------------------------------------------------------------------
|
||||
struct UserSubscribedItemsListChanged_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUGCCallbacks + 18 };
|
||||
AppId_t m_nAppID;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Status of the user's acceptable/rejection of the app's specific Workshop EULA
|
||||
//-----------------------------------------------------------------------------
|
||||
struct WorkshopEULAStatus_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUGCCallbacks + 20 };
|
||||
EResult m_eResult;
|
||||
AppId_t m_nAppID;
|
||||
uint32 m_unVersion;
|
||||
RTime32 m_rtAction;
|
||||
bool m_bAccepted;
|
||||
bool m_bNeedsAction;
|
||||
};
|
||||
|
||||
#pragma pack( pop )
|
||||
|
||||
#endif // ISTEAMUGC_H
|
@ -1,63 +0,0 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose: Interface to unified messages client
|
||||
//
|
||||
// You should not need to use this interface except if your product is using a language other than C++.
|
||||
// Contact your Steam Tech contact for more details.
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMUNIFIEDMESSAGES_H
|
||||
#define ISTEAMUNIFIEDMESSAGES_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
typedef uint64 ClientUnifiedMessageHandle;
|
||||
|
||||
class ISteamUnifiedMessages
|
||||
{
|
||||
public:
|
||||
static const ClientUnifiedMessageHandle k_InvalidUnifiedMessageHandle = 0;
|
||||
|
||||
// Sends a service method (in binary serialized form) using the Steam Client.
|
||||
// Returns a unified message handle (k_InvalidUnifiedMessageHandle if could not send the message).
|
||||
virtual ClientUnifiedMessageHandle SendMethod( const char *pchServiceMethod, const void *pRequestBuffer, uint32 unRequestBufferSize, uint64 unContext ) = 0;
|
||||
|
||||
// Gets the size of the response and the EResult. Returns false if the response is not ready yet.
|
||||
virtual bool GetMethodResponseInfo( ClientUnifiedMessageHandle hHandle, uint32 *punResponseSize, EResult *peResult ) = 0;
|
||||
|
||||
// Gets a response in binary serialized form (and optionally release the corresponding allocated memory).
|
||||
virtual bool GetMethodResponseData( ClientUnifiedMessageHandle hHandle, void *pResponseBuffer, uint32 unResponseBufferSize, bool bAutoRelease ) = 0;
|
||||
|
||||
// Releases the message and its corresponding allocated memory.
|
||||
virtual bool ReleaseMethod( ClientUnifiedMessageHandle hHandle ) = 0;
|
||||
|
||||
// Sends a service notification (in binary serialized form) using the Steam Client.
|
||||
// Returns true if the notification was sent successfully.
|
||||
virtual bool SendNotification( const char *pchServiceNotification, const void *pNotificationBuffer, uint32 unNotificationBufferSize ) = 0;
|
||||
};
|
||||
|
||||
#define STEAMUNIFIEDMESSAGES_INTERFACE_VERSION "STEAMUNIFIEDMESSAGES_INTERFACE_VERSION001"
|
||||
|
||||
// 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
|
||||
#endif
|
||||
|
||||
struct SteamUnifiedMessagesSendMethodResult_t
|
||||
{
|
||||
enum { k_iCallback = k_iClientUnifiedMessagesCallbacks + 1 };
|
||||
ClientUnifiedMessageHandle m_hHandle; // The handle returned by SendMethod().
|
||||
uint64 m_unContext; // Context provided when calling SendMethod().
|
||||
EResult m_eResult; // The result of the method call.
|
||||
uint32 m_unResponseSize; // The size of the response.
|
||||
};
|
||||
|
||||
#pragma pack( pop )
|
||||
|
||||
#endif // ISTEAMUNIFIEDMESSAGES_H
|
@ -1,4 +1,4 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//====== Copyright (c) 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: interface to user account information in Steam
|
||||
//
|
||||
@ -10,28 +10,7 @@
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "isteamclient.h"
|
||||
|
||||
// structure that contains client callback data
|
||||
// see callbacks documentation for more details
|
||||
#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
|
||||
#endif
|
||||
struct CallbackMsg_t
|
||||
{
|
||||
HSteamUser m_hSteamUser;
|
||||
int m_iCallback;
|
||||
uint8 *m_pubParam;
|
||||
int m_cubParam;
|
||||
};
|
||||
#pragma pack( pop )
|
||||
|
||||
// reference to a steam call, to filter results by
|
||||
typedef int32 HSteamCall;
|
||||
#include "steam_api_common.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Functions for accessing and manipulating a steam account
|
||||
@ -44,7 +23,7 @@ public:
|
||||
// this is only used internally by the API, and by a few select interfaces that support multi-user
|
||||
virtual HSteamUser GetHSteamUser() = 0;
|
||||
|
||||
// returns true if the Steam client current has a live connection to the Steam servers.
|
||||
// returns true if the Steam client current has a live connection to the Steam servers.
|
||||
// If false, it means there is no active connection due to either a networking issue on the local machine, or the Steam server is down/busy.
|
||||
// The Steam client will automatically be trying to recreate the connection as often as possible.
|
||||
virtual bool BLoggedOn() = 0;
|
||||
@ -54,7 +33,7 @@ public:
|
||||
virtual CSteamID GetSteamID() = 0;
|
||||
|
||||
// Multiplayer Authentication functions
|
||||
|
||||
|
||||
// InitiateGameConnection() starts the state machine for authenticating the game client with the game server
|
||||
// It is the client portion of a three-way handshake between the client, the game server, and the steam servers
|
||||
//
|
||||
@ -68,10 +47,16 @@ public:
|
||||
//
|
||||
// return value - returns the number of bytes written to pBlob. If the return is 0, then the buffer passed in was too small, and the call has failed
|
||||
// The contents of pBlob should then be sent to the game server, for it to use to complete the authentication process.
|
||||
//
|
||||
// DEPRECATED! This function will be removed from the SDK in an upcoming version.
|
||||
// Please migrate to BeginAuthSession and related functions.
|
||||
virtual int InitiateGameConnection( void *pAuthBlob, int cbMaxAuthBlob, CSteamID steamIDGameServer, uint32 unIPServer, uint16 usPortServer, bool bSecure ) = 0;
|
||||
|
||||
// notify of disconnect
|
||||
// needs to occur when the game client leaves the specified game server, needs to match with the InitiateGameConnection() call
|
||||
//
|
||||
// DEPRECATED! This function will be removed from the SDK in an upcoming version.
|
||||
// Please migrate to BeginAuthSession and related functions.
|
||||
virtual void TerminateGameConnection( uint32 unIPServer, uint16 usPortServer ) = 0;
|
||||
|
||||
// Legacy functions
|
||||
@ -91,41 +76,64 @@ public:
|
||||
// k_eVoiceResultNotRecording
|
||||
virtual void StopVoiceRecording( ) = 0;
|
||||
|
||||
// Determine the amount of captured audio data that is available in bytes.
|
||||
// This provides both the compressed and uncompressed data. Please note that the uncompressed
|
||||
// data is not the raw feed from the microphone: data may only be available if audible
|
||||
// levels of speech are detected.
|
||||
// nUncompressedVoiceDesiredSampleRate is necessary to know the number of bytes to return in pcbUncompressed - can be set to 0 if you don't need uncompressed (the usual case)
|
||||
// If you're upgrading from an older Steamworks API, you'll want to pass in 11025 to nUncompressedVoiceDesiredSampleRate
|
||||
virtual EVoiceResult GetAvailableVoice(uint32 *pcbCompressed, uint32 *pcbUncompressed, uint32 nUncompressedVoiceDesiredSampleRate) = 0;
|
||||
// Determine the size of captured audio data that is available from GetVoice.
|
||||
// Most applications will only use compressed data and should ignore the other
|
||||
// parameters, which exist primarily for backwards compatibility. See comments
|
||||
// below for further explanation of "uncompressed" data.
|
||||
virtual EVoiceResult GetAvailableVoice( uint32 *pcbCompressed, uint32 *pcbUncompressed_Deprecated = 0, uint32 nUncompressedVoiceDesiredSampleRate_Deprecated = 0 ) = 0;
|
||||
|
||||
// Gets the latest voice data from the microphone. Compressed data is an arbitrary format, and is meant to be handed back to
|
||||
// DecompressVoice() for playback later as a binary blob. Uncompressed data is 16-bit, signed integer, 11025Hz PCM format.
|
||||
// Please note that the uncompressed data is not the raw feed from the microphone: data may only be available if audible
|
||||
// levels of speech are detected, and may have passed through denoising filters, etc.
|
||||
// This function should be called as often as possible once recording has started; once per frame at least.
|
||||
// nBytesWritten is set to the number of bytes written to pDestBuffer.
|
||||
// nUncompressedBytesWritten is set to the number of bytes written to pUncompressedDestBuffer.
|
||||
// You must grab both compressed and uncompressed here at the same time, if you want both.
|
||||
// Matching data that is not read during this call will be thrown away.
|
||||
// GetAvailableVoice() can be used to determine how much data is actually available.
|
||||
// If you're upgrading from an older Steamworks API, you'll want to pass in 11025 to nUncompressedVoiceDesiredSampleRate
|
||||
virtual EVoiceResult GetVoice( bool bWantCompressed, void *pDestBuffer, uint32 cbDestBufferSize, uint32 *nBytesWritten, bool bWantUncompressed, void *pUncompressedDestBuffer, uint32 cbUncompressedDestBufferSize, uint32 *nUncompressBytesWritten, uint32 nUncompressedVoiceDesiredSampleRate ) = 0;
|
||||
// ---------------------------------------------------------------------------
|
||||
// NOTE: "uncompressed" audio is a deprecated feature and should not be used
|
||||
// by most applications. It is raw single-channel 16-bit PCM wave data which
|
||||
// may have been run through preprocessing filters and/or had silence removed,
|
||||
// so the uncompressed audio could have a shorter duration than you expect.
|
||||
// There may be no data at all during long periods of silence. Also, fetching
|
||||
// uncompressed audio will cause GetVoice to discard any leftover compressed
|
||||
// audio, so you must fetch both types at once. Finally, GetAvailableVoice is
|
||||
// not precisely accurate when the uncompressed size is requested. So if you
|
||||
// really need to use uncompressed audio, you should call GetVoice frequently
|
||||
// with two very large (20kb+) output buffers instead of trying to allocate
|
||||
// perfectly-sized buffers. But most applications should ignore all of these
|
||||
// details and simply leave the "uncompressed" parameters as NULL/zero.
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
// Decompresses a chunk of compressed data produced by GetVoice().
|
||||
// nBytesWritten is set to the number of bytes written to pDestBuffer unless the return value is k_EVoiceResultBufferTooSmall.
|
||||
// In that case, nBytesWritten is set to the size of the buffer required to decompress the given
|
||||
// data. The suggested buffer size for the destination buffer is 22 kilobytes.
|
||||
// The output format of the data is 16-bit signed at the requested samples per second.
|
||||
// If you're upgrading from an older Steamworks API, you'll want to pass in 11025 to nDesiredSampleRate
|
||||
// Read captured audio data from the microphone buffer. This should be called
|
||||
// at least once per frame, and preferably every few milliseconds, to keep the
|
||||
// microphone input delay as low as possible. Most applications will only use
|
||||
// compressed data and should pass NULL/zero for the "uncompressed" parameters.
|
||||
// Compressed data can be transmitted by your application and decoded into raw
|
||||
// using the DecompressVoice function below.
|
||||
virtual EVoiceResult GetVoice( bool bWantCompressed, void *pDestBuffer, uint32 cbDestBufferSize, uint32 *nBytesWritten, bool bWantUncompressed_Deprecated = false, void *pUncompressedDestBuffer_Deprecated = 0, uint32 cbUncompressedDestBufferSize_Deprecated = 0, uint32 *nUncompressBytesWritten_Deprecated = 0, uint32 nUncompressedVoiceDesiredSampleRate_Deprecated = 0 ) = 0;
|
||||
|
||||
// Decodes the compressed voice data returned by GetVoice. The output data is
|
||||
// raw single-channel 16-bit PCM audio. The decoder supports any sample rate
|
||||
// from 11025 to 48000; see GetVoiceOptimalSampleRate() below for details.
|
||||
// If the output buffer is not large enough, then *nBytesWritten will be set
|
||||
// to the required buffer size, and k_EVoiceResultBufferTooSmall is returned.
|
||||
// It is suggested to start with a 20kb buffer and reallocate as necessary.
|
||||
virtual EVoiceResult DecompressVoice( const void *pCompressed, uint32 cbCompressed, void *pDestBuffer, uint32 cbDestBufferSize, uint32 *nBytesWritten, uint32 nDesiredSampleRate ) = 0;
|
||||
|
||||
// This returns the frequency of the voice data as it's stored internally; calling DecompressVoice() with this size will yield the best results
|
||||
// This returns the native sample rate of the Steam voice decompressor; using
|
||||
// this sample rate for DecompressVoice will perform the least CPU processing.
|
||||
// However, the final audio quality will depend on how well the audio device
|
||||
// (and/or your application's audio output SDK) deals with lower sample rates.
|
||||
// You may find that you get the best audio output quality when you ignore
|
||||
// this function and use the native sample rate of your audio output device,
|
||||
// which is usually 48000 or 44100.
|
||||
virtual uint32 GetVoiceOptimalSampleRate() = 0;
|
||||
|
||||
// Retrieve ticket to be sent to the entity who wishes to authenticate you.
|
||||
// Retrieve ticket to be sent to the entity who wishes to authenticate you.
|
||||
// pcbTicket retrieves the length of the actual ticket.
|
||||
virtual HAuthTicket GetAuthSessionTicket( void *pTicket, int cbMaxTicket, uint32 *pcbTicket ) = 0;
|
||||
// SteamNetworkingIdentity is an optional input parameter to hold the public IP address or SteamID of the entity you are connecting to
|
||||
// if an IP address is passed Steam will only allow the ticket to be used by an entity with that IP address
|
||||
// if a Steam ID is passed Steam will only allow the ticket to be used by that Steam ID
|
||||
// not to be used for "ISteamUserAuth\AuthenticateUserTicket" - it will fail
|
||||
virtual HAuthTicket GetAuthSessionTicket( void *pTicket, int cbMaxTicket, uint32 *pcbTicket, const SteamNetworkingIdentity *pSteamNetworkingIdentity ) = 0;
|
||||
|
||||
// Request a ticket which will be used for webapi "ISteamUserAuth\AuthenticateUserTicket"
|
||||
// pchIdentity is an optional input parameter to identify the service the ticket will be sent to
|
||||
// the ticket will be returned in callback GetTicketForWebApiResponse_t
|
||||
virtual HAuthTicket GetAuthTicketForWebApi( const char *pchIdentity ) = 0;
|
||||
|
||||
// Authenticate ticket from entity steamID to be sure it is valid and isnt reused
|
||||
// Registers for callbacks if the entity goes offline or cancels the ticket ( see ValidateAuthTicketResponse_t callback and EAuthSessionResponse )
|
||||
@ -140,8 +148,8 @@ public:
|
||||
// After receiving a user's authentication data, and passing it to BeginAuthSession, use this function
|
||||
// to determine if the user owns downloadable content specified by the provided AppID.
|
||||
virtual EUserHasLicenseForAppResult UserHasLicenseForApp( CSteamID steamID, AppId_t appID ) = 0;
|
||||
|
||||
// returns true if this users looks like they are behind a NAT device. Only valid once the user has connected to steam
|
||||
|
||||
// returns true if this users looks like they are behind a NAT device. Only valid once the user has connected to steam
|
||||
// (i.e a SteamServersConnected_t has been issued) and may not catch all forms of NAT.
|
||||
virtual bool BIsBehindNAT() = 0;
|
||||
|
||||
@ -153,52 +161,69 @@ 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 )
|
||||
STEAM_CALL_RESULT( EncryptedAppTicketResponse_t )
|
||||
virtual SteamAPICall_t RequestEncryptedAppTicket( void *pDataToInclude, int cbDataToInclude ) = 0;
|
||||
|
||||
// retrieve a finished ticket
|
||||
// Retrieves a finished ticket.
|
||||
// If no ticket is available, or your buffer is too small, returns false.
|
||||
// Upon exit, *pcbTicket will be either the size of the ticket copied into your buffer
|
||||
// (if true was returned), or the size needed (if false was returned). To determine the
|
||||
// proper size of the ticket, you can pass pTicket=NULL and cbMaxTicket=0; if a ticket
|
||||
// is available, *pcbTicket will contain the size needed, otherwise it will be zero.
|
||||
virtual bool GetEncryptedAppTicket( void *pTicket, int cbMaxTicket, uint32 *pcbTicket ) = 0;
|
||||
|
||||
#ifdef _PS3
|
||||
// Initiates PS3 Logon request using just PSN ticket.
|
||||
//
|
||||
// PARAMS: bInteractive - If set tells Steam to go ahead and show the PS3 NetStart dialog if needed to
|
||||
// prompt the user for network setup/PSN logon before initiating the Steam side of the logon.
|
||||
//
|
||||
// Listen for SteamServersConnected_t or SteamServerConnectFailure_t for status. SteamServerConnectFailure_t
|
||||
// may return with EResult k_EResultExternalAccountUnlinked if the PSN account is unknown to Steam. You should
|
||||
// then call LogOnAndLinkSteamAccountToPSN() after prompting the user for credentials to establish a link.
|
||||
// Future calls to LogOn() after the one time link call should succeed as long as the user is connected to PSN.
|
||||
virtual void LogOn( bool bInteractive ) = 0;
|
||||
// Trading Card badges data access
|
||||
// if you only have one set of cards, the series will be 1
|
||||
// the user has can have two different badges for a series; the regular (max level 5) and the foil (max level 1)
|
||||
virtual int GetGameBadgeLevel( int nSeries, bool bFoil ) = 0;
|
||||
|
||||
// Initiates a request to logon with a specific steam username/password and create a PSN account link at
|
||||
// the same time. Should call this only if LogOn() has failed and indicated the PSN account is unlinked.
|
||||
//
|
||||
// PARAMS: bInteractive - If set tells Steam to go ahead and show the PS3 NetStart dialog if needed to
|
||||
// prompt the user for network setup/PSN logon before initiating the Steam side of the logon. pchUserName
|
||||
// should be the users Steam username, and pchPassword should be the users Steam password.
|
||||
//
|
||||
// Listen for SteamServersConnected_t or SteamServerConnectFailure_t for status. SteamServerConnectFailure_t
|
||||
// may return with EResult k_EResultOtherAccountAlreadyLinked if already linked to another account.
|
||||
virtual void LogOnAndLinkSteamAccountToPSN( bool bInteractive, const char *pchUserName, const char *pchPassword ) = 0;
|
||||
// gets the Steam Level of the user, as shown on their profile
|
||||
virtual int GetPlayerSteamLevel() = 0;
|
||||
|
||||
// Final logon option for PS3, this logs into an existing account if already linked, but if not already linked
|
||||
// creates a new account using the info in the PSN ticket to generate a unique account name. The new account is
|
||||
// then linked to the PSN ticket. This is the faster option for new users who don't have an existing Steam account
|
||||
// to get into multiplayer.
|
||||
//
|
||||
// PARAMS: bInteractive - If set tells Steam to go ahead and show the PS3 NetStart dialog if needed to
|
||||
// prompt the user for network setup/PSN logon before initiating the Steam side of the logon.
|
||||
virtual void LogOnAndCreateNewSteamAccountIfNeeded( bool bInteractive ) = 0;
|
||||
// Requests a URL which authenticates an in-game browser for store check-out,
|
||||
// and then redirects to the specified URL. As long as the in-game browser
|
||||
// accepts and handles session cookies, Steam microtransaction checkout pages
|
||||
// will automatically recognize the user instead of presenting a login page.
|
||||
// The result of this API call will be a StoreAuthURLResponse_t callback.
|
||||
// NOTE: The URL has a very short lifetime to prevent history-snooping attacks,
|
||||
// so you should only call this API when you are about to launch the browser,
|
||||
// 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.
|
||||
STEAM_CALL_RESULT( StoreAuthURLResponse_t )
|
||||
virtual SteamAPICall_t RequestStoreAuthURL( const char *pchRedirectURL ) = 0;
|
||||
|
||||
// Returns a special SteamID that represents the user's PSN information. Can be used to query the user's PSN avatar,
|
||||
// online name, etc. through the standard Steamworks interfaces.
|
||||
virtual CSteamID GetConsoleSteamID() = 0;
|
||||
#endif
|
||||
// gets whether the users phone number is verified
|
||||
virtual bool BIsPhoneVerified() = 0;
|
||||
|
||||
// gets whether the user has two factor enabled on their account
|
||||
virtual bool BIsTwoFactorEnabled() = 0;
|
||||
|
||||
// gets whether the users phone number is identifying
|
||||
virtual bool BIsPhoneIdentifying() = 0;
|
||||
|
||||
// gets whether the users phone number is awaiting (re)verification
|
||||
virtual bool BIsPhoneRequiringVerification() = 0;
|
||||
|
||||
STEAM_CALL_RESULT( MarketEligibilityResponse_t )
|
||||
virtual SteamAPICall_t GetMarketEligibility() = 0;
|
||||
|
||||
// Retrieves anti indulgence / duration control for current user
|
||||
STEAM_CALL_RESULT( DurationControl_t )
|
||||
virtual SteamAPICall_t GetDurationControl() = 0;
|
||||
|
||||
// Advise steam china duration control system about the online state of the game.
|
||||
// This will prevent offline gameplay time from counting against a user's
|
||||
// playtime limits.
|
||||
virtual bool BSetDurationControlOnlineState( EDurationControlOnlineState eNewState ) = 0;
|
||||
|
||||
};
|
||||
|
||||
#define STEAMUSER_INTERFACE_VERSION "SteamUser016"
|
||||
#define STEAMUSER_INTERFACE_VERSION "SteamUser023"
|
||||
|
||||
// Global interface accessor
|
||||
inline ISteamUser *SteamUser();
|
||||
STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamUser *, SteamUser, STEAMUSER_INTERFACE_VERSION );
|
||||
|
||||
// callbacks
|
||||
#if defined( VALVE_CALLBACK_PACK_SMALL )
|
||||
@ -206,15 +231,16 @@ public:
|
||||
#elif defined( VALVE_CALLBACK_PACK_LARGE )
|
||||
#pragma pack( push, 8 )
|
||||
#else
|
||||
#error isteamclient.h must be included
|
||||
#endif
|
||||
#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx
|
||||
#endif
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: called when a connections to the Steam back-end has been established
|
||||
// this means the Steam client now has a working connection to the Steam servers
|
||||
// usually this will have occurred before the game has launched, and should
|
||||
// Purpose: Called when an authenticated connection to the Steam back-end has been established.
|
||||
// This means the Steam client now has a working connection to the Steam servers.
|
||||
// Usually this will have occurred before the game has launched, and should
|
||||
// only be seen if the user has dropped connection due to a networking issue
|
||||
// or a Steam server update
|
||||
// or a Steam server update.
|
||||
//-----------------------------------------------------------------------------
|
||||
struct SteamServersConnected_t
|
||||
{
|
||||
@ -223,13 +249,14 @@ struct SteamServersConnected_t
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: called when a connection attempt has failed
|
||||
// this will occur periodically if the Steam client is not connected,
|
||||
// this will occur periodically if the Steam client is not connected,
|
||||
// and has failed in it's retry to establish a connection
|
||||
//-----------------------------------------------------------------------------
|
||||
struct SteamServerConnectFailure_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserCallbacks + 2 };
|
||||
EResult m_eResult;
|
||||
bool m_bStillRetrying;
|
||||
};
|
||||
|
||||
|
||||
@ -270,15 +297,24 @@ struct ClientGameServerDeny_t
|
||||
struct IPCFailure_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserCallbacks + 17 };
|
||||
enum EFailureType
|
||||
{
|
||||
k_EFailureFlushedCallbackQueue,
|
||||
enum EFailureType
|
||||
{
|
||||
k_EFailureFlushedCallbackQueue,
|
||||
k_EFailurePipeFail,
|
||||
};
|
||||
uint8 m_eFailureType;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Signaled whenever licenses change
|
||||
//-----------------------------------------------------------------------------
|
||||
struct LicensesUpdated_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserCallbacks + 25 };
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// callback for BeginAuthSession
|
||||
//-----------------------------------------------------------------------------
|
||||
@ -287,6 +323,7 @@ struct ValidateAuthTicketResponse_t
|
||||
enum { k_iCallback = k_iSteamUserCallbacks + 43 };
|
||||
CSteamID m_SteamID;
|
||||
EAuthSessionResponse m_eAuthSessionResponse;
|
||||
CSteamID m_OwnerSteamID; // different from m_SteamID if borrowed
|
||||
};
|
||||
|
||||
|
||||
@ -296,7 +333,7 @@ struct ValidateAuthTicketResponse_t
|
||||
struct MicroTxnAuthorizationResponse_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserCallbacks + 52 };
|
||||
|
||||
|
||||
uint32 m_unAppID; // AppID for this microtransaction
|
||||
uint64 m_ulOrderID; // OrderID provided for the microtransaction
|
||||
uint8 m_bAuthorized; // if user authorized transaction
|
||||
@ -323,7 +360,6 @@ struct GetAuthSessionTicketResponse_t
|
||||
EResult m_eResult;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: sent to your game in response to a steam://gamewebcallback/ command
|
||||
//-----------------------------------------------------------------------------
|
||||
@ -333,6 +369,70 @@ struct GameWebCallback_t
|
||||
char m_szURL[256];
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: sent to your game in response to ISteamUser::RequestStoreAuthURL
|
||||
//-----------------------------------------------------------------------------
|
||||
struct StoreAuthURLResponse_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserCallbacks + 65 };
|
||||
char m_szURL[512];
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// 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
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: sent for games with enabled anti indulgence / duration control, for
|
||||
// enabled users. Lets the game know whether the user can keep playing or
|
||||
// whether the game should exit, and returns info about remaining gameplay time.
|
||||
//
|
||||
// This callback is fired asynchronously in response to timers triggering.
|
||||
// It is also fired in response to calls to GetDurationControl().
|
||||
//-----------------------------------------------------------------------------
|
||||
struct DurationControl_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserCallbacks + 67 };
|
||||
|
||||
EResult m_eResult; // result of call (always k_EResultOK for asynchronous timer-based notifications)
|
||||
AppId_t m_appid; // appid generating playtime
|
||||
|
||||
bool m_bApplicable; // is duration control applicable to user + game combination
|
||||
int32 m_csecsLast5h; // playtime since most recent 5 hour gap in playtime, only counting up to regulatory limit of playtime, in seconds
|
||||
|
||||
EDurationControlProgress m_progress; // recommended progress (either everything is fine, or please exit game)
|
||||
EDurationControlNotification m_notification; // notification to show, if any (always k_EDurationControlNotification_None for API calls)
|
||||
|
||||
int32 m_csecsToday; // playtime on current calendar day
|
||||
int32 m_csecsRemaining; // playtime remaining until the user hits a regulatory limit
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// callback for GetTicketForWebApi
|
||||
//-----------------------------------------------------------------------------
|
||||
struct GetTicketForWebApiResponse_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUserCallbacks + 68 };
|
||||
HAuthTicket m_hAuthTicket;
|
||||
EResult m_eResult;
|
||||
int m_cubTicket;
|
||||
static const int k_nCubTicketMaxLength = 2560;
|
||||
uint8 m_rgubTicket[k_nCubTicketMaxLength];
|
||||
};
|
||||
|
||||
|
||||
#pragma pack( pop )
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//====== Copyright <20> 1996-2009, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: interface to stats, achievements, and leaderboards
|
||||
// Purpose: interface to stats, achievements, and leaderboards
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
@ -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)
|
||||
@ -48,7 +48,7 @@ enum ELeaderboardSortMethod
|
||||
// the display type (used by the Steam Community web site) for a leaderboard
|
||||
enum ELeaderboardDisplayType
|
||||
{
|
||||
k_ELeaderboardDisplayTypeNone = 0,
|
||||
k_ELeaderboardDisplayTypeNone = 0,
|
||||
k_ELeaderboardDisplayTypeNumeric = 1, // simple numerical score
|
||||
k_ELeaderboardDisplayTypeTimeSeconds = 2, // the score represents a time, in seconds
|
||||
k_ELeaderboardDisplayTypeTimeMilliSeconds = 3, // the score represents a time, in milliseconds
|
||||
@ -67,8 +67,8 @@ enum ELeaderboardUploadScoreMethod
|
||||
#elif defined( VALVE_CALLBACK_PACK_LARGE )
|
||||
#pragma pack( push, 8 )
|
||||
#else
|
||||
#error isteamclient.h must be included
|
||||
#endif
|
||||
#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx
|
||||
#endif
|
||||
|
||||
struct LeaderboardEntry_t
|
||||
{
|
||||
@ -89,15 +89,23 @@ class ISteamUserStats
|
||||
{
|
||||
public:
|
||||
// Ask the server to send down this user's data and achievements for this game
|
||||
STEAM_CALL_BACK( UserStatsReceived_t )
|
||||
virtual bool RequestCurrentStats() = 0;
|
||||
|
||||
// Data accessors
|
||||
STEAM_FLAT_NAME( GetStatInt32 )
|
||||
virtual bool GetStat( const char *pchName, int32 *pData ) = 0;
|
||||
|
||||
STEAM_FLAT_NAME( GetStatFloat )
|
||||
virtual bool GetStat( const char *pchName, float *pData ) = 0;
|
||||
|
||||
// Set / update data
|
||||
STEAM_FLAT_NAME( SetStatInt32 )
|
||||
virtual bool SetStat( const char *pchName, int32 nData ) = 0;
|
||||
|
||||
STEAM_FLAT_NAME( SetStatFloat )
|
||||
virtual bool SetStat( const char *pchName, float fData ) = 0;
|
||||
|
||||
virtual bool UpdateAvgRateStat( const char *pchName, float flCountThisSession, double dSessionLength ) = 0;
|
||||
|
||||
// Achievement flag accessors
|
||||
@ -106,14 +114,14 @@ public:
|
||||
virtual bool ClearAchievement( const char *pchName ) = 0;
|
||||
|
||||
// Get the achievement status, and the time it was unlocked if unlocked.
|
||||
// If the return value is true, but the unlock time is zero, that means it was unlocked before Steam
|
||||
// If the return value is true, but the unlock time is zero, that means it was unlocked before Steam
|
||||
// began tracking achievement unlock times (December 2009). Time is seconds since January 1, 1970.
|
||||
virtual bool GetAchievementAndUnlockTime( const char *pchName, bool *pbAchieved, uint32 *punUnlockTime ) = 0;
|
||||
|
||||
// Store the current data on the server, will get a callback when set
|
||||
// And one callback for every new achievement
|
||||
//
|
||||
// If the callback has a result of k_EResultInvalidParam, one or more stats
|
||||
// If the callback has a result of k_EResultInvalidParam, one or more stats
|
||||
// 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.
|
||||
@ -121,7 +129,7 @@ public:
|
||||
|
||||
// Achievement / GroupAchievement metadata
|
||||
|
||||
// Gets the icon of the achievement, which is a handle to be used in ISteamUtils::GetImageRGBA(), or 0 if none set.
|
||||
// Gets the icon of the achievement, which is a handle to be used in ISteamUtils::GetImageRGBA(), or 0 if none set.
|
||||
// A return value of 0 may indicate we are still fetching data, and you can wait for the UserAchievementIconFetched_t callback
|
||||
// which will notify you when the bits are ready. If the callback still returns zero, then there is no image set for the
|
||||
// specified achievement.
|
||||
@ -148,26 +156,33 @@ 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
|
||||
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()
|
||||
STEAM_FLAT_NAME( GetUserStatInt32 )
|
||||
virtual bool GetUserStat( CSteamID steamIDUser, const char *pchName, int32 *pData ) = 0;
|
||||
|
||||
STEAM_FLAT_NAME( GetUserStatFloat )
|
||||
virtual bool GetUserStat( CSteamID steamIDUser, const char *pchName, float *pData ) = 0;
|
||||
|
||||
virtual bool GetUserAchievement( CSteamID steamIDUser, const char *pchName, bool *pbAchieved ) = 0;
|
||||
// See notes for GetAchievementAndUnlockTime above
|
||||
virtual bool GetUserAchievementAndUnlockTime( CSteamID steamIDUser, const char *pchName, bool *pbAchieved, uint32 *punUnlockTime ) = 0;
|
||||
|
||||
// Reset stats
|
||||
// Reset stats
|
||||
virtual bool ResetAllStats( bool bAchievementsToo ) = 0;
|
||||
|
||||
// Leaderboard functions
|
||||
|
||||
// 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
|
||||
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
|
||||
STEAM_CALL_RESULT( LeaderboardFindResult_t )
|
||||
virtual SteamAPICall_t FindLeaderboard( const char *pchLeaderboardName ) = 0;
|
||||
|
||||
// returns the name of a leaderboard
|
||||
@ -189,12 +204,15 @@ public:
|
||||
// k_ELeaderboardDataRequestGlobal requests rows in the leaderboard from the full table, with nRangeStart & nRangeEnd in the range [1, TotalEntries]
|
||||
// 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
|
||||
// k_ELeaderboardDataRequestFriends requests all the rows for friends of the current user
|
||||
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
|
||||
virtual SteamAPICall_t DownloadLeaderboardEntriesForUsers( SteamLeaderboard_t hSteamLeaderboard, CSteamID *prgUsers, int cUsers ) = 0;
|
||||
STEAM_CALL_RESULT( LeaderboardScoresDownloaded_t )
|
||||
virtual SteamAPICall_t DownloadLeaderboardEntriesForUsers( SteamLeaderboard_t hSteamLeaderboard,
|
||||
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
|
||||
@ -216,24 +234,28 @@ 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
|
||||
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.
|
||||
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
|
||||
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.
|
||||
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
|
||||
// the next most achieved afterwards. Will return -1 if there is no data on achievement
|
||||
// the next most achieved afterwards. Will return -1 if there is no data on achievement
|
||||
// percentages (ie, you haven't called RequestGlobalAchievementPercentages and waited on the callback).
|
||||
virtual int GetMostAchievedAchievementInfo( char *pchName, uint32 unNameBufLen, float *pflPercent, bool *pbAchieved ) = 0;
|
||||
|
||||
@ -249,41 +271,43 @@ 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.
|
||||
STEAM_CALL_RESULT( GlobalStatsReceived_t )
|
||||
virtual SteamAPICall_t RequestGlobalStats( int nHistoryDays ) = 0;
|
||||
|
||||
// Gets the lifetime totals for an aggregated stat
|
||||
STEAM_FLAT_NAME( GetGlobalStatInt64 )
|
||||
virtual bool GetGlobalStat( const char *pchStatName, int64 *pData ) = 0;
|
||||
|
||||
STEAM_FLAT_NAME( GetGlobalStatDouble )
|
||||
virtual bool GetGlobalStat( const char *pchStatName, double *pData ) = 0;
|
||||
|
||||
// Gets history for an aggregated stat. pData will be filled with daily values, starting with today.
|
||||
// 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
|
||||
// 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, int64 *pData, uint32 cubData ) = 0;
|
||||
virtual int32 GetGlobalStatHistory( const char *pchStatName, 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
|
||||
// callback.
|
||||
virtual bool InstallPS3Trophies() = 0;
|
||||
STEAM_FLAT_NAME( GetGlobalStatHistoryInt64 )
|
||||
virtual int32 GetGlobalStatHistory( const char *pchStatName, STEAM_ARRAY_COUNT(cubData) int64 *pData, uint32 cubData ) = 0;
|
||||
|
||||
// Returns the amount of space required at boot to install trophies. This value can be used when comparing the amount of space needed
|
||||
// by the game to the available space value passed to the game at boot. The value is set during InstallPS3Trophies().
|
||||
virtual uint64 GetTrophySpaceRequiredBeforeInstall() = 0;
|
||||
STEAM_FLAT_NAME( GetGlobalStatHistoryDouble )
|
||||
virtual int32 GetGlobalStatHistory( const char *pchStatName, STEAM_ARRAY_COUNT(cubData) double *pData, uint32 cubData ) = 0;
|
||||
|
||||
// On PS3, user stats & achievement progress through Steam must be stored with the user's saved game data.
|
||||
// At startup, before calling RequestCurrentStats(), you must pass the user's stats data to Steam via this method.
|
||||
// If you do not have any user data, call this function with pvData = NULL and cubData = 0
|
||||
virtual bool SetUserStatsData( const void *pvData, uint32 cubData ) = 0;
|
||||
// For achievements that have related Progress stats, use this to query what the bounds of that progress are.
|
||||
// You may want this info to selectively call IndicateAchievementProgress when appropriate milestones of progress
|
||||
// have been made, to show a progress notification to the user.
|
||||
STEAM_FLAT_NAME( GetAchievementProgressLimitsInt32 )
|
||||
virtual bool GetAchievementProgressLimits( const char *pchName, int32 *pnMinProgress, int32 *pnMaxProgress ) = 0;
|
||||
|
||||
STEAM_FLAT_NAME( GetAchievementProgressLimitsFloat )
|
||||
virtual bool GetAchievementProgressLimits( const char *pchName, float *pfMinProgress, float *pfMaxProgress ) = 0;
|
||||
|
||||
// Call to get the user's current stats data. You should retrieve this data after receiving successful UserStatsReceived_t & UserStatsStored_t
|
||||
// callbacks, and store the data with the user's save game data. You can call this method with pvData = NULL and cubData = 0 to get the required
|
||||
// buffer size.
|
||||
virtual bool GetUserStatsData( void *pvData, uint32 cubData, uint32 *pcubWritten ) = 0;
|
||||
#endif
|
||||
};
|
||||
|
||||
#define STEAMUSERSTATS_INTERFACE_VERSION "STEAMUSERSTATS_INTERFACE_VERSION011"
|
||||
#define STEAMUSERSTATS_INTERFACE_VERSION "STEAMUSERSTATS_INTERFACE_VERSION012"
|
||||
|
||||
// Global interface accessor
|
||||
inline ISteamUserStats *SteamUserStats();
|
||||
STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamUserStats *, SteamUserStats, STEAMUSERSTATS_INTERFACE_VERSION );
|
||||
|
||||
// callbacks
|
||||
#if defined( VALVE_CALLBACK_PACK_SMALL )
|
||||
@ -291,8 +315,8 @@ public:
|
||||
#elif defined( VALVE_CALLBACK_PACK_LARGE )
|
||||
#pragma pack( push, 8 )
|
||||
#else
|
||||
#error isteamclient.h must be included
|
||||
#endif
|
||||
#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx
|
||||
#endif
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: called when the latests stats and achievements have been received
|
||||
@ -319,7 +343,7 @@ struct UserStatsStored_t
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: result of a request to store the achievements for a game, or an
|
||||
// Purpose: result of a request to store the achievements for a game, or an
|
||||
// "indicate progress" call. If both m_nCurProgress and m_nMaxProgress
|
||||
// are zero, that means the achievement has been fully unlocked.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
@ -1,4 +1,4 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//====== Copyright <20> 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: interface to utility functions in Steam
|
||||
//
|
||||
@ -6,11 +6,8 @@
|
||||
|
||||
#ifndef ISTEAMUTILS_H
|
||||
#define ISTEAMUTILS_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "isteamclient.h"
|
||||
#include "steam_api_common.h"
|
||||
|
||||
|
||||
// Steam API call failure results
|
||||
@ -41,12 +38,24 @@ enum EGamepadTextInputLineMode
|
||||
k_EGamepadTextInputLineModeMultipleLines = 1
|
||||
};
|
||||
|
||||
enum EFloatingGamepadTextInputMode
|
||||
{
|
||||
k_EFloatingGamepadTextInputModeModeSingleLine = 0, // Enter dismisses the keyboard
|
||||
k_EFloatingGamepadTextInputModeModeMultipleLines = 1, // User needs to explictly close the keyboard
|
||||
k_EFloatingGamepadTextInputModeModeEmail = 2, // Keyboard layout is email, enter dismisses the keyboard
|
||||
k_EFloatingGamepadTextInputModeModeNumeric = 3, // Keyboard layout is numeric, enter dismisses the keyboard
|
||||
|
||||
};
|
||||
|
||||
// The context where text filtering is being done
|
||||
enum ETextFilteringContext
|
||||
{
|
||||
k_ETextFilteringContextUnknown = 0, // Unknown context
|
||||
k_ETextFilteringContextGameContent = 1, // Game content, only legally required filtering is performed
|
||||
k_ETextFilteringContextChat = 2, // Chat from another player
|
||||
k_ETextFilteringContextName = 3, // Character or item name
|
||||
};
|
||||
|
||||
// function prototype for warning message hook
|
||||
#if defined( POSIX )
|
||||
#define __cdecl
|
||||
#endif
|
||||
extern "C" typedef void (__cdecl *SteamAPIWarningMessageHook_t)(int, const char *);
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: interface to user independent utility functions
|
||||
@ -54,14 +63,14 @@ extern "C" typedef void (__cdecl *SteamAPIWarningMessageHook_t)(int, const char
|
||||
class ISteamUtils
|
||||
{
|
||||
public:
|
||||
// return the number of seconds since the user
|
||||
// return the number of seconds since the user
|
||||
virtual uint32 GetSecondsSinceAppActive() = 0;
|
||||
virtual uint32 GetSecondsSinceComputerActive() = 0;
|
||||
|
||||
// the universe this client is connecting to
|
||||
virtual EUniverse GetConnectedUniverse() = 0;
|
||||
|
||||
// Steam server time - in PST, number of seconds since January 1, 1970 (i.e unix time)
|
||||
// Steam server time. Number of seconds since January 1, 1970, GMT (i.e unix time)
|
||||
virtual uint32 GetServerRealTime() = 0;
|
||||
|
||||
// returns the 2 digit ISO 3166-1-alpha-2 format country code this client is running in (as looked up via an IP-to-location database)
|
||||
@ -76,8 +85,8 @@ public:
|
||||
// the destination buffer size should be 4 * height * width * sizeof(char)
|
||||
virtual bool GetImageRGBA( int iImage, uint8 *pubDest, int nDestBufferSize ) = 0;
|
||||
|
||||
// returns the IP of the reporting server for valve - currently only used in Source engine games
|
||||
virtual bool GetCSERIPPort( uint32 *unIP, uint16 *usPort ) = 0;
|
||||
// Deprecated. Do not call this.
|
||||
STEAM_PRIVATE_API( virtual bool GetCSERIPPort( uint32 *unIP, uint16 *usPort ) = 0; )
|
||||
|
||||
// return the amount of battery power left in the current system in % [0..100], 255 for being on AC power
|
||||
virtual uint8 GetCurrentBatteryPower() = 0;
|
||||
@ -95,9 +104,8 @@ public:
|
||||
virtual ESteamAPICallFailure GetAPICallFailureReason( SteamAPICall_t hSteamAPICall ) = 0;
|
||||
virtual bool GetAPICallResult( SteamAPICall_t hSteamAPICall, void *pCallback, int cubCallback, int iCallbackExpected, bool *pbFailed ) = 0;
|
||||
|
||||
// this needs to be called every frame to process matchmaking results
|
||||
// redundant if you're already calling SteamAPI_RunCallbacks()
|
||||
virtual void RunFrame() = 0;
|
||||
// Deprecated. Applications should use SteamAPI_RunCallbacks() instead. Game servers do not need to call this function.
|
||||
STEAM_PRIVATE_API( virtual void RunFrame() = 0; )
|
||||
|
||||
// returns the number of IPC calls made since the last time this function was called
|
||||
// Used for perf debugging so you can understand how many IPC calls your game makes per frame
|
||||
@ -115,10 +123,10 @@ public:
|
||||
// start & hook the game process, so this function will initially return false while the overlay is loading.
|
||||
virtual bool IsOverlayEnabled() = 0;
|
||||
|
||||
// Normally this call is unneeded if your game has a constantly running frame loop that calls the
|
||||
// Normally this call is unneeded if your game has a constantly running frame loop that calls the
|
||||
// D3D Present API, or OGL SwapBuffers API every frame.
|
||||
//
|
||||
// However, if you have a game that only refreshes the screen on an event driven basis then that can break
|
||||
// However, if you have a game that only refreshes the screen on an event driven basis then that can break
|
||||
// the overlay, as it uses your Present/SwapBuffers calls to drive it's internal frame loop and it may also
|
||||
// need to Present() to the screen any time an even needing a notification happens or when the overlay is
|
||||
// brought up over the game by a user. You can use this API to ask the overlay if it currently need a present
|
||||
@ -126,41 +134,101 @@ public:
|
||||
// refresh the screen with Present or SwapBuffers to allow the overlay to do it's work.
|
||||
virtual bool BOverlayNeedsPresent() = 0;
|
||||
|
||||
#ifndef _PS3
|
||||
// Asynchronous call to check if an executable file has been signed using the public key set on the signing tab
|
||||
// of the partner site, for example to refuse to load modified executable files.
|
||||
// of the partner site, for example to refuse to load modified executable files.
|
||||
// The result is returned in CheckFileSignature_t.
|
||||
// k_ECheckFileSignatureNoSignaturesFoundForThisApp - This app has not been configured on the signing tab of the partner site to enable this function.
|
||||
// k_ECheckFileSignatureNoSignaturesFoundForThisFile - This file is not listed on the signing tab for the partner site.
|
||||
// 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.
|
||||
STEAM_CALL_RESULT( CheckFileSignature_t )
|
||||
virtual SteamAPICall_t CheckFileSignature( const char *szFileName ) = 0;
|
||||
#endif
|
||||
|
||||
#ifdef _PS3
|
||||
virtual void PostPS3SysutilCallback( uint64 status, uint64 param, void* userdata ) = 0;
|
||||
virtual bool BIsReadyToShutdown() = 0;
|
||||
virtual bool BIsPSNOnline() = 0;
|
||||
|
||||
// Call this with localized strings for the language the game is running in, otherwise default english
|
||||
// strings will be used by Steam.
|
||||
virtual void SetPSNGameBootInviteStrings( const char *pchSubject, const char *pchBody ) = 0;
|
||||
#endif
|
||||
|
||||
// Activates the Big Picture text input dialog which only supports gamepad input
|
||||
virtual bool ShowGamepadTextInput( EGamepadTextInputMode eInputMode, EGamepadTextInputLineMode eLineInputMode, const char *pchDescription, uint32 unCharMax ) = 0;
|
||||
// Activates the full-screen text input dialog which takes a initial text string and returns the text the user has typed
|
||||
virtual bool ShowGamepadTextInput( EGamepadTextInputMode eInputMode, EGamepadTextInputLineMode eLineInputMode, const char *pchDescription, uint32 unCharMax, const char *pchExistingText ) = 0;
|
||||
|
||||
// Returns previously entered text & length
|
||||
virtual uint32 GetEnteredGamepadTextLength() = 0;
|
||||
virtual bool GetEnteredGamepadTextInput( char *pchText, uint32 cchText ) = 0;
|
||||
virtual bool GetEnteredGamepadTextInput( char *pchText, uint32 cchText ) = 0;
|
||||
|
||||
// returns the language the steam client is running in, you probably want ISteamApps::GetCurrentGameLanguage instead, this is for very special usage cases
|
||||
virtual const char *GetSteamUILanguage() = 0;
|
||||
|
||||
// returns true if Steam itself is running in VR mode
|
||||
virtual bool IsSteamRunningInVR() = 0;
|
||||
|
||||
// Sets the inset of the overlay notification from the corner specified by SetOverlayNotificationPosition.
|
||||
virtual void SetOverlayNotificationInset( int nHorizontalInset, int nVerticalInset ) = 0;
|
||||
|
||||
// returns true if Steam & the Steam Overlay are running in Big Picture mode
|
||||
// Games much be launched through the Steam client to enable the Big Picture overlay. During development,
|
||||
// a game can be added as a non-steam game to the developers library to test this feature
|
||||
virtual bool IsSteamInBigPictureMode() = 0;
|
||||
|
||||
// ask SteamUI to create and render its OpenVR dashboard
|
||||
virtual void StartVRDashboard() = 0;
|
||||
|
||||
// Returns true if the HMD content will be streamed via Steam Remote Play
|
||||
virtual bool IsVRHeadsetStreamingEnabled() = 0;
|
||||
|
||||
// Set whether the HMD content will be streamed via Steam Remote Play
|
||||
// If this is set to true, then the scene in the HMD headset will be streamed, and remote input will not be allowed.
|
||||
// If this is set to false, then the application window will be streamed instead, and remote input will be allowed.
|
||||
// The default is true unless "VRHeadsetStreaming" "0" is in the extended appinfo for a game.
|
||||
// (this is useful for games that have asymmetric multiplayer gameplay)
|
||||
virtual void SetVRHeadsetStreamingEnabled( bool bEnabled ) = 0;
|
||||
|
||||
// Returns whether this steam client is a Steam China specific client, vs the global client.
|
||||
virtual bool IsSteamChinaLauncher() = 0;
|
||||
|
||||
// Initializes text filtering, loading dictionaries for the language the game is running in.
|
||||
// unFilterOptions are reserved for future use and should be set to 0
|
||||
// Returns false if filtering is unavailable for the game's language, in which case FilterText() will act as a passthrough.
|
||||
//
|
||||
// Users can customize the text filter behavior in their Steam Account preferences:
|
||||
// https://store.steampowered.com/account/preferences#CommunityContentPreferences
|
||||
virtual bool InitFilterText( uint32 unFilterOptions = 0 ) = 0;
|
||||
|
||||
// Filters the provided input message and places the filtered result into pchOutFilteredText, using legally required filtering and additional filtering based on the context and user settings
|
||||
// eContext is the type of content in the input string
|
||||
// sourceSteamID is the Steam ID that is the source of the input string (e.g. the player with the name, or who said the chat text)
|
||||
// pchInputText is the input string that should be filtered, which can be ASCII or UTF-8
|
||||
// pchOutFilteredText is where the output will be placed, even if no filtering is performed
|
||||
// nByteSizeOutFilteredText is the size (in bytes) of pchOutFilteredText, should be at least strlen(pchInputText)+1
|
||||
// Returns the number of characters (not bytes) filtered
|
||||
virtual int FilterText( ETextFilteringContext eContext, CSteamID sourceSteamID, const char *pchInputMessage, char *pchOutFilteredText, uint32 nByteSizeOutFilteredText ) = 0;
|
||||
|
||||
// Return what we believe your current ipv6 connectivity to "the internet" is on the specified protocol.
|
||||
// This does NOT tell you if the Steam client is currently connected to Steam via ipv6.
|
||||
virtual ESteamIPv6ConnectivityState GetIPv6ConnectivityState( ESteamIPv6ConnectivityProtocol eProtocol ) = 0;
|
||||
|
||||
// returns true if currently running on the Steam Deck device
|
||||
virtual bool IsSteamRunningOnSteamDeck() = 0;
|
||||
|
||||
// Opens a floating keyboard over the game content and sends OS keyboard keys directly to the game.
|
||||
// The text field position is specified in pixels relative the origin of the game window and is used to position the floating keyboard in a way that doesn't cover the text field
|
||||
virtual bool ShowFloatingGamepadTextInput( EFloatingGamepadTextInputMode eKeyboardMode, int nTextFieldXPosition, int nTextFieldYPosition, int nTextFieldWidth, int nTextFieldHeight ) = 0;
|
||||
|
||||
// In game launchers that don't have controller support you can call this to have Steam Input translate the controller input into mouse/kb to navigate the launcher
|
||||
virtual void SetGameLauncherMode( bool bLauncherMode ) = 0;
|
||||
|
||||
// Dismisses the floating keyboard.
|
||||
virtual bool DismissFloatingGamepadTextInput() = 0;
|
||||
|
||||
// Dismisses the full-screen text input dialog.
|
||||
virtual bool DismissGamepadTextInput() = 0;
|
||||
};
|
||||
|
||||
#define STEAMUTILS_INTERFACE_VERSION "SteamUtils006"
|
||||
#define STEAMUTILS_INTERFACE_VERSION "SteamUtils010"
|
||||
|
||||
// Global interface accessor
|
||||
inline ISteamUtils *SteamUtils();
|
||||
STEAM_DEFINE_INTERFACE_ACCESSOR( ISteamUtils *, SteamUtils, SteamInternal_FindOrCreateUserInterface( 0, STEAMUTILS_INTERFACE_VERSION ), "user", STEAMUTILS_INTERFACE_VERSION );
|
||||
|
||||
// Global accessor for the gameserver client
|
||||
inline ISteamUtils *SteamGameServerUtils();
|
||||
STEAM_DEFINE_INTERFACE_ACCESSOR( ISteamUtils *, SteamGameServerUtils, SteamInternal_FindOrCreateGameServerInterface( 0, STEAMUTILS_INTERFACE_VERSION ), "gameserver", STEAMUTILS_INTERFACE_VERSION );
|
||||
|
||||
// callbacks
|
||||
#if defined( VALVE_CALLBACK_PACK_SMALL )
|
||||
@ -168,8 +236,8 @@ public:
|
||||
#elif defined( VALVE_CALLBACK_PACK_LARGE )
|
||||
#pragma pack( push, 8 )
|
||||
#else
|
||||
#error isteamclient.h must be included
|
||||
#endif
|
||||
#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx
|
||||
#endif
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: The country of the user changed
|
||||
@ -181,7 +249,7 @@ struct IPCountry_t
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Fired when running on a laptop and less than 10 minutes of battery is left, fires then every minute
|
||||
// Purpose: Fired when running on a handheld PC or laptop with less than 10 minutes of battery is left, fires then every minute
|
||||
//-----------------------------------------------------------------------------
|
||||
struct LowBatteryPower_t
|
||||
{
|
||||
@ -197,6 +265,8 @@ struct SteamAPICallCompleted_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUtilsCallbacks + 3 };
|
||||
SteamAPICall_t m_hAsyncCall;
|
||||
int m_iCallback;
|
||||
uint32 m_cubParam;
|
||||
};
|
||||
|
||||
|
||||
@ -229,75 +299,44 @@ struct CheckFileSignature_t
|
||||
ECheckFileSignature m_eCheckFileSignature;
|
||||
};
|
||||
|
||||
#ifdef _PS3
|
||||
//-----------------------------------------------------------------------------
|
||||
// callback for NetCtlNetStartDialog finishing on PS3
|
||||
//-----------------------------------------------------------------------------
|
||||
struct NetStartDialogFinished_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUtilsCallbacks + 6 };
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// callback for NetCtlNetStartDialog unloaded on PS3
|
||||
//-----------------------------------------------------------------------------
|
||||
struct NetStartDialogUnloaded_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUtilsCallbacks + 7 };
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// callback for system menu closing on PS3 - should trigger resyncronizing friends list, etc.
|
||||
//-----------------------------------------------------------------------------
|
||||
struct PS3SystemMenuClosed_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUtilsCallbacks + 8 };
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// callback for NP message being selected by user on PS3 - should trigger handling of message if it's a lobby invite, etc.
|
||||
//-----------------------------------------------------------------------------
|
||||
struct PS3NPMessageSelected_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUtilsCallbacks + 9 };
|
||||
uint32 dataid;
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// callback for when the PS3 keyboard dialog closes
|
||||
//-----------------------------------------------------------------------------
|
||||
struct PS3KeyboardDialogFinished_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUtilsCallbacks + 10 };
|
||||
};
|
||||
|
||||
// k_iSteamUtilsCallbacks + 11 is taken
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// callback for PSN status changing on PS3
|
||||
//-----------------------------------------------------------------------------
|
||||
struct PS3PSNStatusChange_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUtilsCallbacks + 12 };
|
||||
bool m_bPSNOnline;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
// k_iSteamUtilsCallbacks + 13 is taken
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Big Picture gamepad text input has been closed
|
||||
// Full Screen gamepad text input has been closed
|
||||
//-----------------------------------------------------------------------------
|
||||
struct GamepadTextInputDismissed_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUtilsCallbacks + 14 };
|
||||
bool m_bSubmitted; // true if user entered & accepted text (Call ISteamUtils::GetEnteredGamepadTextInput() for text), false if canceled input
|
||||
uint32 m_unSubmittedText;
|
||||
AppId_t m_unAppID;
|
||||
};
|
||||
|
||||
// k_iSteamUtilsCallbacks + 15 is taken
|
||||
// k_iSteamUtilsCallbacks + 15 through 35 are taken
|
||||
|
||||
STEAM_CALLBACK_BEGIN( AppResumingFromSuspend_t, k_iSteamUtilsCallbacks + 36 )
|
||||
STEAM_CALLBACK_END(0)
|
||||
|
||||
// k_iSteamUtilsCallbacks + 37 is taken
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// The floating on-screen keyboard has been closed
|
||||
//-----------------------------------------------------------------------------
|
||||
struct FloatingGamepadTextInputDismissed_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUtilsCallbacks + 38 };
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// The text filtering dictionary has changed
|
||||
//-----------------------------------------------------------------------------
|
||||
struct FilterTextDictionaryChanged_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamUtilsCallbacks + 39 };
|
||||
int m_eLanguage; // One of ELanguage, or k_LegallyRequiredFiltering
|
||||
};
|
||||
|
||||
#pragma pack( pop )
|
||||
|
||||
|
67
rehlds/public/steam/isteamvideo.h
Normal file
67
rehlds/public/steam/isteamvideo.h
Normal file
@ -0,0 +1,67 @@
|
||||
//====== Copyright © 1996-2014 Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: interface to Steam Video
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ISTEAMVIDEO_H
|
||||
#define ISTEAMVIDEO_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "steam_api_common.h"
|
||||
|
||||
// callbacks
|
||||
#if defined( VALVE_CALLBACK_PACK_SMALL )
|
||||
#pragma pack( push, 4 )
|
||||
#elif defined( VALVE_CALLBACK_PACK_LARGE )
|
||||
#pragma pack( push, 8 )
|
||||
#else
|
||||
#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx
|
||||
#endif
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Steam Video API
|
||||
//-----------------------------------------------------------------------------
|
||||
class ISteamVideo
|
||||
{
|
||||
public:
|
||||
|
||||
// Get a URL suitable for streaming the given Video app ID's video
|
||||
virtual void GetVideoURL( AppId_t unVideoAppID ) = 0;
|
||||
|
||||
// returns true if user is uploading a live broadcast
|
||||
virtual bool IsBroadcasting( int *pnNumViewers ) = 0;
|
||||
|
||||
// Get the OPF Details for 360 Video Playback
|
||||
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_V007"
|
||||
|
||||
// Global interface accessor
|
||||
inline ISteamVideo *SteamVideo();
|
||||
STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamVideo *, SteamVideo, STEAMVIDEO_INTERFACE_VERSION );
|
||||
|
||||
STEAM_CALLBACK_BEGIN( GetVideoURLResult_t, k_iSteamVideoCallbacks + 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)
|
||||
|
||||
|
||||
STEAM_CALLBACK_BEGIN( GetOPFSettingsResult_t, k_iSteamVideoCallbacks + 24 )
|
||||
STEAM_CALLBACK_MEMBER( 0, EResult, m_eResult )
|
||||
STEAM_CALLBACK_MEMBER( 1, AppId_t, m_unVideoAppID )
|
||||
STEAM_CALLBACK_END(2)
|
||||
|
||||
|
||||
#pragma pack( pop )
|
||||
|
||||
|
||||
#endif // ISTEAMVIDEO_H
|
@ -1,6 +1,6 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//========= Copyright <EFBFBD> 1996-2008, Valve LLC, All rights reserved. ============
|
||||
//
|
||||
// Purpose:
|
||||
// Purpose:
|
||||
//
|
||||
// $NoKeywords: $
|
||||
//=============================================================================
|
||||
@ -8,21 +8,9 @@
|
||||
#ifndef MATCHMAKINGTYPES_H
|
||||
#define MATCHMAKINGTYPES_H
|
||||
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#ifdef POSIX
|
||||
#ifndef _snprintf
|
||||
#define _snprintf snprintf
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "common.h" //Q_snprinf
|
||||
|
||||
//
|
||||
// Max size (in bytes of UTF-8 data, not in characters) of server fields, including null terminator.
|
||||
// WARNING: These cannot be changed easily, without breaking clients using old interfaces.
|
||||
@ -34,6 +22,11 @@ const int k_cbMaxGameServerName = 64;
|
||||
const int k_cbMaxGameServerTags = 128;
|
||||
const int k_cbMaxGameServerGameData = 2048;
|
||||
|
||||
/// Store key/value pair used in matchmaking queries.
|
||||
///
|
||||
/// Actually, the name Key/Value is a bit misleading. The "key" is better
|
||||
/// understood as "filter operation code" and the "value" is the operand to this
|
||||
/// filter operation. The meaning of the operand depends upon the filter.
|
||||
struct MatchMakingKeyValuePair_t
|
||||
{
|
||||
MatchMakingKeyValuePair_t() { m_szKey[0] = m_szValue[0] = 0; }
|
||||
@ -58,17 +51,14 @@ enum EMatchMakingServerResponse
|
||||
|
||||
// servernetadr_t is all the addressing info the serverbrowser needs to know about a game server,
|
||||
// namely: its IP, its connection port, and its query port.
|
||||
class servernetadr_t
|
||||
class servernetadr_t
|
||||
{
|
||||
public:
|
||||
|
||||
|
||||
servernetadr_t() : m_usConnectionPort( 0 ), m_usQueryPort( 0 ), m_unIP( 0 ) {}
|
||||
|
||||
void Init( unsigned int ip, uint16 usQueryPort, uint16 usConnectionPort );
|
||||
|
||||
// Uncompatible feature commented
|
||||
//#ifdef NETADR_H
|
||||
// netadr_t GetIPAndQueryPort();
|
||||
//#endif
|
||||
|
||||
// Access the query port.
|
||||
uint16 GetQueryPort() const;
|
||||
void SetQueryPort( uint16 usPort );
|
||||
@ -79,7 +69,7 @@ public:
|
||||
|
||||
// Access the IP
|
||||
uint32 GetIP() const;
|
||||
void SetIP( uint32 );
|
||||
void SetIP( uint32 unIP );
|
||||
|
||||
// This gets the 'a.b.c.d:port' string with the connection port (instead of the query port).
|
||||
const char *GetConnectionAddressString() const;
|
||||
@ -94,7 +84,7 @@ public:
|
||||
m_unIP = that.m_unIP;
|
||||
}
|
||||
|
||||
|
||||
|
||||
private:
|
||||
const char *ToString( uint32 unIP, uint16 usPort ) const;
|
||||
uint16 m_usConnectionPort; // (in HOST byte order)
|
||||
@ -110,14 +100,6 @@ inline void servernetadr_t::Init( unsigned int ip, uint16 usQueryPort, uint16 us
|
||||
m_usConnectionPort = usConnectionPort;
|
||||
}
|
||||
|
||||
// Uncompatible feature commented
|
||||
//#ifdef NETADR_H
|
||||
//inline netadr_t servernetadr_t::GetIPAndQueryPort()
|
||||
//{
|
||||
// return netadr_t( m_unIP, m_usQueryPort );
|
||||
//}
|
||||
//#endif
|
||||
|
||||
inline uint16 servernetadr_t::GetQueryPort() const
|
||||
{
|
||||
return m_usQueryPort;
|
||||
@ -154,9 +136,9 @@ inline const char *servernetadr_t::ToString( uint32 unIP, uint16 usPort ) const
|
||||
static int nBuf = 0;
|
||||
unsigned char *ipByte = (unsigned char *)&unIP;
|
||||
#ifdef VALVE_BIG_ENDIAN
|
||||
Q_snprintf (s[nBuf], sizeof( s[nBuf] ), "%u.%u.%u.%u:%i", (int)(ipByte[0]), (int)(ipByte[1]), (int)(ipByte[2]), (int)(ipByte[3]), usPort );
|
||||
snprintf(s[nBuf], sizeof( s[nBuf] ), "%u.%u.%u.%u:%i", (int)(ipByte[0]), (int)(ipByte[1]), (int)(ipByte[2]), (int)(ipByte[3]), usPort );
|
||||
#else
|
||||
Q_snprintf (s[nBuf], sizeof( s[nBuf] ), "%u.%u.%u.%u:%i", (int)(ipByte[3]), (int)(ipByte[2]), (int)(ipByte[1]), (int)(ipByte[0]), usPort );
|
||||
snprintf(s[nBuf], sizeof( s[nBuf] ), "%u.%u.%u.%u:%i", (int)(ipByte[3]), (int)(ipByte[2]), (int)(ipByte[1]), (int)(ipByte[0]), usPort );
|
||||
#endif
|
||||
const char *pchRet = s[nBuf];
|
||||
++nBuf;
|
||||
@ -171,7 +153,7 @@ inline const char* servernetadr_t::GetConnectionAddressString() const
|
||||
|
||||
inline const char* servernetadr_t::GetQueryAddressString() const
|
||||
{
|
||||
return ToString( m_unIP, m_usQueryPort );
|
||||
return ToString( m_unIP, m_usQueryPort );
|
||||
}
|
||||
|
||||
inline bool servernetadr_t::operator<(const servernetadr_t &netadr) const
|
||||
|
@ -1,6 +1,13 @@
|
||||
//========= Copyright 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"
|
||||
@ -20,42 +31,22 @@
|
||||
#include "isteamnetworking.h"
|
||||
#include "isteamremotestorage.h"
|
||||
#include "isteamscreenshots.h"
|
||||
#include "isteammusic.h"
|
||||
#include "isteammusicremote.h"
|
||||
#include "isteamhttp.h"
|
||||
#include "isteamunifiedmessages.h"
|
||||
#include "isteamcontroller.h"
|
||||
#include "isteamugc.h"
|
||||
#include "isteamhtmlsurface.h"
|
||||
#include "isteaminventory.h"
|
||||
#include "isteamtimeline.h"
|
||||
#include "isteamvideo.h"
|
||||
#include "isteamparentalsettings.h"
|
||||
#include "isteaminput.h"
|
||||
#include "isteamremoteplay.h"
|
||||
#include "isteamnetworkingmessages.h"
|
||||
#include "isteamnetworkingsockets.h"
|
||||
#include "isteamnetworkingutils.h"
|
||||
|
||||
#if defined( _PS3 )
|
||||
#include "steamps3params.h"
|
||||
#endif
|
||||
|
||||
// Steam API export macro
|
||||
#if defined( _WIN32 ) && !defined( _X360 )
|
||||
#if defined( STEAM_API_EXPORTS )
|
||||
#define S_API extern "C" __declspec( dllexport ) EXT_FUNC
|
||||
#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"))) EXT_FUNC
|
||||
#else
|
||||
#define S_API extern "C"
|
||||
#endif // STEAM_API_EXPORTS
|
||||
#else // !WIN32
|
||||
#if defined( STEAM_API_EXPORTS )
|
||||
#define S_API extern "C" EXT_FUNC
|
||||
#else
|
||||
#define S_API extern "C"
|
||||
#endif // STEAM_API_EXPORTS
|
||||
#endif
|
||||
|
||||
class CCallbackBase;
|
||||
|
||||
#ifdef REHLDS_SELF
|
||||
#include "rehlds/platform.h"
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
// Steam API setup & shutdown
|
||||
@ -64,300 +55,80 @@ class CCallbackBase;
|
||||
//
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
|
||||
// S_API void SteamAPI_Init(); (see below)
|
||||
S_API void SteamAPI_Shutdown();
|
||||
enum ESteamAPIInitResult
|
||||
{
|
||||
k_ESteamAPIInitResult_OK = 0,
|
||||
k_ESteamAPIInitResult_FailedGeneric = 1, // Some other failure
|
||||
k_ESteamAPIInitResult_NoSteamClient = 2, // We cannot connect to Steam, steam probably isn't running
|
||||
k_ESteamAPIInitResult_VersionMismatch = 3, // Steam client appears to be out of date
|
||||
};
|
||||
|
||||
// checks if a local Steam client is running
|
||||
S_API bool SteamAPI_IsSteamRunning();
|
||||
// Initializing the Steamworks SDK
|
||||
// -----------------------------
|
||||
//
|
||||
// There are three different methods you can use to initialize the Steamworks SDK, depending on
|
||||
// your project's environment. You should only use one method in your project.
|
||||
//
|
||||
// If you are able to include this C++ header in your project, we recommend using the following
|
||||
// initialization methods. They will ensure that all ISteam* interfaces defined in other
|
||||
// C++ header files have versions that are supported by the user's Steam Client:
|
||||
// - SteamAPI_InitEx() for new projects so you can show a detailed error message to the user
|
||||
// - SteamAPI_Init() for existing projects that only display a generic error message
|
||||
//
|
||||
// If you are unable to include this C++ header in your project and are dynamically loading
|
||||
// Steamworks SDK methods from dll/so, you can use the following method:
|
||||
// - SteamAPI_InitFlat()
|
||||
|
||||
// Detects if your executable was launched through the Steam client, and restarts your game through
|
||||
// the client if necessary. The Steam client will be started if it is not running.
|
||||
|
||||
// See "Initializing the Steamworks SDK" above for how to choose an init method.
|
||||
// On success k_ESteamAPIInitResult_OK is returned. Otherwise, returns a value that can be used
|
||||
// to create a localized error message for the user. If pOutErrMsg is non-NULL,
|
||||
// it will receive an example error message, in English, that explains the reason for the failure.
|
||||
//
|
||||
// Returns: true if your executable was NOT launched through the Steam client. This function will
|
||||
// then start your application through the client. Your current process should exit.
|
||||
// Example usage:
|
||||
//
|
||||
// false if your executable was started through the Steam client or a steam_appid.txt file
|
||||
// is present in your game's directory (for development). Your current process should continue.
|
||||
// SteamErrMsg errMsg;
|
||||
// if ( SteamAPI_Init(&errMsg) != k_ESteamAPIInitResult_OK )
|
||||
// FatalError( "Failed to init Steam. %s", errMsg );
|
||||
inline ESteamAPIInitResult SteamAPI_InitEx( SteamErrMsg *pOutErrMsg );
|
||||
|
||||
// See "Initializing the Steamworks SDK" above for how to choose an init method.
|
||||
// Returns true on success
|
||||
inline bool SteamAPI_Init()
|
||||
{
|
||||
return SteamAPI_InitEx( NULL ) == k_ESteamAPIInitResult_OK;
|
||||
}
|
||||
|
||||
// See "Initializing the Steamworks SDK" above for how to choose an init method.
|
||||
// Same usage as SteamAPI_InitEx(), however does not verify ISteam* interfaces are
|
||||
// supported by the user's client and is exported from the dll
|
||||
S_API ESteamAPIInitResult S_CALLTYPE SteamAPI_InitFlat( SteamErrMsg *pOutErrMsg );
|
||||
|
||||
// SteamAPI_Shutdown should be called during process shutdown if possible.
|
||||
S_API void S_CALLTYPE SteamAPI_Shutdown();
|
||||
|
||||
// SteamAPI_RestartAppIfNecessary ensures that your executable was launched through Steam.
|
||||
//
|
||||
// NOTE: This function should be used only if you are using CEG or not using Steam's DRM. Once applied
|
||||
// to your executable, Steam's DRM will handle restarting through Steam if necessary.
|
||||
S_API bool SteamAPI_RestartAppIfNecessary( uint32 unOwnAppID );
|
||||
// Returns true if the current process should terminate. Steam is now re-launching your application.
|
||||
//
|
||||
// Returns false if no action needs to be taken. This means that your executable was started through
|
||||
// the Steam client, or a steam_appid.txt file is present in your game's directory (for development).
|
||||
// Your current process should continue if false is returned.
|
||||
//
|
||||
// NOTE: If you use the Steam DRM wrapper on your primary executable file, this check is unnecessary
|
||||
// since the DRM wrapper will ensure that your application was launched properly through Steam.
|
||||
S_API bool S_CALLTYPE SteamAPI_RestartAppIfNecessary( uint32 unOwnAppID );
|
||||
|
||||
// Many Steam API functions allocate a small amount of thread-local memory for parameter storage.
|
||||
// SteamAPI_ReleaseCurrentThreadMemory() will free API memory associated with the calling thread.
|
||||
// This function is also called automatically by SteamAPI_RunCallbacks(), so a single-threaded
|
||||
// program never needs to explicitly call this function.
|
||||
S_API void S_CALLTYPE SteamAPI_ReleaseCurrentThreadMemory();
|
||||
|
||||
|
||||
// crash dump recording functions
|
||||
S_API void SteamAPI_WriteMiniDump( uint32 uStructuredExceptionCode, void* pvExceptionInfo, uint32 uBuildID );
|
||||
S_API void SteamAPI_SetMiniDumpComment( const char *pchMsg );
|
||||
|
||||
// interface pointers, configured by SteamAPI_Init()
|
||||
S_API ISteamClient *SteamClient();
|
||||
|
||||
|
||||
//
|
||||
// VERSION_SAFE_STEAM_API_INTERFACES is usually not necessary, but it provides safety against releasing
|
||||
// new steam_api.dll's without recompiling/rereleasing modules that use it.
|
||||
//
|
||||
// If you use VERSION_SAFE_STEAM_API_INTERFACES, then you should call SteamAPI_InitSafe(). Also, to get the
|
||||
// Steam interfaces, you must create and Init() a CSteamAPIContext (below) and use the interfaces in there.
|
||||
//
|
||||
// If you don't use VERSION_SAFE_STEAM_API_INTERFACES, then you can use SteamAPI_Init() and the SteamXXXX()
|
||||
// functions below to get at the Steam interfaces.
|
||||
//
|
||||
#ifdef VERSION_SAFE_STEAM_API_INTERFACES
|
||||
S_API bool SteamAPI_InitSafe();
|
||||
#else
|
||||
|
||||
#if defined(_PS3)
|
||||
S_API bool SteamAPI_Init( SteamPS3Params_t *pParams );
|
||||
#else
|
||||
S_API bool SteamAPI_Init();
|
||||
#endif
|
||||
|
||||
S_API ISteamUser *SteamUser();
|
||||
S_API ISteamFriends *SteamFriends();
|
||||
S_API ISteamUtils *SteamUtils();
|
||||
S_API ISteamMatchmaking *SteamMatchmaking();
|
||||
S_API ISteamUserStats *SteamUserStats();
|
||||
S_API ISteamApps *SteamApps();
|
||||
S_API ISteamNetworking *SteamNetworking();
|
||||
S_API ISteamMatchmakingServers *SteamMatchmakingServers();
|
||||
S_API ISteamRemoteStorage *SteamRemoteStorage();
|
||||
S_API ISteamScreenshots *SteamScreenshots();
|
||||
S_API ISteamHTTP *SteamHTTP();
|
||||
S_API ISteamUnifiedMessages *SteamUnifiedMessages();
|
||||
#ifdef _PS3
|
||||
S_API ISteamPS3OverlayRender * SteamPS3OverlayRender();
|
||||
#endif
|
||||
#endif // VERSION_SAFE_STEAM_API_INTERFACES
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
// steam callback helper functions
|
||||
//
|
||||
// The following classes/macros are used to be able to easily multiplex callbacks
|
||||
// from the Steam API into various objects in the app in a thread-safe manner
|
||||
//
|
||||
// These functors are triggered via the SteamAPI_RunCallbacks() function, mapping the callback
|
||||
// to as many functions/objects as are registered to it
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
|
||||
S_API void SteamAPI_RunCallbacks();
|
||||
|
||||
|
||||
|
||||
// functions used by the utility CCallback objects to receive callbacks
|
||||
S_API void SteamAPI_RegisterCallback( class CCallbackBase *pCallback, int iCallback );
|
||||
S_API void SteamAPI_UnregisterCallback( class CCallbackBase *pCallback );
|
||||
// functions used by the utility CCallResult objects to receive async call results
|
||||
S_API void SteamAPI_RegisterCallResult( class CCallbackBase *pCallback, SteamAPICall_t hAPICall );
|
||||
S_API void SteamAPI_UnregisterCallResult( class CCallbackBase *pCallback, SteamAPICall_t hAPICall );
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: base for callbacks,
|
||||
// used only by CCallback, shouldn't be used directly
|
||||
//-----------------------------------------------------------------------------
|
||||
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;
|
||||
|
||||
//Added for hooking support
|
||||
uint8 GetFlags() { return m_nCallbackFlags; }
|
||||
void SetFlags(uint8 flags) { m_nCallbackFlags = flags; }
|
||||
void SetICallback(int cb) { m_iCallback = cb; }
|
||||
|
||||
protected:
|
||||
enum { k_ECallbackFlagsRegistered = 0x01, k_ECallbackFlagsGameServer = 0x02 };
|
||||
uint8 m_nCallbackFlags;
|
||||
int m_iCallback;
|
||||
friend class CCallbackMgr;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// 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()
|
||||
{
|
||||
m_hAPICall = k_uAPICallInvalid;
|
||||
m_pObj = NULL;
|
||||
m_Func = NULL;
|
||||
m_iCallback = P::k_iCallback;
|
||||
}
|
||||
|
||||
void Set( SteamAPICall_t hAPICall, T *p, func_t func )
|
||||
{
|
||||
if ( m_hAPICall )
|
||||
SteamAPI_UnregisterCallResult( this, m_hAPICall );
|
||||
|
||||
m_hAPICall = hAPICall;
|
||||
m_pObj = p;
|
||||
m_Func = func;
|
||||
|
||||
if ( hAPICall )
|
||||
SteamAPI_RegisterCallResult( this, hAPICall );
|
||||
}
|
||||
|
||||
bool IsActive() const
|
||||
{
|
||||
return ( m_hAPICall != k_uAPICallInvalid );
|
||||
}
|
||||
|
||||
void Cancel()
|
||||
{
|
||||
if ( m_hAPICall != k_uAPICallInvalid )
|
||||
{
|
||||
SteamAPI_UnregisterCallResult( this, m_hAPICall );
|
||||
m_hAPICall = k_uAPICallInvalid;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
~CCallResult()
|
||||
{
|
||||
Cancel();
|
||||
}
|
||||
|
||||
void SetGameserverFlag() { m_nCallbackFlags |= k_ECallbackFlagsGameServer; }
|
||||
private:
|
||||
virtual void Run( void *pvParam )
|
||||
{
|
||||
m_hAPICall = k_uAPICallInvalid; // caller unregisters for us
|
||||
(m_pObj->*m_Func)( (P *)pvParam, false );
|
||||
}
|
||||
void Run( void *pvParam, bool bIOFailure, SteamAPICall_t hSteamAPICall )
|
||||
{
|
||||
if ( hSteamAPICall == m_hAPICall )
|
||||
{
|
||||
m_hAPICall = k_uAPICallInvalid; // caller unregisters for us
|
||||
(m_pObj->*m_Func)( (P *)pvParam, bIOFailure );
|
||||
}
|
||||
}
|
||||
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
|
||||
//-----------------------------------------------------------------------------
|
||||
template< class T, class P, bool bGameServer >
|
||||
class CCallback : protected CCallbackBase
|
||||
{
|
||||
public:
|
||||
typedef void (T::*func_t)( P* );
|
||||
|
||||
// If you can't support constructing a callback with the correct parameters
|
||||
// then uncomment the empty constructor below and manually call
|
||||
// ::Register() for your object
|
||||
// Or, just call the regular constructor with (NULL, NULL)
|
||||
// CCallback() {}
|
||||
|
||||
// constructor for initializing this object in owner's constructor
|
||||
CCallback( T *pObj, func_t func ) : m_pObj( pObj ), m_Func( func )
|
||||
{
|
||||
if ( pObj && func )
|
||||
Register( pObj, func );
|
||||
}
|
||||
|
||||
~CCallback()
|
||||
{
|
||||
if ( m_nCallbackFlags & k_ECallbackFlagsRegistered )
|
||||
Unregister();
|
||||
}
|
||||
|
||||
// manual registration of the callback
|
||||
void Register( T *pObj, func_t func )
|
||||
{
|
||||
if ( !pObj || !func )
|
||||
return;
|
||||
|
||||
if ( m_nCallbackFlags & k_ECallbackFlagsRegistered )
|
||||
Unregister();
|
||||
|
||||
if ( bGameServer )
|
||||
{
|
||||
m_nCallbackFlags |= k_ECallbackFlagsGameServer;
|
||||
}
|
||||
m_pObj = pObj;
|
||||
m_Func = func;
|
||||
// SteamAPI_RegisterCallback sets k_ECallbackFlagsRegistered
|
||||
|
||||
#ifdef REHLDS_SELF
|
||||
CRehldsPlatformHolder::get()->SteamAPI_RegisterCallback(this, P::k_iCallback);
|
||||
#else
|
||||
SteamAPI_RegisterCallback(this, P::k_iCallback);
|
||||
#endif // REHLDS_SELF
|
||||
}
|
||||
|
||||
void Unregister()
|
||||
{
|
||||
// SteamAPI_UnregisterCallback removes k_ECallbackFlagsRegistered
|
||||
|
||||
#ifdef REHLDS_SELF
|
||||
CRehldsPlatformHolder::get()->SteamAPI_UnregisterCallback(this);
|
||||
#else
|
||||
SteamAPI_UnregisterCallback(this);
|
||||
#endif // REHLDS_SELF
|
||||
}
|
||||
|
||||
void SetGameserverFlag() { m_nCallbackFlags |= k_ECallbackFlagsGameServer; }
|
||||
protected:
|
||||
virtual void Run( void *pvParam )
|
||||
{
|
||||
(m_pObj->*m_Func)( (P *)pvParam );
|
||||
}
|
||||
virtual void Run( void *pvParam, bool, SteamAPICall_t )
|
||||
{
|
||||
(m_pObj->*m_Func)( (P *)pvParam );
|
||||
}
|
||||
int GetCallbackSizeBytes()
|
||||
{
|
||||
return sizeof( P );
|
||||
}
|
||||
|
||||
T *m_pObj;
|
||||
func_t m_Func;
|
||||
};
|
||||
|
||||
// Allows you to defer registration of the callback
|
||||
template< class T, class P, bool bGameServer >
|
||||
class CCallbackManual : public CCallback< T, P, bGameServer >
|
||||
{
|
||||
public:
|
||||
CCallbackManual() : CCallback< T, P, bGameServer >( NULL, NULL ) {}
|
||||
};
|
||||
|
||||
// utility macro for declaring the function and callback object together
|
||||
#define STEAM_CALLBACK( thisclass, func, param, var ) CCallback< thisclass, param, false > var; void func( param *pParam )
|
||||
|
||||
// same as above, but lets you defer the callback binding by calling Register later
|
||||
#define STEAM_CALLBACK_MANUAL( thisclass, func, param, var ) CCallbackManual< thisclass, param, false > var; void func( param *pParam )
|
||||
|
||||
|
||||
#ifdef _WIN32
|
||||
// disable this warning; this pattern need for steam callback registration
|
||||
#pragma warning( disable: 4355 ) // 'this' : used in base member initializer list
|
||||
#endif
|
||||
|
||||
S_API void S_CALLTYPE SteamAPI_WriteMiniDump( uint32 uStructuredExceptionCode, void* pvExceptionInfo, uint32 uBuildID );
|
||||
S_API void S_CALLTYPE SteamAPI_SetMiniDumpComment( const char *pchMsg );
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
// steamclient.dll private wrapper functions
|
||||
@ -365,181 +136,137 @@ public:
|
||||
// The following functions are part of abstracting API access to the steamclient.dll, but should only be used in very specific cases
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
|
||||
// pumps out all the steam messages, calling the register callback
|
||||
S_API void Steam_RunCallbacks( HSteamPipe hSteamPipe, bool bGameServerCallbacks );
|
||||
// SteamAPI_IsSteamRunning() returns true if Steam is currently running
|
||||
S_API bool S_CALLTYPE SteamAPI_IsSteamRunning();
|
||||
|
||||
// register the callback funcs to use to interact with the steam dll
|
||||
S_API void Steam_RegisterInterfaceFuncs( void *hModule );
|
||||
|
||||
// returns the HSteamUser of the last user to dispatch a callback
|
||||
S_API HSteamUser Steam_GetHSteamUserCurrent();
|
||||
|
||||
// returns the filename path of the current running Steam process, used if you need to load an explicit steam dll by name
|
||||
// returns the filename path of the current running Steam process, used if you need to load an explicit steam dll by name.
|
||||
// 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
|
||||
// This is ignored if you are using the manual callback dispatch method
|
||||
S_API void SteamAPI_SetTryCatchCallbacks( bool bTryCatchCallbacks );
|
||||
|
||||
// backwards compat export, passes through to SteamAPI_ variants
|
||||
S_API HSteamPipe GetHSteamPipe();
|
||||
S_API HSteamUser GetHSteamUser();
|
||||
|
||||
#ifdef VERSION_SAFE_STEAM_API_INTERFACES
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
// VERSION_SAFE_STEAM_API_INTERFACES uses CSteamAPIContext to provide interfaces to each module in a way that
|
||||
// lets them each specify the interface versions they are compiled with.
|
||||
//
|
||||
// It's important that these stay inlined in the header so the calling module specifies the interface versions
|
||||
// for whatever Steam API version it has.
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
|
||||
S_API HSteamUser SteamAPI_GetHSteamUser();
|
||||
|
||||
class CSteamAPIContext
|
||||
{
|
||||
public:
|
||||
CSteamAPIContext();
|
||||
void Clear();
|
||||
|
||||
bool Init();
|
||||
|
||||
ISteamUser* SteamUser() { return m_pSteamUser; }
|
||||
ISteamFriends* SteamFriends() { return m_pSteamFriends; }
|
||||
ISteamUtils* SteamUtils() { return m_pSteamUtils; }
|
||||
ISteamMatchmaking* SteamMatchmaking() { return m_pSteamMatchmaking; }
|
||||
ISteamUserStats* SteamUserStats() { return m_pSteamUserStats; }
|
||||
ISteamApps* SteamApps() { return m_pSteamApps; }
|
||||
ISteamMatchmakingServers* SteamMatchmakingServers() { return m_pSteamMatchmakingServers; }
|
||||
ISteamNetworking* SteamNetworking() { return m_pSteamNetworking; }
|
||||
ISteamRemoteStorage* SteamRemoteStorage() { return m_pSteamRemoteStorage; }
|
||||
ISteamScreenshots* SteamScreenshots() { return m_pSteamScreenshots; }
|
||||
ISteamHTTP* SteamHTTP() { return m_pSteamHTTP; }
|
||||
ISteamUnifiedMessages* SteamUnifiedMessages() { return m_pSteamUnifiedMessages; }
|
||||
#ifdef _PS3
|
||||
ISteamPS3OverlayRender* SteamPS3OverlayRender() { return m_pSteamPS3OverlayRender; }
|
||||
#if defined( VERSION_SAFE_STEAM_API_INTERFACES )
|
||||
// exists only for backwards compat with code written against older SDKs
|
||||
S_API bool S_CALLTYPE SteamAPI_InitSafe();
|
||||
#endif
|
||||
|
||||
private:
|
||||
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;
|
||||
ISteamUnifiedMessages*m_pSteamUnifiedMessages;
|
||||
ISteamController *m_pController;
|
||||
#ifdef _PS3
|
||||
ISteamPS3OverlayRender *m_pSteamPS3OverlayRender;
|
||||
#endif
|
||||
};
|
||||
|
||||
inline CSteamAPIContext::CSteamAPIContext()
|
||||
{
|
||||
Clear();
|
||||
}
|
||||
|
||||
inline void CSteamAPIContext::Clear()
|
||||
{
|
||||
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_pSteamUnifiedMessages = NULL;
|
||||
#ifdef _PS3
|
||||
m_pSteamPS3OverlayRender = NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
// This function must be inlined so the module using steam_api.dll gets the version names they want.
|
||||
inline bool CSteamAPIContext::Init()
|
||||
{
|
||||
if ( !SteamClient() )
|
||||
return false;
|
||||
|
||||
HSteamUser hSteamUser = SteamAPI_GetHSteamUser();
|
||||
HSteamPipe hSteamPipe = SteamAPI_GetHSteamPipe();
|
||||
|
||||
m_pSteamUser = SteamClient()->GetISteamUser( hSteamUser, hSteamPipe, STEAMUSER_INTERFACE_VERSION );
|
||||
if ( !m_pSteamUser )
|
||||
return false;
|
||||
|
||||
m_pSteamFriends = SteamClient()->GetISteamFriends( hSteamUser, hSteamPipe, STEAMFRIENDS_INTERFACE_VERSION );
|
||||
if ( !m_pSteamFriends )
|
||||
return false;
|
||||
|
||||
m_pSteamUtils = SteamClient()->GetISteamUtils( hSteamPipe, STEAMUTILS_INTERFACE_VERSION );
|
||||
if ( !m_pSteamUtils )
|
||||
return false;
|
||||
|
||||
m_pSteamMatchmaking = SteamClient()->GetISteamMatchmaking( hSteamUser, hSteamPipe, STEAMMATCHMAKING_INTERFACE_VERSION );
|
||||
if ( !m_pSteamMatchmaking )
|
||||
return false;
|
||||
|
||||
m_pSteamMatchmakingServers = SteamClient()->GetISteamMatchmakingServers( hSteamUser, hSteamPipe, STEAMMATCHMAKINGSERVERS_INTERFACE_VERSION );
|
||||
if ( !m_pSteamMatchmakingServers )
|
||||
return false;
|
||||
|
||||
m_pSteamUserStats = SteamClient()->GetISteamUserStats( hSteamUser, hSteamPipe, STEAMUSERSTATS_INTERFACE_VERSION );
|
||||
if ( !m_pSteamUserStats )
|
||||
return false;
|
||||
|
||||
m_pSteamApps = SteamClient()->GetISteamApps( hSteamUser, hSteamPipe, STEAMAPPS_INTERFACE_VERSION );
|
||||
if ( !m_pSteamApps )
|
||||
return false;
|
||||
|
||||
m_pSteamNetworking = SteamClient()->GetISteamNetworking( hSteamUser, hSteamPipe, STEAMNETWORKING_INTERFACE_VERSION );
|
||||
if ( !m_pSteamNetworking )
|
||||
return false;
|
||||
|
||||
m_pSteamRemoteStorage = SteamClient()->GetISteamRemoteStorage( hSteamUser, hSteamPipe, STEAMREMOTESTORAGE_INTERFACE_VERSION );
|
||||
if ( !m_pSteamRemoteStorage )
|
||||
return false;
|
||||
|
||||
m_pSteamScreenshots = SteamClient()->GetISteamScreenshots( hSteamUser, hSteamPipe, STEAMSCREENSHOTS_INTERFACE_VERSION );
|
||||
if ( !m_pSteamScreenshots )
|
||||
return false;
|
||||
|
||||
m_pSteamHTTP = SteamClient()->GetISteamHTTP( hSteamUser, hSteamPipe, STEAMHTTP_INTERFACE_VERSION );
|
||||
if ( !m_pSteamHTTP )
|
||||
return false;
|
||||
|
||||
m_pSteamUnifiedMessages = SteamClient()->GetISteamUnifiedMessages( hSteamUser, hSteamPipe, STEAMUNIFIEDMESSAGES_INTERFACE_VERSION );
|
||||
if ( !m_pSteamUnifiedMessages )
|
||||
return false;
|
||||
|
||||
#ifdef _PS3
|
||||
m_pSteamPS3OverlayRender = SteamClient()->GetISteamPS3OverlayRender();
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif // VERSION_SAFE_STEAM_API_INTERFACES
|
||||
|
||||
#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 )
|
||||
// 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 SteamAPI_UseBreakpadCrashHandler( char const *pchVersion, char const *pchDate, char const *pchTime, bool bFullMemoryDumps, void *pvContext, PFNPreMinidumpCallback m_pfnPreMinidumpCallback );
|
||||
S_API void SteamAPI_SetBreakpadAppID( uint32 unAppID );
|
||||
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
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
//
|
||||
// Manual callback loop
|
||||
//
|
||||
// An alternative method for dispatching callbacks. Similar to a windows message loop.
|
||||
//
|
||||
// If you use the manual callback dispatch, you must NOT use:
|
||||
//
|
||||
// - SteamAPI_RunCallbacks or SteamGameServer_RunCallbacks
|
||||
// - STEAM_CALLBACK, CCallResult, CCallback, or CCallbackManual
|
||||
//
|
||||
// Here is the basic template for replacing SteamAPI_RunCallbacks() with manual dispatch
|
||||
/*
|
||||
|
||||
HSteamPipe hSteamPipe = SteamAPI_GetHSteamPipe(); // See also SteamGameServer_GetHSteamPipe()
|
||||
SteamAPI_ManualDispatch_RunFrame( hSteamPipe )
|
||||
CallbackMsg_t callback;
|
||||
while ( SteamAPI_ManualDispatch_GetNextCallback( hSteamPipe, &callback ) )
|
||||
{
|
||||
// Check for dispatching API call results
|
||||
if ( callback.m_iCallback == SteamAPICallCompleted_t::k_iCallback )
|
||||
{
|
||||
SteamAPICallCompleted_t *pCallCompleted = (SteamAPICallCompleted_t *)callback.
|
||||
void *pTmpCallResult = malloc( pCallback->m_cubParam );
|
||||
bool bFailed;
|
||||
if ( SteamAPI_ManualDispatch_GetAPICallResult( hSteamPipe, pCallCompleted->m_hAsyncCall, pTmpCallResult, pCallback->m_cubParam, pCallback->m_iCallback, &bFailed ) )
|
||||
{
|
||||
// Dispatch the call result to the registered handler(s) for the
|
||||
// call identified by pCallCompleted->m_hAsyncCall
|
||||
}
|
||||
free( pTmpCallResult );
|
||||
}
|
||||
else
|
||||
{
|
||||
// Look at callback.m_iCallback to see what kind of callback it is,
|
||||
// and dispatch to appropriate handler(s)
|
||||
}
|
||||
SteamAPI_ManualDispatch_FreeLastCallback( hSteamPipe );
|
||||
}
|
||||
|
||||
*/
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
|
||||
/// Inform the API that you wish to use manual event dispatch. This must be called after SteamAPI_Init, but before
|
||||
/// you use any of the other manual dispatch functions below.
|
||||
S_API void S_CALLTYPE SteamAPI_ManualDispatch_Init();
|
||||
|
||||
/// Perform certain periodic actions that need to be performed.
|
||||
S_API void S_CALLTYPE SteamAPI_ManualDispatch_RunFrame( HSteamPipe hSteamPipe );
|
||||
|
||||
/// Fetch the next pending callback on the given pipe, if any. If a callback is available, true is returned
|
||||
/// and the structure is populated. In this case, you MUST call SteamAPI_ManualDispatch_FreeLastCallback
|
||||
/// (after dispatching the callback) before calling SteamAPI_ManualDispatch_GetNextCallback again.
|
||||
S_API bool S_CALLTYPE SteamAPI_ManualDispatch_GetNextCallback( HSteamPipe hSteamPipe, CallbackMsg_t *pCallbackMsg );
|
||||
|
||||
/// You must call this after dispatching the callback, if SteamAPI_ManualDispatch_GetNextCallback returns true.
|
||||
S_API void S_CALLTYPE SteamAPI_ManualDispatch_FreeLastCallback( HSteamPipe hSteamPipe );
|
||||
|
||||
/// Return the call result for the specified call on the specified pipe. You really should
|
||||
/// only call this in a handler for SteamAPICallCompleted_t callback.
|
||||
S_API bool S_CALLTYPE SteamAPI_ManualDispatch_GetAPICallResult( HSteamPipe hSteamPipe, SteamAPICall_t hSteamAPICall, void *pCallback, int cubCallback, int iCallbackExpected, bool *pbFailed );
|
||||
|
||||
#ifdef REHLDS_SELF
|
||||
#include "rehlds/platform.h"
|
||||
#endif
|
||||
|
||||
#include "steam_api_callbacks.h"
|
||||
|
||||
// Internal implementation of SteamAPI_InitEx. This is done in a way that checks
|
||||
// all of the versions of interfaces from headers being compiled into this code.
|
||||
S_API ESteamAPIInitResult S_CALLTYPE SteamInternal_SteamAPI_Init( const char *pszInternalCheckInterfaceVersions, SteamErrMsg *pOutErrMsg );
|
||||
inline ESteamAPIInitResult SteamAPI_InitEx( SteamErrMsg *pOutErrMsg )
|
||||
{
|
||||
const char *pszInternalCheckInterfaceVersions =
|
||||
STEAMUTILS_INTERFACE_VERSION "\0"
|
||||
STEAMNETWORKINGUTILS_INTERFACE_VERSION "\0"
|
||||
STEAMAPPS_INTERFACE_VERSION "\0"
|
||||
STEAMCONTROLLER_INTERFACE_VERSION "\0"
|
||||
STEAMFRIENDS_INTERFACE_VERSION "\0"
|
||||
STEAMGAMESEARCH_INTERFACE_VERSION "\0"
|
||||
STEAMHTMLSURFACE_INTERFACE_VERSION "\0"
|
||||
STEAMHTTP_INTERFACE_VERSION "\0"
|
||||
STEAMINPUT_INTERFACE_VERSION "\0"
|
||||
STEAMINVENTORY_INTERFACE_VERSION "\0"
|
||||
STEAMMATCHMAKINGSERVERS_INTERFACE_VERSION "\0"
|
||||
STEAMMATCHMAKING_INTERFACE_VERSION "\0"
|
||||
STEAMMUSICREMOTE_INTERFACE_VERSION "\0"
|
||||
STEAMMUSIC_INTERFACE_VERSION "\0"
|
||||
STEAMNETWORKINGMESSAGES_INTERFACE_VERSION "\0"
|
||||
STEAMNETWORKINGSOCKETS_INTERFACE_VERSION "\0"
|
||||
STEAMNETWORKING_INTERFACE_VERSION "\0"
|
||||
STEAMPARENTALSETTINGS_INTERFACE_VERSION "\0"
|
||||
STEAMPARTIES_INTERFACE_VERSION "\0"
|
||||
STEAMREMOTEPLAY_INTERFACE_VERSION "\0"
|
||||
STEAMREMOTESTORAGE_INTERFACE_VERSION "\0"
|
||||
STEAMSCREENSHOTS_INTERFACE_VERSION "\0"
|
||||
STEAMUGC_INTERFACE_VERSION "\0"
|
||||
STEAMUSERSTATS_INTERFACE_VERSION "\0"
|
||||
STEAMUSER_INTERFACE_VERSION "\0"
|
||||
STEAMVIDEO_INTERFACE_VERSION "\0"
|
||||
|
||||
"\0";
|
||||
|
||||
return SteamInternal_SteamAPI_Init( pszInternalCheckInterfaceVersions, pOutErrMsg );
|
||||
}
|
||||
|
||||
#endif // STEAM_API_H
|
||||
|
152
rehlds/public/steam/steam_api_callbacks.h
Normal file
152
rehlds/public/steam/steam_api_callbacks.h
Normal file
@ -0,0 +1,152 @@
|
||||
//====== Copyright Valve Corporation, All rights reserved. ====================
|
||||
//
|
||||
// Steamworks SDK minimal include
|
||||
//
|
||||
// Defines the minimal set of things we need to use register for any callback.
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef STEAM_API_CALLBACKS_H
|
||||
#define STEAM_API_CALLBACKS_H
|
||||
|
||||
//
|
||||
// Internal stuff used for the standard, higher-level callback mechanism
|
||||
//
|
||||
|
||||
// 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 );
|
||||
|
||||
#define _STEAM_CALLBACK_OFFSETOF( type, member ) ( (size_t)( (char *)&( (type *)0 )->member ) )
|
||||
#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
|
||||
#define _STEAM_CALLBACK_3( extra_code, thisclass, func, param ) \
|
||||
struct CCallbackInternal_ ## func : private CCallbackImpl< sizeof( param ) > { \
|
||||
CCallbackInternal_ ## func () { extra_code SteamAPI_RegisterCallback( this, param::k_iCallback ); } \
|
||||
CCallbackInternal_ ## func ( const CCallbackInternal_ ## func & ) { extra_code SteamAPI_RegisterCallback( this, param::k_iCallback ); } \
|
||||
CCallbackInternal_ ## func & operator=( const CCallbackInternal_ ## func & ) { return *this; } \
|
||||
private: virtual void Run( void *pvParam ) S_OVERRIDE { _STEAM_CALLBACK_AUTO_HOOK( thisclass, func, param ) \
|
||||
thisclass *pOuter = reinterpret_cast<thisclass*>( reinterpret_cast<char*>(this) - _STEAM_CALLBACK_OFFSETOF( thisclass, m_steamcallback_ ## func ) ); \
|
||||
pOuter->func( reinterpret_cast<param*>( pvParam ) ); \
|
||||
} \
|
||||
} 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 )
|
||||
|
||||
#ifndef API_GEN
|
||||
|
||||
template< class T, class P >
|
||||
inline CCallResult<T, P>::CCallResult()
|
||||
{
|
||||
m_hAPICall = k_uAPICallInvalid;
|
||||
m_pObj = nullptr;
|
||||
m_Func = nullptr;
|
||||
m_iCallback = P::k_iCallback;
|
||||
}
|
||||
|
||||
template< class T, class P >
|
||||
inline void CCallResult<T, P>::Set( SteamAPICall_t hAPICall, T *p, func_t func )
|
||||
{
|
||||
if ( m_hAPICall )
|
||||
SteamAPI_UnregisterCallResult( this, m_hAPICall );
|
||||
|
||||
m_hAPICall = hAPICall;
|
||||
m_pObj = p;
|
||||
m_Func = func;
|
||||
|
||||
if ( hAPICall )
|
||||
SteamAPI_RegisterCallResult( this, hAPICall );
|
||||
}
|
||||
|
||||
template< class T, class P >
|
||||
inline bool CCallResult<T, P>::IsActive() const
|
||||
{
|
||||
return (m_hAPICall != k_uAPICallInvalid);
|
||||
}
|
||||
|
||||
template< class T, class P >
|
||||
inline void CCallResult<T, P>::Cancel()
|
||||
{
|
||||
if ( m_hAPICall != k_uAPICallInvalid )
|
||||
{
|
||||
SteamAPI_UnregisterCallResult( this, m_hAPICall );
|
||||
m_hAPICall = k_uAPICallInvalid;
|
||||
}
|
||||
}
|
||||
|
||||
template< class T, class P >
|
||||
inline CCallResult<T, P>::~CCallResult()
|
||||
{
|
||||
Cancel();
|
||||
}
|
||||
|
||||
template< class T, class P >
|
||||
inline void CCallResult<T, P>::Run( void *pvParam )
|
||||
{
|
||||
m_hAPICall = k_uAPICallInvalid; // caller unregisters for us
|
||||
(m_pObj->*m_Func)((P *)pvParam, false);
|
||||
}
|
||||
|
||||
template< class T, class P >
|
||||
inline void CCallResult<T, P>::Run( void *pvParam, bool bIOFailure, SteamAPICall_t hSteamAPICall )
|
||||
{
|
||||
if ( hSteamAPICall == m_hAPICall )
|
||||
{
|
||||
m_hAPICall = k_uAPICallInvalid; // caller unregisters for us
|
||||
(m_pObj->*m_Func)((P *)pvParam, bIOFailure);
|
||||
}
|
||||
}
|
||||
|
||||
template< class T, class P, bool bGameserver >
|
||||
inline CCallback< T, P, bGameserver >::CCallback( T *pObj, func_t func )
|
||||
: m_pObj( nullptr ), m_Func( nullptr )
|
||||
{
|
||||
if ( bGameserver )
|
||||
{
|
||||
this->SetGameserverFlag();
|
||||
}
|
||||
Register( pObj, func );
|
||||
}
|
||||
|
||||
template< class T, class P, bool bGameserver >
|
||||
inline void CCallback< T, P, bGameserver >::Register( T *pObj, func_t func )
|
||||
{
|
||||
if ( !pObj || !func )
|
||||
return;
|
||||
|
||||
if ( this->m_nCallbackFlags & CCallbackBase::k_ECallbackFlagsRegistered )
|
||||
Unregister();
|
||||
|
||||
m_pObj = pObj;
|
||||
m_Func = func;
|
||||
// SteamAPI_RegisterCallback sets k_ECallbackFlagsRegistered
|
||||
|
||||
#ifdef REHLDS_SELF
|
||||
CRehldsPlatformHolder::get()->SteamAPI_RegisterCallback(this, P::k_iCallback);
|
||||
#else
|
||||
SteamAPI_RegisterCallback(this, P::k_iCallback);
|
||||
#endif // REHLDS_SELF
|
||||
}
|
||||
|
||||
template< class T, class P, bool bGameserver >
|
||||
inline void CCallback< T, P, bGameserver >::Unregister()
|
||||
{
|
||||
// SteamAPI_UnregisterCallback removes k_ECallbackFlagsRegistered
|
||||
SteamAPI_UnregisterCallback( this );
|
||||
}
|
||||
|
||||
template< class T, class P, bool bGameserver >
|
||||
inline void CCallback< T, P, bGameserver >::Run( void *pvParam )
|
||||
{
|
||||
(m_pObj->*m_Func)((P *)pvParam);
|
||||
}
|
||||
|
||||
#endif // #ifndef API_GEN
|
||||
|
||||
#endif // STEAM_API_CALLBACKS_H
|
253
rehlds/public/steam/steam_api_common.h
Normal file
253
rehlds/public/steam/steam_api_common.h
Normal file
@ -0,0 +1,253 @@
|
||||
//====== Copyright Valve Corporation, All rights reserved. ====================
|
||||
//
|
||||
// Steamworks SDK minimal include
|
||||
//
|
||||
// Defines the minimal set of things we need to use any single interface.
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef STEAM_API_COMMON_H
|
||||
#define STEAM_API_COMMON_H
|
||||
|
||||
#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( __cplusplus ) && ( __cplusplus >= 201103L )
|
||||
#define S_OVERRIDE override
|
||||
#else
|
||||
#define S_OVERRIDE
|
||||
#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;
|
||||
|
||||
// A fixed size buffer to receive an error message that is returned by some API
|
||||
// calls.
|
||||
const int k_cchMaxSteamErrMsg = 1024;
|
||||
typedef char SteamErrMsg[ k_cchMaxSteamErrMsg ];
|
||||
|
||||
// #define away __cdecl on posix.
|
||||
// This is really, really bad. We're sorry. But it's been this way for
|
||||
// a long time now and it's scary to change it, as there may be others that
|
||||
// depend on it.
|
||||
#ifndef _WIN32
|
||||
#define __cdecl
|
||||
#endif
|
||||
|
||||
// function prototype
|
||||
extern "C" typedef void ( S_CALLTYPE *SteamAPIWarningMessageHook_t )( int, const char * );
|
||||
extern "C" typedef uint32 ( S_CALLTYPE *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().
|
||||
//
|
||||
// Note that there is an alternative, lower level callback dispatch mechanism.
|
||||
// See SteamAPI_ManualDispatch_Init
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
|
||||
// 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;
|
||||
|
||||
// added for hooking support
|
||||
uint8 GetFlags() { return m_nCallbackFlags; }
|
||||
void SetFlags(uint8 flags) { m_nCallbackFlags = flags; }
|
||||
void SetICallback(int cb) { m_iCallback = cb; }
|
||||
|
||||
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:
|
||||
friend class CCallbackMgr;
|
||||
virtual void Run( void *pvParam ) S_OVERRIDE = 0;
|
||||
virtual void Run( void *pvParam, bool /*bIOFailure*/, SteamAPICall_t /*hSteamAPICall*/ ) S_OVERRIDE { Run( pvParam ); }
|
||||
virtual int GetCallbackSizeBytes() S_OVERRIDE { 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 ) S_OVERRIDE;
|
||||
virtual void Run( void *pvParam, bool bIOFailure, SteamAPICall_t hSteamAPICall ) S_OVERRIDE;
|
||||
virtual int GetCallbackSizeBytes() S_OVERRIDE { 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 ) S_OVERRIDE;
|
||||
|
||||
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
|
1286
rehlds/public/steam/steam_api_flat.h
Normal file
1286
rehlds/public/steam/steam_api_flat.h
Normal file
File diff suppressed because it is too large
Load Diff
203
rehlds/public/steam/steam_api_internal.h
Normal file
203
rehlds/public/steam/steam_api_internal.h
Normal file
@ -0,0 +1,203 @@
|
||||
//====== Copyright Valve Corporation, All rights reserved. ====================
|
||||
//
|
||||
// Internal implementation details of the steamworks SDK.
|
||||
//
|
||||
// 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 <string.h>
|
||||
|
||||
// Internal functions used to locate/create interfaces
|
||||
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 );
|
||||
|
||||
// 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.
|
||||
//
|
||||
// SteamInternal_ContextInit takes a base pointer for the equivalent of
|
||||
// struct { void (*pFn)(void* pCtx); uintptr_t counter; void *ptr; }
|
||||
// Do not change layout or add non-pointer aligned data!
|
||||
#define STEAM_DEFINE_INTERFACE_ACCESSOR( type, name, expr, kind, version ) \
|
||||
inline void S_CALLTYPE SteamInternal_Init_ ## name( type *p ) { *p = (type)( expr ); } \
|
||||
STEAM_CLANG_ATTR( "interface_accessor_kind:" kind ";interface_accessor_version:" version ";" ) \
|
||||
inline type name() { \
|
||||
static void* s_CallbackCounterAndContext[ 3 ] = { (void*)&SteamInternal_Init_ ## name, 0, 0 }; \
|
||||
return *(type*)SteamInternal_ContextInit( s_CallbackCounterAndContext ); \
|
||||
}
|
||||
|
||||
#define STEAM_DEFINE_USER_INTERFACE_ACCESSOR( type, name, version ) \
|
||||
STEAM_DEFINE_INTERFACE_ACCESSOR( type, name, SteamInternal_FindOrCreateUserInterface( SteamAPI_GetHSteamUser(), version ), "user", version )
|
||||
#define STEAM_DEFINE_GAMESERVER_INTERFACE_ACCESSOR( type, name, version ) \
|
||||
STEAM_DEFINE_INTERFACE_ACCESSOR( type, name, SteamInternal_FindOrCreateGameServerInterface( SteamGameServer_GetHSteamUser(), version ), "gameserver", version )
|
||||
|
||||
// structure that contains client callback data
|
||||
// see callbacks documentation for more details
|
||||
#if defined( VALVE_CALLBACK_PACK_SMALL )
|
||||
#pragma pack( push, 4 )
|
||||
#elif defined( VALVE_CALLBACK_PACK_LARGE )
|
||||
#pragma pack( push, 8 )
|
||||
#else
|
||||
#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx
|
||||
#endif
|
||||
|
||||
/// Internal structure used in manual callback dispatch
|
||||
struct CallbackMsg_t
|
||||
{
|
||||
HSteamUser m_hSteamUser; // Specific user to whom this callback applies.
|
||||
int m_iCallback; // Callback identifier. (Corresponds to the k_iCallback enum in the callback structure.)
|
||||
uint8 *m_pubParam; // Points to the callback structure
|
||||
int m_cubParam; // Size of the data pointed to by m_pubParam
|
||||
};
|
||||
#pragma pack( pop )
|
||||
|
||||
// Macros to define steam callback structures. Used internally for debugging
|
||||
#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 ISteamHTMLSurface;
|
||||
class ISteamInventory;
|
||||
class ISteamVideo;
|
||||
class ISteamParentalSettings;
|
||||
class ISteamGameSearch;
|
||||
class ISteamInput;
|
||||
class ISteamParties;
|
||||
class ISteamRemotePlay;
|
||||
|
||||
// Forward declare types
|
||||
struct SteamNetworkingIdentity;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// 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_iSteamAppsCallbacks = 1000 };
|
||||
enum { k_iSteamUserStatsCallbacks = 1100 };
|
||||
enum { k_iSteamNetworkingCallbacks = 1200 };
|
||||
enum { k_iSteamNetworkingSocketsCallbacks = 1220 };
|
||||
enum { k_iSteamNetworkingMessagesCallbacks = 1250 };
|
||||
enum { k_iSteamNetworkingUtilsCallbacks = 1280 };
|
||||
enum { k_iSteamRemoteStorageCallbacks = 1300 };
|
||||
enum { k_iSteamGameServerItemsCallbacks = 1500 };
|
||||
enum { k_iSteamGameCoordinatorCallbacks = 1700 };
|
||||
enum { k_iSteamGameServerStatsCallbacks = 1800 };
|
||||
enum { k_iSteam2AsyncCallbacks = 1900 };
|
||||
enum { k_iSteamGameStatsCallbacks = 2000 };
|
||||
enum { k_iSteamHTTPCallbacks = 2100 };
|
||||
enum { k_iSteamScreenshotsCallbacks = 2300 };
|
||||
// NOTE: 2500-2599 are reserved
|
||||
enum { k_iSteamStreamLauncherCallbacks = 2600 };
|
||||
enum { k_iSteamControllerCallbacks = 2800 };
|
||||
enum { k_iSteamUGCCallbacks = 3400 };
|
||||
enum { k_iSteamStreamClientCallbacks = 3500 };
|
||||
enum { k_iSteamMusicCallbacks = 4000 };
|
||||
enum { k_iSteamMusicRemoteCallbacks = 4100 };
|
||||
enum { k_iSteamGameNotificationCallbacks = 4400 };
|
||||
enum { k_iSteamHTMLSurfaceCallbacks = 4500 };
|
||||
enum { k_iSteamVideoCallbacks = 4600 };
|
||||
enum { k_iSteamInventoryCallbacks = 4700 };
|
||||
enum { k_ISteamParentalSettingsCallbacks = 5000 };
|
||||
enum { k_iSteamGameSearchCallbacks = 5200 };
|
||||
enum { k_iSteamPartiesCallbacks = 5300 };
|
||||
enum { k_iSteamSTARCallbacks = 5500 };
|
||||
enum { k_iSteamRemotePlayCallbacks = 5700 };
|
||||
enum { k_iSteamChatCallbacks = 5900 };
|
||||
enum { k_iSteamTimelineCallbacks = 6000 };
|
||||
// NOTE: Internal "IClientXxx" callback IDs go in clientenums.h
|
||||
|
||||
// Macros used to annotate various Steamworks interfaces to generate the
|
||||
// flat API
|
||||
#ifdef API_GEN
|
||||
# define STEAM_CLANG_ATTR(ATTR) __attribute__((annotate( ATTR )))
|
||||
#else
|
||||
# define STEAM_CLANG_ATTR(ATTR)
|
||||
#endif
|
||||
|
||||
#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 ";")
|
||||
#define STEAM_FLAT_NAME(NAME) STEAM_CLANG_ATTR("flat_name:" #NAME ";")
|
||||
|
||||
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; }
|
||||
|
||||
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;
|
||||
};
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//====== Copyright © 1996-2008, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose:
|
||||
// Purpose:
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
@ -16,148 +16,122 @@
|
||||
|
||||
enum EServerMode
|
||||
{
|
||||
eServerModeInvalid = 0, // DO NOT USE
|
||||
eServerModeInvalid = 0, // DO NOT USE
|
||||
eServerModeNoAuthentication = 1, // Don't authenticate user logins and don't list on the server list
|
||||
eServerModeAuthentication = 2, // Authenticate users, list on the server list, don't run VAC on clients that connect
|
||||
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.
|
||||
/// Pass to SteamGameServer_Init to indicate that the same UDP port will be used for game traffic
|
||||
/// UDP queries for server browser pings and LAN discovery. In this case, Steam will not open up a
|
||||
/// socket to handle server browser queries, and you must use ISteamGameServer::HandleIncomingPacket
|
||||
/// and ISteamGameServer::GetNextOutgoingPacket to handle packets related to server discovery on your socket.
|
||||
const uint16 STEAMGAMESERVER_QUERY_PORT_SHARED = 0xffff;
|
||||
|
||||
// DEPRECATED: This old name was really confusing.
|
||||
const uint16 MASTERSERVERUPDATERPORT_USEGAMESOCKETSHARE = STEAMGAMESERVER_QUERY_PORT_SHARED;
|
||||
|
||||
// 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.
|
||||
// - usGamePort is the port that clients will connect to for gameplay.
|
||||
// - unIP will usually be zero. If you are on a machine with multiple IP addresses, you can pass a non-zero
|
||||
// value here and the relevant sockets will be bound to that IP. This can be used to ensure that
|
||||
// the IP you desire is the one used in the server browser.
|
||||
// - usGamePort is the port that clients will connect to for gameplay. You will usually open up your
|
||||
// own socket bound to this port.
|
||||
// - 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
|
||||
// pings from clients. If you pass STEAMGAMESERVER_QUERY_PORT_SHARED for usQueryPort, then it
|
||||
// will use "GameSocketShare" mode, which means that the game is responsible for sending and receiving
|
||||
// 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
|
||||
// UDP packets for the master server updater. (See ISteamGameServer::HandleIncomingPacket and
|
||||
// ISteamGameServer::GetNextOutgoingPacket.)
|
||||
// - The version string should be 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.)
|
||||
#ifndef _PS3
|
||||
//
|
||||
// On success k_ESteamAPIInitResult_OK is returned. Otherwise, if pOutErrMsg is non-NULL,
|
||||
// it will receive a non-localized message that explains the reason for the failure
|
||||
inline ESteamAPIInitResult SteamGameServer_InitEx( uint32 unIP, uint16 usGamePort, uint16 usQueryPort, EServerMode eServerMode, const char *pchVersionString, SteamErrMsg *pOutErrMsg );
|
||||
|
||||
#ifdef VERSION_SAFE_STEAM_API_INTERFACES
|
||||
S_API bool SteamGameServer_InitSafe( uint32 unIP, uint16 usSteamPort, uint16 usGamePort, uint16 usQueryPort, EServerMode eServerMode, const char *pchVersionString );
|
||||
#else
|
||||
S_API bool SteamGameServer_Init( uint32 unIP, uint16 usSteamPort, uint16 usGamePort, uint16 usQueryPort, EServerMode eServerMode, const char *pchVersionString );
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
#ifdef VERSION_SAFE_STEAM_API_INTERFACES
|
||||
S_API bool SteamGameServer_InitSafe( const SteamPS3Params_t *ps3Params, uint32 unIP, uint16 usSteamPort, uint16 usGamePort, uint16 usQueryPort, EServerMode eServerMode, const char *pchVersionString );
|
||||
#else
|
||||
S_API bool SteamGameServer_Init( const SteamPS3Params_t *ps3Params, uint32 unIP, uint16 usSteamPort, uint16 usGamePort, uint16 usQueryPort, EServerMode eServerMode, const char *pchVersionString );
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef VERSION_SAFE_STEAM_API_INTERFACES
|
||||
S_API ISteamGameServer *SteamGameServer();
|
||||
S_API ISteamUtils *SteamGameServerUtils();
|
||||
S_API ISteamNetworking *SteamGameServerNetworking();
|
||||
S_API ISteamGameServerStats *SteamGameServerStats();
|
||||
S_API ISteamHTTP *SteamGameServerHTTP();
|
||||
#endif
|
||||
// This function is included for compatibility with older SDK.
|
||||
// You can use it if you don't care about decent error handling
|
||||
inline bool SteamGameServer_Init( uint32 unIP, uint16 usGamePort, uint16 usQueryPort, EServerMode eServerMode, const char *pchVersionString )
|
||||
{
|
||||
return SteamGameServer_InitEx( unIP, usGamePort, usQueryPort, eServerMode, pchVersionString, NULL ) == k_ESteamAPIInitResult_OK;
|
||||
}
|
||||
|
||||
// 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()
|
||||
// will free all API-related memory associated with the calling thread.
|
||||
// This memory is released automatically by SteamGameServer_RunCallbacks(),
|
||||
// so single-threaded servers do not need to explicitly call this function.
|
||||
inline void SteamGameServer_ReleaseCurrentThreadMemory();
|
||||
|
||||
S_API bool SteamGameServer_BSecure();
|
||||
S_API uint64 SteamGameServer_GetSteamID();
|
||||
|
||||
#define STEAM_GAMESERVER_CALLBACK( thisclass, func, param, var ) CCallback< thisclass, param, true > var; void func( param *pParam )
|
||||
// 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.
|
||||
//S_API ISteamClient *g_pSteamClientGameServer;
|
||||
|
||||
// SteamGameServer_InitSafe has been replaced with SteamGameServer_Init and
|
||||
// is no longer supported. Use SteamGameServer_Init instead.
|
||||
//S_API void S_CALLTYPE SteamGameServer_InitSafe();
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
// 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 SteamGameServer_GetHSteamPipe();
|
||||
|
||||
#ifdef VERSION_SAFE_STEAM_API_INTERFACES
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
// VERSION_SAFE_STEAM_API_INTERFACES uses CSteamAPIContext to provide interfaces to each module in a way that
|
||||
// lets them each specify the interface versions they are compiled with.
|
||||
// Internal implementation details below
|
||||
//
|
||||
// It's important that these stay inlined in the header so the calling module specifies the interface versions
|
||||
// for whatever Steam API version it has.
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
//=============================================================================
|
||||
|
||||
S_API HSteamUser SteamGameServer_GetHSteamUser();
|
||||
|
||||
class CSteamGameServerAPIContext
|
||||
{
|
||||
public:
|
||||
CSteamGameServerAPIContext();
|
||||
void Clear();
|
||||
|
||||
bool Init();
|
||||
|
||||
ISteamGameServer *SteamGameServer() { return m_pSteamGameServer; }
|
||||
ISteamUtils *SteamGameServerUtils() { return m_pSteamGameServerUtils; }
|
||||
ISteamNetworking *SteamGameServerNetworking() { return m_pSteamGameServerNetworking; }
|
||||
ISteamGameServerStats *SteamGameServerStats() { return m_pSteamGameServerStats; }
|
||||
ISteamHTTP *SteamHTTP() { return m_pSteamHTTP; }
|
||||
|
||||
private:
|
||||
ISteamGameServer *m_pSteamGameServer;
|
||||
ISteamUtils *m_pSteamGameServerUtils;
|
||||
ISteamNetworking *m_pSteamGameServerNetworking;
|
||||
ISteamGameServerStats *m_pSteamGameServerStats;
|
||||
ISteamHTTP *m_pSteamHTTP;
|
||||
};
|
||||
|
||||
inline CSteamGameServerAPIContext::CSteamGameServerAPIContext()
|
||||
{
|
||||
Clear();
|
||||
}
|
||||
|
||||
inline void CSteamGameServerAPIContext::Clear()
|
||||
{
|
||||
m_pSteamGameServer = NULL;
|
||||
m_pSteamGameServerUtils = NULL;
|
||||
m_pSteamGameServerNetworking = NULL;
|
||||
m_pSteamGameServerStats = NULL;
|
||||
m_pSteamHTTP = NULL;
|
||||
}
|
||||
|
||||
S_API ISteamClient *g_pSteamClientGameServer;
|
||||
// This function must be inlined so the module using steam_api.dll gets the version names they want.
|
||||
#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()
|
||||
{
|
||||
if ( !g_pSteamClientGameServer )
|
||||
m_pSteamClient = ::SteamGameServerClient();
|
||||
if ( !m_pSteamClient )
|
||||
return false;
|
||||
|
||||
HSteamUser hSteamUser = SteamGameServer_GetHSteamUser();
|
||||
HSteamPipe hSteamPipe = SteamGameServer_GetHSteamPipe();
|
||||
|
||||
m_pSteamGameServer = g_pSteamClientGameServer->GetISteamGameServer( hSteamUser, hSteamPipe, STEAMGAMESERVER_INTERFACE_VERSION );
|
||||
if ( !m_pSteamGameServer )
|
||||
return false;
|
||||
|
||||
m_pSteamGameServerUtils = g_pSteamClientGameServer->GetISteamUtils( hSteamPipe, STEAMUTILS_INTERFACE_VERSION );
|
||||
if ( !m_pSteamGameServerUtils )
|
||||
return false;
|
||||
|
||||
m_pSteamGameServerNetworking = g_pSteamClientGameServer->GetISteamNetworking( hSteamUser, hSteamPipe, STEAMNETWORKING_INTERFACE_VERSION );
|
||||
if ( !m_pSteamGameServerNetworking )
|
||||
return false;
|
||||
|
||||
m_pSteamGameServerStats = g_pSteamClientGameServer->GetISteamGameServerStats( hSteamUser, hSteamPipe, STEAMGAMESERVERSTATS_INTERFACE_VERSION );
|
||||
if ( !m_pSteamGameServerStats )
|
||||
return false;
|
||||
|
||||
m_pSteamHTTP = g_pSteamClientGameServer->GetISteamHTTP( hSteamUser, hSteamPipe, STEAMHTTP_INTERFACE_VERSION );
|
||||
if ( !m_pSteamGameServerStats )
|
||||
m_pSteamGameServer = ::SteamGameServer();
|
||||
m_pSteamGameServerUtils = ::SteamGameServerUtils();
|
||||
m_pSteamGameServerNetworking = ::SteamGameServerNetworking();
|
||||
m_pSteamGameServerStats = ::SteamGameServerStats();
|
||||
m_pSteamHTTP = ::SteamGameServerHTTP();
|
||||
m_pSteamInventory = ::SteamGameServerInventory();
|
||||
m_pSteamUGC = ::SteamGameServerUGC();
|
||||
if ( !m_pSteamGameServer || !m_pSteamGameServerUtils || !m_pSteamGameServerNetworking || !m_pSteamGameServerStats
|
||||
|| !m_pSteamHTTP || !m_pSteamInventory || !m_pSteamUGC )
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // VERSION_SAFE_STEAM_API_INTERFACES
|
||||
S_API ESteamAPIInitResult S_CALLTYPE SteamInternal_GameServer_Init_V2( uint32 unIP, uint16 usGamePort, uint16 usQueryPort, EServerMode eServerMode, const char *pchVersionString, const char *pszInternalCheckInterfaceVersions, SteamErrMsg *pOutErrMsg );
|
||||
inline ESteamAPIInitResult SteamGameServer_InitEx( uint32 unIP, uint16 usGamePort, uint16 usQueryPort, EServerMode eServerMode, const char *pchVersionString, SteamErrMsg *pOutErrMsg )
|
||||
{
|
||||
const char *pszInternalCheckInterfaceVersions =
|
||||
STEAMUTILS_INTERFACE_VERSION "\0"
|
||||
STEAMNETWORKINGUTILS_INTERFACE_VERSION "\0"
|
||||
|
||||
STEAMGAMESERVER_INTERFACE_VERSION "\0"
|
||||
STEAMGAMESERVERSTATS_INTERFACE_VERSION "\0"
|
||||
STEAMHTTP_INTERFACE_VERSION "\0"
|
||||
STEAMINVENTORY_INTERFACE_VERSION "\0"
|
||||
STEAMNETWORKING_INTERFACE_VERSION "\0"
|
||||
STEAMNETWORKINGMESSAGES_INTERFACE_VERSION "\0"
|
||||
STEAMNETWORKINGSOCKETS_INTERFACE_VERSION "\0"
|
||||
STEAMUGC_INTERFACE_VERSION "\0"
|
||||
"\0";
|
||||
return SteamInternal_GameServer_Init_V2( unIP, usGamePort, usQueryPort, eServerMode, pchVersionString, pszInternalCheckInterfaceVersions, pOutErrMsg );
|
||||
}
|
||||
inline void SteamGameServer_ReleaseCurrentThreadMemory()
|
||||
{
|
||||
SteamAPI_ReleaseCurrentThreadMemory();
|
||||
}
|
||||
|
||||
#endif // STEAM_GAMESERVER_H
|
||||
|
@ -1,32 +1,21 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//========= Copyright <EFBFBD> 1996-2008, Valve LLC, All rights reserved. ============
|
||||
//
|
||||
// Purpose:
|
||||
// Declare common types used by the Steamworks SDK.
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef STEAMCLIENTPUBLIC_H
|
||||
#define STEAMCLIENTPUBLIC_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
//lint -save -e1931 -e1927 -e1924 -e613 -e726
|
||||
|
||||
// This header file defines the interface between the calling application and the code that
|
||||
// knows how to communicate with the connection manager (CM) from the Steam service
|
||||
|
||||
// This header file is intended to be portable; ideally this 1 header file plus a lib or dll
|
||||
// is all you need to integrate the client library into some other tree. So please avoid
|
||||
// including or requiring other header files if possible. This header should only describe the
|
||||
// interface layer, no need to include anything about the implementation.
|
||||
|
||||
#include "steamtypes.h"
|
||||
|
||||
#include "steamuniverse.h"
|
||||
|
||||
// General result codes
|
||||
enum EResult
|
||||
{
|
||||
k_EResultNone = 0, // no result
|
||||
k_EResultOK = 1, // success
|
||||
k_EResultFail = 2, // generic failure
|
||||
k_EResultFail = 2, // generic failure
|
||||
k_EResultNoConnection = 3, // no/failed network connection
|
||||
// k_EResultNoConnectionRetry = 4, // OBSOLETE - removed
|
||||
k_EResultInvalidPassword = 5, // password/ticket is invalid
|
||||
@ -90,9 +79,9 @@ enum EResult
|
||||
k_EResultAccountLogonDenied = 63, // account login denied due to 2nd factor authentication failure
|
||||
k_EResultCannotUseOldPassword = 64, // The requested new password is not legal
|
||||
k_EResultInvalidLoginAuthCode = 65, // account login denied due to auth code invalid
|
||||
k_EResultAccountLogonDeniedNoMail = 66, // account login denied due to 2nd factor auth failure - and no mail has been sent
|
||||
k_EResultHardwareNotCapableOfIPT = 67, //
|
||||
k_EResultIPTInitError = 68, //
|
||||
k_EResultAccountLogonDeniedNoMail = 66, // account login denied due to 2nd factor auth failure - and no mail has been sent - partner site specific
|
||||
k_EResultHardwareNotCapableOfIPT = 67, //
|
||||
k_EResultIPTInitError = 68, //
|
||||
k_EResultParentalControlRestricted = 69, // operation failed due to parental control restrictions for current user
|
||||
k_EResultFacebookQueryError = 70, // Facebook query returned an error
|
||||
k_EResultExpiredLoginAuthCode = 71, // account login denied due to auth code expired
|
||||
@ -102,7 +91,58 @@ enum EResult
|
||||
k_EResultNoMatchingURL = 75,
|
||||
k_EResultBadResponse = 76, // parse failure, missing field, etc.
|
||||
k_EResultRequirePasswordReEntry = 77, // The user cannot complete the action until they re-enter their password
|
||||
k_EResultValueOutOfRange = 78 // the value entered is outside the acceptable range
|
||||
k_EResultValueOutOfRange = 78, // the value entered is outside the acceptable range
|
||||
k_EResultUnexpectedError = 79, // something happened that we didn't expect to ever happen
|
||||
k_EResultDisabled = 80, // The requested service has been configured to be unavailable
|
||||
k_EResultInvalidCEGSubmission = 81, // The set of files submitted to the CEG server are not valid !
|
||||
k_EResultRestrictedDevice = 82, // The device being used is not allowed to perform this action
|
||||
k_EResultRegionLocked = 83, // The action could not be complete because it is region restricted
|
||||
k_EResultRateLimitExceeded = 84, // Temporary rate limit exceeded, try again later, different from k_EResultLimitExceeded which may be permanent
|
||||
k_EResultAccountLoginDeniedNeedTwoFactor = 85, // Need two-factor code to login
|
||||
k_EResultItemDeleted = 86, // The thing we're trying to access has been deleted
|
||||
k_EResultAccountLoginDeniedThrottle = 87, // login attempt failed, try to throttle response to possible attacker
|
||||
k_EResultTwoFactorCodeMismatch = 88, // two factor code mismatch
|
||||
k_EResultTwoFactorActivationCodeMismatch = 89, // activation code for two-factor didn't match
|
||||
k_EResultAccountAssociatedToMultiplePartners = 90, // account has been associated with multiple partners
|
||||
k_EResultNotModified = 91, // data not modified
|
||||
k_EResultNoMobileDevice = 92, // the account does not have a mobile device associated with it
|
||||
k_EResultTimeNotSynced = 93, // the time presented is out of range or tolerance
|
||||
k_EResultSmsCodeFailed = 94, // SMS code failure (no match, none pending, etc.)
|
||||
k_EResultAccountLimitExceeded = 95, // Too many accounts access this resource
|
||||
k_EResultAccountActivityLimitExceeded = 96, // Too many changes to this account
|
||||
k_EResultPhoneActivityLimitExceeded = 97, // Too many changes to this phone
|
||||
k_EResultRefundToWallet = 98, // Cannot refund to payment method, must use wallet
|
||||
k_EResultEmailSendFailure = 99, // Cannot send an email
|
||||
k_EResultNotSettled = 100, // Can't perform operation till payment has settled
|
||||
k_EResultNeedCaptcha = 101, // Needs to provide a valid captcha
|
||||
k_EResultGSLTDenied = 102, // a game server login token owned by this token's owner has been banned
|
||||
k_EResultGSOwnerDenied = 103, // game server owner is denied for other reason (account lock, community ban, vac ban, missing phone)
|
||||
k_EResultInvalidItemType = 104, // the type of thing we were requested to act on is invalid
|
||||
k_EResultIPBanned = 105, // the ip address has been banned from taking this action
|
||||
k_EResultGSLTExpired = 106, // this token has expired from disuse; can be reset for use
|
||||
k_EResultInsufficientFunds = 107, // user doesn't have enough wallet funds to complete the action
|
||||
k_EResultTooManyPending = 108, // There are too many of this thing pending already
|
||||
k_EResultNoSiteLicensesFound = 109, // No site licenses found
|
||||
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
|
||||
k_EResultAccountDeleted = 114, // account has been deleted
|
||||
k_EResultExistingUserCancelledLicense = 115, // A license for this already exists, but cancelled
|
||||
k_EResultCommunityCooldown = 116, // access is denied because of a community cooldown (probably from support profile data resets)
|
||||
k_EResultNoLauncherSpecified = 117, // No launcher was specified, but a launcher was needed to choose correct realm for operation.
|
||||
k_EResultMustAgreeToSSA = 118, // User must agree to china SSA or global SSA before login
|
||||
k_EResultLauncherMigrated = 119, // The specified launcher type is no longer supported; the user should be directed elsewhere
|
||||
k_EResultSteamRealmMismatch = 120, // The user's realm does not match the realm of the requested resource
|
||||
k_EResultInvalidSignature = 121, // signature check did not match
|
||||
k_EResultParseFailure = 122, // Failed to parse input
|
||||
k_EResultNoVerifiedPhone = 123, // account does not have a verified phone number
|
||||
k_EResultInsufficientBattery = 124, // user device doesn't have enough battery charge currently to complete the action
|
||||
k_EResultChargerRequired = 125, // The operation requires a charger to be plugged in, which wasn't present
|
||||
k_EResultCachedCredentialInvalid = 126, // Cached credential was invalid - user must reauthenticate
|
||||
K_EResultPhoneNumberIsVOIP = 127, // The phone number provided is a Voice Over IP number
|
||||
k_EResultNotSupported = 128, // The data being accessed is not supported by this API
|
||||
k_EResultFamilySizeLimitExceeded = 129, // Reached the maximum size of the family
|
||||
};
|
||||
|
||||
// Error codes for use with the voice functions
|
||||
@ -116,11 +156,13 @@ enum EVoiceResult
|
||||
k_EVoiceResultDataCorrupted = 5,
|
||||
k_EVoiceResultRestricted = 6,
|
||||
k_EVoiceResultUnsupportedCodec = 7,
|
||||
k_EVoiceResultReceiverOutOfDate = 8,
|
||||
k_EVoiceResultReceiverDidNotAnswer = 9,
|
||||
|
||||
};
|
||||
|
||||
// Result codes to GSHandleClientDeny/Kick
|
||||
typedef enum
|
||||
enum EDenyReason
|
||||
{
|
||||
k_EDenyInvalid = 0,
|
||||
k_EDenyInvalidVersion = 1,
|
||||
@ -138,14 +180,14 @@ typedef enum
|
||||
k_EDenySteamResponseTimedOut = 13,
|
||||
k_EDenySteamValidationStalled = 14,
|
||||
k_EDenySteamOwnerLeftGuestUser = 15,
|
||||
} EDenyReason;
|
||||
};
|
||||
|
||||
// return type of GetAuthSessionTicket
|
||||
typedef uint32 HAuthTicket;
|
||||
const HAuthTicket k_HAuthTicketInvalid = 0;
|
||||
|
||||
// results from BeginAuthSession
|
||||
typedef enum
|
||||
enum EBeginAuthSessionResult
|
||||
{
|
||||
k_EBeginAuthSessionResultOK = 0, // Ticket is valid for this game and this steamID.
|
||||
k_EBeginAuthSessionResultInvalidTicket = 1, // Ticket is not valid.
|
||||
@ -153,10 +195,10 @@ typedef enum
|
||||
k_EBeginAuthSessionResultInvalidVersion = 3, // Ticket is from an incompatible interface version
|
||||
k_EBeginAuthSessionResultGameMismatch = 4, // Ticket is not for this game
|
||||
k_EBeginAuthSessionResultExpiredTicket = 5, // Ticket has expired
|
||||
} EBeginAuthSessionResult;
|
||||
};
|
||||
|
||||
// Callback values for callback ValidateAuthTicketResponse_t which is a response to BeginAuthSession
|
||||
typedef enum
|
||||
enum EAuthSessionResponse
|
||||
{
|
||||
k_EAuthSessionResponseOK = 0, // Steam has verified the user is online, the ticket is valid and ticket has not been reused.
|
||||
k_EAuthSessionResponseUserNotConnectedToSteam = 1, // The user in question is not connected to steam
|
||||
@ -167,33 +209,23 @@ typedef enum
|
||||
k_EAuthSessionResponseAuthTicketCanceled = 6, // The ticket has been canceled by the issuer
|
||||
k_EAuthSessionResponseAuthTicketInvalidAlreadyUsed = 7, // This ticket has already been used, it is not valid.
|
||||
k_EAuthSessionResponseAuthTicketInvalid = 8, // This ticket is not from a user instance currently connected to steam.
|
||||
} EAuthSessionResponse;
|
||||
k_EAuthSessionResponsePublisherIssuedBan = 9, // The user is banned for this game. The ban came via the web api and not VAC
|
||||
k_EAuthSessionResponseAuthTicketNetworkIdentityFailure = 10, // The network identity in the ticket does not match the server authenticating the ticket
|
||||
};
|
||||
|
||||
// results from UserHasLicenseForApp
|
||||
typedef enum
|
||||
enum EUserHasLicenseForAppResult
|
||||
{
|
||||
k_EUserHasLicenseResultHasLicense = 0, // User has a license for specified app
|
||||
k_EUserHasLicenseResultDoesNotHaveLicense = 1, // User does not have a license for the specified app
|
||||
k_EUserHasLicenseResultNoAuth = 2, // User has not been authenticated
|
||||
} EUserHasLicenseForAppResult;
|
||||
|
||||
|
||||
// Steam universes. Each universe is a self-contained Steam instance.
|
||||
enum EUniverse
|
||||
{
|
||||
k_EUniverseInvalid = 0,
|
||||
k_EUniversePublic = 1,
|
||||
k_EUniverseBeta = 2,
|
||||
k_EUniverseInternal = 3,
|
||||
k_EUniverseDev = 4,
|
||||
// k_EUniverseRC = 5, // no such universe anymore
|
||||
k_EUniverseMax
|
||||
};
|
||||
|
||||
|
||||
// Steam account types
|
||||
enum EAccountType
|
||||
{
|
||||
k_EAccountTypeInvalid = 0,
|
||||
k_EAccountTypeInvalid = 0,
|
||||
k_EAccountTypeIndividual = 1, // single user account
|
||||
k_EAccountTypeMultiseat = 2, // multiseat (e.g. cybercafe) account
|
||||
k_EAccountTypeGameServer = 3, // game server account
|
||||
@ -211,79 +243,12 @@ enum EAccountType
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
//-----------------------------------------------------------------------------
|
||||
enum EAppReleaseState
|
||||
{
|
||||
k_EAppReleaseState_Unknown = 0, // unknown, required appinfo or license info is missing
|
||||
k_EAppReleaseState_Unavailable = 1, // even if user 'just' owns it, can see game at all
|
||||
k_EAppReleaseState_Prerelease = 2, // can be purchased and is visible in games list, nothing else. Common appInfo section released
|
||||
k_EAppReleaseState_PreloadOnly = 3, // owners can preload app, not play it. AppInfo fully released.
|
||||
k_EAppReleaseState_Released = 4, // owners can download and play app.
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
//-----------------------------------------------------------------------------
|
||||
enum EAppOwernshipFlags
|
||||
{
|
||||
k_EAppOwernshipFlags_None = 0, // unknown
|
||||
k_EAppOwernshipFlags_OwnsLicense = 1, // owns license for this game
|
||||
k_EAppOwernshipFlags_FreeLicense = 2, // not paid for game
|
||||
k_EAppOwernshipFlags_RegionRestricted = 4, // owns app, but not allowed to play in current region
|
||||
k_EAppOwernshipFlags_LowViolence = 8, // only low violence version
|
||||
k_EAppOwernshipFlags_InvalidPlatform = 16, // app not supported on current platform
|
||||
k_EAppOwernshipFlags_DeviceLicense = 32, // license was granted by authorized local device
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: designed as flags to allow filters masks
|
||||
//-----------------------------------------------------------------------------
|
||||
enum EAppType
|
||||
{
|
||||
k_EAppType_Invalid = 0x000, // unknown / invalid
|
||||
k_EAppType_Game = 0x001, // playable game, default type
|
||||
k_EAppType_Application = 0x002, // software application
|
||||
k_EAppType_Tool = 0x004, // SDKs, editors & dedicated servers
|
||||
k_EAppType_Demo = 0x008, // game demo
|
||||
k_EAppType_Media = 0x010, // media trailer
|
||||
k_EAppType_DLC = 0x020, // down loadable content
|
||||
k_EAppType_Guide = 0x040, // game guide, PDF etc
|
||||
k_EAppType_Driver = 0x080, // hardware driver updater (ATI, Razor etc)
|
||||
|
||||
k_EAppType_Shortcut = 0x40000000, // just a shortcut, client side only
|
||||
k_EAppType_DepotOnly = 0x80000000, // placeholder since depots and apps share the same namespace
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// types of user game stats fields
|
||||
// WARNING: DO NOT RENUMBER EXISTING VALUES - STORED IN DATABASE
|
||||
//-----------------------------------------------------------------------------
|
||||
enum ESteamUserStatType
|
||||
{
|
||||
k_ESteamUserStatTypeINVALID = 0,
|
||||
k_ESteamUserStatTypeINT = 1,
|
||||
k_ESteamUserStatTypeFLOAT = 2,
|
||||
// Read as FLOAT, set with count / session length
|
||||
k_ESteamUserStatTypeAVGRATE = 3,
|
||||
k_ESteamUserStatTypeACHIEVEMENTS = 4,
|
||||
k_ESteamUserStatTypeGROUPACHIEVEMENTS = 5,
|
||||
|
||||
// max, for sanity checks
|
||||
k_ESteamUserStatTypeMAX
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Chat Entry Types (previously was only friend-to-friend message types)
|
||||
//-----------------------------------------------------------------------------
|
||||
enum EChatEntryType
|
||||
{
|
||||
k_EChatEntryTypeInvalid = 0,
|
||||
k_EChatEntryTypeInvalid = 0,
|
||||
k_EChatEntryTypeChatMsg = 1, // Normal text message from another user
|
||||
k_EChatEntryTypeTyping = 2, // Another user is typing (not used in multi-user chat)
|
||||
k_EChatEntryTypeInviteGame = 3, // Invite from other user into that users current game
|
||||
@ -296,7 +261,9 @@ enum EChatEntryType
|
||||
k_EChatEntryTypeWasBanned = 9, // user was banned (data: 64-bit steamid of actor performing the ban)
|
||||
k_EChatEntryTypeDisconnected = 10, // user disconnected
|
||||
k_EChatEntryTypeHistoricalChat = 11, // a chat message from user's chat history or offilne message
|
||||
|
||||
//k_EChatEntryTypeReserved1 = 12, // No longer used
|
||||
//k_EChatEntryTypeReserved2 = 13, // No longer used
|
||||
k_EChatEntryTypeLinkBlocked = 14, // a link was removed by the chat filter.
|
||||
};
|
||||
|
||||
|
||||
@ -319,30 +286,13 @@ enum EChatRoomEnterResponse
|
||||
// k_EChatRoomEnterResponseNoRankingDataLobby = 12, // No longer used
|
||||
// k_EChatRoomEnterResponseNoRankingDataUser = 13, // No longer used
|
||||
// k_EChatRoomEnterResponseRankOutOfRange = 14, // No longer used
|
||||
k_EChatRoomEnterResponseRatelimitExceeded = 15, // Join failed - to many join attempts in a very short period of time
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Status of a given depot version, these are stored in the DB, don't renumber
|
||||
//-----------------------------------------------------------------------------
|
||||
enum EStatusDepotVersion
|
||||
{
|
||||
k_EStatusDepotVersionInvalid = 0,
|
||||
k_EStatusDepotVersionDisabled = 1, // version was disabled, no manifest & content available
|
||||
k_EStatusDepotVersionAvailable = 2, // manifest & content is available, but not current
|
||||
k_EStatusDepotVersionCurrent = 3, // current depot version. The can be multiple, one for public and one for each beta key
|
||||
};
|
||||
|
||||
|
||||
typedef void (*PFNLegacyKeyRegistration)( const char *pchCDKey, const char *pchInstallPath );
|
||||
typedef bool (*PFNLegacyKeyInstalled)();
|
||||
|
||||
const unsigned int k_unSteamAccountIDMask = 0xFFFFFFFF;
|
||||
const unsigned int k_unSteamAccountInstanceMask = 0x000FFFFF;
|
||||
// we allow 3 simultaneous user account instances right now, 1= desktop, 2 = console, 4 = web, 0 = all
|
||||
const unsigned int k_unSteamUserDesktopInstance = 1;
|
||||
const unsigned int k_unSteamUserConsoleInstance = 2;
|
||||
const unsigned int k_unSteamUserWebInstance = 4;
|
||||
const unsigned int k_unSteamUserDefaultInstance = 1; // fixed instance for all individual users
|
||||
|
||||
// Special flags for Chat accounts - they go in the top 8 bits
|
||||
// of the steam ID's "instance", leaving 12 for the actual instances
|
||||
@ -358,31 +308,12 @@ enum EChatSteamIDInstanceFlags
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Marketing message flags that change how a client should handle them
|
||||
//-----------------------------------------------------------------------------
|
||||
enum EMarketingMessageFlags
|
||||
{
|
||||
k_EMarketingMessageFlagsNone = 0,
|
||||
k_EMarketingMessageFlagsHighPriority = 1 << 0,
|
||||
k_EMarketingMessageFlagsPlatformWindows = 1 << 1,
|
||||
k_EMarketingMessageFlagsPlatformMac = 1 << 2,
|
||||
k_EMarketingMessageFlagsPlatformLinux = 1 << 3,
|
||||
|
||||
//aggregate flags
|
||||
k_EMarketingMessageFlagsPlatformRestrictions =
|
||||
k_EMarketingMessageFlagsPlatformWindows |
|
||||
k_EMarketingMessageFlagsPlatformMac |
|
||||
k_EMarketingMessageFlagsPlatformLinux,
|
||||
};
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Possible positions to tell the overlay to show notifications in
|
||||
//-----------------------------------------------------------------------------
|
||||
enum ENotificationPosition
|
||||
{
|
||||
k_EPositionInvalid = -1,
|
||||
k_EPositionTopLeft = 0,
|
||||
k_EPositionTopRight = 1,
|
||||
k_EPositionBottomLeft = 2,
|
||||
@ -390,7 +321,157 @@ enum ENotificationPosition
|
||||
};
|
||||
|
||||
|
||||
#pragma pack( push, 1 )
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Broadcast upload result details
|
||||
//-----------------------------------------------------------------------------
|
||||
enum EBroadcastUploadResult
|
||||
{
|
||||
k_EBroadcastUploadResultNone = 0, // broadcast state unknown
|
||||
k_EBroadcastUploadResultOK = 1, // broadcast was good, no problems
|
||||
k_EBroadcastUploadResultInitFailed = 2, // broadcast init failed
|
||||
k_EBroadcastUploadResultFrameFailed = 3, // broadcast frame upload failed
|
||||
k_EBroadcastUploadResultTimeout = 4, // broadcast upload timed out
|
||||
k_EBroadcastUploadResultBandwidthExceeded = 5, // broadcast send too much data
|
||||
k_EBroadcastUploadResultLowFPS = 6, // broadcast FPS too low
|
||||
k_EBroadcastUploadResultMissingKeyFrames = 7, // broadcast sending not enough key frames
|
||||
k_EBroadcastUploadResultNoConnection = 8, // broadcast client failed to connect to relay
|
||||
k_EBroadcastUploadResultRelayFailed = 9, // relay dropped the upload
|
||||
k_EBroadcastUploadResultSettingsChanged = 10, // the client changed broadcast settings
|
||||
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
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// 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),
|
||||
};
|
||||
|
||||
|
||||
//
|
||||
// describes XP / progress restrictions to apply for games with duration control /
|
||||
// anti-indulgence enabled for minor Steam China users.
|
||||
//
|
||||
// WARNING: DO NOT RENUMBER
|
||||
enum EDurationControlProgress
|
||||
{
|
||||
k_EDurationControlProgress_Full = 0, // Full progress
|
||||
k_EDurationControlProgress_Half = 1, // deprecated - XP or persistent rewards should be halved
|
||||
k_EDurationControlProgress_None = 2, // deprecated - XP or persistent rewards should be stopped
|
||||
|
||||
k_EDurationControl_ExitSoon_3h = 3, // allowed 3h time since 5h gap/break has elapsed, game should exit - steam will terminate the game soon
|
||||
k_EDurationControl_ExitSoon_5h = 4, // allowed 5h time in calendar day has elapsed, game should exit - steam will terminate the game soon
|
||||
k_EDurationControl_ExitSoon_Night = 5, // game running after day period, game should exit - steam will terminate the game soon
|
||||
};
|
||||
|
||||
|
||||
//
|
||||
// describes which notification timer has expired, for steam china duration control feature
|
||||
//
|
||||
// WARNING: DO NOT RENUMBER
|
||||
enum EDurationControlNotification
|
||||
{
|
||||
k_EDurationControlNotification_None = 0, // just informing you about progress, no notification to show
|
||||
k_EDurationControlNotification_1Hour = 1, // "you've been playing for N hours"
|
||||
|
||||
k_EDurationControlNotification_3Hours = 2, // deprecated - "you've been playing for 3 hours; take a break"
|
||||
k_EDurationControlNotification_HalfProgress = 3,// deprecated - "your XP / progress is half normal"
|
||||
k_EDurationControlNotification_NoProgress = 4, // deprecated - "your XP / progress is zero"
|
||||
|
||||
k_EDurationControlNotification_ExitSoon_3h = 5, // allowed 3h time since 5h gap/break has elapsed, game should exit - steam will terminate the game soon
|
||||
k_EDurationControlNotification_ExitSoon_5h = 6, // allowed 5h time in calendar day has elapsed, game should exit - steam will terminate the game soon
|
||||
k_EDurationControlNotification_ExitSoon_Night = 7,// game running after day period, game should exit - steam will terminate the game soon
|
||||
};
|
||||
|
||||
|
||||
//
|
||||
// Specifies a game's online state in relation to duration control
|
||||
//
|
||||
enum EDurationControlOnlineState
|
||||
{
|
||||
k_EDurationControlOnlineState_Invalid = 0, // nil value
|
||||
k_EDurationControlOnlineState_Offline = 1, // currently in offline play - single-player, offline co-op, etc.
|
||||
k_EDurationControlOnlineState_Online = 2, // currently in online play
|
||||
k_EDurationControlOnlineState_OnlineHighPri = 3, // currently in online play and requests not to be interrupted
|
||||
};
|
||||
|
||||
|
||||
enum EBetaBranchFlags
|
||||
{
|
||||
k_EBetaBranch_None = 0,
|
||||
k_EBetaBranch_Default = 1, // this is the default branch ("public")
|
||||
k_EBetaBranch_Available = 2, // this branch can be selected (available)
|
||||
k_EBetaBranch_Private = 4, // this is a private branch (password protected)
|
||||
k_EBetaBranch_Selected = 8, // this is the currently selected branch (active)
|
||||
k_EBetaBranch_Installed = 16, // this is the currently installed branch (mounted)
|
||||
};
|
||||
|
||||
#pragma pack( push, 1 )
|
||||
|
||||
#define CSTEAMID_DEFINED
|
||||
|
||||
@ -426,14 +507,14 @@ public:
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Constructor
|
||||
// Input : unAccountID - 32-bit account ID
|
||||
// unAccountInstance - instance
|
||||
// unAccountInstance - instance
|
||||
// eUniverse - Universe this account belongs to
|
||||
// eAccountType - Type of account
|
||||
//-----------------------------------------------------------------------------
|
||||
CSteamID( uint32 unAccountID, unsigned int unAccountInstance, EUniverse eUniverse, EAccountType eAccountType )
|
||||
{
|
||||
#if defined(_SERVER) && defined(Assert)
|
||||
Assert( ! ( ( k_EAccountTypeIndividual == eAccountType ) && ( unAccountInstance > k_unSteamUserWebInstance ) ) ); // enforce that for individual accounts, instance is always 1
|
||||
Assert( ( k_EAccountTypeIndividual != eAccountType ) || ( unAccountInstance == k_unSteamUserDefaultInstance ) ); // enforce that for individual accounts, instance is always 1
|
||||
#endif // _SERVER
|
||||
InstancedSet( unAccountID, unAccountInstance, eUniverse, eAccountType );
|
||||
}
|
||||
@ -449,6 +530,12 @@ public:
|
||||
{
|
||||
SetFromUint64( ulSteamID );
|
||||
}
|
||||
#ifdef INT64_DIFFERENT_FROM_INT64_T
|
||||
CSteamID( uint64_t ulSteamID )
|
||||
{
|
||||
SetFromUint64( (uint64)ulSteamID );
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@ -463,14 +550,13 @@ public:
|
||||
m_steamid.m_comp.m_EUniverse = eUniverse;
|
||||
m_steamid.m_comp.m_EAccountType = eAccountType;
|
||||
|
||||
if ( eAccountType == k_EAccountTypeClan )
|
||||
if ( eAccountType == k_EAccountTypeClan || eAccountType == k_EAccountTypeGameServer )
|
||||
{
|
||||
m_steamid.m_comp.m_unAccountInstance = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
// by default we pick the desktop instance
|
||||
m_steamid.m_comp.m_unAccountInstance = k_unSteamUserDesktopInstance;
|
||||
m_steamid.m_comp.m_unAccountInstance = k_unSteamUserDefaultInstance;
|
||||
}
|
||||
}
|
||||
|
||||
@ -524,37 +610,6 @@ public:
|
||||
m_steamid.m_comp.m_unAccountInstance = 0;
|
||||
}
|
||||
|
||||
|
||||
#if defined( INCLUDED_STEAM_COMMON_STEAMCOMMON_H )
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Initializes a steam ID from a Steam2 ID structure
|
||||
// Input: pTSteamGlobalUserID - Steam2 ID to convert
|
||||
// eUniverse - universe this ID belongs to
|
||||
//-----------------------------------------------------------------------------
|
||||
void SetFromSteam2( TSteamGlobalUserID *pTSteamGlobalUserID, EUniverse eUniverse )
|
||||
{
|
||||
m_steamid.m_comp.m_unAccountID = pTSteamGlobalUserID->m_SteamLocalUserID.Split.Low32bits * 2 +
|
||||
pTSteamGlobalUserID->m_SteamLocalUserID.Split.High32bits;
|
||||
m_steamid.m_comp.m_EUniverse = eUniverse; // set the universe
|
||||
m_steamid.m_comp.m_EAccountType = k_EAccountTypeIndividual; // Steam 2 accounts always map to account type of individual
|
||||
m_steamid.m_comp.m_unAccountInstance = k_unSteamUserDesktopInstance; // Steam2 only knew desktop instances
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Fills out a Steam2 ID structure
|
||||
// Input: pTSteamGlobalUserID - Steam2 ID to write to
|
||||
//-----------------------------------------------------------------------------
|
||||
void ConvertToSteam2( TSteamGlobalUserID *pTSteamGlobalUserID ) const
|
||||
{
|
||||
// only individual accounts have any meaning in Steam 2, only they can be mapped
|
||||
// Assert( m_steamid.m_comp.m_EAccountType == k_EAccountTypeIndividual );
|
||||
|
||||
pTSteamGlobalUserID->m_SteamInstanceID = 0;
|
||||
pTSteamGlobalUserID->m_SteamLocalUserID.Split.High32bits = m_steamid.m_comp.m_unAccountID % 2;
|
||||
pTSteamGlobalUserID->m_SteamLocalUserID.Split.Low32bits = m_steamid.m_comp.m_unAccountID / 2;
|
||||
}
|
||||
#endif // defined( INCLUDED_STEAM_COMMON_STEAMCOMMON_H )
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Converts steam ID to its 64-bit representation
|
||||
// Output : 64-bit representation of a Steam ID
|
||||
@ -706,8 +761,7 @@ public:
|
||||
// simple accessors
|
||||
void SetAccountID( uint32 unAccountID ) { m_steamid.m_comp.m_unAccountID = unAccountID; }
|
||||
void SetAccountInstance( uint32 unInstance ){ m_steamid.m_comp.m_unAccountInstance = unInstance; }
|
||||
void ClearIndividualInstance() { if ( BIndividualAccount() ) m_steamid.m_comp.m_unAccountInstance = 0; }
|
||||
bool HasNoIndividualInstance() const { return BIndividualAccount() && (m_steamid.m_comp.m_unAccountInstance==0); }
|
||||
|
||||
AccountID_t GetAccountID() const { return m_steamid.m_comp.m_unAccountID; }
|
||||
uint32 GetUnAccountInstance() const { return m_steamid.m_comp.m_unAccountInstance; }
|
||||
EAccountType GetEAccountType() const { return ( EAccountType ) m_steamid.m_comp.m_EAccountType; }
|
||||
@ -727,9 +781,8 @@ public:
|
||||
// and is preferred when the caller knows it's safe to be strict.
|
||||
// Returns whether the string parsed correctly.
|
||||
bool SetFromStringStrict( const char *pchSteamID, EUniverse eDefaultUniverse );
|
||||
bool SetFromSteam2String( const char *pchSteam2ID, EUniverse eUniverse );
|
||||
|
||||
inline bool operator==( const CSteamID &val ) const { return m_steamid.m_unAll64Bits == val.m_steamid.m_unAll64Bits; }
|
||||
inline bool operator==( const CSteamID &val ) const { return m_steamid.m_unAll64Bits == val.m_steamid.m_unAll64Bits; }
|
||||
inline bool operator!=( const CSteamID &val ) const { return !operator==( val ); }
|
||||
inline bool operator<( const CSteamID &val ) const { return m_steamid.m_unAll64Bits < val.m_steamid.m_unAll64Bits; }
|
||||
inline bool operator>( const CSteamID &val ) const { return m_steamid.m_unAll64Bits > val.m_steamid.m_unAll64Bits; }
|
||||
@ -771,13 +824,13 @@ inline bool CSteamID::IsValid() const
|
||||
{
|
||||
if ( m_steamid.m_comp.m_EAccountType <= k_EAccountTypeInvalid || m_steamid.m_comp.m_EAccountType >= k_EAccountTypeMax )
|
||||
return false;
|
||||
|
||||
|
||||
if ( m_steamid.m_comp.m_EUniverse <= k_EUniverseInvalid || m_steamid.m_comp.m_EUniverse >= k_EUniverseMax )
|
||||
return false;
|
||||
|
||||
if ( m_steamid.m_comp.m_EAccountType == k_EAccountTypeIndividual )
|
||||
{
|
||||
if ( m_steamid.m_comp.m_unAccountID == 0 || m_steamid.m_comp.m_unAccountInstance > k_unSteamUserWebInstance )
|
||||
if ( m_steamid.m_comp.m_unAccountID == 0 || m_steamid.m_comp.m_unAccountInstance != k_unSteamUserDefaultInstance )
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -796,6 +849,41 @@ inline bool CSteamID::IsValid() const
|
||||
return true;
|
||||
}
|
||||
|
||||
#if defined( INCLUDED_STEAM2_USERID_STRUCTS )
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Initializes a steam ID from a Steam2 ID structure
|
||||
// Input: pTSteamGlobalUserID - Steam2 ID to convert
|
||||
// eUniverse - universe this ID belongs to
|
||||
//-----------------------------------------------------------------------------
|
||||
inline CSteamID SteamIDFromSteam2UserID( TSteamGlobalUserID *pTSteamGlobalUserID, EUniverse eUniverse )
|
||||
{
|
||||
uint32 unAccountID = pTSteamGlobalUserID->m_SteamLocalUserID.Split.Low32bits * 2 +
|
||||
pTSteamGlobalUserID->m_SteamLocalUserID.Split.High32bits;
|
||||
|
||||
return CSteamID( unAccountID, k_unSteamUserDefaultInstance, eUniverse, k_EAccountTypeIndividual );
|
||||
}
|
||||
|
||||
bool SteamIDFromSteam2String( const char *pchSteam2ID, EUniverse eUniverse, CSteamID *pSteamIDOut );
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Fills out a Steam2 ID structure
|
||||
// Input: pTSteamGlobalUserID - Steam2 ID to write to
|
||||
//-----------------------------------------------------------------------------
|
||||
inline TSteamGlobalUserID SteamIDToSteam2UserID( CSteamID steamID )
|
||||
{
|
||||
TSteamGlobalUserID steamGlobalUserID;
|
||||
|
||||
steamGlobalUserID.m_SteamInstanceID = 0;
|
||||
steamGlobalUserID.m_SteamLocalUserID.Split.High32bits = steamID.GetAccountID() % 2;
|
||||
steamGlobalUserID.m_SteamLocalUserID.Split.Low32bits = steamID.GetAccountID() / 2;
|
||||
|
||||
return steamGlobalUserID;
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
// generic invalid CSteamID
|
||||
#define k_steamIDNil CSteamID()
|
||||
|
||||
@ -834,6 +922,14 @@ class CGameID
|
||||
{
|
||||
public:
|
||||
|
||||
enum EGameIDType
|
||||
{
|
||||
k_EGameIDTypeApp = 0,
|
||||
k_EGameIDTypeGameMod = 1,
|
||||
k_EGameIDTypeShortcut = 2,
|
||||
k_EGameIDTypeP2P = 3,
|
||||
};
|
||||
|
||||
CGameID()
|
||||
{
|
||||
m_gameID.m_nType = k_EGameIDTypeApp;
|
||||
@ -845,6 +941,12 @@ public:
|
||||
{
|
||||
m_ulGameID = ulGameID;
|
||||
}
|
||||
#ifdef INT64_DIFFERENT_FROM_INT64_T
|
||||
CGameID( uint64_t ulGameID )
|
||||
{
|
||||
m_ulGameID = (uint64)ulGameID;
|
||||
}
|
||||
#endif
|
||||
|
||||
explicit CGameID( int32 nAppID )
|
||||
{
|
||||
@ -858,12 +960,23 @@ public:
|
||||
m_gameID.m_nAppID = nAppID;
|
||||
}
|
||||
|
||||
CGameID( uint32 nAppID, uint32 nModID )
|
||||
// Not validating anything .. use IsValid()
|
||||
explicit CGameID( uint32 nAppID, uint32 nModID, CGameID::EGameIDType nType )
|
||||
{
|
||||
m_ulGameID = 0;
|
||||
m_gameID.m_nAppID = nAppID;
|
||||
m_gameID.m_nModID = nModID;
|
||||
m_gameID.m_nType = k_EGameIDTypeGameMod;
|
||||
m_gameID.m_nType = nType;
|
||||
}
|
||||
|
||||
CGameID( const CGameID &that )
|
||||
{
|
||||
m_ulGameID = that.m_ulGameID;
|
||||
}
|
||||
|
||||
CGameID& operator=( const CGameID & that )
|
||||
{
|
||||
m_ulGameID = that.m_ulGameID;
|
||||
return *this;
|
||||
}
|
||||
|
||||
// Hidden functions used only by Steam
|
||||
@ -871,70 +984,6 @@ public:
|
||||
const char *Render() const; // render this Game ID to string
|
||||
static const char *Render( uint64 ulGameID ); // static method to render a uint64 representation of a Game ID to a string
|
||||
|
||||
// must include checksum_crc.h first to get this functionality
|
||||
#if defined( CHECKSUM_CRC_H )
|
||||
CGameID( uint32 nAppID, const char *pchModPath )
|
||||
{
|
||||
m_ulGameID = 0;
|
||||
m_gameID.m_nAppID = nAppID;
|
||||
m_gameID.m_nType = k_EGameIDTypeGameMod;
|
||||
|
||||
char rgchModDir[MAX_PATH];
|
||||
Q_FileBase( pchModPath, rgchModDir, sizeof( rgchModDir ) );
|
||||
CRC32_t crc32;
|
||||
CRC32_Init( &crc32 );
|
||||
CRC32_ProcessBuffer( &crc32, rgchModDir, Q_strlen( rgchModDir ) );
|
||||
CRC32_Final( &crc32 );
|
||||
|
||||
// set the high-bit on the mod-id
|
||||
// reduces crc32 to 31bits, but lets us use the modID as a guaranteed unique
|
||||
// replacement for appID's
|
||||
m_gameID.m_nModID = crc32 | (0x80000000);
|
||||
}
|
||||
|
||||
CGameID( const char *pchExePath, const char *pchAppName )
|
||||
{
|
||||
m_ulGameID = 0;
|
||||
m_gameID.m_nAppID = k_uAppIdInvalid;
|
||||
m_gameID.m_nType = k_EGameIDTypeShortcut;
|
||||
|
||||
CRC32_t crc32;
|
||||
CRC32_Init( &crc32 );
|
||||
CRC32_ProcessBuffer( &crc32, pchExePath, Q_strlen( pchExePath ) );
|
||||
CRC32_ProcessBuffer( &crc32, pchAppName, Q_strlen( pchAppName ) );
|
||||
CRC32_Final( &crc32 );
|
||||
|
||||
// set the high-bit on the mod-id
|
||||
// reduces crc32 to 31bits, but lets us use the modID as a guaranteed unique
|
||||
// replacement for appID's
|
||||
m_gameID.m_nModID = crc32 | (0x80000000);
|
||||
}
|
||||
|
||||
#if defined( VSTFILEID_H )
|
||||
|
||||
CGameID( VstFileID vstFileID )
|
||||
{
|
||||
m_ulGameID = 0;
|
||||
m_gameID.m_nAppID = k_uAppIdInvalid;
|
||||
m_gameID.m_nType = k_EGameIDTypeP2P;
|
||||
|
||||
CRC32_t crc32;
|
||||
CRC32_Init( &crc32 );
|
||||
const char *pchFileId = vstFileID.Render();
|
||||
CRC32_ProcessBuffer( &crc32, pchFileId, Q_strlen( pchFileId ) );
|
||||
CRC32_Final( &crc32 );
|
||||
|
||||
// set the high-bit on the mod-id
|
||||
// reduces crc32 to 31bits, but lets us use the modID as a guaranteed unique
|
||||
// replacement for appID's
|
||||
m_gameID.m_nModID = crc32 | (0x80000000);
|
||||
}
|
||||
|
||||
#endif /* VSTFILEID_H */
|
||||
|
||||
#endif /* CHECKSUM_CRC_H */
|
||||
|
||||
|
||||
uint64 ToUint64() const
|
||||
{
|
||||
return m_ulGameID;
|
||||
@ -969,16 +1018,20 @@ public:
|
||||
{
|
||||
return ( m_gameID.m_nType == k_EGameIDTypeApp );
|
||||
}
|
||||
|
||||
|
||||
uint32 ModID() const
|
||||
{
|
||||
return m_gameID.m_nModID;
|
||||
}
|
||||
|
||||
uint32 AppID() const
|
||||
#if !defined(VALVE_SHORTCUT_DEBUG)
|
||||
uint32 AppID( bool = false ) const
|
||||
{
|
||||
return m_gameID.m_nAppID;
|
||||
}
|
||||
#else
|
||||
uint32 AppID( bool bShortcutOK = false ) const;
|
||||
#endif
|
||||
|
||||
bool operator == ( const CGameID &rhs ) const
|
||||
{
|
||||
@ -1004,39 +1057,30 @@ public:
|
||||
return m_gameID.m_nAppID != k_uAppIdInvalid;
|
||||
|
||||
case k_EGameIDTypeGameMod:
|
||||
return m_gameID.m_nAppID != k_uAppIdInvalid && m_gameID.m_nModID & 0x80000000;
|
||||
return m_gameID.m_nAppID != k_uAppIdInvalid && (m_gameID.m_nModID & 0x80000000);
|
||||
|
||||
case k_EGameIDTypeShortcut:
|
||||
return (m_gameID.m_nModID & 0x80000000) != 0;
|
||||
return m_gameID.m_nAppID == k_uAppIdInvalid
|
||||
&& (m_gameID.m_nModID & 0x80000000)
|
||||
&& m_gameID.m_nModID >= (5000 | 0x80000000); // k_unMaxExpectedLocalAppId - shortcuts are pushed beyond that range
|
||||
|
||||
case k_EGameIDTypeP2P:
|
||||
return m_gameID.m_nAppID == k_uAppIdInvalid && m_gameID.m_nModID & 0x80000000;
|
||||
return m_gameID.m_nAppID == k_uAppIdInvalid && (m_gameID.m_nModID & 0x80000000);
|
||||
|
||||
default:
|
||||
#if defined(Assert)
|
||||
Assert(false);
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void Reset()
|
||||
void Reset()
|
||||
{
|
||||
m_ulGameID = 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
enum EGameIDType
|
||||
{
|
||||
k_EGameIDTypeApp = 0,
|
||||
k_EGameIDTypeGameMod = 1,
|
||||
k_EGameIDTypeShortcut = 2,
|
||||
k_EGameIDTypeP2P = 3,
|
||||
};
|
||||
//
|
||||
// Internal stuff. Use the accessors above if possible
|
||||
//
|
||||
|
||||
struct GameID_t
|
||||
{
|
||||
@ -1056,6 +1100,8 @@ private:
|
||||
uint64 m_ulGameID;
|
||||
GameID_t m_gameID;
|
||||
};
|
||||
|
||||
friend CGameID GameIDFromAppAndModPath( uint32 nAppID, const char *pchModPath );
|
||||
};
|
||||
|
||||
#pragma pack( pop )
|
||||
@ -1063,24 +1109,90 @@ private:
|
||||
const int k_cchGameExtraInfoMax = 64;
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Constants used for query ports.
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#define QUERY_PORT_NOT_INITIALIZED 0xFFFF // We haven't asked the GS for this query port's actual value yet.
|
||||
#define QUERY_PORT_ERROR 0xFFFE // We were unable to get the query port for this server.
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Passed as argument to SteamAPI_UseBreakpadCrashHandler to enable optional callback
|
||||
// just before minidump file is captured after a crash has occurred. (Allows app to append additional comment data to the dump, etc.)
|
||||
//-----------------------------------------------------------------------------
|
||||
typedef void (*PFNPreMinidumpCallback)(void *context);
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Used by ICrashHandler interfaces to reference particular installed crash handlers
|
||||
//-----------------------------------------------------------------------------
|
||||
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
|
||||
};
|
||||
|
||||
|
||||
enum ESteamIPv6ConnectivityProtocol
|
||||
{
|
||||
k_ESteamIPv6ConnectivityProtocol_Invalid = 0,
|
||||
k_ESteamIPv6ConnectivityProtocol_HTTP = 1, // because a proxy may make this different than other protocols
|
||||
k_ESteamIPv6ConnectivityProtocol_UDP = 2, // test UDP connectivity. Uses a port that is commonly needed for other Steam stuff. If UDP works, TCP probably works.
|
||||
};
|
||||
|
||||
// For the above transport protocol, what do we think the local machine's connectivity to the internet over ipv6 is like
|
||||
enum ESteamIPv6ConnectivityState
|
||||
{
|
||||
k_ESteamIPv6ConnectivityState_Unknown = 0, // We haven't run a test yet
|
||||
k_ESteamIPv6ConnectivityState_Good = 1, // We have recently been able to make a request on ipv6 for the given protocol
|
||||
k_ESteamIPv6ConnectivityState_Bad = 2, // We failed to make a request, either because this machine has no ipv6 address assigned, or it has no upstream connectivity
|
||||
};
|
||||
|
||||
|
||||
// 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__) || defined(__FreeBSD__)
|
||||
// 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
|
||||
|
@ -1,4 +1,4 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//====== Copyright © 1996-2010, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: HTTP related enums, stuff that is shared by both clients and servers, and our
|
||||
// UI projects goes here.
|
||||
@ -20,13 +20,14 @@ enum EHTTPMethod
|
||||
k_EHTTPMethodGET,
|
||||
k_EHTTPMethodHEAD,
|
||||
k_EHTTPMethodPOST,
|
||||
|
||||
// The remaining HTTP methods are not yet supported, per rfc2616 section 5.1.1 only GET and HEAD are required for
|
||||
// a compliant general purpose server. We'll likely add more as we find uses for them.
|
||||
|
||||
// k_EHTTPMethodOPTIONS,
|
||||
k_EHTTPMethodPUT,
|
||||
k_EHTTPMethodDELETE,
|
||||
k_EHTTPMethodOPTIONS,
|
||||
k_EHTTPMethodPATCH,
|
||||
|
||||
// The remaining HTTP methods are not yet supported, per rfc2616 section 5.1.1 only GET and HEAD are required for
|
||||
// a compliant general purpose server. We'll likely add more as we find uses for them.
|
||||
|
||||
// k_EHTTPMethodTRACE,
|
||||
// k_EHTTPMethodCONNECT
|
||||
};
|
||||
@ -61,10 +62,11 @@ enum EHTTPStatusCode
|
||||
k_EHTTPStatusCode305UseProxy = 305,
|
||||
//k_EHTTPStatusCode306Unused = 306, (used in old HTTP spec, now unused in 1.1)
|
||||
k_EHTTPStatusCode307TemporaryRedirect = 307,
|
||||
k_EHTTPStatusCode308PermanentRedirect = 308,
|
||||
|
||||
// Error codes
|
||||
k_EHTTPStatusCode400BadRequest = 400,
|
||||
k_EHTTPStatusCode401Unauthorized = 401,
|
||||
k_EHTTPStatusCode401Unauthorized = 401, // You probably want 403 or something else. 401 implies you're sending a WWW-Authenticate header and the client can sent an Authorization header in response.
|
||||
k_EHTTPStatusCode402PaymentRequired = 402, // This is reserved for future HTTP specs, not really supported by clients
|
||||
k_EHTTPStatusCode403Forbidden = 403,
|
||||
k_EHTTPStatusCode404NotFound = 404,
|
||||
@ -81,6 +83,9 @@ enum EHTTPStatusCode
|
||||
k_EHTTPStatusCode415UnsupportedMediaType = 415,
|
||||
k_EHTTPStatusCode416RequestedRangeNotSatisfiable = 416,
|
||||
k_EHTTPStatusCode417ExpectationFailed = 417,
|
||||
k_EHTTPStatusCode4xxUnknown = 418, // 418 is reserved, so we'll use it to mean unknown
|
||||
k_EHTTPStatusCode429TooManyRequests = 429,
|
||||
k_EHTTPStatusCode444ConnectionClosed = 444, // nginx only?
|
||||
|
||||
// Server error codes
|
||||
k_EHTTPStatusCode500InternalServerError = 500,
|
||||
@ -89,6 +94,12 @@ enum EHTTPStatusCode
|
||||
k_EHTTPStatusCode503ServiceUnavailable = 503,
|
||||
k_EHTTPStatusCode504GatewayTimeout = 504,
|
||||
k_EHTTPStatusCode505HTTPVersionNotSupported = 505,
|
||||
k_EHTTPStatusCode5xxUnknown = 599,
|
||||
};
|
||||
|
||||
inline bool BIsHTTPStatusSuccess( EHTTPStatusCode eStatus )
|
||||
{
|
||||
return eStatus >= 200 && eStatus <= 299;
|
||||
}
|
||||
|
||||
#endif // STEAMHTTPENUMS_H
|
||||
|
135
rehlds/public/steam/steamnetworkingfakeip.h
Normal file
135
rehlds/public/steam/steamnetworkingfakeip.h
Normal file
@ -0,0 +1,135 @@
|
||||
//====== Copyright Valve Corporation, All rights reserved. ====================
|
||||
|
||||
#ifndef STEAMNETWORKINGFAKEIP_H
|
||||
#define STEAMNETWORKINGFAKEIP_H
|
||||
#pragma once
|
||||
|
||||
#include "steamnetworkingtypes.h"
|
||||
#include "steam_api_common.h"
|
||||
|
||||
// It is HIGHLY recommended to limit messages sent via Fake UDP port to this
|
||||
// value. The purpose of a Fake UDP port is to make porting ordinary ad-hoc UDP
|
||||
// code easier. Although the real MTU might be higher than this, this particular
|
||||
// conservative value is chosen so that fragmentation won't be occurring and
|
||||
// hiding performance problems from you.
|
||||
constexpr int k_cbSteamNetworkingSocketsFakeUDPPortRecommendedMTU = 1200;
|
||||
|
||||
// Messages larger than this size are not allowed and cannot be sent
|
||||
// via Fake UDP port.
|
||||
constexpr int k_cbSteamNetworkingSocketsFakeUDPPortMaxMessageSize = 4096;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/// ISteamNetworkingFakeUDPPort
|
||||
///
|
||||
/// Acts like a UDP port, sending and receiving datagrams addressed using
|
||||
/// FakeIP addresses.
|
||||
///
|
||||
/// See: ISteamNetworkingSockets::CreateFakeUDPPort
|
||||
|
||||
class ISteamNetworkingFakeUDPPort
|
||||
{
|
||||
public:
|
||||
/// Destroy the object and cleanup any internal connections.
|
||||
/// Note that this function call is not threadsafe with respect
|
||||
/// to any other method of this interface. (However, in general
|
||||
/// all other operations are threadsafe with respect to each other.)
|
||||
virtual void DestroyFakeUDPPort() = 0;
|
||||
|
||||
/// Send a datagram to the specified FakeIP.
|
||||
///
|
||||
/// See ISteamNetworkingSockets::SendMessageToConnection for the meaning of
|
||||
/// nSendFlags and possible return codes.
|
||||
///
|
||||
/// Notes:
|
||||
/// - datagrams larger than the underlying MTU are supported, but
|
||||
/// reliable messages (k_nSteamNetworkingSend_Reliable) are not supported.
|
||||
/// - You will usually want to use k_nSteamNetworkingSend_NoNagle
|
||||
/// - k_EResultBusy is returned if this is a "server" port and the global
|
||||
/// allocation has not yet completed.
|
||||
/// - k_EResultIPNotFound will be returned if the address is a local/ephemeral
|
||||
/// address and no existing connection can be found. This can happen if
|
||||
/// the remote host contacted us without having a global address, and we
|
||||
/// assigned them a random local address, and then the session with
|
||||
/// that host timed out.
|
||||
/// - When initiating communications, the first messages may be sent
|
||||
/// via backend signaling, or otherwise delayed, while a route is found.
|
||||
/// Expect the ping time to fluctuate during this period, and it's possible
|
||||
/// that messages will be delivered out of order (which is also possible with
|
||||
/// ordinary UDP).
|
||||
virtual EResult SendMessageToFakeIP( const SteamNetworkingIPAddr &remoteAddress, const void *pData, uint32 cbData, int nSendFlags ) = 0;
|
||||
|
||||
/// Receive messages on the port.
|
||||
///
|
||||
/// Returns the number of messages returned into your array, up to nMaxMessages.
|
||||
///
|
||||
/// SteamNetworkingMessage_t::m_identity in the returned message(s) will always contain
|
||||
/// a FakeIP. See ISteamNetworkingUtils::GetRealIdentityForFakeIP.
|
||||
virtual int ReceiveMessages( SteamNetworkingMessage_t **ppOutMessages, int nMaxMessages ) = 0;
|
||||
|
||||
/// Schedule the internal connection for a given peer to be cleaned up in a few seconds.
|
||||
///
|
||||
/// Idle connections automatically time out, and so this is not strictly *necessary*,
|
||||
/// but if you have reason to believe that you are done talking to a given peer for
|
||||
/// a while, you can call this to speed up the timeout. If any remaining packets are
|
||||
/// sent or received from the peer, the cleanup is canceled and the usual timeout
|
||||
/// value is restored. Thus you will usually call this immediately after sending
|
||||
/// or receiving application-layer "close connection" packets.
|
||||
virtual void ScheduleCleanup( const SteamNetworkingIPAddr &remoteAddress ) = 0;
|
||||
};
|
||||
|
||||
/// 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
|
||||
|
||||
/// A struct used to describe a "fake IP" we have been assigned to
|
||||
/// use as an identifier. This callback is posted when
|
||||
/// ISteamNetworkingSoockets::BeginAsyncRequestFakeIP completes.
|
||||
/// See also ISteamNetworkingSockets::GetFakeIP
|
||||
struct SteamNetworkingFakeIPResult_t
|
||||
{
|
||||
enum { k_iCallback = k_iSteamNetworkingSocketsCallbacks + 3 };
|
||||
|
||||
/// Status/result of the allocation request. Possible failure values are:
|
||||
/// - k_EResultBusy - you called GetFakeIP but the request has not completed.
|
||||
/// - k_EResultInvalidParam - you called GetFakeIP with an invalid port index
|
||||
/// - k_EResultLimitExceeded - You asked for too many ports, or made an
|
||||
/// additional request after one had already succeeded
|
||||
/// - k_EResultNoMatch - GetFakeIP was called, but no request has been made
|
||||
///
|
||||
/// Note that, with the exception of k_EResultBusy (if you are polling),
|
||||
/// it is highly recommended to treat all failures as fatal.
|
||||
EResult m_eResult;
|
||||
|
||||
/// Local identity of the ISteamNetworkingSockets object that made
|
||||
/// this request and is assigned the IP. This is needed in the callback
|
||||
/// in the case where there are multiple ISteamNetworkingSockets objects.
|
||||
/// (E.g. one for the user, and another for the local gameserver).
|
||||
SteamNetworkingIdentity m_identity;
|
||||
|
||||
/// Fake IPv4 IP address that we have been assigned. NOTE: this
|
||||
/// IP address is not exclusively ours! Steam tries to avoid sharing
|
||||
/// IP addresses, but this may not always be possible. The IP address
|
||||
/// may be currently in use by another host, but with different port(s).
|
||||
/// The exact same IP:port address may have been used previously.
|
||||
/// Steam tries to avoid reusing ports until they have not been in use for
|
||||
/// some time, but this may not always be possible.
|
||||
uint32 m_unIP;
|
||||
|
||||
/// Port number(s) assigned to us. Only the first entries will contain
|
||||
/// nonzero values. Entries corresponding to ports beyond what was
|
||||
/// allocated for you will be zero.
|
||||
///
|
||||
/// (NOTE: At the time of this writing, the maximum number of ports you may
|
||||
/// request is 4.)
|
||||
enum { k_nMaxReturnPorts = 8 };
|
||||
uint16 m_unPorts[k_nMaxReturnPorts];
|
||||
};
|
||||
|
||||
#pragma pack( pop )
|
||||
|
||||
#endif // _H
|
1879
rehlds/public/steam/steamnetworkingtypes.h
Normal file
1879
rehlds/public/steam/steamnetworkingtypes.h
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,37 +1,49 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
//=============================================================================
|
||||
//========= Copyright 1996-2022, Valve LLC, All rights reserved. ============
|
||||
|
||||
#ifndef STEAMTYPES_H
|
||||
#define STEAMTYPES_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#define S_CALLTYPE __cdecl
|
||||
// WARNING: __cdecl is potentially #defined away in steam_api_common.h
|
||||
|
||||
// Steam-specific types. Defined here so this header file can be included in other code bases.
|
||||
#ifndef WCHARTYPES_H
|
||||
typedef unsigned char uint8;
|
||||
#endif
|
||||
|
||||
#if defined( __GNUC__ ) && !defined(POSIX)
|
||||
#ifdef __GNUC__
|
||||
#if __GNUC__ < 4
|
||||
#error "Steamworks requires GCC 4.X (4.2 or 4.4 have been tested)"
|
||||
#endif
|
||||
#define POSIX 1
|
||||
#endif
|
||||
|
||||
#if defined(__x86_64__) || defined(_WIN64)
|
||||
#if defined(__LP64__) || defined(__x86_64__) || defined(_WIN64) || defined(__aarch64__) || defined(__s390x__)
|
||||
#define X64BITS
|
||||
#endif
|
||||
|
||||
#if !defined(VALVE_BIG_ENDIAN)
|
||||
#if defined(_PS3)
|
||||
// Make sure VALVE_BIG_ENDIAN gets set on PS3, may already be set previously in Valve internal code.
|
||||
#if !defined(VALVE_BIG_ENDIAN) && defined(_PS3)
|
||||
#define VALVE_BIG_ENDIAN
|
||||
#define VALVE_BIG_ENDIAN 1
|
||||
#endif
|
||||
#if defined( __GNUC__ ) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
|
||||
#define VALVE_BIG_ENDIAN 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined( _WIN32 )
|
||||
#if defined( _WIN32 ) && !defined( __GNUC__ )
|
||||
|
||||
typedef __int8 int8;
|
||||
typedef unsigned __int8 uint8;
|
||||
typedef __int16 int16;
|
||||
typedef unsigned __int16 uint16;
|
||||
typedef __int32 int32;
|
||||
typedef unsigned __int32 uint32;
|
||||
typedef __int64 int64;
|
||||
typedef unsigned __int64 uint64;
|
||||
|
||||
typedef int64 lint64;
|
||||
typedef uint64 ulint64;
|
||||
|
||||
#ifdef X64BITS
|
||||
typedef __int64 intp; // intp is an integer that can accomodate a pointer
|
||||
@ -43,6 +55,24 @@ typedef unsigned __int32 uintp;
|
||||
|
||||
#else // _WIN32
|
||||
|
||||
typedef signed char int8;
|
||||
typedef unsigned char uint8;
|
||||
typedef short int16;
|
||||
typedef unsigned short uint16;
|
||||
typedef int int32;
|
||||
typedef unsigned int uint32;
|
||||
typedef long long int64;
|
||||
typedef unsigned long long uint64;
|
||||
|
||||
// [u]int64 are actually defined as 'long long' and gcc 64-bit
|
||||
// doesn't automatically consider them the same as 'long int'.
|
||||
// Changing the types for [u]int64 is complicated by
|
||||
// there being many definitions, so we just
|
||||
// define a 'long int' here and use it in places that would
|
||||
// otherwise confuse the compiler.
|
||||
typedef long int lint64;
|
||||
typedef unsigned long int ulint64;
|
||||
|
||||
#ifdef X64BITS
|
||||
typedef long long intp;
|
||||
typedef unsigned long long uintp;
|
||||
@ -53,68 +83,101 @@ typedef unsigned int uintp;
|
||||
|
||||
#endif // else _WIN32
|
||||
|
||||
const int k_cubSaltSize = 8;
|
||||
typedef uint8 Salt_t[ k_cubSaltSize ];
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// GID (GlobalID) stuff
|
||||
// This is a globally unique identifier. It's guaranteed to be unique across all
|
||||
// racks and servers for as long as a given universe persists.
|
||||
//-----------------------------------------------------------------------------
|
||||
// NOTE: for GID parsing/rendering and other utils, see gid.h
|
||||
typedef uint64 GID_t;
|
||||
|
||||
const GID_t k_GIDNil = 0xffffffffffffffffull;
|
||||
|
||||
// For convenience, we define a number of types that are just new names for GIDs
|
||||
typedef GID_t JobID_t; // Each Job has a unique ID
|
||||
typedef GID_t TxnID_t; // Each financial transaction has a unique ID
|
||||
|
||||
const GID_t k_TxnIDNil = k_GIDNil;
|
||||
const GID_t k_TxnIDUnknown = 0;
|
||||
|
||||
|
||||
// this is baked into client messages and interfaces as an int,
|
||||
// make sure we never break this.
|
||||
typedef uint32 PackageId_t;
|
||||
const PackageId_t k_uPackageIdFreeSub = 0x0;
|
||||
const PackageId_t k_uPackageIdInvalid = 0xFFFFFFFF;
|
||||
|
||||
|
||||
// this is baked into client messages and interfaces as an int,
|
||||
// make sure we never break this.
|
||||
typedef uint32 AppId_t;
|
||||
const AppId_t k_uAppIdInvalid = 0x0;
|
||||
|
||||
typedef uint64 AssetClassId_t;
|
||||
const AssetClassId_t k_ulAssetClassIdInvalid = 0x0;
|
||||
|
||||
typedef uint32 PhysicalItemId_t;
|
||||
const PhysicalItemId_t k_uPhysicalItemIdInvalid = 0x0;
|
||||
|
||||
|
||||
// this is baked into client messages and interfaces as an int,
|
||||
// make sure we never break this. AppIds and DepotIDs also presently
|
||||
// share the same namespace, but since we'd like to change that in the future
|
||||
// I've defined it seperately here.
|
||||
// AppIds and DepotIDs also presently share the same namespace
|
||||
typedef uint32 DepotId_t;
|
||||
const DepotId_t k_uDepotIdInvalid = 0x0;
|
||||
|
||||
// RTime32
|
||||
// We use this 32 bit time representing real world time.
|
||||
// It offers 1 second resolution beginning on January 1, 1970 (Unix time)
|
||||
// RTime32. Seconds elapsed since Jan 1 1970, i.e. unix timestamp.
|
||||
// It's the same as time_t, but it is always 32-bit and unsigned.
|
||||
typedef uint32 RTime32;
|
||||
|
||||
typedef uint32 CellID_t;
|
||||
const CellID_t k_uCellIDInvalid = 0xFFFFFFFF;
|
||||
|
||||
// handle to a Steam API call
|
||||
typedef uint64 SteamAPICall_t;
|
||||
const SteamAPICall_t k_uAPICallInvalid = 0x0;
|
||||
|
||||
typedef uint32 AccountID_t;
|
||||
const AccountID_t k_uAccountIdInvalid = 0;
|
||||
|
||||
typedef uint32 PartnerId_t;
|
||||
const PartnerId_t k_uPartnerIdInvalid = 0;
|
||||
// Party Beacon ID
|
||||
typedef uint64 PartyBeaconID_t;
|
||||
const PartyBeaconID_t k_ulPartyBeaconIdInvalid = 0;
|
||||
|
||||
enum ESteamIPType
|
||||
{
|
||||
k_ESteamIPTypeIPv4 = 0,
|
||||
k_ESteamIPTypeIPv6 = 1,
|
||||
};
|
||||
|
||||
#pragma pack( push, 1 )
|
||||
|
||||
struct SteamIPAddress_t
|
||||
{
|
||||
union {
|
||||
|
||||
uint32 m_unIPv4; // Host order
|
||||
uint8 m_rgubIPv6[16]; // Network order! Same as inaddr_in6. (0011:2233:4455:6677:8899:aabb:ccdd:eeff)
|
||||
|
||||
// Internal use only
|
||||
uint64 m_ipv6Qword[2]; // big endian
|
||||
};
|
||||
|
||||
ESteamIPType m_eType;
|
||||
|
||||
bool IsSet() const
|
||||
{
|
||||
if ( k_ESteamIPTypeIPv4 == m_eType )
|
||||
{
|
||||
return m_unIPv4 != 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
return m_ipv6Qword[0] !=0 || m_ipv6Qword[1] != 0;
|
||||
}
|
||||
}
|
||||
|
||||
static SteamIPAddress_t IPv4Any()
|
||||
{
|
||||
SteamIPAddress_t ipOut;
|
||||
ipOut.m_eType = k_ESteamIPTypeIPv4;
|
||||
ipOut.m_unIPv4 = 0;
|
||||
|
||||
return ipOut;
|
||||
}
|
||||
|
||||
static SteamIPAddress_t IPv6Any()
|
||||
{
|
||||
SteamIPAddress_t ipOut;
|
||||
ipOut.m_eType = k_ESteamIPTypeIPv6;
|
||||
ipOut.m_ipv6Qword[0] = 0;
|
||||
ipOut.m_ipv6Qword[1] = 0;
|
||||
|
||||
return ipOut;
|
||||
}
|
||||
|
||||
static SteamIPAddress_t IPv4Loopback()
|
||||
{
|
||||
SteamIPAddress_t ipOut;
|
||||
ipOut.m_eType = k_ESteamIPTypeIPv4;
|
||||
ipOut.m_unIPv4 = 0x7f000001;
|
||||
|
||||
return ipOut;
|
||||
}
|
||||
|
||||
static SteamIPAddress_t IPv6Loopback()
|
||||
{
|
||||
SteamIPAddress_t ipOut;
|
||||
ipOut.m_eType = k_ESteamIPTypeIPv6;
|
||||
ipOut.m_ipv6Qword[0] = 0;
|
||||
ipOut.m_ipv6Qword[1] = 0;
|
||||
ipOut.m_rgubIPv6[15] = 1;
|
||||
|
||||
return ipOut;
|
||||
}
|
||||
};
|
||||
|
||||
#pragma pack( pop )
|
||||
|
||||
#endif // STEAMTYPES_H
|
||||
|
27
rehlds/public/steam/steamuniverse.h
Normal file
27
rehlds/public/steam/steamuniverse.h
Normal file
@ -0,0 +1,27 @@
|
||||
//========= Copyright <20> 1996-2008, Valve LLC, All rights reserved. ============
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef STEAMUNIVERSE_H
|
||||
#define STEAMUNIVERSE_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
|
||||
// Steam universes. Each universe is a self-contained Steam instance.
|
||||
enum EUniverse
|
||||
{
|
||||
k_EUniverseInvalid = 0,
|
||||
k_EUniversePublic = 1,
|
||||
k_EUniverseBeta = 2,
|
||||
k_EUniverseInternal = 3,
|
||||
k_EUniverseDev = 4,
|
||||
// k_EUniverseRC = 5, // no such universe anymore
|
||||
k_EUniverseMax
|
||||
};
|
||||
|
||||
|
||||
#endif // STEAMUNIVERSE_H
|
@ -1,6 +1,6 @@
|
||||
#include "precompiled.h"
|
||||
|
||||
bool CSteamID::SetFromSteam2String(const char *pchSteam2ID, EUniverse eUniverse)
|
||||
bool SteamIDFromSteam2String(const char *pchSteam2ID, EUniverse eUniverse, CSteamID *pSteamIDOut)
|
||||
{
|
||||
Assert(pchSteam2ID);
|
||||
|
||||
@ -27,6 +27,6 @@ bool CSteamID::SetFromSteam2String(const char *pchSteam2ID, EUniverse eUniverse)
|
||||
return false;
|
||||
|
||||
// Now convert to steam ID from the Steam2 ID structure
|
||||
SetFromSteam2(&steam2ID, eUniverse);
|
||||
*pSteamIDOut = SteamIDFromSteam2UserID(&steam2ID, eUniverse);
|
||||
return true;
|
||||
}
|
||||
|
@ -161,8 +161,8 @@ void CSimplePlatform::SteamAPI_RegisterCallback(CCallbackBase *pCallback, int iC
|
||||
::SteamAPI_RegisterCallback(pCallback, iCallback);
|
||||
}
|
||||
|
||||
bool CSimplePlatform::SteamAPI_Init() {
|
||||
return ::SteamAPI_Init();
|
||||
ESteamAPIInitResult CSimplePlatform::SteamAPI_InitInternal(const char *pszInternalCheckInterfaceVersions, SteamErrMsg *pOutErrMsg) {
|
||||
return ::SteamInternal_SteamAPI_Init(pszInternalCheckInterfaceVersions, pOutErrMsg);
|
||||
}
|
||||
|
||||
void CSimplePlatform::SteamAPI_UnregisterCallResult(class CCallbackBase *pCallback, SteamAPICall_t hAPICall) {
|
||||
@ -174,7 +174,7 @@ ISteamApps* CSimplePlatform::SteamApps() {
|
||||
}
|
||||
|
||||
bool CSimplePlatform::SteamGameServer_Init(uint32 unIP, uint16 usSteamPort, uint16 usGamePort, uint16 usQueryPort, EServerMode eServerMode, const char *pchVersionString) {
|
||||
return ::SteamGameServer_Init(unIP, usSteamPort, usGamePort, usQueryPort, eServerMode, pchVersionString);
|
||||
return ::SteamGameServer_Init(unIP, usGamePort, usQueryPort, eServerMode, pchVersionString);
|
||||
}
|
||||
|
||||
ISteamGameServer* CSimplePlatform::SteamGameServer() {
|
||||
|
@ -45,8 +45,8 @@ public:
|
||||
virtual void SteamAPI_SetBreakpadAppID(uint32 unAppID) = 0;
|
||||
virtual void SteamAPI_UseBreakpadCrashHandler(char const *pchVersion, char const *pchDate, char const *pchTime, bool bFullMemoryDumps, void *pvContext, PFNPreMinidumpCallback m_pfnPreMinidumpCallback) = 0;
|
||||
virtual void SteamAPI_RegisterCallback(CCallbackBase *pCallback, int iCallback) = 0;
|
||||
virtual bool SteamAPI_Init() = 0;
|
||||
virtual void SteamAPI_UnregisterCallResult(class CCallbackBase *pCallback, SteamAPICall_t hAPICall) = 0;
|
||||
virtual ESteamAPIInitResult SteamAPI_InitInternal(const char *pszInternalCheckInterfaceVersions, SteamErrMsg *pOutErrMsg) = 0;
|
||||
virtual void SteamAPI_UnregisterCallResult(CCallbackBase *pCallback, SteamAPICall_t hAPICall) = 0;
|
||||
virtual ISteamApps* SteamApps() = 0;
|
||||
virtual bool SteamGameServer_Init(uint32 unIP, uint16 usSteamPort, uint16 usGamePort, uint16 usQueryPort, EServerMode eServerMode, const char *pchVersionString) = 0;
|
||||
virtual ISteamGameServer* SteamGameServer() = 0;
|
||||
@ -102,8 +102,8 @@ public:
|
||||
virtual void SteamAPI_SetBreakpadAppID(uint32 unAppID);
|
||||
virtual void SteamAPI_UseBreakpadCrashHandler(char const *pchVersion, char const *pchDate, char const *pchTime, bool bFullMemoryDumps, void *pvContext, PFNPreMinidumpCallback m_pfnPreMinidumpCallback);
|
||||
virtual void SteamAPI_RegisterCallback(CCallbackBase *pCallback, int iCallback);
|
||||
virtual bool SteamAPI_Init();
|
||||
virtual void SteamAPI_UnregisterCallResult(class CCallbackBase *pCallback, SteamAPICall_t hAPICall);
|
||||
virtual ESteamAPIInitResult SteamAPI_InitInternal(const char *pszInternalCheckInterfaceVersions, SteamErrMsg *pOutErrMsg);
|
||||
virtual void SteamAPI_UnregisterCallResult(CCallbackBase *pCallback, SteamAPICall_t hAPICall);
|
||||
virtual ISteamApps* SteamApps();
|
||||
virtual bool SteamGameServer_Init(uint32 unIP, uint16 usSteamPort, uint16 usGamePort, uint16 usQueryPort, EServerMode eServerMode, const char *pchVersionString);
|
||||
virtual ISteamGameServer* SteamGameServer();
|
||||
|
@ -186,7 +186,7 @@ bool CSteamAppsAnonymizingWrapper::MarkContentCorrupt(bool bMissingFilesOnly)
|
||||
//return false;
|
||||
}
|
||||
|
||||
uint32 CSteamAppsAnonymizingWrapper::GetInstalledDepots(DepotId_t *pvecDepots, uint32 cMaxDepots)
|
||||
uint32 CSteamAppsAnonymizingWrapper::GetInstalledDepots(AppId_t appID, DepotId_t *pvecDepots, uint32 cMaxDepots)
|
||||
{
|
||||
rehlds_syserror("%s: not implemented", __func__);
|
||||
//return 0;
|
||||
@ -198,6 +198,76 @@ uint32 CSteamAppsAnonymizingWrapper::GetAppInstallDir(AppId_t appID, char *pchFo
|
||||
//return 0;
|
||||
}
|
||||
|
||||
bool CSteamAppsAnonymizingWrapper::BIsAppInstalled(AppId_t appID)
|
||||
{
|
||||
rehlds_syserror("%s: not implemented", __func__);
|
||||
}
|
||||
|
||||
CSteamID CSteamAppsAnonymizingWrapper::GetAppOwner()
|
||||
{
|
||||
rehlds_syserror("%s: not implemented", __func__);
|
||||
}
|
||||
|
||||
const char *CSteamAppsAnonymizingWrapper::GetLaunchQueryParam(const char *pchKey)
|
||||
{
|
||||
rehlds_syserror("%s: not implemented", __func__);
|
||||
}
|
||||
|
||||
bool CSteamAppsAnonymizingWrapper::GetDlcDownloadProgress(AppId_t nAppID, uint64 *punBytesDownloaded, uint64 *punBytesTotal)
|
||||
{
|
||||
rehlds_syserror("%s: not implemented", __func__);
|
||||
}
|
||||
|
||||
int CSteamAppsAnonymizingWrapper::GetAppBuildId()
|
||||
{
|
||||
rehlds_syserror("%s: not implemented", __func__);
|
||||
}
|
||||
|
||||
void CSteamAppsAnonymizingWrapper::RequestAllProofOfPurchaseKeys()
|
||||
{
|
||||
rehlds_syserror("%s: not implemented", __func__);
|
||||
}
|
||||
|
||||
SteamAPICall_t CSteamAppsAnonymizingWrapper::GetFileDetails(const char *pszFileName)
|
||||
{
|
||||
rehlds_syserror("%s: not implemented", __func__);
|
||||
}
|
||||
|
||||
int CSteamAppsAnonymizingWrapper::GetLaunchCommandLine(char *pszCommandLine, int cubCommandLine)
|
||||
{
|
||||
rehlds_syserror("%s: not implemented", __func__);
|
||||
}
|
||||
|
||||
bool CSteamAppsAnonymizingWrapper::BIsSubscribedFromFamilySharing()
|
||||
{
|
||||
rehlds_syserror("%s: not implemented", __func__);
|
||||
}
|
||||
|
||||
bool CSteamAppsAnonymizingWrapper::BIsTimedTrial(uint32 *punSecondsAllowed, uint32 *punSecondsPlayed)
|
||||
{
|
||||
rehlds_syserror("%s: not implemented", __func__);
|
||||
}
|
||||
|
||||
bool CSteamAppsAnonymizingWrapper::SetDlcContext(AppId_t nAppID)
|
||||
{
|
||||
rehlds_syserror("%s: not implemented", __func__);
|
||||
}
|
||||
|
||||
int CSteamAppsAnonymizingWrapper::GetNumBetas(int *pnAvailable, int *pnPrivate)
|
||||
{
|
||||
rehlds_syserror("%s: not implemented", __func__);
|
||||
}
|
||||
|
||||
bool CSteamAppsAnonymizingWrapper::GetBetaInfo(int iBetaIndex, uint32 *punFlags, uint32 *punBuildID, char *pchBetaName, int cchBetaName, char *pchDescription, int cchDescription)
|
||||
{
|
||||
rehlds_syserror("%s: not implemented", __func__);
|
||||
}
|
||||
|
||||
bool CSteamAppsAnonymizingWrapper::SetActiveBeta(const char *pchBetaName)
|
||||
{
|
||||
rehlds_syserror("%s: not implemented", __func__);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@ -235,7 +305,7 @@ void CSteamGameServerAnonymizingWrapper::SetDedicatedServer(bool bDedicated)
|
||||
m_Wrapped->SetDedicatedServer(bDedicated);
|
||||
}
|
||||
|
||||
void CSteamGameServerAnonymizingWrapper::LogOn(const char *pszAccountName, const char *pszPassword)
|
||||
void CSteamGameServerAnonymizingWrapper::LogOn(const char *pszToken)
|
||||
{
|
||||
rehlds_syserror("%s: not implemented", __func__);
|
||||
}
|
||||
@ -365,7 +435,7 @@ bool CSteamGameServerAnonymizingWrapper::BUpdateUserData(CSteamID steamIDUser, c
|
||||
return res;
|
||||
}
|
||||
|
||||
HAuthTicket CSteamGameServerAnonymizingWrapper::GetAuthSessionTicket(void *pTicket, int cbMaxTicket, uint32 *pcbTicket)
|
||||
HAuthTicket CSteamGameServerAnonymizingWrapper::GetAuthSessionTicket(void *pTicket, int cbMaxTicket, uint32 *pcbTicket, const SteamNetworkingIdentity *pSnid)
|
||||
{
|
||||
rehlds_syserror("%s: not implemented", __func__);
|
||||
//return k_HAuthTicketInvalid;
|
||||
@ -410,7 +480,7 @@ SteamAPICall_t CSteamGameServerAnonymizingWrapper::GetServerReputation()
|
||||
//return k_uAPICallInvalid;
|
||||
}
|
||||
|
||||
uint32 CSteamGameServerAnonymizingWrapper::GetPublicIP()
|
||||
SteamIPAddress_t CSteamGameServerAnonymizingWrapper::GetPublicIP()
|
||||
{
|
||||
rehlds_syserror("%s: not implemented", __func__);
|
||||
//return 0;
|
||||
@ -419,7 +489,7 @@ uint32 CSteamGameServerAnonymizingWrapper::GetPublicIP()
|
||||
bool CSteamGameServerAnonymizingWrapper::HandleIncomingPacket(const void *pData, int cbData, uint32 srcIP, uint16 srcPort)
|
||||
{
|
||||
uint32 realIp = m_Anonymizer->Fake2RealIp(htonl(srcIP), __func__);
|
||||
|
||||
|
||||
bool res;
|
||||
if (m_Anonymizer->m_OriginalConnectPacketLen) {
|
||||
res = m_Wrapped->HandleIncomingPacket(m_Anonymizer->m_OriginalConnectPacketData, m_Anonymizer->m_OriginalConnectPacketLen, ntohl(realIp), srcPort);
|
||||
@ -451,17 +521,17 @@ int CSteamGameServerAnonymizingWrapper::GetNextOutgoingPacket(void *pOut, int cb
|
||||
return res;
|
||||
}
|
||||
|
||||
void CSteamGameServerAnonymizingWrapper::EnableHeartbeats(bool bActive)
|
||||
void CSteamGameServerAnonymizingWrapper::SetAdvertiseServerActive(bool bActive)
|
||||
{
|
||||
m_Wrapped->EnableHeartbeats(bActive);
|
||||
m_Wrapped->SetAdvertiseServerActive(bActive);
|
||||
}
|
||||
|
||||
void CSteamGameServerAnonymizingWrapper::SetHeartbeatInterval(int iHeartbeatInterval)
|
||||
void CSteamGameServerAnonymizingWrapper::SetMasterServerHeartbeatInterval(int iHeartbeatInterval)
|
||||
{
|
||||
m_Wrapped->SetHeartbeatInterval(iHeartbeatInterval);
|
||||
m_Wrapped->SetMasterServerHeartbeatInterval(iHeartbeatInterval);
|
||||
}
|
||||
|
||||
void CSteamGameServerAnonymizingWrapper::ForceHeartbeat()
|
||||
void CSteamGameServerAnonymizingWrapper::ForceMasterServerHeartbeat()
|
||||
{
|
||||
rehlds_syserror("%s: not implemented", __func__);
|
||||
}
|
||||
@ -682,9 +752,9 @@ void CAnonymizingEngExtInterceptor::SteamAPI_RegisterCallback(CCallbackBase *pCa
|
||||
|
||||
}
|
||||
|
||||
bool CAnonymizingEngExtInterceptor::SteamAPI_Init()
|
||||
ESteamAPIInitResult CAnonymizingEngExtInterceptor::SteamAPI_InitInternal(const char *pszInternalCheckInterfaceVersions, SteamErrMsg *pOutErrMsg)
|
||||
{
|
||||
bool res = m_BasePlatform->SteamAPI_Init();
|
||||
ESteamAPIInitResult res = m_BasePlatform->SteamAPI_InitInternal(pszInternalCheckInterfaceVersions, pOutErrMsg);
|
||||
return res;
|
||||
}
|
||||
|
||||
@ -711,7 +781,7 @@ ISteamApps* CAnonymizingEngExtInterceptor::SteamApps()
|
||||
} else {
|
||||
m_BasePlatform->SteamApps();
|
||||
}
|
||||
|
||||
|
||||
return m_SteamAppsWrapper;
|
||||
}
|
||||
|
||||
@ -873,10 +943,10 @@ void CAnonymizingEngExtInterceptor::AnonymizeSteamId(const CSteamID& real, const
|
||||
|
||||
void CAnonymizingEngExtInterceptor::AnonymizeSteamId(const char* real, const char* fake) {
|
||||
CSteamID realId;
|
||||
realId.SetFromSteam2String(real, k_EUniversePublic);
|
||||
SteamIDFromSteam2String(real, k_EUniversePublic, &realId);
|
||||
|
||||
CSteamID fakeId;
|
||||
fakeId.SetFromSteam2String(fake, k_EUniversePublic);
|
||||
SteamIDFromSteam2String(fake, k_EUniversePublic, &fakeId);
|
||||
|
||||
AnonymizeSteamId(realId, fakeId);
|
||||
}
|
||||
@ -933,7 +1003,7 @@ void CAnonymizingEngExtInterceptor::ProcessConnectPacket(uint8* data, unsigned i
|
||||
|
||||
int protocol = Q_atoi(Cmd_Argv(1));
|
||||
int challenge = Q_atoi(Cmd_Argv(2));
|
||||
|
||||
|
||||
strncpy(protinfo, Cmd_Argv(3), ARRAYSIZE(protinfo));
|
||||
protinfo[ARRAYSIZE(protinfo) - 1] = 0;
|
||||
|
||||
|
@ -39,9 +39,24 @@ public:
|
||||
|
||||
virtual bool GetCurrentBetaName(char *pchName, int cchNameBufferSize);
|
||||
virtual bool MarkContentCorrupt(bool bMissingFilesOnly);
|
||||
virtual uint32 GetInstalledDepots(DepotId_t *pvecDepots, uint32 cMaxDepots);
|
||||
virtual uint32 GetInstalledDepots(AppId_t appID, DepotId_t *pvecDepots, uint32 cMaxDepots);
|
||||
|
||||
virtual uint32 GetAppInstallDir(AppId_t appID, char *pchFolder, uint32 cchFolderBufferSize);
|
||||
|
||||
virtual bool BIsAppInstalled(AppId_t appID);
|
||||
virtual CSteamID GetAppOwner();
|
||||
virtual const char *GetLaunchQueryParam(const char *pchKey);
|
||||
virtual bool GetDlcDownloadProgress(AppId_t nAppID, uint64 *punBytesDownloaded, uint64 *punBytesTotal);
|
||||
virtual int GetAppBuildId();
|
||||
virtual void RequestAllProofOfPurchaseKeys();
|
||||
virtual SteamAPICall_t GetFileDetails(const char *pszFileName);
|
||||
virtual int GetLaunchCommandLine(char *pszCommandLine, int cubCommandLine);
|
||||
virtual bool BIsSubscribedFromFamilySharing();
|
||||
virtual bool BIsTimedTrial(uint32 *punSecondsAllowed, uint32 *punSecondsPlayed);
|
||||
virtual bool SetDlcContext(AppId_t nAppID);
|
||||
virtual int GetNumBetas(int *pnAvailable, int *pnPrivate);
|
||||
virtual bool GetBetaInfo(int iBetaIndex, uint32 *punFlags, uint32 *punBuildID, char *pchBetaName, int cchBetaName, char *pchDescription, int cchDescription);
|
||||
virtual bool SetActiveBeta(const char *pchBetaName);
|
||||
};
|
||||
|
||||
class CSteamGameServerAnonymizingWrapper : public ISteamGameServer
|
||||
@ -58,7 +73,7 @@ public:
|
||||
virtual void SetGameDescription(const char *pszGameDescription);
|
||||
virtual void SetModDir(const char *pszModDir);
|
||||
virtual void SetDedicatedServer(bool bDedicated);
|
||||
virtual void LogOn(const char *pszAccountName, const char *pszPassword);
|
||||
virtual void LogOn(const char *pszToken);
|
||||
virtual void LogOnAnonymous();
|
||||
virtual void LogOff();
|
||||
virtual bool BLoggedOn();
|
||||
@ -81,7 +96,7 @@ public:
|
||||
virtual CSteamID CreateUnauthenticatedUserConnection();
|
||||
virtual void SendUserDisconnect(CSteamID steamIDUser);
|
||||
virtual bool BUpdateUserData(CSteamID steamIDUser, const char *pchPlayerName, uint32 uScore);
|
||||
virtual HAuthTicket GetAuthSessionTicket(void *pTicket, int cbMaxTicket, uint32 *pcbTicket);
|
||||
virtual HAuthTicket GetAuthSessionTicket(void *pTicket, int cbMaxTicket, uint32 *pcbTicket, const SteamNetworkingIdentity *pSnid);
|
||||
virtual EBeginAuthSessionResult BeginAuthSession(const void *pAuthTicket, int cbAuthTicket, CSteamID steamID);
|
||||
virtual void EndAuthSession(CSteamID steamID);
|
||||
virtual void CancelAuthTicket(HAuthTicket hAuthTicket);
|
||||
@ -89,12 +104,12 @@ public:
|
||||
virtual bool RequestUserGroupStatus(CSteamID steamIDUser, CSteamID steamIDGroup);
|
||||
virtual void GetGameplayStats();
|
||||
virtual SteamAPICall_t GetServerReputation();
|
||||
virtual uint32 GetPublicIP();
|
||||
virtual SteamIPAddress_t GetPublicIP();
|
||||
virtual bool HandleIncomingPacket(const void *pData, int cbData, uint32 srcIP, uint16 srcPort);
|
||||
virtual int GetNextOutgoingPacket(void *pOut, int cbMaxOut, uint32 *pNetAdr, uint16 *pPort);
|
||||
virtual void EnableHeartbeats(bool bActive);
|
||||
virtual void SetHeartbeatInterval(int iHeartbeatInterval);
|
||||
virtual void ForceHeartbeat();
|
||||
virtual void SetAdvertiseServerActive(bool bActive);
|
||||
virtual void SetMasterServerHeartbeatInterval(int iHeartbeatInterval);
|
||||
virtual void ForceMasterServerHeartbeat();
|
||||
virtual SteamAPICall_t AssociateWithClan(CSteamID steamIDClan);
|
||||
virtual SteamAPICall_t ComputeNewPlayerCompatibility(CSteamID steamIDNewPlayer);
|
||||
};
|
||||
@ -206,7 +221,7 @@ public:
|
||||
virtual void SteamAPI_SetBreakpadAppID(uint32 unAppID);
|
||||
virtual void SteamAPI_UseBreakpadCrashHandler(char const *pchVersion, char const *pchDate, char const *pchTime, bool bFullMemoryDumps, void *pvContext, PFNPreMinidumpCallback m_pfnPreMinidumpCallback);
|
||||
virtual void SteamAPI_RegisterCallback(CCallbackBase *pCallback, int iCallback);
|
||||
virtual bool SteamAPI_Init();
|
||||
virtual ESteamAPIInitResult SteamAPI_InitInternal(const char *pszInternalCheckInterfaceVersions, SteamErrMsg *pOutErrMsg);
|
||||
virtual void SteamAPI_UnregisterCallResult(class CCallbackBase *pCallback, SteamAPICall_t hAPICall);
|
||||
virtual ISteamApps* SteamApps();
|
||||
virtual bool SteamGameServer_Init(uint32 unIP, uint16 usSteamPort, uint16 usGamePort, uint16 usQueryPort, EServerMode eServerMode, const char *pchVersionString);
|
||||
|
@ -1137,11 +1137,28 @@ void CSteamApiRegisterCallbackCall::readEpilogue(std::istream &stream) {
|
||||
/* ============================================================================
|
||||
CSteamApiInitCall
|
||||
============================================================================ */
|
||||
CSteamApiInitCall::CSteamApiInitCall(const char *pszInternalCheckInterfaceVersions, SteamErrMsg &pOutErrMsg)
|
||||
{
|
||||
m_nCheckInterfaceVersionsLen = strlen(pszInternalCheckInterfaceVersions) + 1;
|
||||
if (m_nCheckInterfaceVersionsLen > sizeof(m_szCheckInterfaceVersions))
|
||||
rehlds_syserror("%s: too long check interfaces version string", __func__);
|
||||
|
||||
memcpy(m_szCheckInterfaceVersions, pszInternalCheckInterfaceVersions, m_nCheckInterfaceVersionsLen);
|
||||
|
||||
m_nOutErrMsgLen = strlen(pOutErrMsg) + 1;
|
||||
if (m_nOutErrMsgLen > sizeof(m_szOutErrMsg))
|
||||
rehlds_syserror("%s: too long outerror message string", __func__);
|
||||
|
||||
memcpy(m_szOutErrMsg, pOutErrMsg, m_nOutErrMsgLen);
|
||||
|
||||
m_Res = k_ESteamAPIInitResult_FailedGeneric;
|
||||
}
|
||||
|
||||
std::string CSteamApiInitCall::toString()
|
||||
{
|
||||
std::stringstream ss;
|
||||
ss << "CSteamApiInitCall( ) => " << m_Res;
|
||||
ss << "SteamAPI_Init( szCheckInterfaceVersions: " << m_szCheckInterfaceVersions
|
||||
<< "; szOutErrMsg: " << m_szOutErrMsg << " ) => " << m_Res;
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
@ -1151,15 +1168,44 @@ bool CSteamApiInitCall::compareInputArgs(IEngExtCall* other, bool strict)
|
||||
if (otherCall == NULL)
|
||||
return false;
|
||||
|
||||
if (otherCall->m_nCheckInterfaceVersionsLen != m_nCheckInterfaceVersionsLen)
|
||||
return false;
|
||||
|
||||
if (strcmp(otherCall->m_szCheckInterfaceVersions, m_szCheckInterfaceVersions))
|
||||
return false;
|
||||
|
||||
if (otherCall->m_nOutErrMsgLen != m_nOutErrMsgLen)
|
||||
return false;
|
||||
|
||||
if (strcmp(otherCall->m_szOutErrMsg, m_szOutErrMsg))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void CSteamApiInitCall::writePrologue(std::ostream &stream) {
|
||||
stream
|
||||
.write((char*)&m_nCheckInterfaceVersionsLen, sizeof(m_nCheckInterfaceVersionsLen))
|
||||
.write((char*)&m_nOutErrMsgLen, sizeof(m_nOutErrMsgLen))
|
||||
.write(m_szCheckInterfaceVersions, m_nCheckInterfaceVersionsLen)
|
||||
.write(m_szOutErrMsg, m_nOutErrMsgLen);
|
||||
}
|
||||
|
||||
void CSteamApiInitCall::readPrologue(std::istream &stream)
|
||||
{
|
||||
stream
|
||||
.read((char *)&m_nCheckInterfaceVersionsLen, sizeof(m_nCheckInterfaceVersionsLen))
|
||||
.read((char *)&m_nOutErrMsgLen, sizeof(m_nOutErrMsgLen));
|
||||
stream.read(m_szCheckInterfaceVersions, m_nCheckInterfaceVersionsLen);
|
||||
stream.read(m_szOutErrMsg, m_nOutErrMsgLen);
|
||||
}
|
||||
|
||||
void CSteamApiInitCall::writeEpilogue(std::ostream &stream) {
|
||||
stream.write((char*)&m_Res, 1);
|
||||
}
|
||||
|
||||
void CSteamApiInitCall::readEpilogue(std::istream &stream) {
|
||||
m_Res = false;
|
||||
m_Res = k_ESteamAPIInitResult_FailedGeneric;
|
||||
stream.read((char*)&m_Res, 1);
|
||||
}
|
||||
|
||||
|
@ -268,7 +268,7 @@ public:
|
||||
|
||||
public:
|
||||
CGetTimeZoneInfoCall() { memset(&m_Res, 0, sizeof(m_Res)); }
|
||||
|
||||
|
||||
void SetResult(LPTIME_ZONE_INFORMATION res) { m_Res = *res; }
|
||||
virtual bool compareInputArgs(IEngExtCall* other, bool strict);
|
||||
virtual std::string toString();
|
||||
@ -370,7 +370,7 @@ public:
|
||||
int m_Len;
|
||||
int m_Flags;
|
||||
int m_FromLenIn;
|
||||
|
||||
|
||||
char m_Data[8192];
|
||||
int m_FromLenOut;
|
||||
char m_From[32];
|
||||
@ -544,16 +544,27 @@ public:
|
||||
|
||||
class CSteamApiInitCall : public IEngExtCall {
|
||||
public:
|
||||
bool m_Res;
|
||||
ESteamAPIInitResult m_Res;
|
||||
char m_szCheckInterfaceVersions[2048];
|
||||
int m_nCheckInterfaceVersionsLen;
|
||||
SteamErrMsg m_szOutErrMsg;
|
||||
int m_nOutErrMsgLen;
|
||||
|
||||
public:
|
||||
CSteamApiInitCall() { m_Res = false; }
|
||||
void setResult(bool res) { m_Res = res; }
|
||||
|
||||
|
||||
CSteamApiInitCall()
|
||||
{
|
||||
m_Res = k_ESteamAPIInitResult_FailedGeneric;
|
||||
memset(m_szCheckInterfaceVersions, 0, sizeof(m_szCheckInterfaceVersions)); m_nCheckInterfaceVersionsLen = 0;
|
||||
memset(m_szOutErrMsg, 0, sizeof(m_szOutErrMsg)); m_nOutErrMsgLen = 0;
|
||||
}
|
||||
CSteamApiInitCall(const char *pszInternalCheckInterfaceVersions, SteamErrMsg &pOutErrMsg);
|
||||
void setResult(ESteamAPIInitResult res) { m_Res = res; }
|
||||
|
||||
virtual bool compareInputArgs(IEngExtCall* other, bool strict);
|
||||
virtual std::string toString();
|
||||
virtual ExtCallFuncs getOpcode() { return ECF_STEAM_API_INIT; }
|
||||
virtual void writePrologue(std::ostream &stream);
|
||||
virtual void readPrologue(std::istream &stream);
|
||||
virtual void writeEpilogue(std::ostream &stream);
|
||||
virtual void readEpilogue(std::istream &stream);
|
||||
};
|
||||
@ -907,7 +918,7 @@ public:
|
||||
int m_Result;
|
||||
uint32 m_Addr;
|
||||
uint16 m_Port;
|
||||
|
||||
|
||||
public:
|
||||
CGameServerGetNextOutgoingPacketCall() { m_MaxOut = 0; m_BufLen = m_Result = 0; m_Addr = 0; m_Port = 0; }
|
||||
CGameServerGetNextOutgoingPacketCall(int maxOut);
|
||||
@ -1111,9 +1122,9 @@ public:
|
||||
FILETIME m_UserTime;
|
||||
|
||||
public:
|
||||
CGetProcessTimesCall() {
|
||||
m_Res = FALSE;
|
||||
memset(&m_CreationTime, 0, sizeof(m_CreationTime));
|
||||
CGetProcessTimesCall() {
|
||||
m_Res = FALSE;
|
||||
memset(&m_CreationTime, 0, sizeof(m_CreationTime));
|
||||
memset(&m_ExitTime, 0, sizeof(m_ExitTime));
|
||||
memset(&m_KernelTime, 0, sizeof(m_KernelTime));
|
||||
memset(&m_UserTime, 0, sizeof(m_UserTime));
|
||||
|
@ -317,11 +317,11 @@ void CPlayingEngExtInterceptor::Sleep(DWORD msec) {
|
||||
BOOL CPlayingEngExtInterceptor::QueryPerfCounter(LARGE_INTEGER* counter) {
|
||||
CQueryPerfCounterCall* playCall = dynamic_cast<CQueryPerfCounterCall*>(getNextCall(false, false, ECF_QUERY_PERF_COUNTER, true, __func__));
|
||||
CQueryPerfCounterCall* playEndCall = dynamic_cast<CQueryPerfCounterCall*>(getNextCall(false, true, ECF_QUERY_PERF_COUNTER, false, __func__));
|
||||
|
||||
|
||||
counter->QuadPart = playEndCall->m_Counter;
|
||||
BOOL res = playEndCall->m_Res;
|
||||
freeFuncCall(playCall); freeFuncCall(playEndCall);
|
||||
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
@ -581,11 +581,12 @@ void CPlayingEngExtInterceptor::SteamAPI_RegisterCallback(CCallbackBase *pCallba
|
||||
freeFuncCall(playCall); freeFuncCall(playEndCall);
|
||||
}
|
||||
|
||||
bool CPlayingEngExtInterceptor::SteamAPI_Init() {
|
||||
ESteamAPIInitResult CPlayingEngExtInterceptor::SteamAPI_InitInternal(const char *pszInternalCheckInterfaceVersions, SteamErrMsg *pOutErrMsg) {
|
||||
CSteamApiInitCall* playCall = dynamic_cast<CSteamApiInitCall*>(getNextCall(false, false, ECF_STEAM_API_INIT, true, __func__));
|
||||
CSteamApiInitCall(pszInternalCheckInterfaceVersions, *pOutErrMsg).ensureArgsAreEqual(playCall, m_bStrictChecks, __func__);
|
||||
CSteamApiInitCall* playEndCall = dynamic_cast<CSteamApiInitCall*>(getNextCall(false, true, ECF_STEAM_API_INIT, false, __func__));
|
||||
|
||||
bool res = playEndCall->m_Res;
|
||||
ESteamAPIInitResult res = playEndCall->m_Res;
|
||||
freeFuncCall(playCall); freeFuncCall(playEndCall);
|
||||
|
||||
return res;
|
||||
@ -723,7 +724,7 @@ void CSteamGameServerPlayingWrapper::SetDedicatedServer(bool bDedicated) {
|
||||
m_Player->freeFuncCall(playCall); m_Player->freeFuncCall(playEndCall);
|
||||
}
|
||||
|
||||
void CSteamGameServerPlayingWrapper::LogOn(const char *pszAccountName, const char *pszPassword) {
|
||||
void CSteamGameServerPlayingWrapper::LogOn(const char *pszToken) {
|
||||
rehlds_syserror("%s: not implemented", __func__);
|
||||
}
|
||||
|
||||
@ -897,7 +898,7 @@ bool CSteamGameServerPlayingWrapper::BUpdateUserData(CSteamID steamIDUser, const
|
||||
return res;
|
||||
}
|
||||
|
||||
HAuthTicket CSteamGameServerPlayingWrapper::GetAuthSessionTicket(void *pTicket, int cbMaxTicket, uint32 *pcbTicket) {
|
||||
HAuthTicket CSteamGameServerPlayingWrapper::GetAuthSessionTicket(void *pTicket, int cbMaxTicket, uint32 *pcbTicket, const SteamNetworkingIdentity *pSnid) {
|
||||
rehlds_syserror("%s: not implemented", __func__);
|
||||
//return k_HAuthTicketInvalid;
|
||||
}
|
||||
@ -934,7 +935,7 @@ SteamAPICall_t CSteamGameServerPlayingWrapper::GetServerReputation() {
|
||||
//return k_uAPICallInvalid;
|
||||
}
|
||||
|
||||
uint32 CSteamGameServerPlayingWrapper::GetPublicIP() {
|
||||
SteamIPAddress_t CSteamGameServerPlayingWrapper::GetPublicIP() {
|
||||
rehlds_syserror("%s: not implemented", __func__);
|
||||
//return 0;
|
||||
}
|
||||
@ -964,7 +965,7 @@ int CSteamGameServerPlayingWrapper::GetNextOutgoingPacket(void *pOut, int cbMaxO
|
||||
return res;
|
||||
}
|
||||
|
||||
void CSteamGameServerPlayingWrapper::EnableHeartbeats(bool bActive) {
|
||||
void CSteamGameServerPlayingWrapper::SetAdvertiseServerActive(bool bActive) {
|
||||
CGameServerEnableHeartbeatsCall* playCall = dynamic_cast<CGameServerEnableHeartbeatsCall*>(m_Player->getNextCall(false, false, ECF_GS_ENABLE_HEARTBEATS, true, __func__));
|
||||
CGameServerEnableHeartbeatsCall(bActive).ensureArgsAreEqual(playCall, m_bStrictChecks, __func__);
|
||||
CGameServerEnableHeartbeatsCall* playEndCall = dynamic_cast<CGameServerEnableHeartbeatsCall*>(m_Player->getNextCall(false, true, ECF_GS_ENABLE_HEARTBEATS, false, __func__));
|
||||
@ -972,7 +973,7 @@ void CSteamGameServerPlayingWrapper::EnableHeartbeats(bool bActive) {
|
||||
m_Player->freeFuncCall(playCall); m_Player->freeFuncCall(playEndCall);
|
||||
}
|
||||
|
||||
void CSteamGameServerPlayingWrapper::SetHeartbeatInterval(int iHeartbeatInterval) {
|
||||
void CSteamGameServerPlayingWrapper::SetMasterServerHeartbeatInterval(int iHeartbeatInterval) {
|
||||
CGameServerSetHeartbeatIntervalCall* playCall = dynamic_cast<CGameServerSetHeartbeatIntervalCall*>(m_Player->getNextCall(false, false, ECF_GS_SET_HEARTBEATS_INTERVAL, true, __func__));
|
||||
CGameServerSetHeartbeatIntervalCall(iHeartbeatInterval).ensureArgsAreEqual(playCall, m_bStrictChecks, __func__);
|
||||
CGameServerSetHeartbeatIntervalCall* playEndCall = dynamic_cast<CGameServerSetHeartbeatIntervalCall*>(m_Player->getNextCall(false, true, ECF_GS_SET_HEARTBEATS_INTERVAL, false, __func__));
|
||||
@ -980,7 +981,7 @@ void CSteamGameServerPlayingWrapper::SetHeartbeatInterval(int iHeartbeatInterval
|
||||
m_Player->freeFuncCall(playCall); m_Player->freeFuncCall(playEndCall);
|
||||
}
|
||||
|
||||
void CSteamGameServerPlayingWrapper::ForceHeartbeat() {
|
||||
void CSteamGameServerPlayingWrapper::ForceMasterServerHeartbeat() {
|
||||
rehlds_syserror("%s: not implemented", __func__);
|
||||
}
|
||||
|
||||
@ -1096,3 +1097,63 @@ uint32 CSteamAppsPlayingWrapper::GetAppInstallDir(AppId_t appID, char *pchFolder
|
||||
rehlds_syserror("%s: not implemented", __func__);
|
||||
//return 0;
|
||||
}
|
||||
|
||||
uint32 CSteamAppsPlayingWrapper::GetInstalledDepots(AppId_t appID, DepotId_t *pvecDepots, uint32 cMaxDepots) {
|
||||
rehlds_syserror("%s: not implemented", __func__);
|
||||
}
|
||||
|
||||
bool CSteamAppsPlayingWrapper::BIsAppInstalled(AppId_t appID) {
|
||||
rehlds_syserror("%s: not implemented", __func__);
|
||||
}
|
||||
|
||||
CSteamID CSteamAppsPlayingWrapper::GetAppOwner() {
|
||||
rehlds_syserror("%s: not implemented", __func__);
|
||||
}
|
||||
|
||||
const char *CSteamAppsPlayingWrapper::GetLaunchQueryParam(const char *pchKey) {
|
||||
rehlds_syserror("%s: not implemented", __func__);
|
||||
}
|
||||
|
||||
bool CSteamAppsPlayingWrapper::GetDlcDownloadProgress(AppId_t nAppID, uint64 *punBytesDownloaded, uint64 *punBytesTotal) {
|
||||
rehlds_syserror("%s: not implemented", __func__);
|
||||
}
|
||||
|
||||
int CSteamAppsPlayingWrapper::GetAppBuildId() {
|
||||
rehlds_syserror("%s: not implemented", __func__);
|
||||
}
|
||||
|
||||
void CSteamAppsPlayingWrapper::RequestAllProofOfPurchaseKeys() {
|
||||
rehlds_syserror("%s: not implemented", __func__);
|
||||
}
|
||||
|
||||
SteamAPICall_t CSteamAppsPlayingWrapper::GetFileDetails(const char *pszFileName) {
|
||||
rehlds_syserror("%s: not implemented", __func__);
|
||||
}
|
||||
|
||||
int CSteamAppsPlayingWrapper::GetLaunchCommandLine(char *pszCommandLine, int cubCommandLine) {
|
||||
rehlds_syserror("%s: not implemented", __func__);
|
||||
}
|
||||
|
||||
bool CSteamAppsPlayingWrapper::BIsSubscribedFromFamilySharing() {
|
||||
rehlds_syserror("%s: not implemented", __func__);
|
||||
}
|
||||
|
||||
bool CSteamAppsPlayingWrapper::BIsTimedTrial(uint32 *punSecondsAllowed, uint32 *punSecondsPlayed) {
|
||||
rehlds_syserror("%s: not implemented", __func__);
|
||||
}
|
||||
|
||||
bool CSteamAppsPlayingWrapper::SetDlcContext(AppId_t nAppID) {
|
||||
rehlds_syserror("%s: not implemented", __func__);
|
||||
}
|
||||
|
||||
int CSteamAppsPlayingWrapper::GetNumBetas(int *pnAvailable, int *pnPrivate) {
|
||||
rehlds_syserror("%s: not implemented", __func__);
|
||||
}
|
||||
|
||||
bool CSteamAppsPlayingWrapper::GetBetaInfo(int iBetaIndex, uint32 *punFlags, uint32 *punBuildID, char *pchBetaName, int cchBetaName, char *pchDescription, int cchDescription) {
|
||||
rehlds_syserror("%s: not implemented", __func__);
|
||||
}
|
||||
|
||||
bool CSteamAppsPlayingWrapper::SetActiveBeta(const char *pchBetaName) {
|
||||
rehlds_syserror("%s: not implemented", __func__);
|
||||
}
|
||||
|
@ -49,6 +49,22 @@ public:
|
||||
virtual uint32 GetInstalledDepots(DepotId_t *pvecDepots, uint32 cMaxDepots);
|
||||
|
||||
virtual uint32 GetAppInstallDir(AppId_t appID, char *pchFolder, uint32 cchFolderBufferSize);
|
||||
|
||||
virtual uint32 GetInstalledDepots(AppId_t appID, DepotId_t *pvecDepots, uint32 cMaxDepots);
|
||||
virtual bool BIsAppInstalled(AppId_t appID);
|
||||
virtual CSteamID GetAppOwner();
|
||||
virtual const char *GetLaunchQueryParam(const char *pchKey);
|
||||
virtual bool GetDlcDownloadProgress(AppId_t nAppID, uint64 *punBytesDownloaded, uint64 *punBytesTotal);
|
||||
virtual int GetAppBuildId();
|
||||
virtual void RequestAllProofOfPurchaseKeys();
|
||||
virtual SteamAPICall_t GetFileDetails(const char *pszFileName);
|
||||
virtual int GetLaunchCommandLine(char *pszCommandLine, int cubCommandLine);
|
||||
virtual bool BIsSubscribedFromFamilySharing();
|
||||
virtual bool BIsTimedTrial(uint32 *punSecondsAllowed, uint32 *punSecondsPlayed);
|
||||
virtual bool SetDlcContext(AppId_t nAppID);
|
||||
virtual int GetNumBetas(int *pnAvailable, int *pnPrivate);
|
||||
virtual bool GetBetaInfo(int iBetaIndex, uint32 *punFlags, uint32 *punBuildID, char *pchBetaName, int cchBetaName, char *pchDescription, int cchDescription);
|
||||
virtual bool SetActiveBeta(const char *pchBetaName);
|
||||
};
|
||||
|
||||
class CSteamGameServerPlayingWrapper : public ISteamGameServer
|
||||
@ -65,7 +81,7 @@ public:
|
||||
virtual void SetGameDescription(const char *pszGameDescription);
|
||||
virtual void SetModDir(const char *pszModDir);
|
||||
virtual void SetDedicatedServer(bool bDedicated);
|
||||
virtual void LogOn(const char *pszAccountName, const char *pszPassword);
|
||||
virtual void LogOn(const char *pszToken);
|
||||
virtual void LogOnAnonymous();
|
||||
virtual void LogOff();
|
||||
virtual bool BLoggedOn();
|
||||
@ -88,7 +104,7 @@ public:
|
||||
virtual CSteamID CreateUnauthenticatedUserConnection();
|
||||
virtual void SendUserDisconnect(CSteamID steamIDUser);
|
||||
virtual bool BUpdateUserData(CSteamID steamIDUser, const char *pchPlayerName, uint32 uScore);
|
||||
virtual HAuthTicket GetAuthSessionTicket(void *pTicket, int cbMaxTicket, uint32 *pcbTicket);
|
||||
virtual HAuthTicket GetAuthSessionTicket(void *pTicket, int cbMaxTicket, uint32 *pcbTicket, const SteamNetworkingIdentity *pSnid);
|
||||
virtual EBeginAuthSessionResult BeginAuthSession(const void *pAuthTicket, int cbAuthTicket, CSteamID steamID);
|
||||
virtual void EndAuthSession(CSteamID steamID);
|
||||
virtual void CancelAuthTicket(HAuthTicket hAuthTicket);
|
||||
@ -96,12 +112,12 @@ public:
|
||||
virtual bool RequestUserGroupStatus(CSteamID steamIDUser, CSteamID steamIDGroup);
|
||||
virtual void GetGameplayStats();
|
||||
virtual SteamAPICall_t GetServerReputation();
|
||||
virtual uint32 GetPublicIP();
|
||||
virtual SteamIPAddress_t GetPublicIP();
|
||||
virtual bool HandleIncomingPacket(const void *pData, int cbData, uint32 srcIP, uint16 srcPort);
|
||||
virtual int GetNextOutgoingPacket(void *pOut, int cbMaxOut, uint32 *pNetAdr, uint16 *pPort);
|
||||
virtual void EnableHeartbeats(bool bActive);
|
||||
virtual void SetHeartbeatInterval(int iHeartbeatInterval);
|
||||
virtual void ForceHeartbeat();
|
||||
virtual void SetAdvertiseServerActive(bool bActive);
|
||||
virtual void SetMasterServerHeartbeatInterval(int iHeartbeatInterval);
|
||||
virtual void ForceMasterServerHeartbeat();
|
||||
virtual SteamAPICall_t AssociateWithClan(CSteamID steamIDClan);
|
||||
virtual SteamAPICall_t ComputeNewPlayerCompatibility(CSteamID steamIDNewPlayer);
|
||||
};
|
||||
@ -195,7 +211,7 @@ public:
|
||||
virtual void SteamAPI_SetBreakpadAppID(uint32 unAppID);
|
||||
virtual void SteamAPI_UseBreakpadCrashHandler(char const *pchVersion, char const *pchDate, char const *pchTime, bool bFullMemoryDumps, void *pvContext, PFNPreMinidumpCallback m_pfnPreMinidumpCallback);
|
||||
virtual void SteamAPI_RegisterCallback(CCallbackBase *pCallback, int iCallback);
|
||||
virtual bool SteamAPI_Init();
|
||||
virtual ESteamAPIInitResult SteamAPI_InitInternal(const char *pszInternalCheckInterfaceVersions, SteamErrMsg *pOutErrMsg);
|
||||
virtual void SteamAPI_UnregisterCallResult(class CCallbackBase *pCallback, SteamAPICall_t hAPICall);
|
||||
virtual ISteamApps* SteamApps();
|
||||
virtual bool SteamGameServer_Init(uint32 unIP, uint16 usSteamPort, uint16 usGamePort, uint16 usQueryPort, EServerMode eServerMode, const char *pchVersionString);
|
||||
|
@ -86,7 +86,7 @@ bool CSteamAppsRecordingWrapper::BIsVACBanned()
|
||||
const char* CSteamAppsRecordingWrapper::GetCurrentGameLanguage()
|
||||
{
|
||||
CSteamAppGetCurrentGameLanguageCall fcall; CRecorderFuncCall frec(&fcall);
|
||||
m_Recorder->PushFunc(&frec);
|
||||
m_Recorder->PushFunc(&frec);
|
||||
const char* res = m_Wrapped->GetCurrentGameLanguage();
|
||||
fcall.setResult(res);
|
||||
m_Recorder->PopFunc(&frec);
|
||||
@ -174,6 +174,82 @@ uint32 CSteamAppsRecordingWrapper::GetAppInstallDir(AppId_t appID, char *pchFold
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32 CSteamAppsRecordingWrapper::GetInstalledDepots(AppId_t appID, DepotId_t *pvecDepots, uint32 cMaxDepots)
|
||||
{
|
||||
rehlds_syserror("%s: not implemented", __func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool CSteamAppsRecordingWrapper::BIsAppInstalled(AppId_t appID)
|
||||
{
|
||||
rehlds_syserror("%s: not implemented", __func__);
|
||||
}
|
||||
|
||||
CSteamID CSteamAppsRecordingWrapper::GetAppOwner()
|
||||
{
|
||||
rehlds_syserror("%s: not implemented", __func__);
|
||||
}
|
||||
|
||||
const char *CSteamAppsRecordingWrapper::GetLaunchQueryParam(const char *pchKey)
|
||||
{
|
||||
rehlds_syserror("%s: not implemented", __func__);
|
||||
}
|
||||
|
||||
bool CSteamAppsRecordingWrapper::GetDlcDownloadProgress(AppId_t nAppID, uint64 *punBytesDownloaded, uint64 *punBytesTotal)
|
||||
{
|
||||
rehlds_syserror("%s: not implemented", __func__);
|
||||
}
|
||||
|
||||
int CSteamAppsRecordingWrapper::GetAppBuildId()
|
||||
{
|
||||
rehlds_syserror("%s: not implemented", __func__);
|
||||
}
|
||||
|
||||
void CSteamAppsRecordingWrapper::RequestAllProofOfPurchaseKeys()
|
||||
{
|
||||
rehlds_syserror("%s: not implemented", __func__);
|
||||
}
|
||||
|
||||
SteamAPICall_t CSteamAppsRecordingWrapper::GetFileDetails(const char *pszFileName)
|
||||
{
|
||||
rehlds_syserror("%s: not implemented", __func__);
|
||||
}
|
||||
|
||||
int CSteamAppsRecordingWrapper::GetLaunchCommandLine(char *pszCommandLine, int cubCommandLine)
|
||||
{
|
||||
rehlds_syserror("%s: not implemented", __func__);
|
||||
}
|
||||
|
||||
bool CSteamAppsRecordingWrapper::BIsSubscribedFromFamilySharing()
|
||||
{
|
||||
rehlds_syserror("%s: not implemented", __func__);
|
||||
}
|
||||
|
||||
bool CSteamAppsRecordingWrapper::BIsTimedTrial(uint32 *punSecondsAllowed, uint32 *punSecondsPlayed)
|
||||
{
|
||||
rehlds_syserror("%s: not implemented", __func__);
|
||||
}
|
||||
|
||||
bool CSteamAppsRecordingWrapper::SetDlcContext(AppId_t nAppID)
|
||||
{
|
||||
rehlds_syserror("%s: not implemented", __func__);
|
||||
}
|
||||
|
||||
int CSteamAppsRecordingWrapper::GetNumBetas(int *pnAvailable, int *pnPrivate)
|
||||
{
|
||||
rehlds_syserror("%s: not implemented", __func__);
|
||||
}
|
||||
|
||||
bool CSteamAppsRecordingWrapper::GetBetaInfo(int iBetaIndex, uint32 *punFlags, uint32 *punBuildID, char *pchBetaName, int cchBetaName, char *pchDescription, int cchDescription)
|
||||
{
|
||||
rehlds_syserror("%s: not implemented", __func__);
|
||||
}
|
||||
|
||||
bool CSteamAppsRecordingWrapper::SetActiveBeta(const char *pchBetaName)
|
||||
{
|
||||
rehlds_syserror("%s: not implemented", __func__);
|
||||
}
|
||||
|
||||
|
||||
CSteamGameServerRecordingWrapper::CSteamGameServerRecordingWrapper(ISteamGameServer* original, CRecordingEngExtInterceptor* recorder)
|
||||
{
|
||||
@ -219,7 +295,7 @@ void CSteamGameServerRecordingWrapper::SetDedicatedServer(bool bDedicated)
|
||||
m_Recorder->PopFunc(&frec);
|
||||
}
|
||||
|
||||
void CSteamGameServerRecordingWrapper::LogOn(const char *pszAccountName, const char *pszPassword)
|
||||
void CSteamGameServerRecordingWrapper::LogOn(const char *pszToken)
|
||||
{
|
||||
rehlds_syserror("%s: not implemented", __func__);
|
||||
}
|
||||
@ -399,7 +475,7 @@ bool CSteamGameServerRecordingWrapper::BUpdateUserData(CSteamID steamIDUser, con
|
||||
return res;
|
||||
}
|
||||
|
||||
HAuthTicket CSteamGameServerRecordingWrapper::GetAuthSessionTicket(void *pTicket, int cbMaxTicket, uint32 *pcbTicket)
|
||||
HAuthTicket CSteamGameServerRecordingWrapper::GetAuthSessionTicket(void *pTicket, int cbMaxTicket, uint32 *pcbTicket, const SteamNetworkingIdentity *pSnid)
|
||||
{
|
||||
rehlds_syserror("%s: not implemented", __func__);
|
||||
return k_HAuthTicketInvalid;
|
||||
@ -444,10 +520,10 @@ SteamAPICall_t CSteamGameServerRecordingWrapper::GetServerReputation()
|
||||
return k_uAPICallInvalid;
|
||||
}
|
||||
|
||||
uint32 CSteamGameServerRecordingWrapper::GetPublicIP()
|
||||
SteamIPAddress_t CSteamGameServerRecordingWrapper::GetPublicIP()
|
||||
{
|
||||
rehlds_syserror("%s: not implemented", __func__);
|
||||
return 0;
|
||||
return SteamIPAddress_t{};
|
||||
}
|
||||
|
||||
bool CSteamGameServerRecordingWrapper::HandleIncomingPacket(const void *pData, int cbData, uint32 srcIP, uint16 srcPort)
|
||||
@ -470,23 +546,23 @@ int CSteamGameServerRecordingWrapper::GetNextOutgoingPacket(void *pOut, int cbMa
|
||||
return res;
|
||||
}
|
||||
|
||||
void CSteamGameServerRecordingWrapper::EnableHeartbeats(bool bActive)
|
||||
void CSteamGameServerRecordingWrapper::SetAdvertiseServerActive(bool bActive)
|
||||
{
|
||||
CGameServerEnableHeartbeatsCall fcall(bActive); CRecorderFuncCall frec(&fcall);
|
||||
m_Recorder->PushFunc(&frec);
|
||||
m_Wrapped->EnableHeartbeats(bActive);
|
||||
m_Wrapped->SetAdvertiseServerActive(bActive);
|
||||
m_Recorder->PopFunc(&frec);
|
||||
}
|
||||
|
||||
void CSteamGameServerRecordingWrapper::SetHeartbeatInterval(int iHeartbeatInterval)
|
||||
void CSteamGameServerRecordingWrapper::SetMasterServerHeartbeatInterval(int iHeartbeatInterval)
|
||||
{
|
||||
CGameServerSetHeartbeatIntervalCall fcall(iHeartbeatInterval); CRecorderFuncCall frec(&fcall);
|
||||
m_Recorder->PushFunc(&frec);
|
||||
m_Wrapped->SetHeartbeatInterval(iHeartbeatInterval);
|
||||
m_Wrapped->SetMasterServerHeartbeatInterval(iHeartbeatInterval);
|
||||
m_Recorder->PopFunc(&frec);
|
||||
}
|
||||
|
||||
void CSteamGameServerRecordingWrapper::ForceHeartbeat()
|
||||
void CSteamGameServerRecordingWrapper::ForceMasterServerHeartbeat()
|
||||
{
|
||||
rehlds_syserror("%s: not implemented", __func__);
|
||||
}
|
||||
@ -507,7 +583,7 @@ CRecordingEngExtInterceptor::CRecordingEngExtInterceptor(const char* fname, IReH
|
||||
{
|
||||
m_OutStream.exceptions(std::ios::badbit | std::ios::failbit);
|
||||
m_OutStream.open(fname, std::ios::out | std::ios::binary);
|
||||
|
||||
|
||||
m_ServerSocket = INVALID_SOCKET;
|
||||
m_SteamCallbacksCounter = 0;
|
||||
m_SteamAppsWrapper = NULL;
|
||||
@ -848,7 +924,7 @@ void CRecordingEngExtInterceptor::SteamAPI_RegisterCallback(CCallbackBase *pCall
|
||||
CSteamApiRegisterCallbackCall fcall(wrappee->getRehldsCallbackId(), iCallback, wrappee); CRecorderFuncCall frec(&fcall);
|
||||
PushFunc(&frec);
|
||||
m_BasePlatform->SteamAPI_RegisterCallback(wrappee, iCallback);
|
||||
|
||||
|
||||
fcall.setResult(wrappee);
|
||||
pCallback->SetFlags(wrappee->GetFlags());
|
||||
pCallback->SetICallback(wrappee->GetICallback());
|
||||
@ -856,11 +932,11 @@ void CRecordingEngExtInterceptor::SteamAPI_RegisterCallback(CCallbackBase *pCall
|
||||
PopFunc(&frec);
|
||||
}
|
||||
|
||||
bool CRecordingEngExtInterceptor::SteamAPI_Init()
|
||||
ESteamAPIInitResult CRecordingEngExtInterceptor::SteamAPI_InitInternal(const char *pszInternalCheckInterfaceVersions, SteamErrMsg *pOutErrMsg)
|
||||
{
|
||||
CSteamApiInitCall fcall; CRecorderFuncCall frec(&fcall);
|
||||
CSteamApiInitCall fcall(pszInternalCheckInterfaceVersions, *pOutErrMsg); CRecorderFuncCall frec(&fcall);
|
||||
PushFunc(&frec);
|
||||
bool res = m_BasePlatform->SteamAPI_Init();
|
||||
ESteamAPIInitResult res = m_BasePlatform->SteamAPI_InitInternal(pszInternalCheckInterfaceVersions, pOutErrMsg);
|
||||
fcall.setResult(res);
|
||||
PopFunc(&frec);
|
||||
return res;
|
||||
@ -874,11 +950,11 @@ void CRecordingEngExtInterceptor::SteamAPI_UnregisterCallResult(class CCallbackB
|
||||
if (wrappee->GetICallback() != pCallback->GetICallback()) rehlds_syserror("%s: flags desync", __func__);
|
||||
|
||||
CSteamApiUnrigestierCallResultCall fcall(wrappee->getRehldsCallbackId(), hAPICall, wrappee); CRecorderFuncCall frec(&fcall);
|
||||
|
||||
|
||||
PushFunc(&frec);
|
||||
|
||||
|
||||
m_BasePlatform->SteamAPI_UnregisterCallResult(wrappee, hAPICall);
|
||||
|
||||
|
||||
fcall.setResult(wrappee);
|
||||
pCallback->SetFlags(wrappee->GetFlags());
|
||||
pCallback->SetICallback(wrappee->GetICallback());
|
||||
|
@ -55,6 +55,22 @@ public:
|
||||
virtual uint32 GetInstalledDepots(DepotId_t *pvecDepots, uint32 cMaxDepots);
|
||||
|
||||
virtual uint32 GetAppInstallDir(AppId_t appID, char *pchFolder, uint32 cchFolderBufferSize);
|
||||
|
||||
virtual uint32 GetInstalledDepots(AppId_t appID, DepotId_t *pvecDepots, uint32 cMaxDepots);
|
||||
virtual bool BIsAppInstalled(AppId_t appID);
|
||||
virtual CSteamID GetAppOwner();
|
||||
virtual const char *GetLaunchQueryParam(const char *pchKey);
|
||||
virtual bool GetDlcDownloadProgress(AppId_t nAppID, uint64 *punBytesDownloaded, uint64 *punBytesTotal);
|
||||
virtual int GetAppBuildId();
|
||||
virtual void RequestAllProofOfPurchaseKeys();
|
||||
virtual SteamAPICall_t GetFileDetails(const char *pszFileName);
|
||||
virtual int GetLaunchCommandLine(char *pszCommandLine, int cubCommandLine);
|
||||
virtual bool BIsSubscribedFromFamilySharing();
|
||||
virtual bool BIsTimedTrial(uint32 *punSecondsAllowed, uint32 *punSecondsPlayed);
|
||||
virtual bool SetDlcContext(AppId_t nAppID);
|
||||
virtual int GetNumBetas(int *pnAvailable, int *pnPrivate);
|
||||
virtual bool GetBetaInfo(int iBetaIndex, uint32 *punFlags, uint32 *punBuildID, char *pchBetaName, int cchBetaName, char *pchDescription, int cchDescription);
|
||||
virtual bool SetActiveBeta(const char *pchBetaName);
|
||||
};
|
||||
|
||||
class CSteamGameServerRecordingWrapper : public ISteamGameServer
|
||||
@ -71,7 +87,7 @@ public:
|
||||
virtual void SetGameDescription(const char *pszGameDescription);
|
||||
virtual void SetModDir(const char *pszModDir);
|
||||
virtual void SetDedicatedServer(bool bDedicated);
|
||||
virtual void LogOn(const char *pszAccountName, const char *pszPassword);
|
||||
virtual void LogOn(const char *pszToken);
|
||||
virtual void LogOnAnonymous();
|
||||
virtual void LogOff();
|
||||
virtual bool BLoggedOn();
|
||||
@ -94,7 +110,7 @@ public:
|
||||
virtual CSteamID CreateUnauthenticatedUserConnection();
|
||||
virtual void SendUserDisconnect(CSteamID steamIDUser);
|
||||
virtual bool BUpdateUserData(CSteamID steamIDUser, const char *pchPlayerName, uint32 uScore);
|
||||
virtual HAuthTicket GetAuthSessionTicket(void *pTicket, int cbMaxTicket, uint32 *pcbTicket);
|
||||
virtual HAuthTicket GetAuthSessionTicket(void *pTicket, int cbMaxTicket, uint32 *pcbTicket, const SteamNetworkingIdentity *pSnid);
|
||||
virtual EBeginAuthSessionResult BeginAuthSession(const void *pAuthTicket, int cbAuthTicket, CSteamID steamID);
|
||||
virtual void EndAuthSession(CSteamID steamID);
|
||||
virtual void CancelAuthTicket(HAuthTicket hAuthTicket);
|
||||
@ -102,12 +118,12 @@ public:
|
||||
virtual bool RequestUserGroupStatus(CSteamID steamIDUser, CSteamID steamIDGroup);
|
||||
virtual void GetGameplayStats();
|
||||
virtual SteamAPICall_t GetServerReputation();
|
||||
virtual uint32 GetPublicIP();
|
||||
virtual SteamIPAddress_t GetPublicIP();
|
||||
virtual bool HandleIncomingPacket(const void *pData, int cbData, uint32 srcIP, uint16 srcPort);
|
||||
virtual int GetNextOutgoingPacket(void *pOut, int cbMaxOut, uint32 *pNetAdr, uint16 *pPort);
|
||||
virtual void EnableHeartbeats(bool bActive);
|
||||
virtual void SetHeartbeatInterval(int iHeartbeatInterval);
|
||||
virtual void ForceHeartbeat();
|
||||
virtual void SetAdvertiseServerActive(bool bActive);
|
||||
virtual void SetMasterServerHeartbeatInterval(int iHeartbeatInterval);
|
||||
virtual void ForceMasterServerHeartbeat();
|
||||
virtual SteamAPICall_t AssociateWithClan(CSteamID steamIDClan);
|
||||
virtual SteamAPICall_t ComputeNewPlayerCompatibility(CSteamID steamIDNewPlayer);
|
||||
};
|
||||
@ -188,7 +204,7 @@ public:
|
||||
virtual void SteamAPI_SetBreakpadAppID(uint32 unAppID);
|
||||
virtual void SteamAPI_UseBreakpadCrashHandler(char const *pchVersion, char const *pchDate, char const *pchTime, bool bFullMemoryDumps, void *pvContext, PFNPreMinidumpCallback m_pfnPreMinidumpCallback);
|
||||
virtual void SteamAPI_RegisterCallback(CCallbackBase *pCallback, int iCallback);
|
||||
virtual bool SteamAPI_Init();
|
||||
virtual ESteamAPIInitResult SteamAPI_InitInternal(const char *pszInternalCheckInterfaceVersions, SteamErrMsg *pOutErrMsg);
|
||||
virtual void SteamAPI_UnregisterCallResult(class CCallbackBase *pCallback, SteamAPICall_t hAPICall);
|
||||
virtual ISteamApps* SteamApps();
|
||||
virtual bool SteamGameServer_Init(uint32 unIP, uint16 usSteamPort, uint16 usGamePort, uint16 usQueryPort, EServerMode eServerMode, const char *pchVersionString);
|
||||
@ -198,4 +214,4 @@ public:
|
||||
virtual void SteamGameServer_Shutdown();
|
||||
virtual void SteamAPI_UnregisterCallback(CCallbackBase *pCallback);
|
||||
};
|
||||
#endif //_WIN32
|
||||
#endif //_WIN32
|
||||
|
@ -137,9 +137,9 @@ void __cdecl SteamAPI_RunCallbacks_hooked()
|
||||
CRehldsPlatformHolder::get()->SteamAPI_RunCallbacks();
|
||||
}
|
||||
|
||||
bool __cdecl SteamAPI_Init_hooked()
|
||||
ESteamAPIInitResult __cdecl SteamInternal_SteamAPI_InitInternal_hooked(const char *pszInternalCheckInterfaceVersions, SteamErrMsg *pOutErrMsg)
|
||||
{
|
||||
return CRehldsPlatformHolder::get()->SteamAPI_Init();
|
||||
return CRehldsPlatformHolder::get()->SteamAPI_InitInternal(pszInternalCheckInterfaceVersions, pOutErrMsg);
|
||||
}
|
||||
|
||||
ISteamUser* __cdecl SteamUser_hooked()
|
||||
@ -169,11 +169,6 @@ void __cdecl SteamGameServer_Shutdown_hooked()
|
||||
CRehldsPlatformHolder::get()->SteamGameServer_Shutdown();
|
||||
}
|
||||
|
||||
bool __cdecl SteamGameServer_Init_hooked(uint32 unIP, uint16 usSteamPort, uint16 usGamePort, uint16 usQueryPort, EServerMode eServerMode, const char *pchVersionString)
|
||||
{
|
||||
return CRehldsPlatformHolder::get()->SteamGameServer_Init(unIP, usSteamPort, usGamePort, usQueryPort, eServerMode, pchVersionString);
|
||||
}
|
||||
|
||||
void __cdecl SteamAPI_UnregisterCallback_hooked(class CCallbackBase *pCallback)
|
||||
{
|
||||
CRehldsPlatformHolder::get()->SteamAPI_UnregisterCallback(pCallback);
|
||||
@ -244,8 +239,9 @@ void InstallImportTableHook(PIMAGE_THUNK_DATA thunk, void* func)
|
||||
}
|
||||
|
||||
void TestSuite_InstallHooks(const Module* engine) {
|
||||
|
||||
HMODULE hKernel32 = getModuleHandleOrDie("kernel32.dll");
|
||||
HMODULE hWinSock32 = getModuleHandleOrDie("wsock32.dll");
|
||||
HMODULE hWinSock32 = getModuleHandleOrDie("ws2_32.dll");
|
||||
HMODULE hSteamApi = getModuleHandleOrDie("steam_api.dll");
|
||||
|
||||
|
||||
@ -273,26 +269,24 @@ void TestSuite_InstallHooks(const Module* engine) {
|
||||
void* SteamAPI_WriteMiniDump_addr = getProcAddressOrDie(hSteamApi, "SteamAPI_WriteMiniDump");
|
||||
void* SteamAPI_RegisterCallback_addr = getProcAddressOrDie(hSteamApi, "SteamAPI_RegisterCallback");
|
||||
void* SteamAPI_RunCallbacks_addr = getProcAddressOrDie(hSteamApi, "SteamAPI_RunCallbacks");
|
||||
void* SteamAPI_Init_addr = getProcAddressOrDie(hSteamApi, "SteamAPI_Init");
|
||||
void* SteamUser_addr = getProcAddressOrDie(hSteamApi, "SteamUser");
|
||||
void* SteamFriends_addr = getProcAddressOrDie(hSteamApi, "SteamFriends");
|
||||
void* SteamInternal_SteamAPI_InitInternal_addr = getProcAddressOrDie(hSteamApi, "SteamInternal_SteamAPI_Init");
|
||||
void* SteamUser_addr = getProcAddressOrDie(hSteamApi, "SteamAPI_SteamUser_v023");
|
||||
void* SteamFriends_addr = getProcAddressOrDie(hSteamApi, "SteamAPI_SteamFriends_v017");
|
||||
void* SteamGameServer_RunCallbacks_addr = getProcAddressOrDie(hSteamApi, "SteamGameServer_RunCallbacks");
|
||||
void* SteamAPI_Shutdown_addr = getProcAddressOrDie(hSteamApi, "SteamAPI_Shutdown");
|
||||
void* SteamGameServer_Shutdown_addr = getProcAddressOrDie(hSteamApi, "SteamGameServer_Shutdown");
|
||||
void* SteamGameServer_Init_addr = getProcAddressOrDie(hSteamApi, "SteamGameServer_Init");
|
||||
void* SteamAPI_UnregisterCallback_addr = getProcAddressOrDie(hSteamApi, "SteamAPI_UnregisterCallback");
|
||||
void* SteamGameServer_addr = getProcAddressOrDie(hSteamApi, "SteamGameServer");
|
||||
void* SteamGameServer_addr = getProcAddressOrDie(hSteamApi, "SteamAPI_SteamGameServer_v015");
|
||||
void* SteamAPI_SetBreakpadAppID_addr = getProcAddressOrDie(hSteamApi, "SteamAPI_SetBreakpadAppID");
|
||||
void* SteamAPI_RegisterCallResult_addr = getProcAddressOrDie(hSteamApi, "SteamAPI_RegisterCallResult");
|
||||
void* SteamHTTP_addr = getProcAddressOrDie(hSteamApi, "SteamHTTP");
|
||||
void* SteamHTTP_addr = getProcAddressOrDie(hSteamApi, "SteamAPI_SteamHTTP_v003");
|
||||
void* SteamAPI_UnregisterCallResult_addr = getProcAddressOrDie(hSteamApi, "SteamAPI_UnregisterCallResult");
|
||||
void* SteamApps_addr = getProcAddressOrDie(hSteamApi, "SteamApps");
|
||||
void* SteamApps_addr = getProcAddressOrDie(hSteamApi, "SteamAPI_SteamApps_v008");
|
||||
void* SteamAPI_UseBreakpadCrashHandler_addr = getProcAddressOrDie(hSteamApi, "SteamAPI_UseBreakpadCrashHandler");
|
||||
|
||||
|
||||
PIMAGE_DOS_HEADER peHeader = (PIMAGE_DOS_HEADER)engine->base;
|
||||
PIMAGE_NT_HEADERS ntHeader = (PIMAGE_NT_HEADERS)(engine->base + peHeader->e_lfanew);
|
||||
|
||||
|
||||
PIMAGE_IMPORT_DESCRIPTOR impDesc = (PIMAGE_IMPORT_DESCRIPTOR)(ntHeader->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT].VirtualAddress + engine->base);
|
||||
for (; impDesc->Name; impDesc++)
|
||||
{
|
||||
@ -383,7 +377,7 @@ void TestSuite_InstallHooks(const Module* engine) {
|
||||
{
|
||||
InstallImportTableHook(thunk, &SteamAPI_WriteMiniDump_hooked);
|
||||
}
|
||||
else if (fptr == SteamAPI_RegisterCallback_addr)
|
||||
if (fptr == SteamAPI_RegisterCallback_addr)
|
||||
{
|
||||
InstallImportTableHook(thunk, &SteamAPI_RegisterCallback_hooked);
|
||||
}
|
||||
@ -391,9 +385,9 @@ void TestSuite_InstallHooks(const Module* engine) {
|
||||
{
|
||||
InstallImportTableHook(thunk, &SteamAPI_RunCallbacks_hooked);
|
||||
}
|
||||
else if (fptr == SteamAPI_Init_addr)
|
||||
else if (fptr == SteamInternal_SteamAPI_InitInternal_addr)
|
||||
{
|
||||
InstallImportTableHook(thunk, &SteamAPI_Init_hooked);
|
||||
InstallImportTableHook(thunk, &SteamInternal_SteamAPI_InitInternal_hooked);
|
||||
}
|
||||
else if (fptr == SteamUser_addr)
|
||||
{
|
||||
@ -415,10 +409,6 @@ void TestSuite_InstallHooks(const Module* engine) {
|
||||
{
|
||||
InstallImportTableHook(thunk, &SteamGameServer_Shutdown_hooked);
|
||||
}
|
||||
else if (fptr == SteamGameServer_Init_addr)
|
||||
{
|
||||
InstallImportTableHook(thunk, &SteamGameServer_Init_hooked);
|
||||
}
|
||||
else if (fptr == SteamAPI_UnregisterCallback_addr)
|
||||
{
|
||||
InstallImportTableHook(thunk, &SteamAPI_UnregisterCallback_hooked);
|
||||
|
Loading…
x
Reference in New Issue
Block a user