question

squigglyo avatar image
squigglyo asked

Help with Steam

I am getting an error with my Steam Logins that I wasnt getting before (pretty sure I wasnt).

Failed: /Client/LoginWithSteam: Steam WebAPI error: 102 (Ticket for other app)

I have looked over every single post about this error and nothing has worked for me.

In the Addons page, my app id is set to the same number it shows up with on the Home Page of Steamworks in the unreleased apps: Game Name (gameID)

The Steam Web API I got by going to

Users & Permissions -> Manage Groups -> Everyone (WebAPI) -> Generate API

I cant remember but im pretty sure that Everyone group was there when I started.

Brendan, if your the one who sees this, I saw your answers on the other questions, and I have added you as a User to my Steamworks stuff.

My game is here is CFC5

Here is the code im using, its mostly copy/paste from the examples.

using System;
using System.Text;
using PlayFab;
using PlayFab.ClientModels;
using Steamworks;
using UnityEngine;


public class SteamAPI_GS : MonoBehaviour
{
    //This method returns
    public string GetSteamAuthTicket()
    {
        byte[] ticketBlob = new byte[1024];
        uint ticketSize;


        // Retrieve ticket; hTicket should be a field in the class so you can use it to cancel the ticket later
        // When you pass an object, the object can be modified by the callee. This function modifies the byte array you've passed to it.
        HAuthTicket hTicket = SteamUser.GetAuthSessionTicket(ticketBlob, ticketBlob.Length, out ticketSize);


        // Resize the buffer to actual length
        Array.Resize(ref ticketBlob, (int)ticketSize);


        // Convert bytes to string
        StringBuilder sb = new StringBuilder();
        foreach (byte b in ticketBlob)
        {
            sb.AppendFormat("{0:x2}", b);
        }


        Debug.Log(sb.ToString());
        return sb.ToString();
    }


    public void OnGUI()
    {
        if (GUILayout.Button("Log In"))
        {
            if (SteamManager.Initialized)
            {
                // Execute PlayFab API call to log in with steam ticket
                PlayFabClientAPI.LoginWithSteam(new LoginWithSteamRequest
                {
                    CreateAccount = true,
                    SteamTicket = GetSteamAuthTicket()
                }, OnComplete, OnFailed);
            }
        }
    }


    // Utility callbacks to log the result
    private void OnComplete(LoginResult obj)
    {
        Debug.Log("Success!");
    }


    private void OnFailed(PlayFabError error)
    {
        Debug.Log("Failed: " + error.GenerateErrorReport());
    }


    public void PurchaseTest()
    {
    }
}
2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

JayZuo avatar image JayZuo ♦ commented ·

So have you check this answer:https://community.playfab.com/answers/3796/view.html? Did you tried to remove and re-created your WebAPI Key, and update the PlayFab setting for your title?

0 Likes 0 ·
squigglyo avatar image squigglyo JayZuo ♦ commented ·

Yes, tried this multiple times.

0 Likes 0 ·
brendan avatar image
brendan answered

One thing to be aware of is that every time I've seen this, when you create the new Web API Key, there's a period of time that needs to pass before it's actually configured in Steam. I've yet to find any docs on their site detailing this, but I believe it's at least an hour. And it's not clear why sometimes the Web API Key works, and sometimes it doesn't. What I would do, to be safe, is (since obviously some time will have passed since you created the current one) if it's not working now, delete the one that's there, create a new one, and then don't try making any calls against it until you've let an hour pass. I'm starting to think that trying to use it before it's ready might be what's causing the issue their service.

3 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

squigglyo avatar image squigglyo commented ·

Ok, deleted the key, made a new one, updated Playfab. Will try and connect in an hour or so and see how it goes.

0 Likes 0 ·
squigglyo avatar image squigglyo squigglyo commented ·

My power went out, so had a gap of about 8 hours. Just went on now and everything is working. Looks like you were correct, time is a factor in some way.

Not sure why it broke the first time though, it worked just fine and the next night broke. Unless it happens again though, doesnt matter, could have been something I forgot I did.

Thanks

0 Likes 0 ·
brendan avatar image brendan commented ·

Happy that worked for you, @Squigglyo!

For those running into this later, I've just found out about one additional thing that could be impacting folks:

If you're using steamworks.net, the steam_appid.txt in the project isn't necessarily the same one that Steam is using. It uses the one in the root project which you won't see in your Unity project. In that case, you'll want to update the App ID to that of the one in the root.

0 Likes 0 ·
squigglyo avatar image
squigglyo answered

So this same problem happened with a new project.

After several hours of trying different things, strangely something worked.

I closed Unity and reopened the project. As simple as it seems, this wasnt something that occured to me since I assumed of this problem was on the Cloud/Steam side of things.

So restarting the Project worked. And in my last project, my power went off and then everything was fixed as well...

So perhaps, the main problem, if you've done everything right, is just Unity needing a restart once you've set up the Steam Web Key on PlayFab.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.