Open henrydatei opened 1 year ago
ISteamUserAuth/AuthenticateUserTicket
is a partner only API endpoint which requires a partner API key: https://partner.steamgames.com/doc/webapi/ISteamUserAuth
They say that the web api api.steampowered.com has such a function too (https://partner.steamgames.com/doc/webapi/ISteamUserAuth)
But I think I use the Steamworks SDK 155 (157 is the current one I think, but it didn't compile and I read somewhere that I should use 155 instead). Maybe Steam has changed something with the ticket generation
EDIT: Here I've seen it: https://github.com/philippj/SteamworksPy/issues/88#issuecomment-1563181860
Today I tried to use the SDK 157 where compiling fails with
g++ -std=c++11 -o SteamworksPy.so -shared -fPIC SteamworksPy.cpp -l steam_api -L.
SteamworksPy.cpp: In function ‘int GetAuthSessionTicket(char*)’:
SteamworksPy.cpp:987:38: error: no matching function for call to ‘ISteamUser::GetAuthSessionTicket(char*&, int, uint32*)’
987 | SteamUser()->GetAuthSessionTicket(buffer, 1024, &size);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
In file included from sdk/steam/steam_api.h:25,
from SteamworksPy.cpp:16:
sdk/steam/isteamuser.h:131:29: note: candidate: ‘virtual HAuthTicket ISteamUser::GetAuthSessionTicket(void*, int, uint32*, const SteamNetworkingIdentity*)’
131 | virtual HAuthTicket GetAuthSessionTicket( void *pTicket, int cbMaxTicket, uint32 *pcbTicket, const SteamNetworkingIdentity *pSteamNetworkingIdentity ) = 0;
| ^~~~~~~~~~~~~~~~~~~~
sdk/steam/isteamuser.h:131:29: note: candidate expects 4 arguments, 3 provided
make: *** [Makefile:2: makeall] Fehler 1
So I changed the function GetAuthSessionTicket() (https://github.com/philippj/SteamworksPy/blob/master/library/SteamworksPy.cpp#L982) to
// Returns the info needed to obtain a Session Ticket.
SW_PY int GetAuthSessionTicket(char* buffer) {
if (SteamUser() == NULL) {
return 0;
}
uint32 size{};
SteamNetworkingIdentity identity;
SteamUser()->GetAuthSessionTicket(buffer, 1024, &size, &identity);
return size;
}
To be honest this change was suggested by ChatGPT, I'm pretty clueless when it comes to C++ but after that change compiling works. Unfortunately the inital error of producing an invalid ticket still remains.
Today I tried to use the SDK 157 where compiling fails with
g++ -std=c++11 -o SteamworksPy.so -shared -fPIC SteamworksPy.cpp -l steam_api -L. SteamworksPy.cpp: In function ‘int GetAuthSessionTicket(char*)’: SteamworksPy.cpp:987:38: error: no matching function for call to ‘ISteamUser::GetAuthSessionTicket(char*&, int, uint32*)’ 987 | SteamUser()->GetAuthSessionTicket(buffer, 1024, &size); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~ In file included from sdk/steam/steam_api.h:25, from SteamworksPy.cpp:16: sdk/steam/isteamuser.h:131:29: note: candidate: ‘virtual HAuthTicket ISteamUser::GetAuthSessionTicket(void*, int, uint32*, const SteamNetworkingIdentity*)’ 131 | virtual HAuthTicket GetAuthSessionTicket( void *pTicket, int cbMaxTicket, uint32 *pcbTicket, const SteamNetworkingIdentity *pSteamNetworkingIdentity ) = 0; | ^~~~~~~~~~~~~~~~~~~~ sdk/steam/isteamuser.h:131:29: note: candidate expects 4 arguments, 3 provided make: *** [Makefile:2: makeall] Fehler 1
So I changed the function GetAuthSessionTicket() (https://github.com/philippj/SteamworksPy/blob/master/library/SteamworksPy.cpp#L982) to
// Returns the info needed to obtain a Session Ticket. SW_PY int GetAuthSessionTicket(char* buffer) { if (SteamUser() == NULL) { return 0; } uint32 size{}; SteamNetworkingIdentity identity; SteamUser()->GetAuthSessionTicket(buffer, 1024, &size, &identity); return size; }
To be honest this change was suggested by ChatGPT, I'm pretty clueless when it comes to C++ but after that change compiling works. Unfortunately the inital error of producing an invalid ticket still remains.
This is interesting.
I was actually taking a look at updating this since I am somewhat familiar with the code at this point RE: #91
I will take a look at implementing the change needed for SteamworksPy to be compatible with SDK 157 and onward.
Thanks for taking a look into the code. Hopefully my issue resolves then
I tried to validate a ticket produces by GetAuthSessionTicket(). But Steam says that the ticket is invalid. I used the following code and I'm using Ubuntu 22.04 LTS.
Steam returns
I used the AppID 480 also in the file
steam_appid.txt
. Do I do something wrong?