Could someone who understands the C++ <-> Lua API explain what kind of arguments are required? I am attempting to get the current auth session ticket so I can link the player’s Steam account with their PlayFab account.
The auto generated bindings are terrible to be honest. The Steamworks API is not meant to be used in any other way than from C++ and attempts to automatically create bindings from the API definition will be messy.
The first argument should be a Lua buffer. Created using buffer.create(). Stream name doesn’t matter.
Second argument should be the length of the buffer.
Third argument can be 0.
The buffer will contain the auth ticket and the function will return a handle to the auth ticket and the length of the ticket.
As per the documentation you need to call CancelAuthTicket with the handle once you are done with it.
session_ticket_buffer = buffer.create(128, { { name = "default", type = buffer.VALUE_TYPE_UINT8, count = 1 } })
steamworks.user_get_auth_session_ticket(session_ticket_buffer, 128, 0)
I don’t think I have those arguments correct… Printing out the contents of the buffer with buffer.get_bytes() a few seconds later prints an empty string to the console, and the auth ticket handle returned by user_get_auth_session_ticket() is 0, which implies an error.