Steamworks.NET icon indicating copy to clipboard operation
Steamworks.NET copied to clipboard

GetTicketForWebApiResponse_t not working

Open Anadunee opened this issue 2 years ago • 7 comments

I copy and paste exactly same code from the example ( https://docs.unity.com/ugs/en-us/manual/authentication/manual/platform-signin-steam ). OnAuthCallback function its never firing up. Seems like GetTicketForWebApiResponse_t its not working.

Callback<GetTicketForWebApiResponse_t> m_AuthTicketForWebApiResponseCallback;
string m_SessionTicket;
string identity = "unityauthenticationservice"

void SignInWithSteam()
{
    // It's not necessary to add event handlers if they are 
    // already hooked up.
    // Callback.Create return value must be assigned to a 
    // member variable to prevent the GC from cleaning it up.
    // Create the callback to receive events when the session ticket
    // is ready to use in the web API.
    // See GetAuthSessionTicket document for details.
    m_AuthTicketForWebApiResponseCallback = Callback<GetTicketForWebApiResponse_t>.Create(OnAuthCallback);

    SteamUser.GetAuthTicketForWebApi(identity);
}

void OnAuthCallback(GetTicketForWebApiResponse_t callback)
{
    m_SessionTicket = BitConverter.ToString(callback.m_rgubTicket).Replace("-", string.Empty);
    m_AuthTicketForWebApiResponseCallback.Dispose();
    m_AuthTicketForWebApiResponseCallback = null;
    Debug.Log("Steam Login success. Session Ticket: " + m_SessionTicket);
    // Call Unity Authentication SDK to sign in or link with Steam, displayed in the following examples, using the same identity string and the m_SessionTicket.
}

Anadunee avatar Dec 04 '23 13:12 Anadunee

I am having this exact same problem, any updates? The callback just fails silently.

BenHamrick avatar Jan 21 '24 22:01 BenHamrick

Having the same issue. I can't receive a callback response for the next code: Steamworks.Net v.20.2.0

  public class SteamConnection : MonoBehaviour
  {
      protected Callback<GetTicketForWebApiResponse_t> m_CallbackGetTicketForWebApiResponse;
  
      private void OnEnable()
      {
          if (SteamManager.Initialized)
          {
              Debug.Log("OnEnable.SteamInitialized");
  
              m_CallbackGetTicketForWebApiResponse = Callback<GetTicketForWebApiResponse_t>.Create(OnGetTicketForWebApiResponse);
  
              SteamUser.GetAuthTicketForWebApi("test_app");
  
              Debug.Log("OnEnable.OnGetTicketForWebApiResponse-Start");
          }
      }
  
      private void OnGetTicketForWebApiResponse(GetTicketForWebApiResponse_t pResponse)
      {
          Debug.Log("OnGetTicketForWebApiResponse Called");
      }
  }

Namors14 avatar Feb 07 '24 09:02 Namors14

Tried another Steam account and everything works fine. Looks like I was steam-bunned only for this request. A reason can be ddos from the Update function that I made during some test runs.

Namors14 avatar Feb 07 '24 15:02 Namors14