Hi,
I'm trying to validate a user ticket via my server. I have updated to 1.10.0-SNAPSHOT to use the getAuthTicketForWebApi method, and authTicketHandle.isValid() is true. But the onGetTicketForWebApi method in my SteamUserCallback is never triggered.
According to the steamworks doc https://partner.steamgames.com/doc/api/ISteamUser#GetAuthTicketForWebApi the call should trigger the GetTicketForWebApiResponse callback, but it doesn't do that in my case, and therefore I cannot read the ticketData.
Am I missing something? Any help would be appreciated.
This a minimal code example:
try {
SteamAPI.loadLibraries(SteamLibraryLoaderGdx())
if (!SteamAPI.init()) {
println("Steamworks initialization error, e.g. Steam client not running")
} else {
println("Steamworks initialized")
val user = SteamUser(object : SteamUserCallback {
override fun onGetTicketForWebApi(authTicket: SteamAuthTicket?, result: SteamResult?, ticketData: ByteArray?) {
println("onGetTicketForWebApi")
}
})
println("requesting api ticket")
val authTicketForWebApi = user.getAuthTicketForWebApi("demo-identity")
println("requested api ticket, isValid: ${authTicketForWebApi.isValid}")
}
} catch (e: SteamException) {
println("Error extracting or loading native steamworks libraries")
}
Okay my bad, for the callbacks to trigger SteamAPI.runCallbacks() must be invoked periodically. I had this call only in my game loop but not on my menu. Thanks @code-disaster for the library and the quick help.
Hi, I'm trying to validate a user ticket via my server. I have updated to
1.10.0-SNAPSHOT
to use thegetAuthTicketForWebApi
method, andauthTicketHandle.isValid()
is true. But theonGetTicketForWebApi
method in mySteamUserCallback
is never triggered. According to the steamworks doc https://partner.steamgames.com/doc/api/ISteamUser#GetAuthTicketForWebApi the call should trigger theGetTicketForWebApiResponse
callback, but it doesn't do that in my case, and therefore I cannot read the ticketData. Am I missing something? Any help would be appreciated.This a minimal code example:
Output: