Hi,
I followed the Getting Started With PlayFab tutorial but I keep getting this error when I try to login with a custom ID:
PlayFabError(ServiceUnavailable, java.net.ConnectException: failed to connect to localhost/127.0.0.1 (port 11289): connect failed: ECONNREFUSED (Connection refused), 400 BadRequest)
- Do I need to link the game to the title ID somehow or to my studio?
- Do I need to define something in the manifest?
- Is this supposed to work in the Unity Editor? I tried on an Android device as well.
This is my code:
using UnityEngine; using PlayFab; using PlayFab.ClientModels; public class PlayFabManager : MonoBehaviour { public string UserId { get; private set; } public bool IsLoggedIn { get { return PlayFabClientAPI.IsClientLoggedIn(); } } protected void Awake() { PlayFabSettings.TitleId = Config.PLAY_FAB_TITLE_ID; } protected void Start() { LoginWithDeviceID(); } private void LoginWithDeviceID() { if (IsLoggedIn) return; var request = new LoginWithCustomIDRequest { TitleId = Config.PLAY_FAB_TITLE_ID, CreateAccount = true, CustomId = "8fa79815413d472d" // Just a temp value for testing. }; PlayFabClientAPI.LoginWithCustomID(request, OnLoggedIn, OnLoginError); } private void OnLoggedIn(LoginResult result) { UserId = result.PlayFabId; } private static void OnLoginError(PlayFabError error) { Debug.LogError("Error logging in player with custom ID:"); Debug.LogError(error); } }
BTW, error.ErrorDetails is null.
Thanks!