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); } }