question

Fender Zealand Selim avatar image
Fender Zealand Selim asked

13 yr old problem with Steam and Playfab

Hello internet, I have been seriously times Infinately haunted by an idea of implementing steam but being in a inappropriate age. To Asses the situation, I have already implemented the Steam and Playfab SDK, the only problem is this: "A Playfab error occurred: /Client/LoginWithSteam: SteamNotEnabledForTitle". This is maybe because I haven't had a AppID and Web API Key from Steam Works, that's because as you probably know I'm 13 years old. Is there anyway to bypass this problem cause I need it quick. Thanks.

If you want to look at my code, here it is:

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

public class SteamGameHandler : MonoBehaviour
{

    public static SteamGameHandler Main;

    public bool initializeSteam = false;

    private bool hasLoggedIn = false;
    
    private void Awake()
    {
        Main = this;
    }

    private void Update()
    {
        if (initializeSteam && SteamManager.Initialized)
        {
            if (!hasLoggedIn)
            {
                LoginWithSteam();
                hasLoggedIn = true;
            }
        }
    }

    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);
        }
        return sb.ToString();
    }
    
    public void LoginWithSteam()
    {
        var request = new LoginWithSteamRequest{CreateAccount = true, SteamTicket = GetSteamAuthTicket()};
        PlayFabClientAPI.LoginWithSteam(request, OnLoginWithSteamSuccess, OnLoginFailure);
        PlayfabNetManager.Main.loginButton.gameObject.SetActive(false);
        PlayfabNetManager.Main.gameObject.SetActive(true);
        PlayfabNetManager.Main.connectText.SetText("Connecting...");
    }
    
    private void UpdateSteamDisplayName(string userName)
    {
        var request = new UpdateUserTitleDisplayNameRequest{DisplayName = userName};
        PlayFabClientAPI.UpdateUserTitleDisplayName(request, OnUpdateDisplayName, OnLoginFailure);
    }
    
    void GetAccountInfo(string ID)
    {
        var request = new GetAccountInfoRequest {PlayFabId = ID};
        PlayFabClientAPI.GetAccountInfo(request, OnGetAccountInfoSuccess, OnLoginFailure);
    }

    private void OnLoginWithSteamSuccess(LoginResult obj)
    {
        GetAccountInfo(obj.PlayFabId);
    }
    
    private void OnGetAccountInfoSuccess(GetAccountInfoResult account)
    {
        MultiplayerManager.main.username = account.AccountInfo.Username;
        UpdateSteamDisplayName(account.AccountInfo.Username);
        if (MultiplayerManager.main.usePlayfabFirst)
        {
            MultiplayerManager.main.Connect(account.AccountInfo.Username);
        }
        PlayfabNetManager.Main.OnLogin.Invoke();
    }

    private void OnUpdateDisplayName(UpdateUserTitleDisplayNameResult obj)
    {
        
    }
    
    private void OnLoginFailure(PlayFabError obj)
    {
        PlayfabNetManager.Main.OnLoginFailure(obj);
    }

    
}
sdks
10 |1200

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

1 Answer

·
Sarah Zhang avatar image
Sarah Zhang answered

For clarification, to integrate the third-party authentication with PlayFab login method, you must be certified by the third-party authentication provider. For your case, Steam requires you own the App ID and API key, otherwise it will not provide you with the Steam login API. And PlayFab cannot help you bypass the Steam authentication.

Currently, you can temporarily use other PlayFab authentication APIs, such as LoginWithEmailAddress, to do the test. You can check the documentation – Account linking quickstart for more information about PlayFab Authentication.

1 comment
10 |1200

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

Fender Zealand Selim avatar image Fender Zealand Selim commented ·

Ok Thanks.

0 Likes 0 ·

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.