Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GetTicketForWebApiResponse_t not working #586

Open
Anadunee opened this issue Dec 4, 2023 · 3 comments
Open

GetTicketForWebApiResponse_t not working #586

Anadunee opened this issue Dec 4, 2023 · 3 comments

Comments

@Anadunee
Copy link

Anadunee commented Dec 4, 2023

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.
}
@BenHamrick
Copy link

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

@Namors14
Copy link

Namors14 commented Feb 7, 2024

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
Copy link

Namors14 commented Feb 7, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants