Skip to content

Commit

Permalink
update june 2023
Browse files Browse the repository at this point in the history
  • Loading branch information
hugofnm committed Jun 15, 2023
1 parent d8a36ea commit 01e02ad
Show file tree
Hide file tree
Showing 27 changed files with 1,181 additions and 57 deletions.
70 changes: 68 additions & 2 deletions dll/flat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,16 @@ STEAMAPI_API ISteamRemotePlay * SteamAPI_ISteamClient_GetISteamRemotePlay( IStea
return get_steam_client()->GetISteamRemotePlay(hSteamUser, hSteamPipe, pchVersion);
}

STEAMAPI_API ISteamUser *SteamAPI_SteamUser_v023()
{
return get_steam_client()->GetISteamUser(flat_hsteamuser(), flat_hsteampipe(), "SteamUser023");
}

STEAMAPI_API ISteamUser *SteamAPI_SteamUser_v022()
{
return get_steam_client()->GetISteamUser(flat_hsteamuser(), flat_hsteampipe(), "SteamUser022");
}

STEAMAPI_API ISteamUser *SteamAPI_SteamUser_v021()
{
return get_steam_client()->GetISteamUser(flat_hsteamuser(), flat_hsteampipe(), "SteamUser021");
Expand Down Expand Up @@ -292,11 +302,16 @@ STEAMAPI_API uint32 SteamAPI_ISteamUser_GetVoiceOptimalSampleRate( ISteamUser* s
return (get_steam_client()->steam_user)->GetVoiceOptimalSampleRate();
}

STEAMAPI_API HAuthTicket SteamAPI_ISteamUser_GetAuthSessionTicket( ISteamUser* self, void * pTicket, int cbMaxTicket, uint32 * pcbTicket )
STEAMAPI_API HAuthTicket SteamAPI_ISteamUser_GetAuthSessionTicket( ISteamUser* self, void * pTicket, int cbMaxTicket, uint32 * pcbTicket, const SteamNetworkingIdentity * pSteamNetworkingIdentity)
{
return (get_steam_client()->steam_user)->GetAuthSessionTicket(pTicket, cbMaxTicket, pcbTicket);
}

STEAMAPI_API HAuthTicket SteamAPI_ISteamUser_GetAuthTicketForWebApi( ISteamUser* self, const char * pchIdentity )
{
return (get_steam_client()->steam_user)->GetAuthTicketForWebApi(pchIdentity);
}

STEAMAPI_API EBeginAuthSessionResult SteamAPI_ISteamUser_BeginAuthSession( ISteamUser* self, const void * pAuthTicket, int cbAuthTicket, uint64_steamid steamID )
{
return (get_steam_client()->steam_user)->BeginAuthSession(pAuthTicket, cbAuthTicket, steamID);
Expand Down Expand Up @@ -3493,6 +3508,11 @@ STEAMAPI_API ISteamUGC *SteamAPI_SteamUGC_v016()
return get_steam_client()->GetISteamUGC(flat_hsteamuser(), flat_hsteampipe(), "STEAMUGC_INTERFACE_VERSION016");
}

STEAMAPI_API ISteamUGC *SteamAPI_SteamUGC_v017()
{
return get_steam_client()->GetISteamUGC(flat_hsteamuser(), flat_hsteampipe(), "STEAMUGC_INTERFACE_VERSION017");
}

STEAMAPI_API ISteamUGC *SteamAPI_SteamGameServerUGC_v014()
{
return get_steam_client()->GetISteamUGC(flat_gs_hsteamuser(), flat_gs_hsteampipe(), "STEAMUGC_INTERFACE_VERSION014");
Expand All @@ -3508,6 +3528,11 @@ STEAMAPI_API ISteamUGC *SteamAPI_SteamGameServerUGC_v016()
return get_steam_client()->GetISteamUGC(flat_gs_hsteamuser(), flat_gs_hsteampipe(), "STEAMUGC_INTERFACE_VERSION016");
}

STEAMAPI_API ISteamUGC *SteamAPI_SteamGameServerUGC_v017()
{
return get_steam_client()->GetISteamUGC(flat_gs_hsteamuser(), flat_gs_hsteampipe(), "STEAMUGC_INTERFACE_VERSION017");
}

STEAMAPI_API UGCQueryHandle_t SteamAPI_ISteamUGC_CreateQueryUserUGCRequest( ISteamUGC* self, AccountID_t unAccountID, EUserUGCList eListType, EUGCMatchingUGCType eMatchingUGCType, EUserUGCListSortOrder eSortOrder, AppId_t nCreatorAppID, AppId_t nConsumerAppID, uint32 unPage )
{
long long test1 = ((char *)self - (char*)get_steam_client()->steam_ugc);
Expand Down Expand Up @@ -3760,6 +3785,18 @@ STEAMAPI_API steam_bool SteamAPI_ISteamUGC_GetQueryFirstUGCKeyValueTag( ISteamUG
return (ptr)->GetQueryUGCKeyValueTag(handle, index, pchKey, pchValue, cchValueSize);
}

STEAMAPI_API uint32 SteamAPI_ISteamUGC_GetQueryUGCContentDescriptors( ISteamUGC* self, UGCQueryHandle_t handle, uint32 index, EUGCContentDescriptorID * pvecDescriptors, uint32 cMaxEntries )
{
long long test1 = ((char *)self - (char*)get_steam_client()->steam_ugc);
long long test2 = ((char *)self - (char*)get_steam_client()->steam_gameserver_ugc);
auto ptr = get_steam_client()->steam_gameserver_ugc;
if (test1 >= 0 && (test2 < 0 || test1 < test2)) {
ptr = get_steam_client()->steam_ugc;
}

return (ptr)->GetQueryUGCContentDescriptors(handle, index, pvecDescriptors, cMaxEntries);
}

STEAMAPI_API steam_bool SteamAPI_ISteamUGC_ReleaseQueryUGCRequest( ISteamUGC* self, UGCQueryHandle_t handle )
{
long long test1 = ((char *)self - (char*)get_steam_client()->steam_ugc);
Expand Down Expand Up @@ -4252,6 +4289,30 @@ STEAMAPI_API steam_bool SteamAPI_ISteamUGC_RemoveItemPreview( ISteamUGC* self, U
return (ptr)->RemoveItemPreview(handle, index);
}

STEAMAPI_API steam_bool SteamAPI_ISteamUGC_AddContentDescriptor( ISteamUGC* self, UGCUpdateHandle_t handle, EUGCContentDescriptorID descid )
{
long long test1 = ((char *)self - (char*)get_steam_client()->steam_ugc);
long long test2 = ((char *)self - (char*)get_steam_client()->steam_gameserver_ugc);
auto ptr = get_steam_client()->steam_gameserver_ugc;
if (test1 >= 0 && (test2 < 0 || test1 < test2)) {
ptr = get_steam_client()->steam_ugc;
}

return (ptr)->AddContentDescriptor(handle, descid);
}

STEAMAPI_API steam_bool SteamAPI_ISteamUGC_RemoveContentDescriptor( ISteamUGC* self, UGCUpdateHandle_t handle, EUGCContentDescriptorID descid )
{
long long test1 = ((char *)self - (char*)get_steam_client()->steam_ugc);
long long test2 = ((char *)self - (char*)get_steam_client()->steam_gameserver_ugc);
auto ptr = get_steam_client()->steam_gameserver_ugc;
if (test1 >= 0 && (test2 < 0 || test1 < test2)) {
ptr = get_steam_client()->steam_ugc;
}

return (ptr)->RemoveContentDescriptor(handle, descid);
}

STEAMAPI_API SteamAPICall_t SteamAPI_ISteamUGC_SubmitItemUpdate( ISteamUGC* self, UGCUpdateHandle_t handle, const char * pchChangeNote )
{
long long test1 = ((char *)self - (char*)get_steam_client()->steam_ugc);
Expand Down Expand Up @@ -6393,6 +6454,11 @@ STEAMAPI_API ISteamGameServer *SteamAPI_SteamGameServer_v014()
return get_steam_client()->GetISteamGameServer(flat_gs_hsteamuser(), flat_gs_hsteampipe(), "SteamGameServer014");
}

STEAMAPI_API ISteamGameServer *SteamAPI_SteamGameServer_v015()
{
return get_steam_client()->GetISteamGameServer(flat_gs_hsteamuser(), flat_gs_hsteampipe(), "SteamGameServer015");
}

STEAMAPI_API steam_bool SteamAPI_ISteamGameServer_InitGameServer(intptr_t instancePtr, uint32 unIP, uint16 usGamePort, uint16 usQueryPort, uint32 unFlags, AppId_t nGameAppId, const char * pchVersionString)
{
return ((ISteamGameServer *)instancePtr)->InitGameServer(unIP, usGamePort, usQueryPort, unFlags, nGameAppId, pchVersionString);
Expand Down Expand Up @@ -6548,7 +6614,7 @@ STEAMAPI_API void SteamAPI_ISteamGameServer_SetAdvertiseServerActive( ISteamGame
return get_steam_client()->steam_gameserver->SetAdvertiseServerActive(bActive);
}

STEAMAPI_API HAuthTicket SteamAPI_ISteamGameServer_GetAuthSessionTicket( ISteamGameServer* self, void * pTicket, int cbMaxTicket, uint32 * pcbTicket )
STEAMAPI_API HAuthTicket SteamAPI_ISteamGameServer_GetAuthSessionTicket( ISteamGameServer* self, void * pTicket, int cbMaxTicket, uint32 * pcbTicket, const SteamNetworkingIdentity * pSnid )
{
return get_steam_client()->steam_gameserver->GetAuthSessionTicket(pTicket, cbMaxTicket, pcbTicket);
}
Expand Down
9 changes: 9 additions & 0 deletions dll/steam_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,10 @@ ISteamUser *Steam_Client::GetISteamUser( HSteamUser hSteamUser, HSteamPipe hStea
return (ISteamUser *)(void *)(ISteamUser019 *)steam_user;
} else if (strcmp(pchVersion, "SteamUser020") == 0) {
return (ISteamUser *)(void *)(ISteamUser020 *)steam_user;
} else if (strcmp(pchVersion, "SteamUser021") == 0) {
return (ISteamUser *)(void *)(ISteamUser021 *)steam_user;
} else if (strcmp(pchVersion, "SteamUser022") == 0) {
return (ISteamUser *)(void *)(ISteamUser022 *)steam_user;
} else if (strcmp(pchVersion, STEAMUSER_INTERFACE_VERSION) == 0) {
return (ISteamUser *)(void *)(ISteamUser *)steam_user;
} else {
Expand Down Expand Up @@ -370,6 +374,9 @@ ISteamGameServer *Steam_Client::GetISteamGameServer( HSteamUser hSteamUser, HSte
} else if (strcmp(pchVersion, "SteamGameServer013") == 0) {
gameserver_has_ipv6_functions = true;
return (ISteamGameServer *)(void *)(ISteamGameServer013 *)steam_gameserver;
} else if (strcmp(pchVersion, "SteamGameServer014") == 0) {
gameserver_has_ipv6_functions = true;
return (ISteamGameServer *)(void *)(ISteamGameServer014 *)steam_gameserver;
} else if (strcmp(pchVersion, STEAMGAMESERVER_INTERFACE_VERSION) == 0) {
gameserver_has_ipv6_functions = true;
return (ISteamGameServer *)(void *)(ISteamGameServer *)steam_gameserver;
Expand Down Expand Up @@ -1020,6 +1027,8 @@ ISteamUGC *Steam_Client::GetISteamUGC( HSteamUser hSteamUser, HSteamPipe hSteamP
return (ISteamUGC *)(void *)(ISteamUGC014 *)steam_ugc_temp;
} else if (strcmp(pchVersion, "STEAMUGC_INTERFACE_VERSION015") == 0) {
return (ISteamUGC *)(void *)(ISteamUGC015 *)steam_ugc_temp;
} else if (strcmp(pchVersion, "STEAMUGC_INTERFACE_VERSION016") == 0) {
return (ISteamUGC *)(void *)(ISteamUGC016 *)steam_ugc_temp;
} else if (strcmp(pchVersion, STEAMUGC_INTERFACE_VERSION) == 0) {
return (ISteamUGC *)(void *)(ISteamUGC *)steam_ugc_temp;
} else {
Expand Down
7 changes: 7 additions & 0 deletions dll/steam_gameserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,13 @@ bool Steam_GameServer::BGetUserAchievementStatus( CSteamID steamID, const char *
// Retrieve ticket to be sent to the entity who wishes to authenticate you ( using BeginAuthSession API ).
// pcbTicket retrieves the length of the actual ticket.
HAuthTicket Steam_GameServer::GetAuthSessionTicket( void *pTicket, int cbMaxTicket, uint32 *pcbTicket )
{
return GetAuthSessionTicket(pTicket, cbMaxTicket, pcbTicket, NULL);
}

// SteamNetworkingIdentity is an optional parameter to hold the public IP address of the entity you are connecting to
// if an IP address is passed Steam will only allow the ticket to be used by an entity with that IP address
HAuthTicket Steam_GameServer::GetAuthSessionTicket( void *pTicket, int cbMaxTicket, uint32 *pcbTicket, const SteamNetworkingIdentity *pSnid )
{
PRINT_DEBUG("Steam_GameServer::GetAuthSessionTicket\n");
std::lock_guard<std::recursive_mutex> lock(global_mutex);
Expand Down
4 changes: 4 additions & 0 deletions dll/steam_gameserver.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public ISteamGameServer010,
public ISteamGameServer011,
public ISteamGameServer012,
public ISteamGameServer013,
public ISteamGameServer014,
public ISteamGameServer
{
class Settings *settings;
Expand Down Expand Up @@ -253,6 +254,9 @@ public ISteamGameServer
// Retrieve ticket to be sent to the entity who wishes to authenticate you ( using BeginAuthSession API ).
// pcbTicket retrieves the length of the actual ticket.
HAuthTicket GetAuthSessionTicket( void *pTicket, int cbMaxTicket, uint32 *pcbTicket );
// SteamNetworkingIdentity is an optional parameter to hold the public IP address of the entity you are connecting to
// if an IP address is passed Steam will only allow the ticket to be used by an entity with that IP address
HAuthTicket GetAuthSessionTicket( void *pTicket, int cbMaxTicket, uint32 *pcbTicket, const SteamNetworkingIdentity *pSnid );

// Authenticate ticket ( from GetAuthSessionTicket ) from entity steamID to be sure it is valid and isnt reused
// Registers for callbacks if the entity goes offline or cancels the ticket ( see ValidateAuthTicketResponse_t callback and EAuthSessionResponse )
Expand Down
17 changes: 17 additions & 0 deletions dll/steam_ugc.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public ISteamUGC012,
public ISteamUGC013,
public ISteamUGC014,
public ISteamUGC015,
public ISteamUGC016,
public ISteamUGC
{
class Settings *settings;
Expand Down Expand Up @@ -273,6 +274,11 @@ bool GetQueryUGCKeyValueTag( UGCQueryHandle_t handle, uint32 index, const char *
return false;
}

uint32 GetQueryUGCContentDescriptors( UGCQueryHandle_t handle, uint32 index, EUGCContentDescriptorID *pvecDescriptors, uint32 cMaxEntries )
{
PRINT_DEBUG("Steam_UGC::GetQueryUGCContentDescriptors\n");
return 0;
}

// Release the request to free up memory, after retrieving results
bool ReleaseQueryUGCRequest( UGCQueryHandle_t handle )
Expand Down Expand Up @@ -592,6 +598,17 @@ bool RemoveItemPreview( UGCUpdateHandle_t handle, uint32 index )
}
// remove a preview by index starting at 0 (previews are sorted)

bool AddContentDescriptor( UGCUpdateHandle_t handle, EUGCContentDescriptorID descid )
{
PRINT_DEBUG("Steam_UGC::AddContentDescriptor %llu %u\n", handle, index);
return false;
}

bool RemoveContentDescriptor( UGCUpdateHandle_t handle, EUGCContentDescriptorID descid )
{
PRINT_DEBUG("Steam_UGC::RemoveContentDescriptor %llu %u\n", handle, index);
return false;
}

STEAM_CALL_RESULT( SubmitItemUpdateResult_t )
SteamAPICall_t SubmitItemUpdate( UGCUpdateHandle_t handle, const char *pchChangeNote )
Expand Down
17 changes: 17 additions & 0 deletions dll/steam_user.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public ISteamUser017,
public ISteamUser018,
public ISteamUser019,
public ISteamUser020,
public ISteamUser021,
public ISteamUser
{
Settings *settings;
Expand Down Expand Up @@ -299,13 +300,29 @@ uint32 GetVoiceOptimalSampleRate()
// Retrieve ticket to be sent to the entity who wishes to authenticate you.
// pcbTicket retrieves the length of the actual ticket.
HAuthTicket GetAuthSessionTicket( void *pTicket, int cbMaxTicket, uint32 *pcbTicket )
{
return GetAuthSessionTicket(pTicket, cbMaxTicket, pcbTicket, NULL);
}
// SteamNetworkingIdentity is an optional input parameter to hold the public IP address or SteamID of the entity you are connecting to
// if an IP address is passed Steam will only allow the ticket to be used by an entity with that IP address
// if a Steam ID is passed Steam will only allow the ticket to be used by that Steam ID
HAuthTicket GetAuthSessionTicket( void *pTicket, int cbMaxTicket, uint32 *pcbTicket, const SteamNetworkingIdentity *pSteamNetworkingIdentity )
{
PRINT_DEBUG("Steam_User::GetAuthSessionTicket %i\n", cbMaxTicket);
std::lock_guard<std::recursive_mutex> lock(global_mutex);

return ticket_manager->getTicket(pTicket, cbMaxTicket, pcbTicket);
}

// Request a ticket which will be used for webapi "ISteamUserAuth\AuthenticateUserTicket"
// pchIdentity is an optional input parameter to identify the service the ticket will be sent to
// the ticket will be returned in callback GetTicketForWebApiResponse_t
HAuthTicket GetAuthTicketForWebApi( const char *pchIdentity )
{
PRINT_DEBUG("TODO: Steam_User::GetAuthTicketForWebApi %s\n", pchIdentity);
return 0;
}

// Authenticate ticket from entity steamID to be sure it is valid and isnt reused
// Registers for callbacks if the entity goes offline or cancels the ticket ( see ValidateAuthTicketResponse_t callback and EAuthSessionResponse )
EBeginAuthSessionResult BeginAuthSession( const void *pAuthTicket, int cbAuthTicket, CSteamID steamID )
Expand Down
2 changes: 2 additions & 0 deletions overlay_experimental/steam_overlay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1059,6 +1059,8 @@ void Steam_Overlay::RunCallbacks()
{
GameOverlayActivated_t data = { 0 };
data.m_bActive = show_overlay;
data.m_bUserInitiated = true;
data.m_nAppID = settings->get_local_game_id().AppID();
callbacks->addCBResult(data.k_iCallback, &data, sizeof(data));

overlay_state_changed = false;
Expand Down
15 changes: 13 additions & 2 deletions sdk_includes/isteamcontroller.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@

#define STEAM_CONTROLLER_MAX_COUNT 16

#define STEAM_CONTROLLER_MAX_ANALOG_ACTIONS 16
#define STEAM_CONTROLLER_MAX_ANALOG_ACTIONS 24

#define STEAM_CONTROLLER_MAX_DIGITAL_ACTIONS 128
#define STEAM_CONTROLLER_MAX_DIGITAL_ACTIONS 256

#define STEAM_CONTROLLER_MAX_ORIGINS 8

Expand Down Expand Up @@ -491,6 +491,16 @@ enum EControllerActionOrigin
k_EControllerActionOrigin_SteamDeck_Reserved19,
k_EControllerActionOrigin_SteamDeck_Reserved20,

k_EControllerActionOrigin_Switch_JoyConButton_N, // With a Horizontal JoyCon this will be Y or what would be Dpad Right when vertical
k_EControllerActionOrigin_Switch_JoyConButton_E, // X
k_EControllerActionOrigin_Switch_JoyConButton_S, // A
k_EControllerActionOrigin_Switch_JoyConButton_W, // B

k_EControllerActionOrigin_PS5_LeftGrip,
k_EControllerActionOrigin_PS5_RightGrip,
k_EControllerActionOrigin_PS5_LeftFn,
k_EControllerActionOrigin_PS5_RightFn,

k_EControllerActionOrigin_Count, // If Steam has added support for new controllers origins will go here.
k_EControllerActionOrigin_MaximumPossibleValue = 32767, // Origins are currently a maximum of 16 bits.
};
Expand Down Expand Up @@ -572,6 +582,7 @@ typedef uint64 ControllerAnalogActionHandle_t;
#define ControllerAnalogActionData_t InputAnalogActionData_t
#define ControllerDigitalActionData_t InputDigitalActionData_t
#define ControllerMotionData_t InputMotionData_t
#define ControllerMotionDataV2_t InputMotionDataV2_t
#else
struct ControllerAnalogActionData_t
{
Expand Down
4 changes: 3 additions & 1 deletion sdk_includes/isteamfriends.h
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,9 @@ enum EPersonaChange
struct GameOverlayActivated_t
{
enum { k_iCallback = k_iSteamFriendsCallbacks + 31 };
uint8 m_bActive; // true if it's just been activated, false otherwise
uint8 m_bActive; // true if it's just been activated, false otherwise
bool m_bUserInitiated; // true if the user asked for the overlay to be activated/deactivated
AppId_t m_nAppID; // the appID of the game (should always be the current game)
};


Expand Down
6 changes: 4 additions & 2 deletions sdk_includes/isteamgameserver.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,9 @@ class ISteamGameServer

// Retrieve ticket to be sent to the entity who wishes to authenticate you ( using BeginAuthSession API ).
// pcbTicket retrieves the length of the actual ticket.
virtual HAuthTicket GetAuthSessionTicket( void *pTicket, int cbMaxTicket, uint32 *pcbTicket ) = 0;
// SteamNetworkingIdentity is an optional parameter to hold the public IP address of the entity you are connecting to
// if an IP address is passed Steam will only allow the ticket to be used by an entity with that IP address
virtual HAuthTicket GetAuthSessionTicket( void *pTicket, int cbMaxTicket, uint32 *pcbTicket, const SteamNetworkingIdentity *pSnid ) = 0;

// Authenticate ticket ( from GetAuthSessionTicket ) from entity steamID to be sure it is valid and isnt reused
// Registers for callbacks if the entity goes offline or cancels the ticket ( see ValidateAuthTicketResponse_t callback and EAuthSessionResponse )
Expand Down Expand Up @@ -266,7 +268,7 @@ class ISteamGameServer
)
};

#define STEAMGAMESERVER_INTERFACE_VERSION "SteamGameServer014"
#define STEAMGAMESERVER_INTERFACE_VERSION "SteamGameServer015"

#ifndef STEAM_API_EXPORTS
// Global accessor
Expand Down
Loading

0 comments on commit 01e02ad

Please sign in to comment.