mirror of
https://github.com/anticitizn/creamlinux.git
synced 2025-12-05 21:15:40 -05:00
update steamapi, add logging
This commit is contained in:
11
.gitignore
vendored
11
.gitignore
vendored
@@ -1,14 +1,3 @@
|
||||
CMakeLists.txt.user
|
||||
CMakeCache.txt
|
||||
CMakeFiles
|
||||
CMakeScripts
|
||||
Testing
|
||||
Makefile
|
||||
cmake_install.cmake
|
||||
install_manifest.txt
|
||||
compile_commands.json
|
||||
CTestTestfile.cmake
|
||||
_deps
|
||||
build/
|
||||
.cache
|
||||
.vscode
|
||||
|
||||
@@ -8,6 +8,7 @@ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
||||
SET(CMAKE_BUILD_TYPE Debug)
|
||||
SET (DEBUG true)
|
||||
|
||||
link_directories(${CMAKE_SOURCE_DIR}/lib)
|
||||
|
||||
@@ -20,6 +21,6 @@ ADD_LIBRARY(Creamlinux SHARED
|
||||
)
|
||||
|
||||
# If you want to build the testapp, you'll need to find libsteam_api and copy it to lib/libsteam_api.so
|
||||
# ADD_EXECUTABLE(Testapp ${CMAKE_SOURCE_DIR}/test.cpp)
|
||||
# TARGET_LINK_LIBRARIES(Testapp libsteam_api.so)
|
||||
ADD_EXECUTABLE(Testapp ${CMAKE_SOURCE_DIR}/test.cpp)
|
||||
TARGET_LINK_LIBRARIES(Testapp libsteam_api.so)
|
||||
#TARGET_LINK_LIBRARIES(${CREAMLINUX_NAME} )
|
||||
|
||||
43
main.cpp
43
main.cpp
@@ -1,6 +1,7 @@
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include "steam/steam_api.h"
|
||||
#include "spdlog/spdlog.h"
|
||||
#include "ini.h"
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
@@ -25,6 +26,7 @@ public:
|
||||
bool BIsCybercafe() { return false; }
|
||||
bool BIsVACBanned() { return false; }
|
||||
int GetDLCCount() {
|
||||
spdlog::info("ISteamApps->GetDLCCount called");
|
||||
auto count = dlcs.size();
|
||||
auto content = dlcs;
|
||||
return dlcs.size();
|
||||
@@ -78,6 +80,7 @@ public:
|
||||
bool GetDlcDownloadProgress(AppId_t nAppID, uint64* punBytesDownloaded, uint64* punBytesTotal) { return real_steamApps->GetDlcDownloadProgress(nAppID, punBytesDownloaded, punBytesTotal); }
|
||||
SteamAPICall_t GetFileDetails(const char* pszFileName) { return real_steamApps->GetFileDetails(pszFileName); }
|
||||
int GetLaunchCommandLine(char* pszCommandLine, int cubCommandLine) { return real_steamApps->GetLaunchCommandLine(pszCommandLine, cubCommandLine); }
|
||||
virtual bool BIsTimedTrial( uint32* punSecondsAllowed, uint32* punSecondsPlayed ) { return real_steamApps->BIsTimedTrial(punSecondsAllowed, punSecondsPlayed); }
|
||||
ISteamApps* real_steamApps;
|
||||
};
|
||||
class Hookey_SteamUser_Class : public ISteamUser {
|
||||
@@ -91,11 +94,11 @@ public:
|
||||
CSteamID GetSteamID() {
|
||||
return real_steamUser->GetSteamID();
|
||||
};
|
||||
int InitiateGameConnection( void *pAuthBlob, int cbMaxAuthBlob, CSteamID steamIDGameServer, uint32 unIPServer, uint16 usPortServer, bool bSecure ) {
|
||||
return real_steamUser->InitiateGameConnection(pAuthBlob, cbMaxAuthBlob, steamIDGameServer, unIPServer, usPortServer, bSecure);
|
||||
int InitiateGameConnection_DEPRECATED( void *pAuthBlob, int cbMaxAuthBlob, CSteamID steamIDGameServer, uint32 unIPServer, uint16 usPortServer, bool bSecure ) {
|
||||
return real_steamUser->InitiateGameConnection_DEPRECATED(pAuthBlob, cbMaxAuthBlob, steamIDGameServer, unIPServer, usPortServer, bSecure);
|
||||
};
|
||||
void TerminateGameConnection( uint32 unIPServer, uint16 usPortServer ) {
|
||||
return real_steamUser->TerminateGameConnection(unIPServer, usPortServer);
|
||||
void TerminateGameConnection_DEPRECATED( uint32 unIPServer, uint16 usPortServer ) {
|
||||
return real_steamUser->TerminateGameConnection_DEPRECATED(unIPServer, usPortServer);
|
||||
};
|
||||
void TrackAppUsageEvent( CGameID gameID, int eAppUsageEvent, const char *pchExtraInfo = "" ) {
|
||||
return real_steamUser->TrackAppUsageEvent(gameID, eAppUsageEvent, pchExtraInfo);
|
||||
@@ -134,13 +137,16 @@ public:
|
||||
return real_steamUser->CancelAuthTicket(hAuthTicket);
|
||||
};
|
||||
EUserHasLicenseForAppResult UserHasLicenseForApp( CSteamID steamID, AppId_t appID ) {
|
||||
spdlog::info("ISteamUser->UserHasLicenseForApp {} called", appID);
|
||||
auto reslt = std::find_if(
|
||||
std::begin(dlcs),
|
||||
std::end(dlcs),
|
||||
[&] (const tuple<int, string> a) { return std::get<0>(a) == appID; }) != std::end(dlcs);
|
||||
if (reslt) {
|
||||
spdlog::info("ISteamUser_UserHasLicenseForApp result: owned");
|
||||
return (EUserHasLicenseForAppResult)0;
|
||||
} else {
|
||||
spdlog::info("ISteamUser_UserHasLicenseForApp result: not owned");
|
||||
return (EUserHasLicenseForAppResult)2;
|
||||
}
|
||||
};
|
||||
@@ -179,6 +185,12 @@ public:
|
||||
};
|
||||
SteamAPICall_t GetMarketEligibility() {
|
||||
return real_steamUser->GetMarketEligibility();
|
||||
};
|
||||
virtual SteamAPICall_t GetDurationControl() {
|
||||
return real_steamUser->GetDurationControl();
|
||||
}
|
||||
virtual bool BSetDurationControlOnlineState( EDurationControlOnlineState eNewState ) {
|
||||
return real_steamUser->BSetDurationControlOnlineState(eNewState);
|
||||
};
|
||||
ISteamUser* real_steamUser;
|
||||
};
|
||||
@@ -209,20 +221,27 @@ ISteamUser* Hookey_SteamUser(ISteamUser* real_steamUser) {
|
||||
return Hookey_SteamUser(real_steamUser);
|
||||
}
|
||||
}
|
||||
|
||||
#define STEAMUSER_INTERFACE_VERSION_OLD "SteamUser020"
|
||||
extern "C" void* S_CALLTYPE SteamInternal_FindOrCreateUserInterface(HSteamUser hSteamUser, const char *pszVersion) {
|
||||
void* S_CALLTYPE (*real)(HSteamUser hSteamUser, const char *pszVersion);
|
||||
*(void**)(&real) = dlsym(RTLD_NEXT, "SteamInternal_FindOrCreateUserInterface");
|
||||
|
||||
spdlog::info("SteamInternal_FindOrCreateUserInterface called pszVersion: {}", pszVersion);
|
||||
// Steamapps Interface call is hooked here
|
||||
if (strstr(pszVersion, STEAMAPPS_INTERFACE_VERSION) == pszVersion) {
|
||||
ISteamApps* val = (ISteamApps*)real(hSteamUser, pszVersion);
|
||||
spdlog::info("SteamInternal_FindOrCreateUserInterface hooked ISteamApps");
|
||||
return Hookey_SteamApps(val);
|
||||
}
|
||||
|
||||
// Steamuser interface call is hooked here
|
||||
if (strstr(pszVersion, STEAMUSER_INTERFACE_VERSION) == pszVersion) {
|
||||
ISteamUser* val = (ISteamUser*)real(hSteamUser, pszVersion);
|
||||
spdlog::info("SteamInternal_FindOrCreateUserInterface ISteamUser hook");
|
||||
return Hookey_SteamUser(val);
|
||||
}
|
||||
if (strstr(pszVersion, STEAMUSER_INTERFACE_VERSION_OLD) == pszVersion) {
|
||||
ISteamUser* val = (ISteamUser*)real(hSteamUser, pszVersion);
|
||||
spdlog::info("SteamInternal_FindOrCreateUserInterface ISteamUser(legacy) hook");
|
||||
return Hookey_SteamUser(val);
|
||||
}
|
||||
auto val = real(hSteamUser, pszVersion);
|
||||
@@ -231,6 +250,7 @@ extern "C" void* S_CALLTYPE SteamInternal_FindOrCreateUserInterface(HSteamUser h
|
||||
|
||||
extern "C" EUserHasLicenseForAppResult SteamAPI_ISteamUser_UserHasLicenseForApp(CSteamID steamID, AppId_t appId) {
|
||||
// LOG(TRACE) << "SteamAPI_ISteamUser_UserHasLicenseForApp called!!" << endl;
|
||||
spdlog::info("ISteamUser_UserHasLicenseForApp called");
|
||||
return (EUserHasLicenseForAppResult)0;
|
||||
}
|
||||
|
||||
@@ -252,6 +272,7 @@ extern "C" bool SteamAPI_Init() {
|
||||
if (env != NULL) {
|
||||
creaminipath = env;
|
||||
}
|
||||
spdlog::info("Reading config from {}", creaminipath);
|
||||
mINI::INIFile file(creaminipath);
|
||||
|
||||
// Open ini file
|
||||
@@ -260,18 +281,16 @@ extern "C" bool SteamAPI_Init() {
|
||||
for (pair<string,string> entry : ini["dlc"]) {
|
||||
auto dlctuple = std::make_tuple(stoi(entry.first), entry.second);
|
||||
dlcs.push_back(dlctuple);
|
||||
spdlog::info("Added dlc with id: {0}, name: {1}", entry.first, entry.second);
|
||||
}
|
||||
#if DEBUG
|
||||
LOG(TRACE) << "SteamAPI_Init called" << endl;
|
||||
#endif
|
||||
spdlog::info("SteamAPI_Init called");
|
||||
// finish api call
|
||||
// the spaghetti below this comment is calling the original Init function
|
||||
// can probably be simplified but i'm no c++ expert
|
||||
bool (*real)();
|
||||
*(void**)(&real) = dlsym(RTLD_NEXT, "SteamAPI_Init");
|
||||
auto retval = real();
|
||||
#if DEBUG
|
||||
LOG(TRACE) << "SteamAPI_Init returned" << endl;
|
||||
#endif
|
||||
spdlog::info("SteamAPI_Init returned");
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
#endif
|
||||
|
||||
#include "steam_api_common.h"
|
||||
#include "steamtypes.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: This is a restricted interface that can only be used by previously approved apps,
|
||||
@@ -50,17 +49,19 @@ STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamAppList *, SteamAppList, STEAMAPPLIS
|
||||
//---------------------------------------------------------------------------------
|
||||
// Purpose: Sent when a new app is installed
|
||||
//---------------------------------------------------------------------------------
|
||||
STEAM_CALLBACK_BEGIN( SteamAppInstalled_t, k_iSteamAppListCallbacks + 1 );
|
||||
STEAM_CALLBACK_BEGIN( SteamAppInstalled_t, k_iSteamAppListCallbacks + 1 )
|
||||
STEAM_CALLBACK_MEMBER( 0, AppId_t, m_nAppID ) // ID of the app that installs
|
||||
STEAM_CALLBACK_END(1)
|
||||
STEAM_CALLBACK_MEMBER( 1, int, m_iInstallFolderIndex ) // library folder the app is installed
|
||||
STEAM_CALLBACK_END( 2 )
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------------
|
||||
// Purpose: Sent when an app is uninstalled
|
||||
//---------------------------------------------------------------------------------
|
||||
STEAM_CALLBACK_BEGIN( SteamAppUninstalled_t, k_iSteamAppListCallbacks + 2 );
|
||||
STEAM_CALLBACK_BEGIN( SteamAppUninstalled_t, k_iSteamAppListCallbacks + 2 )
|
||||
STEAM_CALLBACK_MEMBER( 0, AppId_t, m_nAppID ) // ID of the app that installs
|
||||
STEAM_CALLBACK_END(1)
|
||||
STEAM_CALLBACK_MEMBER( 1, int, m_iInstallFolderIndex ) // library folder the app was installed
|
||||
STEAM_CALLBACK_END(2)
|
||||
|
||||
|
||||
#pragma pack( pop )
|
||||
|
||||
@@ -105,6 +105,9 @@ public:
|
||||
|
||||
// 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;
|
||||
};
|
||||
|
||||
#define STEAMAPPS_INTERFACE_VERSION "STEAMAPPS_INTERFACE_VERSION008"
|
||||
@@ -113,10 +116,6 @@ public:
|
||||
inline ISteamApps *SteamApps();
|
||||
STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamApps *, SteamApps, STEAMAPPS_INTERFACE_VERSION );
|
||||
|
||||
// Global accessor for the gameserver client
|
||||
inline ISteamApps *SteamGameServerApps();
|
||||
STEAM_DEFINE_GAMESERVER_INTERFACE_ACCESSOR( ISteamApps *, SteamGameServerApps, STEAMAPPS_INTERFACE_VERSION );
|
||||
|
||||
// callbacks
|
||||
#if defined( VALVE_CALLBACK_PACK_SMALL )
|
||||
#pragma pack( push, 4 )
|
||||
@@ -198,5 +197,17 @@ struct FileDetailsResult_t
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// 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
|
||||
|
||||
@@ -56,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;
|
||||
@@ -156,14 +156,19 @@ public:
|
||||
// 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 "SteamClient018"
|
||||
#define STEAMCLIENT_INTERFACE_VERSION "SteamClient020"
|
||||
|
||||
#ifndef STEAM_API_EXPORTS
|
||||
|
||||
// Global ISteamClient interface accessor
|
||||
inline ISteamClient *SteamClient();
|
||||
STEAM_DEFINE_INTERFACE_ACCESSOR( ISteamClient *, SteamClient, SteamInternal_CreateInterface( STEAMCLIENT_INTERFACE_VERSION ) );
|
||||
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.)
|
||||
|
||||
@@ -27,6 +27,8 @@
|
||||
|
||||
#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
|
||||
|
||||
@@ -41,49 +43,6 @@ enum ESteamControllerPad
|
||||
};
|
||||
#endif
|
||||
|
||||
enum EControllerSource
|
||||
{
|
||||
k_EControllerSource_None,
|
||||
k_EControllerSource_LeftTrackpad,
|
||||
k_EControllerSource_RightTrackpad,
|
||||
k_EControllerSource_Joystick,
|
||||
k_EControllerSource_ABXY,
|
||||
k_EControllerSource_Switch,
|
||||
k_EControllerSource_LeftTrigger,
|
||||
k_EControllerSource_RightTrigger,
|
||||
k_EControllerSource_LeftBumper,
|
||||
k_EControllerSource_RightBumper,
|
||||
k_EControllerSource_Gyro,
|
||||
k_EControllerSource_CenterTrackpad, // PS4
|
||||
k_EControllerSource_RightJoystick, // Traditional Controllers
|
||||
k_EControllerSource_DPad, // Traditional Controllers
|
||||
k_EControllerSource_Key, // Keyboards with scan codes - Unused
|
||||
k_EControllerSource_Mouse, // Traditional mouse - Unused
|
||||
k_EControllerSource_LeftGyro, // Secondary Gyro - Switch - Unused
|
||||
k_EControllerSource_Count
|
||||
};
|
||||
|
||||
enum EControllerSourceMode
|
||||
{
|
||||
k_EControllerSourceMode_None,
|
||||
k_EControllerSourceMode_Dpad,
|
||||
k_EControllerSourceMode_Buttons,
|
||||
k_EControllerSourceMode_FourButtons,
|
||||
k_EControllerSourceMode_AbsoluteMouse,
|
||||
k_EControllerSourceMode_RelativeMouse,
|
||||
k_EControllerSourceMode_JoystickMove,
|
||||
k_EControllerSourceMode_JoystickMouse,
|
||||
k_EControllerSourceMode_JoystickCamera,
|
||||
k_EControllerSourceMode_ScrollWheel,
|
||||
k_EControllerSourceMode_Trigger,
|
||||
k_EControllerSourceMode_TouchMenu,
|
||||
k_EControllerSourceMode_MouseJoystick,
|
||||
k_EControllerSourceMode_MouseRegion,
|
||||
k_EControllerSourceMode_RadialMenu,
|
||||
k_EControllerSourceMode_SingleButton,
|
||||
k_EControllerSourceMode_Switches
|
||||
};
|
||||
|
||||
// Note: Please do not use action origins as a way to identify controller types. There is no
|
||||
// guarantee that they will be added in a contiguous manner - use GetInputTypeForHandle instead
|
||||
// Versions of Steam that add new controller types in the future will extend this enum if you're
|
||||
@@ -345,6 +304,150 @@ enum EControllerActionOrigin
|
||||
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_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.
|
||||
};
|
||||
@@ -397,6 +500,7 @@ enum ESteamInputType
|
||||
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,
|
||||
};
|
||||
@@ -489,7 +593,7 @@ public:
|
||||
// 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( ControllerHandle_t *handlesOut ) = 0;
|
||||
virtual int GetConnectedControllers( STEAM_OUT_ARRAY_COUNT( STEAM_CONTROLLER_MAX_COUNT, Receives list of connected controllers ) ControllerHandle_t *handlesOut ) = 0;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// ACTION SETS
|
||||
@@ -508,7 +612,10 @@ public:
|
||||
virtual void ActivateActionSetLayer( ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetLayerHandle ) = 0;
|
||||
virtual void DeactivateActionSetLayer( ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetLayerHandle ) = 0;
|
||||
virtual void DeactivateAllActionSetLayers( ControllerHandle_t controllerHandle ) = 0;
|
||||
virtual int GetActiveActionSetLayers( ControllerHandle_t controllerHandle, ControllerActionSetHandle_t *handlesOut ) = 0;
|
||||
// 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
|
||||
@@ -523,7 +630,7 @@ public:
|
||||
// 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, EControllerActionOrigin *originsOut ) = 0;
|
||||
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;
|
||||
@@ -534,7 +641,7 @@ public:
|
||||
// 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, EControllerActionOrigin *originsOut ) = 0;
|
||||
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;
|
||||
@@ -565,14 +672,15 @@ public:
|
||||
virtual void SetLEDColor( ControllerHandle_t controllerHandle, uint8 nColorR, uint8 nColorG, uint8 nColorB, unsigned int nFlags ) = 0;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Utility functions availible without using the rest of Steam Input API
|
||||
// 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
|
||||
// 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
|
||||
@@ -582,10 +690,10 @@ public:
|
||||
// Returns the associated gamepad index for the specified controller, if emulating a gamepad or -1 if not associated with an Xinput index
|
||||
virtual int GetGamepadIndexForController( ControllerHandle_t ulControllerHandle ) = 0;
|
||||
|
||||
// Returns a localized string (from Steam's language setting) for the specified Xbox controller origin. This function is cheap.
|
||||
// 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. This function is serialized.
|
||||
// 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
|
||||
@@ -594,9 +702,12 @@ public:
|
||||
|
||||
// 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 "SteamController007"
|
||||
#define STEAMCONTROLLER_INTERFACE_VERSION "SteamController008"
|
||||
|
||||
// Global interface accessor
|
||||
inline ISteamController *SteamController();
|
||||
|
||||
@@ -127,17 +127,6 @@ 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;
|
||||
|
||||
@@ -254,7 +243,9 @@ 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
|
||||
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
|
||||
@@ -344,9 +335,15 @@ public:
|
||||
// Rich Presence data is automatically shared between friends who are in the same game
|
||||
// Each user has a set of Key/Value pairs
|
||||
// Note the following limits: k_cchMaxRichPresenceKeys, k_cchMaxRichPresenceKeyLength, k_cchMaxRichPresenceValueLength
|
||||
// There are two magic keys:
|
||||
// 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()
|
||||
@@ -361,8 +358,7 @@ public:
|
||||
|
||||
// Rich invite support.
|
||||
// If the target accepts the invite, a GameRichPresenceJoinRequested_t callback is posted containing the connect string.
|
||||
// (Or you can configure yout game so that it is passed on the command line instead. This is a deprecated path; ask us if you really need this.)
|
||||
// Invites can only be sent to friends.
|
||||
// (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
|
||||
@@ -415,6 +411,17 @@ public:
|
||||
/// 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;
|
||||
};
|
||||
|
||||
#define STEAMFRIENDS_INTERFACE_VERSION "SteamFriends017"
|
||||
@@ -670,6 +677,17 @@ 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 ];
|
||||
};
|
||||
|
||||
|
||||
#pragma pack( pop )
|
||||
|
||||
#endif // ISTEAMFRIENDS_H
|
||||
|
||||
@@ -12,8 +12,6 @@
|
||||
|
||||
#include "steam_api_common.h"
|
||||
|
||||
#define MASTERSERVERUPDATERPORT_USEGAMESOCKETSHARE ((uint16)-1)
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// 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.
|
||||
@@ -93,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.)
|
||||
@@ -122,8 +129,6 @@ public:
|
||||
|
||||
/// 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;
|
||||
@@ -131,41 +136,19 @@ public:
|
||||
/// Region identifier. This is an optional field, the default value is empty, meaning the "world" region
|
||||
virtual void SetRegion( const char *pszRegion ) = 0;
|
||||
|
||||
//
|
||||
// Player list management / authentication
|
||||
//
|
||||
/// 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;
|
||||
|
||||
// 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.
|
||||
// Player list management / authentication.
|
||||
//
|
||||
// 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 ).
|
||||
// pcbTicket retrieves the length of the actual ticket.
|
||||
@@ -199,14 +182,11 @@ public:
|
||||
// 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;
|
||||
|
||||
// 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
|
||||
// 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 used when you've elected to multiplex the game server's UDP socket
|
||||
// rather than having the master server updater use its own sockets.
|
||||
@@ -225,21 +205,9 @@ 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;
|
||||
@@ -248,27 +216,60 @@ public:
|
||||
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_DEPRECATED( 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_DEPRECATED( 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_DEPRECATED( int iHeartbeatInterval ) = 0;
|
||||
virtual void ForceMasterServerHeartbeat_DEPRECATED() = 0;
|
||||
)
|
||||
};
|
||||
|
||||
#define STEAMGAMESERVER_INTERFACE_VERSION "SteamGameServer012"
|
||||
#define STEAMGAMESERVER_INTERFACE_VERSION "SteamGameServer014"
|
||||
|
||||
// Global accessor
|
||||
inline ISteamGameServer *SteamGameServer();
|
||||
STEAM_DEFINE_GAMESERVER_INTERFACE_ACCESSOR( ISteamGameServer *, SteamGameServer, STEAMGAMESERVER_INTERFACE_VERSION );
|
||||
|
||||
// game server flags
|
||||
const uint32 k_unServerFlagNone = 0x00;
|
||||
const uint32 k_unServerFlagActive = 0x01; // server has users playing
|
||||
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)
|
||||
|
||||
|
||||
// callbacks
|
||||
#if defined( VALVE_CALLBACK_PACK_SMALL )
|
||||
#pragma pack( push, 4 )
|
||||
|
||||
@@ -27,16 +27,25 @@ public:
|
||||
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 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;
|
||||
|
||||
@@ -201,7 +201,6 @@ public:
|
||||
virtual void JSDialogResponse( HHTMLBrowser unBrowserHandle, bool bResult ) = 0;
|
||||
|
||||
// You MUST call this in response to a HTML_FileOpenDialog_t callback
|
||||
STEAM_IGNOREATTR()
|
||||
virtual void FileLoadDialogResponse( HHTMLBrowser unBrowserHandle, const char **pchSelectedFiles ) = 0;
|
||||
};
|
||||
|
||||
|
||||
@@ -161,7 +161,7 @@ STEAM_DEFINE_GAMESERVER_INTERFACE_ACCESSOR( ISteamHTTP *, SteamGameServerHTTP, S
|
||||
|
||||
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;
|
||||
@@ -184,7 +184,7 @@ struct HTTPRequestCompleted_t
|
||||
|
||||
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;
|
||||
@@ -196,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;
|
||||
|
||||
@@ -23,34 +23,14 @@
|
||||
|
||||
#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 EInputSource
|
||||
{
|
||||
k_EInputSource_None,
|
||||
k_EInputSource_LeftTrackpad,
|
||||
k_EInputSource_RightTrackpad,
|
||||
k_EInputSource_Joystick,
|
||||
k_EInputSource_ABXY,
|
||||
k_EInputSource_Switch,
|
||||
k_EInputSource_LeftTrigger,
|
||||
k_EInputSource_RightTrigger,
|
||||
k_EInputSource_LeftBumper,
|
||||
k_EInputSource_RightBumper,
|
||||
k_EInputSource_Gyro,
|
||||
k_EInputSource_CenterTrackpad, // PS4
|
||||
k_EInputSource_RightJoystick, // Traditional Controllers
|
||||
k_EInputSource_DPad, // Traditional Controllers
|
||||
k_EInputSource_Key, // Keyboards with scan codes - Unused
|
||||
k_EInputSource_Mouse, // Traditional mouse - Unused
|
||||
k_EInputSource_LeftGyro, // Secondary Gyro - Switch - Unused
|
||||
k_EInputSource_Count
|
||||
};
|
||||
|
||||
enum EInputSourceMode
|
||||
{
|
||||
k_EInputSourceMode_None,
|
||||
@@ -184,7 +164,7 @@ enum EInputActionOrigin
|
||||
k_EInputActionOrigin_PS4_Gyro_Pitch,
|
||||
k_EInputActionOrigin_PS4_Gyro_Yaw,
|
||||
k_EInputActionOrigin_PS4_Gyro_Roll,
|
||||
k_EInputActionOrigin_PS4_Reserved0,
|
||||
k_EInputActionOrigin_PS4_DPad_Move,
|
||||
k_EInputActionOrigin_PS4_Reserved1,
|
||||
k_EInputActionOrigin_PS4_Reserved2,
|
||||
k_EInputActionOrigin_PS4_Reserved3,
|
||||
@@ -225,12 +205,12 @@ enum EInputActionOrigin
|
||||
k_EInputActionOrigin_XBoxOne_DPad_South,
|
||||
k_EInputActionOrigin_XBoxOne_DPad_West,
|
||||
k_EInputActionOrigin_XBoxOne_DPad_East,
|
||||
k_EInputActionOrigin_XBoxOne_Reserved0,
|
||||
k_EInputActionOrigin_XBoxOne_Reserved1,
|
||||
k_EInputActionOrigin_XBoxOne_Reserved2,
|
||||
k_EInputActionOrigin_XBoxOne_Reserved3,
|
||||
k_EInputActionOrigin_XBoxOne_Reserved4,
|
||||
k_EInputActionOrigin_XBoxOne_Reserved5,
|
||||
k_EInputActionOrigin_XBoxOne_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,
|
||||
@@ -266,7 +246,7 @@ enum EInputActionOrigin
|
||||
k_EInputActionOrigin_XBox360_DPad_South,
|
||||
k_EInputActionOrigin_XBox360_DPad_West,
|
||||
k_EInputActionOrigin_XBox360_DPad_East,
|
||||
k_EInputActionOrigin_XBox360_Reserved0,
|
||||
k_EInputActionOrigin_XBox360_DPad_Move,
|
||||
k_EInputActionOrigin_XBox360_Reserved1,
|
||||
k_EInputActionOrigin_XBox360_Reserved2,
|
||||
k_EInputActionOrigin_XBox360_Reserved3,
|
||||
@@ -314,7 +294,7 @@ enum EInputActionOrigin
|
||||
k_EInputActionOrigin_Switch_ProGyro_Pitch, // Primary Gyro in Pro Controller, or Right JoyCon
|
||||
k_EInputActionOrigin_Switch_ProGyro_Yaw, // Primary Gyro in Pro Controller, or Right JoyCon
|
||||
k_EInputActionOrigin_Switch_ProGyro_Roll, // Primary Gyro in Pro Controller, or Right JoyCon
|
||||
k_EInputActionOrigin_Switch_Reserved0,
|
||||
k_EInputActionOrigin_Switch_DPad_Move,
|
||||
k_EInputActionOrigin_Switch_Reserved1,
|
||||
k_EInputActionOrigin_Switch_Reserved2,
|
||||
k_EInputActionOrigin_Switch_Reserved3,
|
||||
@@ -350,6 +330,158 @@ enum EInputActionOrigin
|
||||
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_Reserved1,
|
||||
k_EInputActionOrigin_PS5_Reserved2,
|
||||
k_EInputActionOrigin_PS5_Reserved3,
|
||||
k_EInputActionOrigin_PS5_Reserved4,
|
||||
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.
|
||||
};
|
||||
@@ -393,6 +525,20 @@ enum ESteamControllerPad
|
||||
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,
|
||||
@@ -408,10 +554,22 @@ enum ESteamInputType
|
||||
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
|
||||
{
|
||||
@@ -421,11 +579,39 @@ enum ESteamInputLEDFlag
|
||||
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;
|
||||
@@ -474,8 +660,31 @@ struct InputMotionData_t
|
||||
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;
|
||||
};
|
||||
};
|
||||
|
||||
#pragma pack( pop )
|
||||
|
||||
typedef void ( *SteamInputActionEventCallbackPointer )( SteamInputActionEvent_t * );
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Steam Input API
|
||||
@@ -484,21 +693,65 @@ class ISteamInput
|
||||
{
|
||||
public:
|
||||
|
||||
// Init and Shutdown must be called when starting/ending use of this interface
|
||||
virtual bool Init() = 0;
|
||||
// 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;
|
||||
|
||||
// Synchronize API state with the latest Steam Controller inputs available. This
|
||||
// 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. This must
|
||||
// be called from somewhere before GetConnectedControllers will return any handles
|
||||
virtual void RunFrame() = 0;
|
||||
// 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( InputHandle_t *handlesOut ) = 0;
|
||||
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 )
|
||||
|
||||
// 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
|
||||
@@ -517,7 +770,11 @@ public:
|
||||
virtual void ActivateActionSetLayer( InputHandle_t inputHandle, InputActionSetHandle_t actionSetLayerHandle ) = 0;
|
||||
virtual void DeactivateActionSetLayer( InputHandle_t inputHandle, InputActionSetHandle_t actionSetLayerHandle ) = 0;
|
||||
virtual void DeactivateAllActionSetLayers( InputHandle_t inputHandle ) = 0;
|
||||
virtual int GetActiveActionSetLayers( InputHandle_t inputHandle, InputActionSetHandle_t *handlesOut ) = 0;
|
||||
|
||||
// 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
|
||||
@@ -532,7 +789,10 @@ public:
|
||||
// Get the origin(s) for a digital action within an action set. Returns the number of origins supplied in originsOut. Use this to display the appropriate on-screen prompt for the action.
|
||||
// originsOut should point to a STEAM_INPUT_MAX_ORIGINS sized array of EInputActionOrigin handles. The EInputActionOrigin enum will get extended as support for new controller controllers gets added to
|
||||
// the Steam client and will exceed the values from this header, please check bounds if you are using a look up table.
|
||||
virtual int GetDigitalActionOrigins( InputHandle_t inputHandle, InputActionSetHandle_t actionSetHandle, InputDigitalActionHandle_t digitalActionHandle, EInputActionOrigin *originsOut ) = 0;
|
||||
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;
|
||||
@@ -543,14 +803,23 @@ public:
|
||||
// Get the origin(s) for an analog action within an action set. Returns the number of origins supplied in originsOut. Use this to display the appropriate on-screen prompt for the action.
|
||||
// originsOut should point to a STEAM_INPUT_MAX_ORIGINS sized array of EInputActionOrigin handles. The EInputActionOrigin enum will get extended as support for new controller controllers gets added to
|
||||
// the Steam client and will exceed the values from this header, please check bounds if you are using a look up table.
|
||||
virtual int GetAnalogActionOrigins( InputHandle_t inputHandle, InputActionSetHandle_t actionSetHandle, InputAnalogActionHandle_t analogActionHandle, EInputActionOrigin *originsOut ) = 0;
|
||||
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 art for on-screen glyph for a particular origin - this call is cheap
|
||||
virtual const char *GetGlyphForActionOrigin( EInputActionOrigin eOrigin ) = 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;
|
||||
|
||||
// Returns a localized string (from Steam's language setting) for the specified origin - this call is serialized
|
||||
// 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;
|
||||
|
||||
@@ -564,27 +833,34 @@ public:
|
||||
// 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 TriggerHapticPulse( InputHandle_t inputHandle, ESteamControllerPad eTargetPad, unsigned short usDurationMicroSec ) = 0;
|
||||
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 TriggerRepeatedHapticPulse( InputHandle_t inputHandle, ESteamControllerPad eTargetPad, unsigned short usDurationMicroSec, unsigned short usOffMicroSec, unsigned short unRepeat, unsigned int nFlags ) = 0;
|
||||
virtual void Legacy_TriggerRepeatedHapticPulse( InputHandle_t inputHandle, ESteamControllerPad eTargetPad, unsigned short usDurationMicroSec, unsigned short usOffMicroSec, unsigned short unRepeat, unsigned int nFlags ) = 0;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Utility functions availible without using the rest of Steam Input API
|
||||
// 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
|
||||
// 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
|
||||
@@ -594,10 +870,10 @@ public:
|
||||
// Returns the associated gamepad index for the specified controller, if emulating a gamepad or -1 if not associated with an Xinput index
|
||||
virtual int GetGamepadIndexForController( InputHandle_t ulinputHandle ) = 0;
|
||||
|
||||
// Returns a localized string (from Steam's language setting) for the specified Xbox controller origin. This function is cheap.
|
||||
// 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. This function is serialized.
|
||||
// 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
|
||||
@@ -605,15 +881,74 @@ public:
|
||||
virtual EInputActionOrigin GetActionOriginFromXboxOrigin( InputHandle_t inputHandle, EXboxOrigin eOrigin ) = 0;
|
||||
|
||||
// Convert an origin to another controller type - for inputs not present on the other controller type this will return k_EInputActionOrigin_None
|
||||
// When a new input type is added you will be able to pass in k_ESteamInputType_Unknown amd the closest origin that your version of the SDK regonized will be returned
|
||||
// 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;
|
||||
};
|
||||
|
||||
#define STEAMINPUT_INTERFACE_VERSION "SteamInput001"
|
||||
#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?
|
||||
};
|
||||
|
||||
#pragma pack( pop )
|
||||
|
||||
#endif // ISTEAMINPUT_H
|
||||
@@ -86,12 +86,10 @@ public:
|
||||
// k_EResultServiceUnavailable - ERROR: service temporarily down, you may retry later
|
||||
// k_EResultLimitExceeded - ERROR: operation would exceed per-user inventory limits
|
||||
// k_EResultFail - ERROR: unknown / generic error
|
||||
STEAM_METHOD_DESC(Find out the status of an asynchronous inventory result handle.)
|
||||
virtual EResult GetResultStatus( SteamInventoryResult_t resultHandle ) = 0;
|
||||
|
||||
// Copies the contents of a result set into a flat array. The specific
|
||||
// contents of the result set depend on which query which was used.
|
||||
STEAM_METHOD_DESC(Copies the contents of a result set into a flat array. The specific contents of the result set depend on which query which was used.)
|
||||
virtual bool GetResultItems( SteamInventoryResult_t resultHandle,
|
||||
STEAM_OUT_ARRAY_COUNT( punOutItemsArraySize,Output array) SteamItemDetails_t *pOutItemsArray,
|
||||
uint32 *punOutItemsArraySize ) = 0;
|
||||
@@ -115,17 +113,14 @@ public:
|
||||
|
||||
// Returns the server time at which the result was generated. Compare against
|
||||
// the value of IClientUtils::GetServerRealTime() to determine age.
|
||||
STEAM_METHOD_DESC(Returns the server time at which the result was generated. Compare against the value of IClientUtils::GetServerRealTime() to determine age.)
|
||||
virtual uint32 GetResultTimestamp( SteamInventoryResult_t resultHandle ) = 0;
|
||||
|
||||
// Returns true if the result belongs to the target steam ID, false if the
|
||||
// result does not. This is important when using DeserializeResult, to verify
|
||||
// that a remote player is not pretending to have a different user's inventory.
|
||||
STEAM_METHOD_DESC(Returns true if the result belongs to the target steam ID or false if the result does not. This is important when using DeserializeResult to verify that a remote player is not pretending to have a different users inventory.)
|
||||
virtual bool CheckResultSteamID( SteamInventoryResult_t resultHandle, CSteamID steamIDExpected ) = 0;
|
||||
|
||||
// Destroys a result handle and frees all associated memory.
|
||||
STEAM_METHOD_DESC(Destroys a result handle and frees all associated memory.)
|
||||
virtual void DestroyResult( SteamInventoryResult_t resultHandle ) = 0;
|
||||
|
||||
|
||||
@@ -139,7 +134,6 @@ public:
|
||||
// cached results if called too frequently. It is suggested that you call
|
||||
// this function only when you are about to display the user's full inventory,
|
||||
// or if you expect that the inventory may have changed.
|
||||
STEAM_METHOD_DESC(Captures the entire state of the current users Steam inventory.)
|
||||
virtual bool GetAllItems( SteamInventoryResult_t *pResultHandle ) = 0;
|
||||
|
||||
|
||||
@@ -150,7 +144,6 @@ public:
|
||||
// For example, you could call GetItemsByID with the IDs of the user's
|
||||
// currently equipped cosmetic items and serialize this to a buffer, and
|
||||
// then transmit this buffer to other players upon joining a game.
|
||||
STEAM_METHOD_DESC(Captures the state of a subset of the current users Steam inventory identified by an array of item instance IDs.)
|
||||
virtual bool GetItemsByID( SteamInventoryResult_t *pResultHandle, STEAM_ARRAY_COUNT( unCountInstanceIDs ) const SteamItemInstanceID_t *pInstanceIDs, uint32 unCountInstanceIDs ) = 0;
|
||||
|
||||
|
||||
@@ -205,7 +198,6 @@ public:
|
||||
// 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.
|
||||
STEAM_METHOD_DESC(GrantPromoItems() checks the list of promotional items for which the user may be eligible and grants the items (one time only).)
|
||||
virtual bool GrantPromoItems( SteamInventoryResult_t *pResultHandle ) = 0;
|
||||
|
||||
// AddPromoItem() / AddPromoItems() are restricted versions of GrantPromoItems(). Instead of
|
||||
@@ -218,7 +210,6 @@ public:
|
||||
// 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.
|
||||
STEAM_METHOD_DESC(ConsumeItem() removes items from the inventory permanently.)
|
||||
virtual bool ConsumeItem( SteamInventoryResult_t *pResultHandle, SteamItemInstanceID_t itemConsume, uint32 unQuantity ) = 0;
|
||||
|
||||
// ExchangeItems() is an atomic combination of item generation and consumption.
|
||||
@@ -245,7 +236,6 @@ public:
|
||||
//
|
||||
|
||||
// Deprecated. Calling this method is not required for proper playtime accounting.
|
||||
STEAM_METHOD_DESC( Deprecated method. Playtime accounting is performed on the Steam servers. )
|
||||
virtual void SendItemDropHeartbeat() = 0;
|
||||
|
||||
// Playtime credit must be consumed and turned into item drops by your game. Only item
|
||||
@@ -257,7 +247,6 @@ public:
|
||||
// to directly control rarity.
|
||||
// See your Steamworks configuration to set playtime drop rates for individual itemdefs.
|
||||
// The client library will suppress too-frequent calls to this method.
|
||||
STEAM_METHOD_DESC(Playtime credit must be consumed and turned into item drops by your game.)
|
||||
virtual bool TriggerItemDrop( SteamInventoryResult_t *pResultHandle, SteamItemDef_t dropListDefinition ) = 0;
|
||||
|
||||
|
||||
@@ -281,7 +270,6 @@ public:
|
||||
// Every time new item definitions are available (eg, from the dynamic addition of new
|
||||
// item types while players are still in-game), a SteamInventoryDefinitionUpdate_t
|
||||
// callback will be fired.
|
||||
STEAM_METHOD_DESC(LoadItemDefinitions triggers the automatic load and refresh of item definitions.)
|
||||
virtual bool LoadItemDefinitions() = 0;
|
||||
|
||||
// GetItemDefinitionIDs returns the set of all defined item definition IDs (which are
|
||||
@@ -350,13 +338,23 @@ public:
|
||||
// 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"
|
||||
@@ -374,7 +372,7 @@ STEAM_DEFINE_GAMESERVER_INTERFACE_ACCESSOR( ISteamInventory *, SteamGameServerIn
|
||||
// always be exactly one callback per handle.
|
||||
struct SteamInventoryResultReady_t
|
||||
{
|
||||
enum { k_iCallback = k_iClientInventoryCallbacks + 0 };
|
||||
enum { k_iCallback = k_iSteamInventoryCallbacks + 0 };
|
||||
SteamInventoryResult_t m_handle;
|
||||
EResult m_result;
|
||||
};
|
||||
@@ -389,7 +387,7 @@ struct SteamInventoryResultReady_t
|
||||
// afterwards; this is an additional notification for your convenience.
|
||||
struct SteamInventoryFullUpdate_t
|
||||
{
|
||||
enum { k_iCallback = k_iClientInventoryCallbacks + 1 };
|
||||
enum { k_iCallback = k_iSteamInventoryCallbacks + 1 };
|
||||
SteamInventoryResult_t m_handle;
|
||||
};
|
||||
|
||||
@@ -400,13 +398,13 @@ struct SteamInventoryFullUpdate_t
|
||||
// a definition update in order to process results from the server.
|
||||
struct SteamInventoryDefinitionUpdate_t
|
||||
{
|
||||
enum { k_iCallback = k_iClientInventoryCallbacks + 2 };
|
||||
enum { k_iCallback = k_iSteamInventoryCallbacks + 2 };
|
||||
};
|
||||
|
||||
// Returned
|
||||
struct SteamInventoryEligiblePromoItemDefIDs_t
|
||||
{
|
||||
enum { k_iCallback = k_iClientInventoryCallbacks + 3 };
|
||||
enum { k_iCallback = k_iSteamInventoryCallbacks + 3 };
|
||||
EResult m_result;
|
||||
CSteamID m_steamID;
|
||||
int m_numEligiblePromoItemDefs;
|
||||
@@ -416,7 +414,7 @@ struct SteamInventoryEligiblePromoItemDefIDs_t
|
||||
// Triggered from StartPurchase call
|
||||
struct SteamInventoryStartPurchaseResult_t
|
||||
{
|
||||
enum { k_iCallback = k_iClientInventoryCallbacks + 4 };
|
||||
enum { k_iCallback = k_iSteamInventoryCallbacks + 4 };
|
||||
EResult m_result;
|
||||
uint64 m_ulOrderID;
|
||||
uint64 m_ulTransID;
|
||||
@@ -426,7 +424,7 @@ struct SteamInventoryStartPurchaseResult_t
|
||||
// Triggered from RequestPrices
|
||||
struct SteamInventoryRequestPricesResult_t
|
||||
{
|
||||
enum { k_iCallback = k_iClientInventoryCallbacks + 5 };
|
||||
enum { k_iCallback = k_iSteamInventoryCallbacks + 5 };
|
||||
EResult m_result;
|
||||
char m_rgchCurrency[4];
|
||||
};
|
||||
|
||||
@@ -23,6 +23,8 @@ enum ELobbyType
|
||||
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
|
||||
@@ -254,7 +256,6 @@ public:
|
||||
// after completion, the local user will no longer be the owner
|
||||
virtual void CheckForPSNGameBootInvite( unsigned int iGameBootAttributes ) = 0;
|
||||
#endif
|
||||
STEAM_CALL_BACK( LobbyChatUpdate_t )
|
||||
};
|
||||
#define STEAMMATCHMAKING_INTERFACE_VERSION "SteamMatchMaking009"
|
||||
|
||||
|
||||
@@ -17,12 +17,16 @@
|
||||
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
|
||||
};
|
||||
|
||||
@@ -120,6 +124,10 @@ 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
|
||||
{
|
||||
@@ -133,6 +141,9 @@ public:
|
||||
// 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
|
||||
@@ -181,6 +192,10 @@ 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;
|
||||
|
||||
|
||||
@@ -198,6 +213,9 @@ public:
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
@@ -209,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
|
||||
@@ -258,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;
|
||||
@@ -270,7 +288,7 @@ 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();
|
||||
|
||||
@@ -28,6 +28,7 @@ enum EParentalFeature
|
||||
k_EFeatureParentalSetup = 10,
|
||||
k_EFeatureLibrary = 11,
|
||||
k_EFeatureTest = 12,
|
||||
k_EFeatureSiteLicense = 13,
|
||||
k_EFeatureMax
|
||||
};
|
||||
|
||||
|
||||
@@ -65,8 +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
|
||||
};
|
||||
@@ -76,6 +78,7 @@ enum ERemoteStoragePublishedFileVisibility
|
||||
k_ERemoteStoragePublishedFileVisibilityPublic = 0,
|
||||
k_ERemoteStoragePublishedFileVisibilityFriendsOnly = 1,
|
||||
k_ERemoteStoragePublishedFileVisibilityPrivate = 2,
|
||||
k_ERemoteStoragePublishedFileVisibilityUnlisted = 3,
|
||||
};
|
||||
|
||||
|
||||
@@ -153,6 +156,28 @@ enum EUGCReadAction
|
||||
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
|
||||
@@ -235,24 +260,6 @@ class ISteamRemoteStorage
|
||||
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;
|
||||
@@ -302,9 +309,18 @@ class ISteamRemoteStorage
|
||||
|
||||
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_VERSION014"
|
||||
#define STEAMREMOTESTORAGE_INTERFACE_VERSION "STEAMREMOTESTORAGE_INTERFACE_VERSION016"
|
||||
|
||||
// Global interface accessor
|
||||
inline ISteamRemoteStorage *SteamRemoteStorage();
|
||||
@@ -319,59 +335,7 @@ STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamRemoteStorage *, SteamRemoteStorage,
|
||||
#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx
|
||||
#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
|
||||
//
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// 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;
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -379,14 +343,14 @@ struct RemoteStorageAppSyncStatusCheck_t
|
||||
//-----------------------------------------------------------------------------
|
||||
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
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -394,19 +358,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;
|
||||
};
|
||||
@@ -417,7 +384,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;
|
||||
@@ -430,7 +397,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;
|
||||
};
|
||||
@@ -441,7 +408,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;
|
||||
@@ -462,7 +429,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;
|
||||
};
|
||||
@@ -473,7 +440,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;
|
||||
@@ -485,7 +452,7 @@ 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.
|
||||
@@ -500,7 +467,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.
|
||||
@@ -527,7 +494,7 @@ struct RemoteStorageGetPublishedFileDetailsResult_t
|
||||
|
||||
struct RemoteStorageEnumerateWorkshopFilesResult_t
|
||||
{
|
||||
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 19 };
|
||||
enum { k_iCallback = k_iSteamRemoteStorageCallbacks + 19 };
|
||||
EResult m_eResult;
|
||||
int32 m_nResultsReturned;
|
||||
int32 m_nTotalResultCount;
|
||||
@@ -543,7 +510,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;
|
||||
@@ -558,7 +525,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.
|
||||
};
|
||||
@@ -568,7 +535,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.
|
||||
};
|
||||
@@ -579,7 +546,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.
|
||||
};
|
||||
@@ -590,7 +557,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
|
||||
};
|
||||
@@ -601,7 +568,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
|
||||
@@ -609,7 +576,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;
|
||||
@@ -618,7 +585,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
|
||||
@@ -626,7 +593,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;
|
||||
@@ -641,7 +608,7 @@ struct RemoteStorageEnumeratePublishedFilesByUserActionResult_t
|
||||
//-----------------------------------------------------------------------------
|
||||
struct RemoteStoragePublishFileProgress_t
|
||||
{
|
||||
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 29 };
|
||||
enum { k_iCallback = k_iSteamRemoteStorageCallbacks + 29 };
|
||||
double m_dPercentFile;
|
||||
bool m_bPreview;
|
||||
};
|
||||
@@ -652,7 +619,7 @@ struct RemoteStoragePublishFileProgress_t
|
||||
//-----------------------------------------------------------------------------
|
||||
struct RemoteStoragePublishedFileUpdated_t
|
||||
{
|
||||
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 30 };
|
||||
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
|
||||
@@ -663,7 +630,7 @@ struct RemoteStoragePublishedFileUpdated_t
|
||||
//-----------------------------------------------------------------------------
|
||||
struct RemoteStorageFileWriteAsyncComplete_t
|
||||
{
|
||||
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 31 };
|
||||
enum { k_iCallback = k_iSteamRemoteStorageCallbacks + 31 };
|
||||
EResult m_eResult; // result
|
||||
};
|
||||
|
||||
@@ -672,13 +639,21 @@ struct RemoteStorageFileWriteAsyncComplete_t
|
||||
//-----------------------------------------------------------------------------
|
||||
struct RemoteStorageFileReadAsyncComplete_t
|
||||
{
|
||||
enum { k_iCallback = k_iClientRemoteStorageCallbacks + 32 };
|
||||
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 )
|
||||
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ enum EUGCMatchingUGCType
|
||||
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, // return everything
|
||||
k_EUGCMatchingUGCType_All = ~0, // @note: will only be valid for CreateQueryUserUGCRequest requests
|
||||
};
|
||||
|
||||
// Different lists of published UGC for a user.
|
||||
@@ -99,6 +99,7 @@ enum EUGCQuery
|
||||
k_EUGCQuery_RankedByLifetimeAveragePlaytime = 16,
|
||||
k_EUGCQuery_RankedByPlaytimeSessionsTrend = 17,
|
||||
k_EUGCQuery_RankedByLifetimePlaytimeSessions = 18,
|
||||
k_EUGCQuery_RankedByLastUpdatedDate = 19,
|
||||
};
|
||||
|
||||
enum EItemUpdateStatus
|
||||
@@ -204,9 +205,11 @@ public:
|
||||
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)
|
||||
@@ -218,6 +221,9 @@ public:
|
||||
|
||||
// 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;
|
||||
@@ -227,11 +233,16 @@ public:
|
||||
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;
|
||||
|
||||
// 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;
|
||||
@@ -251,9 +262,12 @@ public:
|
||||
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
|
||||
@@ -271,6 +285,7 @@ public:
|
||||
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
|
||||
@@ -348,9 +363,15 @@ public:
|
||||
// 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;
|
||||
};
|
||||
|
||||
#define STEAMUGC_INTERFACE_VERSION "STEAMUGC_INTERFACE_VERSION012"
|
||||
#define STEAMUGC_INTERFACE_VERSION "STEAMUGC_INTERFACE_VERSION016"
|
||||
|
||||
// Global interface accessor
|
||||
inline ISteamUGC *SteamUGC();
|
||||
@@ -365,7 +386,7 @@ STEAM_DEFINE_GAMESERVER_INTERFACE_ACCESSOR( ISteamUGC *, SteamGameServerUGC, STE
|
||||
//-----------------------------------------------------------------------------
|
||||
struct SteamUGCQueryCompleted_t
|
||||
{
|
||||
enum { k_iCallback = k_iClientUGCCallbacks + 1 };
|
||||
enum { k_iCallback = k_iSteamUGCCallbacks + 1 };
|
||||
UGCQueryHandle_t m_handle;
|
||||
EResult m_eResult;
|
||||
uint32 m_unNumResultsReturned;
|
||||
@@ -380,7 +401,7 @@ struct SteamUGCQueryCompleted_t
|
||||
//-----------------------------------------------------------------------------
|
||||
struct SteamUGCRequestUGCDetailsResult_t
|
||||
{
|
||||
enum { k_iCallback = k_iClientUGCCallbacks + 2 };
|
||||
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
|
||||
};
|
||||
@@ -391,7 +412,7 @@ struct SteamUGCRequestUGCDetailsResult_t
|
||||
//-----------------------------------------------------------------------------
|
||||
struct CreateItemResult_t
|
||||
{
|
||||
enum { k_iCallback = k_iClientUGCCallbacks + 3 };
|
||||
enum { k_iCallback = k_iSteamUGCCallbacks + 3 };
|
||||
EResult m_eResult;
|
||||
PublishedFileId_t m_nPublishedFileId; // new item got this UGC PublishFileID
|
||||
bool m_bUserNeedsToAcceptWorkshopLegalAgreement;
|
||||
@@ -403,7 +424,7 @@ struct CreateItemResult_t
|
||||
//-----------------------------------------------------------------------------
|
||||
struct SubmitItemUpdateResult_t
|
||||
{
|
||||
enum { k_iCallback = k_iClientUGCCallbacks + 4 };
|
||||
enum { k_iCallback = k_iSteamUGCCallbacks + 4 };
|
||||
EResult m_eResult;
|
||||
bool m_bUserNeedsToAcceptWorkshopLegalAgreement;
|
||||
PublishedFileId_t m_nPublishedFileId;
|
||||
@@ -415,7 +436,7 @@ struct SubmitItemUpdateResult_t
|
||||
//-----------------------------------------------------------------------------
|
||||
struct ItemInstalled_t
|
||||
{
|
||||
enum { k_iCallback = k_iClientUGCCallbacks + 5 };
|
||||
enum { k_iCallback = k_iSteamUGCCallbacks + 5 };
|
||||
AppId_t m_unAppID;
|
||||
PublishedFileId_t m_nPublishedFileId;
|
||||
};
|
||||
@@ -426,7 +447,7 @@ struct ItemInstalled_t
|
||||
//-----------------------------------------------------------------------------
|
||||
struct DownloadItemResult_t
|
||||
{
|
||||
enum { k_iCallback = k_iClientUGCCallbacks + 6 };
|
||||
enum { k_iCallback = k_iSteamUGCCallbacks + 6 };
|
||||
AppId_t m_unAppID;
|
||||
PublishedFileId_t m_nPublishedFileId;
|
||||
EResult m_eResult;
|
||||
@@ -437,7 +458,7 @@ struct DownloadItemResult_t
|
||||
//-----------------------------------------------------------------------------
|
||||
struct UserFavoriteItemsListChanged_t
|
||||
{
|
||||
enum { k_iCallback = k_iClientUGCCallbacks + 7 };
|
||||
enum { k_iCallback = k_iSteamUGCCallbacks + 7 };
|
||||
PublishedFileId_t m_nPublishedFileId;
|
||||
EResult m_eResult;
|
||||
bool m_bWasAddRequest;
|
||||
@@ -448,7 +469,7 @@ struct UserFavoriteItemsListChanged_t
|
||||
//-----------------------------------------------------------------------------
|
||||
struct SetUserItemVoteResult_t
|
||||
{
|
||||
enum { k_iCallback = k_iClientUGCCallbacks + 8 };
|
||||
enum { k_iCallback = k_iSteamUGCCallbacks + 8 };
|
||||
PublishedFileId_t m_nPublishedFileId;
|
||||
EResult m_eResult;
|
||||
bool m_bVoteUp;
|
||||
@@ -459,7 +480,7 @@ struct SetUserItemVoteResult_t
|
||||
//-----------------------------------------------------------------------------
|
||||
struct GetUserItemVoteResult_t
|
||||
{
|
||||
enum { k_iCallback = k_iClientUGCCallbacks + 9 };
|
||||
enum { k_iCallback = k_iSteamUGCCallbacks + 9 };
|
||||
PublishedFileId_t m_nPublishedFileId;
|
||||
EResult m_eResult;
|
||||
bool m_bVotedUp;
|
||||
@@ -472,7 +493,7 @@ struct GetUserItemVoteResult_t
|
||||
//-----------------------------------------------------------------------------
|
||||
struct StartPlaytimeTrackingResult_t
|
||||
{
|
||||
enum { k_iCallback = k_iClientUGCCallbacks + 10 };
|
||||
enum { k_iCallback = k_iSteamUGCCallbacks + 10 };
|
||||
EResult m_eResult;
|
||||
};
|
||||
|
||||
@@ -481,7 +502,7 @@ struct StartPlaytimeTrackingResult_t
|
||||
//-----------------------------------------------------------------------------
|
||||
struct StopPlaytimeTrackingResult_t
|
||||
{
|
||||
enum { k_iCallback = k_iClientUGCCallbacks + 11 };
|
||||
enum { k_iCallback = k_iSteamUGCCallbacks + 11 };
|
||||
EResult m_eResult;
|
||||
};
|
||||
|
||||
@@ -490,7 +511,7 @@ struct StopPlaytimeTrackingResult_t
|
||||
//-----------------------------------------------------------------------------
|
||||
struct AddUGCDependencyResult_t
|
||||
{
|
||||
enum { k_iCallback = k_iClientUGCCallbacks + 12 };
|
||||
enum { k_iCallback = k_iSteamUGCCallbacks + 12 };
|
||||
EResult m_eResult;
|
||||
PublishedFileId_t m_nPublishedFileId;
|
||||
PublishedFileId_t m_nChildPublishedFileId;
|
||||
@@ -501,7 +522,7 @@ struct AddUGCDependencyResult_t
|
||||
//-----------------------------------------------------------------------------
|
||||
struct RemoveUGCDependencyResult_t
|
||||
{
|
||||
enum { k_iCallback = k_iClientUGCCallbacks + 13 };
|
||||
enum { k_iCallback = k_iSteamUGCCallbacks + 13 };
|
||||
EResult m_eResult;
|
||||
PublishedFileId_t m_nPublishedFileId;
|
||||
PublishedFileId_t m_nChildPublishedFileId;
|
||||
@@ -513,7 +534,7 @@ struct RemoveUGCDependencyResult_t
|
||||
//-----------------------------------------------------------------------------
|
||||
struct AddAppDependencyResult_t
|
||||
{
|
||||
enum { k_iCallback = k_iClientUGCCallbacks + 14 };
|
||||
enum { k_iCallback = k_iSteamUGCCallbacks + 14 };
|
||||
EResult m_eResult;
|
||||
PublishedFileId_t m_nPublishedFileId;
|
||||
AppId_t m_nAppID;
|
||||
@@ -524,7 +545,7 @@ struct AddAppDependencyResult_t
|
||||
//-----------------------------------------------------------------------------
|
||||
struct RemoveAppDependencyResult_t
|
||||
{
|
||||
enum { k_iCallback = k_iClientUGCCallbacks + 15 };
|
||||
enum { k_iCallback = k_iSteamUGCCallbacks + 15 };
|
||||
EResult m_eResult;
|
||||
PublishedFileId_t m_nPublishedFileId;
|
||||
AppId_t m_nAppID;
|
||||
@@ -536,7 +557,7 @@ struct RemoveAppDependencyResult_t
|
||||
//-----------------------------------------------------------------------------
|
||||
struct GetAppDependenciesResult_t
|
||||
{
|
||||
enum { k_iCallback = k_iClientUGCCallbacks + 16 };
|
||||
enum { k_iCallback = k_iSteamUGCCallbacks + 16 };
|
||||
EResult m_eResult;
|
||||
PublishedFileId_t m_nPublishedFileId;
|
||||
AppId_t m_rgAppIDs[32];
|
||||
@@ -549,11 +570,36 @@ struct GetAppDependenciesResult_t
|
||||
//-----------------------------------------------------------------------------
|
||||
struct DeleteItemResult_t
|
||||
{
|
||||
enum { k_iCallback = k_iClientUGCCallbacks + 17 };
|
||||
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
|
||||
|
||||
@@ -12,25 +12,6 @@
|
||||
|
||||
#include "steam_api_common.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 steam_api_common.h should define VALVE_CALLBACK_PACK_xxx
|
||||
#endif
|
||||
struct CallbackMsg_t
|
||||
{
|
||||
HSteamUser m_hSteamUser;
|
||||
int m_iCallback;
|
||||
uint8 *m_pubParam;
|
||||
int m_cubParam;
|
||||
};
|
||||
#pragma pack( pop )
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Functions for accessing and manipulating a steam account
|
||||
// associated with one client instance
|
||||
@@ -66,11 +47,17 @@ 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.
|
||||
virtual int InitiateGameConnection( void *pAuthBlob, int cbMaxAuthBlob, CSteamID steamIDGameServer, uint32 unIPServer, uint16 usPortServer, bool bSecure ) = 0;
|
||||
//
|
||||
// DEPRECATED! This function will be removed from the SDK in an upcoming version.
|
||||
// Please migrate to BeginAuthSession and related functions.
|
||||
virtual int InitiateGameConnection_DEPRECATED( 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
|
||||
virtual void TerminateGameConnection( uint32 unIPServer, uint16 usPortServer ) = 0;
|
||||
//
|
||||
// DEPRECATED! This function will be removed from the SDK in an upcoming version.
|
||||
// Please migrate to BeginAuthSession and related functions.
|
||||
virtual void TerminateGameConnection_DEPRECATED( uint32 unIPServer, uint16 usPortServer ) = 0;
|
||||
|
||||
// Legacy functions
|
||||
|
||||
@@ -168,7 +155,12 @@ public:
|
||||
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;
|
||||
|
||||
// Trading Card badges data access
|
||||
@@ -206,9 +198,18 @@ public:
|
||||
|
||||
STEAM_CALL_RESULT( MarketEligibilityResponse_t )
|
||||
virtual SteamAPICall_t GetMarketEligibility() = 0;
|
||||
};
|
||||
|
||||
#define STEAMUSER_INTERFACE_VERSION "SteamUser020"
|
||||
// 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 "SteamUser021"
|
||||
|
||||
// Global interface accessor
|
||||
inline ISteamUser *SteamUser();
|
||||
@@ -383,6 +384,31 @@ struct MarketEligibilityResponse_t
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// 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
|
||||
};
|
||||
|
||||
|
||||
#pragma pack( pop )
|
||||
|
||||
|
||||
@@ -93,12 +93,19 @@ public:
|
||||
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
|
||||
@@ -153,8 +160,12 @@ public:
|
||||
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;
|
||||
@@ -199,7 +210,6 @@ public:
|
||||
// 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
|
||||
STEAM_METHOD_DESC(Downloads leaderboard entries for an arbitrary set of users - ELeaderboardDataRequest is k_ELeaderboardDataRequestUsers)
|
||||
STEAM_CALL_RESULT( LeaderboardScoresDownloaded_t )
|
||||
virtual SteamAPICall_t DownloadLeaderboardEntriesForUsers( SteamLeaderboard_t hSteamLeaderboard,
|
||||
STEAM_ARRAY_COUNT_D(cUsers, Array of users to retrieve) CSteamID *prgUsers, int cUsers ) = 0;
|
||||
@@ -265,38 +275,35 @@ public:
|
||||
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
|
||||
// elements actually set.
|
||||
|
||||
STEAM_FLAT_NAME( GetGlobalStatHistoryInt64 )
|
||||
virtual int32 GetGlobalStatHistory( const char *pchStatName, STEAM_ARRAY_COUNT(cubData) int64 *pData, uint32 cubData ) = 0;
|
||||
|
||||
STEAM_FLAT_NAME( GetGlobalStatHistoryDouble )
|
||||
virtual int32 GetGlobalStatHistory( const char *pchStatName, STEAM_ARRAY_COUNT(cubData) double *pData, uint32 cubData ) = 0;
|
||||
|
||||
#ifdef _PS3
|
||||
// Call to kick off installation of the PS3 trophies. This call is asynchronous, and the results will be returned in a PS3TrophiesInstalled_t
|
||||
// callback.
|
||||
virtual bool InstallPS3Trophies() = 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;
|
||||
|
||||
// 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( GetAchievementProgressLimitsFloat )
|
||||
virtual bool GetAchievementProgressLimits( const char *pchName, float *pfMinProgress, float *pfMaxProgress ) = 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;
|
||||
|
||||
// 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();
|
||||
|
||||
@@ -41,6 +41,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,
|
||||
k_EFloatingGamepadTextInputModeModeNumeric = 3,
|
||||
|
||||
};
|
||||
|
||||
// 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 )
|
||||
@@ -76,8 +94,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;
|
||||
@@ -136,7 +154,7 @@ public:
|
||||
STEAM_CALL_RESULT( CheckFileSignature_t )
|
||||
virtual SteamAPICall_t CheckFileSignature( const char *szFileName ) = 0;
|
||||
|
||||
// Activates the Big Picture text input dialog which only supports gamepad input
|
||||
// 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
|
||||
@@ -160,26 +178,63 @@ public:
|
||||
// ask SteamUI to create and render its OpenVR dashboard
|
||||
virtual void StartVRDashboard() = 0;
|
||||
|
||||
// Returns true if the HMD content will be streamed via Steam In-Home Streaming
|
||||
// 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 In-Home Streaming
|
||||
// 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;
|
||||
};
|
||||
|
||||
#define STEAMUTILS_INTERFACE_VERSION "SteamUtils009"
|
||||
#define STEAMUTILS_INTERFACE_VERSION "SteamUtils010"
|
||||
|
||||
// Global interface accessor
|
||||
inline ISteamUtils *SteamUtils();
|
||||
STEAM_DEFINE_INTERFACE_ACCESSOR( ISteamUtils *, SteamUtils, SteamInternal_FindOrCreateUserInterface( 0, STEAMUTILS_INTERFACE_VERSION ) );
|
||||
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 ) );
|
||||
STEAM_DEFINE_INTERFACE_ACCESSOR( ISteamUtils *, SteamGameServerUtils, SteamInternal_FindOrCreateGameServerInterface( 0, STEAMUTILS_INTERFACE_VERSION ), "gameserver", STEAMUTILS_INTERFACE_VERSION );
|
||||
|
||||
// callbacks
|
||||
#if defined( VALVE_CALLBACK_PACK_SMALL )
|
||||
@@ -255,7 +310,7 @@ struct CheckFileSignature_t
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Big Picture gamepad text input has been closed
|
||||
// Full Screen gamepad text input has been closed
|
||||
//-----------------------------------------------------------------------------
|
||||
struct GamepadTextInputDismissed_t
|
||||
{
|
||||
@@ -264,7 +319,20 @@ struct GamepadTextInputDismissed_t
|
||||
uint32 m_unSubmittedText;
|
||||
};
|
||||
|
||||
// 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 };
|
||||
};
|
||||
|
||||
#pragma pack( pop )
|
||||
|
||||
|
||||
@@ -49,21 +49,14 @@ public:
|
||||
inline ISteamVideo *SteamVideo();
|
||||
STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamVideo *, SteamVideo, STEAMVIDEO_INTERFACE_VERSION );
|
||||
|
||||
STEAM_CALLBACK_BEGIN( BroadcastUploadStart_t, k_iClientVideoCallbacks + 4 )
|
||||
STEAM_CALLBACK_END(0)
|
||||
|
||||
STEAM_CALLBACK_BEGIN( BroadcastUploadStop_t, k_iClientVideoCallbacks + 5 )
|
||||
STEAM_CALLBACK_MEMBER( 0, EBroadcastUploadResult, m_eResult )
|
||||
STEAM_CALLBACK_END(1)
|
||||
|
||||
STEAM_CALLBACK_BEGIN( GetVideoURLResult_t, k_iClientVideoCallbacks + 11 )
|
||||
STEAM_CALLBACK_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_iClientVideoCallbacks + 24 )
|
||||
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)
|
||||
|
||||
@@ -82,7 +82,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;
|
||||
|
||||
@@ -42,6 +42,10 @@
|
||||
#include "isteamvideo.h"
|
||||
#include "isteamparentalsettings.h"
|
||||
#include "isteaminput.h"
|
||||
#include "isteamremoteplay.h"
|
||||
#include "isteamnetworkingmessages.h"
|
||||
#include "isteamnetworkingsockets.h"
|
||||
#include "isteamnetworkingutils.h"
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
@@ -91,28 +95,14 @@ S_API void S_CALLTYPE SteamAPI_SetMiniDumpComment( const char *pchMsg );
|
||||
// SteamAPI_IsSteamRunning() returns true if Steam is currently running
|
||||
S_API bool S_CALLTYPE SteamAPI_IsSteamRunning();
|
||||
|
||||
// Pumps out all the steam messages, calling registered callbacks.
|
||||
// NOT THREADSAFE - do not call from multiple threads simultaneously.
|
||||
S_API void Steam_RunCallbacks( HSteamPipe hSteamPipe, bool bGameServerCallbacks );
|
||||
|
||||
// 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.
|
||||
// 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();
|
||||
|
||||
// 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();
|
||||
|
||||
|
||||
#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();
|
||||
@@ -129,16 +119,78 @@ S_API void S_CALLTYPE SteamAPI_UseBreakpadCrashHandler( char const *pchVersion,
|
||||
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 );
|
||||
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
//
|
||||
// CSteamAPIContext
|
||||
//
|
||||
// Deprecated! This is not necessary any more. Please use the global accessors directly
|
||||
//
|
||||
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
|
||||
|
||||
#ifndef STEAM_API_EXPORTS
|
||||
|
||||
// Deprecated! Use the global accessors directly
|
||||
inline bool CSteamAPIContext::Init()
|
||||
{
|
||||
m_pSteamClient = ::SteamClient();
|
||||
@@ -165,9 +217,11 @@ inline bool CSteamAPIContext::Init()
|
||||
if ( !m_pSteamGameSearch )
|
||||
return false;
|
||||
|
||||
#if !defined( IOSALL) // Not yet supported on iOS.
|
||||
m_pSteamMatchmakingServers = ::SteamMatchmakingServers();
|
||||
if ( !m_pSteamMatchmakingServers )
|
||||
return false;
|
||||
#endif
|
||||
|
||||
m_pSteamUserStats = ::SteamUserStats();
|
||||
if ( !m_pSteamUserStats )
|
||||
@@ -213,7 +267,7 @@ inline bool CSteamAPIContext::Init()
|
||||
if ( !m_pSteamMusicRemote )
|
||||
return false;
|
||||
|
||||
#ifndef ANDROID // Not yet supported on Android
|
||||
#if !defined( ANDROID ) && !defined( IOSALL) // Not yet supported on Android or ios.
|
||||
m_pSteamHTMLSurface = ::SteamHTMLSurface();
|
||||
if ( !m_pSteamHTMLSurface )
|
||||
return false;
|
||||
|
||||
@@ -81,6 +81,9 @@ extern "C" typedef uint32 ( *SteamAPI_CheckCallbackRegistered_t )( int iCallback
|
||||
//
|
||||
// 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.
|
||||
@@ -150,6 +153,7 @@ public:
|
||||
void SetGameserverFlag() { m_nCallbackFlags |= k_ECallbackFlagsGameServer; }
|
||||
|
||||
protected:
|
||||
friend class CCallbackMgr;
|
||||
virtual void Run( void *pvParam ) = 0;
|
||||
virtual void Run( void *pvParam, bool /*bIOFailure*/, SteamAPICall_t /*hSteamAPICall*/ ) { Run( pvParam ); }
|
||||
virtual int GetCallbackSizeBytes() { return sizeof_P; }
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -13,13 +13,7 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
// 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 );
|
||||
|
||||
// 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();
|
||||
@@ -29,6 +23,37 @@ 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 )
|
||||
|
||||
//
|
||||
// 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 );
|
||||
|
||||
// disable this warning; this pattern need for steam callback registration
|
||||
#ifdef _MSVC_VER
|
||||
#pragma warning( push )
|
||||
@@ -53,6 +78,8 @@ S_API void *S_CALLTYPE SteamInternal_FindOrCreateGameServerInterface( HSteamUser
|
||||
#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()
|
||||
{
|
||||
@@ -154,10 +181,29 @@ inline void CCallback< T, P, bGameserver >::Run( void *pvParam )
|
||||
(m_pObj->*m_Func)((P *)pvParam);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Macros to define steam callback structures. Used internally for debugging
|
||||
//-----------------------------------------------------------------------------
|
||||
#endif // #ifndef API_GEN
|
||||
|
||||
// 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
|
||||
@@ -196,6 +242,7 @@ class ISteamParentalSettings;
|
||||
class ISteamGameSearch;
|
||||
class ISteamInput;
|
||||
class ISteamParties;
|
||||
class ISteamRemotePlay;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Base values for callback identifiers, each callback must
|
||||
@@ -208,90 +255,66 @@ enum { k_iSteamBillingCallbacks = 400 };
|
||||
enum { k_iSteamMatchmakingCallbacks = 500 };
|
||||
enum { k_iSteamContentServerCallbacks = 600 };
|
||||
enum { k_iSteamUtilsCallbacks = 700 };
|
||||
enum { k_iClientFriendsCallbacks = 800 };
|
||||
enum { k_iClientUserCallbacks = 900 };
|
||||
enum { k_iSteamAppsCallbacks = 1000 };
|
||||
enum { k_iSteamUserStatsCallbacks = 1100 };
|
||||
enum { k_iSteamNetworkingCallbacks = 1200 };
|
||||
enum { k_iSteamNetworkingSocketsCallbacks = 1220 };
|
||||
enum { k_iSteamNetworkingMessagesCallbacks = 1250 };
|
||||
enum { k_iClientRemoteStorageCallbacks = 1300 };
|
||||
enum { k_iClientDepotBuilderCallbacks = 1400 };
|
||||
enum { k_iSteamNetworkingUtilsCallbacks = 1280 };
|
||||
enum { k_iSteamRemoteStorageCallbacks = 1300 };
|
||||
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_iSteamHTTPCallbacks = 2100 };
|
||||
enum { k_iSteamScreenshotsCallbacks = 2300 };
|
||||
enum { k_iClientAudioCallbacks = 2400 };
|
||||
enum { k_iClientUnifiedMessagesCallbacks = 2500 };
|
||||
// NOTE: 2500-2599 are reserved
|
||||
enum { k_iSteamStreamLauncherCallbacks = 2600 };
|
||||
enum { k_iClientControllerCallbacks = 2700 };
|
||||
enum { k_iSteamControllerCallbacks = 2800 };
|
||||
enum { k_iClientParentalSettingsCallbacks = 2900 };
|
||||
enum { k_iClientDeviceAuthCallbacks = 3000 };
|
||||
enum { k_iClientNetworkDeviceManagerCallbacks = 3100 };
|
||||
enum { k_iClientMusicCallbacks = 3200 };
|
||||
enum { k_iClientRemoteClientManagerCallbacks = 3300 };
|
||||
enum { k_iClientUGCCallbacks = 3400 };
|
||||
enum { k_iSteamUGCCallbacks = 3400 };
|
||||
enum { k_iSteamStreamClientCallbacks = 3500 };
|
||||
enum { k_IClientProductBuilderCallbacks = 3600 };
|
||||
enum { k_iClientShortcutsCallbacks = 3700 };
|
||||
enum { k_iClientRemoteControlManagerCallbacks = 3800 };
|
||||
enum { k_iSteamAppListCallbacks = 3900 };
|
||||
enum { k_iSteamMusicCallbacks = 4000 };
|
||||
enum { k_iSteamMusicRemoteCallbacks = 4100 };
|
||||
enum { k_iClientVRCallbacks = 4200 };
|
||||
enum { k_iClientGameNotificationCallbacks = 4300 };
|
||||
enum { k_iSteamGameNotificationCallbacks = 4400 };
|
||||
enum { k_iSteamHTMLSurfaceCallbacks = 4500 };
|
||||
enum { k_iClientVideoCallbacks = 4600 };
|
||||
enum { k_iClientInventoryCallbacks = 4700 };
|
||||
enum { k_iClientBluetoothManagerCallbacks = 4800 };
|
||||
enum { k_iClientSharedConnectionCallbacks = 4900 };
|
||||
enum { k_iSteamVideoCallbacks = 4600 };
|
||||
enum { k_iSteamInventoryCallbacks = 4700 };
|
||||
enum { k_ISteamParentalSettingsCallbacks = 5000 };
|
||||
enum { k_iClientShaderCallbacks = 5100 };
|
||||
enum { k_iSteamGameSearchCallbacks = 5200 };
|
||||
enum { k_iSteamPartiesCallbacks = 5300 };
|
||||
enum { k_iClientPartiesCallbacks = 5400 };
|
||||
|
||||
// Macro used to define a type-safe accessor that will always return the version
|
||||
// of the interface of the *header file* you are compiling with! We also bounce
|
||||
// through a safety function that checks for interfaces being created or destroyed.
|
||||
#ifndef STEAM_API_EXPORTS
|
||||
// SteamInternal_ContextInit takes a base pointer for the equivalent of
|
||||
// struct { void (*pFn)(void* pCtx); uintp counter; CSteamAPIContext ctx; }
|
||||
// Do not change layout of 2 + sizeof... or add non-pointer aligned data!
|
||||
// NOTE: declaring "static CSteamAPIConext" creates a large function
|
||||
// which queries the initialization status of the object. We know that
|
||||
// it is pointer-aligned and fully memset with zeros, so just alias a
|
||||
// static buffer of the appropriate size and call it a CSteamAPIContext.
|
||||
#define STEAM_DEFINE_INTERFACE_ACCESSOR( type, name, expr ) \
|
||||
inline void S_CALLTYPE SteamInternal_Init_ ## name( type *p ) { *p = (type)( expr ); } \
|
||||
inline type name() { \
|
||||
static void* s_CallbackCounterAndContext[ 3 ] = { (void*)&SteamInternal_Init_ ## name, 0, 0 }; \
|
||||
return *(type*)SteamInternal_ContextInit( s_CallbackCounterAndContext ); \
|
||||
}
|
||||
|
||||
#else
|
||||
// Stub when we're compiling steam_api.dll itself. These are inline
|
||||
// functions defined when the header is included. not functions exported
|
||||
// by the lib!
|
||||
#define STEAM_DEFINE_INTERFACE_ACCESSOR( type, name, expr )
|
||||
#endif
|
||||
|
||||
#define STEAM_DEFINE_USER_INTERFACE_ACCESSOR( type, name, version ) \
|
||||
STEAM_DEFINE_INTERFACE_ACCESSOR( type, name, SteamInternal_FindOrCreateUserInterface( SteamAPI_GetHSteamUser(), version ) )
|
||||
#define STEAM_DEFINE_GAMESERVER_INTERFACE_ACCESSOR( type, name, version ) \
|
||||
STEAM_DEFINE_INTERFACE_ACCESSOR( type, name, SteamInternal_FindOrCreateGameServerInterface( SteamGameServer_GetHSteamUser(), version ) )
|
||||
enum { k_iSteamSTARCallbacks = 5500 };
|
||||
enum { k_iSteamRemotePlayCallbacks = 5700 };
|
||||
enum { k_iSteamChatCallbacks = 5900 };
|
||||
// NOTE: Internal "IClientXxx" callback IDs go in clientenums.h
|
||||
|
||||
#ifdef _MSVC_VER
|
||||
#pragma warning( pop )
|
||||
#endif
|
||||
|
||||
// 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 ";")
|
||||
|
||||
// CSteamAPIContext encapsulates the Steamworks API global accessors into
|
||||
// a single object.
|
||||
//
|
||||
@@ -368,7 +391,6 @@ public:
|
||||
ISteamHTTP *SteamHTTP() const { return m_pSteamHTTP; }
|
||||
ISteamInventory *SteamInventory() const { return m_pSteamInventory; }
|
||||
ISteamUGC *SteamUGC() const { return m_pSteamUGC; }
|
||||
ISteamApps *SteamApps() const { return m_pSteamApps; }
|
||||
|
||||
private:
|
||||
ISteamClient *m_pSteamClient;
|
||||
@@ -379,7 +401,6 @@ private:
|
||||
ISteamHTTP *m_pSteamHTTP;
|
||||
ISteamInventory *m_pSteamInventory;
|
||||
ISteamUGC *m_pSteamUGC;
|
||||
ISteamApps *m_pSteamApps;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -22,25 +22,33 @@ enum EServerMode
|
||||
eServerModeAuthenticationAndSecure = 3, // Authenticate users, list on the server list and VAC protect clients
|
||||
};
|
||||
|
||||
/// 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.
|
||||
// NOTE: unless you are using ver old Steam client binaries, this parameter is ignored, and
|
||||
// you should pass 0. Gameservers now always use WebSockets to talk to Steam.
|
||||
// This protocol is TCP-based and thus always uses an ephemeral local port.
|
||||
// Older steam client binaries used UDP to talk to Steam, and this argument was useful.
|
||||
// A future version of the SDK will remove this argument.
|
||||
// - usGamePort is the port that clients will connect to for gameplay.
|
||||
// - 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.)
|
||||
inline bool SteamGameServer_Init( uint32 unIP, uint16 usSteamPort, uint16 usGamePort, uint16 usQueryPort, EServerMode eServerMode, const char *pchVersionString );
|
||||
inline bool SteamGameServer_Init( uint32 unIP, uint16 usGamePort, uint16 usQueryPort, EServerMode eServerMode, const char *pchVersionString );
|
||||
|
||||
// Shutdown SteamGameSeverXxx interfaces, log out, and free resources.
|
||||
S_API void SteamGameServer_Shutdown();
|
||||
@@ -85,19 +93,18 @@ inline bool CSteamGameServerAPIContext::Init()
|
||||
m_pSteamHTTP = ::SteamGameServerHTTP();
|
||||
m_pSteamInventory = ::SteamGameServerInventory();
|
||||
m_pSteamUGC = ::SteamGameServerUGC();
|
||||
m_pSteamApps = ::SteamGameServerApps();
|
||||
if ( !m_pSteamGameServer || !m_pSteamGameServerUtils || !m_pSteamGameServerNetworking || !m_pSteamGameServerStats
|
||||
|| !m_pSteamHTTP || !m_pSteamInventory || !m_pSteamUGC || !m_pSteamApps )
|
||||
|| !m_pSteamHTTP || !m_pSteamInventory || !m_pSteamUGC )
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
S_API bool S_CALLTYPE SteamInternal_GameServer_Init( uint32 unIP, uint16 usPort, uint16 usGamePort, uint16 usQueryPort, EServerMode eServerMode, const char *pchVersionString );
|
||||
inline bool SteamGameServer_Init( uint32 unIP, uint16 usSteamPort, uint16 usGamePort, uint16 usQueryPort, EServerMode eServerMode, const char *pchVersionString )
|
||||
S_API bool S_CALLTYPE SteamInternal_GameServer_Init( uint32 unIP, uint16 usLegacySteamPort, uint16 usGamePort, uint16 usQueryPort, EServerMode eServerMode, const char *pchVersionString );
|
||||
inline bool SteamGameServer_Init( uint32 unIP, uint16 usGamePort, uint16 usQueryPort, EServerMode eServerMode, const char *pchVersionString )
|
||||
{
|
||||
if ( !SteamInternal_GameServer_Init( unIP, usSteamPort, usGamePort, usQueryPort, eServerMode, pchVersionString ) )
|
||||
if ( !SteamInternal_GameServer_Init( unIP, 0, usGamePort, usQueryPort, eServerMode, pchVersionString ) )
|
||||
return false;
|
||||
|
||||
return true;
|
||||
|
||||
@@ -1,23 +1,11 @@
|
||||
//========= Copyright <20> 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"
|
||||
@@ -25,6 +13,7 @@
|
||||
// General result codes
|
||||
enum EResult
|
||||
{
|
||||
k_EResultNone = 0, // no result
|
||||
k_EResultOK = 1, // success
|
||||
k_EResultFail = 2, // generic failure
|
||||
k_EResultNoConnection = 3, // no/failed network connection
|
||||
@@ -138,6 +127,16 @@ enum EResult
|
||||
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
|
||||
};
|
||||
|
||||
// Error codes for use with the voice functions
|
||||
@@ -237,96 +236,6 @@ 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 EAppOwnershipFlags
|
||||
{
|
||||
k_EAppOwnershipFlags_None = 0x0000, // unknown
|
||||
k_EAppOwnershipFlags_OwnsLicense = 0x0001, // owns license for this game
|
||||
k_EAppOwnershipFlags_FreeLicense = 0x0002, // not paid for game
|
||||
k_EAppOwnershipFlags_RegionRestricted = 0x0004, // owns app, but not allowed to play in current region
|
||||
k_EAppOwnershipFlags_LowViolence = 0x0008, // only low violence version
|
||||
k_EAppOwnershipFlags_InvalidPlatform = 0x0010, // app not supported on current platform
|
||||
k_EAppOwnershipFlags_SharedLicense = 0x0020, // license was granted by authorized local device
|
||||
k_EAppOwnershipFlags_FreeWeekend = 0x0040, // owned by a free weekend licenses
|
||||
k_EAppOwnershipFlags_RetailLicense = 0x0080, // has a retail license for game, (CD-Key etc)
|
||||
k_EAppOwnershipFlags_LicenseLocked = 0x0100, // shared license is locked (in use) by other user
|
||||
k_EAppOwnershipFlags_LicensePending = 0x0200, // owns app, but transaction is still pending. Can't install or play
|
||||
k_EAppOwnershipFlags_LicenseExpired = 0x0400, // doesn't own app anymore since license expired
|
||||
k_EAppOwnershipFlags_LicensePermanent = 0x0800, // permanent license, not borrowed, or guest or freeweekend etc
|
||||
k_EAppOwnershipFlags_LicenseRecurring = 0x1000, // Recurring license, user is charged periodically
|
||||
k_EAppOwnershipFlags_LicenseCanceled = 0x2000, // Mark as canceled, but might be still active if recurring
|
||||
k_EAppOwnershipFlags_AutoGrant = 0x4000, // Ownership is based on any kind of autogrant license
|
||||
k_EAppOwnershipFlags_PendingGift = 0x8000, // user has pending gift to redeem
|
||||
k_EAppOwnershipFlags_RentalNotActivated = 0x10000, // Rental hasn't been activated yet
|
||||
k_EAppOwnershipFlags_Rental = 0x20000, // Is a rental
|
||||
k_EAppOwnershipFlags_SiteLicense = 0x40000, // Is from a site license
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: designed as flags to allow filters masks
|
||||
// NOTE: If you add to this, please update PackageAppType (SteamConfig) as well as populatePackageAppType
|
||||
//-----------------------------------------------------------------------------
|
||||
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_DEPRECATED = 0x010, // legacy - was used for game trailers, which are now just videos on the web
|
||||
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_Config = 0x100, // hidden app used to config Steam features (backpack, sales, etc)
|
||||
k_EAppType_Hardware = 0x200, // a hardware device (Steam Machine, Steam Controller, Steam Link, etc.)
|
||||
k_EAppType_Franchise = 0x400, // A hub for collections of multiple apps, eg films, series, games
|
||||
k_EAppType_Video = 0x800, // A video component of either a Film or TVSeries (may be the feature, an episode, preview, making-of, etc)
|
||||
k_EAppType_Plugin = 0x1000, // Plug-in types for other Apps
|
||||
k_EAppType_Music = 0x2000, // Music files
|
||||
k_EAppType_Series = 0x4000, // Container app for video series
|
||||
k_EAppType_Comic = 0x8000, // Comic Book
|
||||
|
||||
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)
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -374,15 +283,9 @@ enum EChatRoomEnterResponse
|
||||
};
|
||||
|
||||
|
||||
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
|
||||
@@ -398,26 +301,6 @@ 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
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -462,131 +345,6 @@ enum EBroadcastUploadResult
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: codes for well defined launch options
|
||||
//-----------------------------------------------------------------------------
|
||||
enum ELaunchOptionType
|
||||
{
|
||||
k_ELaunchOptionType_None = 0, // unknown what launch option does
|
||||
k_ELaunchOptionType_Default = 1, // runs the game, app, whatever in default mode
|
||||
k_ELaunchOptionType_SafeMode = 2, // runs the game in safe mode
|
||||
k_ELaunchOptionType_Multiplayer = 3, // runs the game in multiplayer mode
|
||||
k_ELaunchOptionType_Config = 4, // runs config tool for this game
|
||||
k_ELaunchOptionType_OpenVR = 5, // runs game in VR mode using OpenVR
|
||||
k_ELaunchOptionType_Server = 6, // runs dedicated server for this game
|
||||
k_ELaunchOptionType_Editor = 7, // runs game editor
|
||||
k_ELaunchOptionType_Manual = 8, // shows game manual
|
||||
k_ELaunchOptionType_Benchmark = 9, // runs game benchmark
|
||||
k_ELaunchOptionType_Option1 = 10, // generic run option, uses description field for game name
|
||||
k_ELaunchOptionType_Option2 = 11, // generic run option, uses description field for game name
|
||||
k_ELaunchOptionType_Option3 = 12, // generic run option, uses description field for game name
|
||||
k_ELaunchOptionType_OculusVR = 13, // runs game in VR mode using the Oculus SDK
|
||||
k_ELaunchOptionType_OpenVROverlay = 14, // runs an OpenVR dashboard overlay
|
||||
k_ELaunchOptionType_OSVR = 15, // runs game in VR mode using the OSVR SDK
|
||||
|
||||
|
||||
k_ELaunchOptionType_Dialog = 1000, // show launch options dialog
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: true if this launch option is any of the vr launching types
|
||||
//-----------------------------------------------------------------------------
|
||||
static inline bool BIsVRLaunchOptionType( const ELaunchOptionType eType )
|
||||
{
|
||||
return eType == k_ELaunchOptionType_OpenVR
|
||||
|| eType == k_ELaunchOptionType_OpenVROverlay
|
||||
|| eType == k_ELaunchOptionType_OculusVR
|
||||
|| eType == k_ELaunchOptionType_OSVR;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: code points for VR HMD vendors and models
|
||||
// WARNING: DO NOT RENUMBER EXISTING VALUES - STORED IN A DATABASE
|
||||
//-----------------------------------------------------------------------------
|
||||
enum EVRHMDType
|
||||
{
|
||||
k_eEVRHMDType_None = -1, // unknown vendor and model
|
||||
|
||||
k_eEVRHMDType_Unknown = 0, // unknown vendor and model
|
||||
|
||||
k_eEVRHMDType_HTC_Dev = 1, // original HTC dev kits
|
||||
k_eEVRHMDType_HTC_VivePre = 2, // htc vive pre
|
||||
k_eEVRHMDType_HTC_Vive = 3, // htc vive consumer release
|
||||
k_eEVRHMDType_HTC_VivePro = 4, // htc vive pro release
|
||||
|
||||
k_eEVRHMDType_HTC_Unknown = 20, // unknown htc hmd
|
||||
|
||||
k_eEVRHMDType_Oculus_DK1 = 21, // Oculus DK1
|
||||
k_eEVRHMDType_Oculus_DK2 = 22, // Oculus DK2
|
||||
k_eEVRHMDType_Oculus_Rift = 23, // Oculus rift
|
||||
|
||||
k_eEVRHMDType_Oculus_Unknown = 40, // // Oculus unknown HMD
|
||||
|
||||
k_eEVRHMDType_Acer_Unknown = 50, // Acer unknown HMD
|
||||
k_eEVRHMDType_Acer_WindowsMR = 51, // Acer QHMD Windows MR headset
|
||||
|
||||
k_eEVRHMDType_Dell_Unknown = 60, // Dell unknown HMD
|
||||
k_eEVRHMDType_Dell_Visor = 61, // Dell Visor Windows MR headset
|
||||
|
||||
k_eEVRHMDType_Lenovo_Unknown = 70, // Lenovo unknown HMD
|
||||
k_eEVRHMDType_Lenovo_Explorer = 71, // Lenovo Explorer Windows MR headset
|
||||
|
||||
k_eEVRHMDType_HP_Unknown = 80, // HP unknown HMD
|
||||
k_eEVRHMDType_HP_WindowsMR = 81, // HP Windows MR headset
|
||||
|
||||
k_eEVRHMDType_Samsung_Unknown = 90, // Samsung unknown HMD
|
||||
k_eEVRHMDType_Samsung_Odyssey = 91, // Samsung Odyssey Windows MR headset
|
||||
|
||||
k_eEVRHMDType_Unannounced_Unknown = 100, // Unannounced unknown HMD
|
||||
k_eEVRHMDType_Unannounced_WindowsMR = 101, // Unannounced Windows MR headset
|
||||
|
||||
k_eEVRHMDType_vridge = 110, // VRIDGE tool
|
||||
|
||||
k_eEVRHMDType_Huawei_Unknown = 120, // Huawei unknown HMD
|
||||
k_eEVRHMDType_Huawei_VR2 = 121, // Huawei VR2 3DOF headset
|
||||
k_eEVRHMDType_Huawei_EndOfRange = 129, // end of Huawei HMD range
|
||||
|
||||
};
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: true if this is from an Oculus HMD
|
||||
//-----------------------------------------------------------------------------
|
||||
static inline bool BIsOculusHMD( EVRHMDType eType )
|
||||
{
|
||||
return eType == k_eEVRHMDType_Oculus_DK1 || eType == k_eEVRHMDType_Oculus_DK2 || eType == k_eEVRHMDType_Oculus_Rift || eType == k_eEVRHMDType_Oculus_Unknown;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: true if this is from a Windows MR HMD
|
||||
//-----------------------------------------------------------------------------
|
||||
static inline bool BIsWindowsMRHeadset( EVRHMDType eType )
|
||||
{
|
||||
return eType >= k_eEVRHMDType_Acer_WindowsMR && eType <= k_eEVRHMDType_Unannounced_WindowsMR;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: true if this is from a Hauwei HMD
|
||||
//-----------------------------------------------------------------------------
|
||||
static inline bool BIsHuaweiHeadset( EVRHMDType eType )
|
||||
{
|
||||
return eType >= k_eEVRHMDType_Huawei_Unknown && eType <= k_eEVRHMDType_Huawei_EndOfRange;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: true if this is from an Vive HMD
|
||||
//-----------------------------------------------------------------------------
|
||||
static inline bool BIsViveHMD( EVRHMDType eType )
|
||||
{
|
||||
return eType == k_eEVRHMDType_HTC_Dev || eType == k_eEVRHMDType_HTC_VivePre || eType == k_eEVRHMDType_HTC_Vive || eType == k_eEVRHMDType_HTC_Unknown || eType == k_eEVRHMDType_HTC_VivePro;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Reasons a user may not use the Community Market.
|
||||
// Used in MarketEligibilityResponse_t.
|
||||
@@ -647,6 +405,54 @@ enum EMarketNotAllowedReasonFlags
|
||||
};
|
||||
|
||||
|
||||
//
|
||||
// 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
|
||||
};
|
||||
|
||||
|
||||
#pragma pack( push, 1 )
|
||||
|
||||
#define CSTEAMID_DEFINED
|
||||
@@ -690,7 +496,7 @@ public:
|
||||
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 );
|
||||
}
|
||||
@@ -732,8 +538,7 @@ public:
|
||||
}
|
||||
else
|
||||
{
|
||||
// by default we pick the desktop instance
|
||||
m_steamid.m_comp.m_unAccountInstance = k_unSteamUserDesktopInstance;
|
||||
m_steamid.m_comp.m_unAccountInstance = k_unSteamUserDefaultInstance;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -800,7 +605,7 @@ public:
|
||||
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
|
||||
m_steamid.m_comp.m_unAccountInstance = k_unSteamUserDefaultInstance; // Steam2 only knew one instance
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -969,8 +774,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; }
|
||||
@@ -1040,7 +844,7 @@ inline bool CSteamID::IsValid() const
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -1135,77 +939,22 @@ public:
|
||||
m_gameID.m_nType = k_EGameIDTypeGameMod;
|
||||
}
|
||||
|
||||
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
|
||||
explicit CGameID( const char *pchGameID );
|
||||
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];
|
||||
V_FileBase( pchModPath, rgchModDir, sizeof( rgchModDir ) );
|
||||
CRC32_t crc32;
|
||||
CRC32_Init( &crc32 );
|
||||
CRC32_ProcessBuffer( &crc32, rgchModDir, V_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 );
|
||||
if ( pchExePath )
|
||||
CRC32_ProcessBuffer( &crc32, pchExePath, V_strlen( pchExePath ) );
|
||||
if ( pchAppName )
|
||||
CRC32_ProcessBuffer( &crc32, pchAppName, V_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, V_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;
|
||||
@@ -1294,9 +1043,9 @@ public:
|
||||
m_ulGameID = 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
private:
|
||||
//
|
||||
// Internal stuff. Use the accessors above if possible
|
||||
//
|
||||
|
||||
enum EGameIDType
|
||||
{
|
||||
@@ -1331,26 +1080,12 @@ 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,
|
||||
@@ -1373,6 +1108,23 @@ enum EPlayerResult_t
|
||||
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];
|
||||
|
||||
|
||||
@@ -29,4 +29,12 @@ S_API bool SteamEncryptedAppTicket_BUserOwnsAppInTicket( uint8 *rgubTicketDecryp
|
||||
|
||||
S_API bool SteamEncryptedAppTicket_BUserIsVacBanned( uint8 *rgubTicketDecrypted, uint32 cubTicketDecrypted );
|
||||
|
||||
S_API bool SteamEncryptedAppTicket_BGetAppDefinedValue( uint8 *rgubTicketDecrypted, uint32 cubTicketDecrypted, uint32 *pValue );
|
||||
|
||||
S_API const uint8 *SteamEncryptedAppTicket_GetUserVariableData( uint8 *rgubTicketDecrypted, uint32 cubTicketDecrypted, uint32 *pcubUserData );
|
||||
|
||||
S_API bool SteamEncryptedAppTicket_BIsTicketSigned( uint8 *rgubTicketDecrypted, uint32 cubTicketDecrypted, const uint8 *pubRSAKey, uint32 cubRSAKey );
|
||||
|
||||
S_API bool SteamEncryptedAppTicket_BIsLicenseBorrowed( uint8 *rgubTicketDecrypted, uint32 cubTicketDecrypted );
|
||||
|
||||
S_API bool SteamEncryptedAppTicket_BIsLicenseTemporary( uint8 *rgubTicketDecrypted, uint32 cubTicketDecrypted );
|
||||
|
||||
@@ -84,6 +84,7 @@ enum EHTTPStatusCode
|
||||
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,
|
||||
|
||||
@@ -17,26 +17,31 @@
|
||||
typedef unsigned char uint8;
|
||||
#endif
|
||||
|
||||
#if defined( __GNUC__ ) && !defined(POSIX)
|
||||
#if defined( __GNUC__ ) && !defined(_WIN32) && !defined(POSIX)
|
||||
#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) || defined(__aarch64__)
|
||||
#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
|
||||
|
||||
typedef unsigned char uint8;
|
||||
typedef signed char int8;
|
||||
|
||||
#if defined( _WIN32 )
|
||||
#if defined( _WIN32 ) && !defined( __GNUC__ )
|
||||
|
||||
typedef __int16 int16;
|
||||
typedef unsigned __int16 uint16;
|
||||
@@ -84,104 +89,100 @@ typedef unsigned int uintp;
|
||||
|
||||
#endif // else _WIN32
|
||||
|
||||
#ifdef API_GEN
|
||||
# define STEAM_CLANG_ATTR(ATTR) __attribute__((annotate( ATTR )))
|
||||
#else
|
||||
# define STEAM_CLANG_ATTR(ATTR)
|
||||
#endif
|
||||
|
||||
#define STEAM_METHOD_DESC(DESC) STEAM_CLANG_ATTR( "desc:" #DESC ";" )
|
||||
#define STEAM_IGNOREATTR() STEAM_CLANG_ATTR( "ignore" )
|
||||
#define STEAM_OUT_STRUCT() STEAM_CLANG_ATTR( "out_struct: ;" )
|
||||
#define STEAM_OUT_STRING() STEAM_CLANG_ATTR( "out_string: ;" )
|
||||
#define STEAM_OUT_ARRAY_CALL(COUNTER,FUNCTION,PARAMS) STEAM_CLANG_ATTR( "out_array_call:" #COUNTER "," #FUNCTION "," #PARAMS ";" )
|
||||
#define STEAM_OUT_ARRAY_COUNT(COUNTER, DESC) STEAM_CLANG_ATTR( "out_array_count:" #COUNTER ";desc:" #DESC )
|
||||
#define STEAM_ARRAY_COUNT(COUNTER) STEAM_CLANG_ATTR( "array_count:" #COUNTER ";" )
|
||||
#define STEAM_ARRAY_COUNT_D(COUNTER, DESC) STEAM_CLANG_ATTR( "array_count:" #COUNTER ";desc:" #DESC )
|
||||
#define STEAM_BUFFER_COUNT(COUNTER) STEAM_CLANG_ATTR( "buffer_count:" #COUNTER ";" )
|
||||
#define STEAM_OUT_BUFFER_COUNT(COUNTER) STEAM_CLANG_ATTR( "out_buffer_count:" #COUNTER ";" )
|
||||
#define STEAM_OUT_STRING_COUNT(COUNTER) STEAM_CLANG_ATTR( "out_string_count:" #COUNTER ";" )
|
||||
#define STEAM_DESC(DESC) STEAM_CLANG_ATTR("desc:" #DESC ";")
|
||||
#define STEAM_CALL_RESULT(RESULT_TYPE) STEAM_CLANG_ATTR("callresult:" #RESULT_TYPE ";")
|
||||
#define STEAM_CALL_BACK(RESULT_TYPE) STEAM_CLANG_ATTR("callback:" #RESULT_TYPE ";")
|
||||
|
||||
const int k_cubSaltSize = 8;
|
||||
typedef uint8 Salt_t[ k_cubSaltSize ];
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// 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 uint64 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;
|
||||
|
||||
const JobID_t k_JobIDNil = 0xffffffffffffffffull;
|
||||
|
||||
// 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;
|
||||
|
||||
typedef uint32 BundleId_t;
|
||||
const BundleId_t k_uBundleIdInvalid = 0;
|
||||
|
||||
// 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;
|
||||
|
||||
typedef uint32 PartnerId_t;
|
||||
const PartnerId_t k_uPartnerIdInvalid = 0;
|
||||
|
||||
// ID for a depot content manifest
|
||||
typedef uint64 ManifestId_t;
|
||||
const ManifestId_t k_uManifestIdInvalid = 0;
|
||||
|
||||
// ID for cafe sites
|
||||
typedef uint64 SiteId_t;
|
||||
const SiteId_t k_ulSiteIdInvalid = 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
|
||||
|
||||
Reference in New Issue
Block a user