question

sammy89 avatar image
sammy89 asked

get faults on test

I used your example script

using PlayFab;
using PlayFab.ClientModels;
using UnityEngine;

public class PlayFabLogin : MonoBehaviour
{
    public void Start()
    {
        //Note: Setting title Id here can be skipped if you have set the value in Editor Extensions already.
        if (string.IsNullOrEmpty(PlayFabSettings.TitleId))
        {
            PlayFabSettings.TitleId = "144F3"; // Please change this value to your own titleId from PlayFab Game Manager
        }
        var request = new LoginWithCustomIDRequest { CustomId = "GettingStartedGuide", CreateAccount = true};
        PlayFabClientAPI.LoginWithCustomID(request, OnLoginSuccess, OnLoginFailure);
    }
    private void OnLoginSuccess(LoginResult result)
    {
        Debug.Log("Congratulations, you made your first successful API call!");
    }
    private void OnLoginFailure(PlayFabError error)
    {
        Debug.LogWarning("Something went wrong with your first API call.  :(");
        Debug.LogError("Here's some debug information:");
        Debug.LogError(error.GenerateErrorReport());
    }
}

and got these problems:

/Client/LoginWithCustomID: HTTP/1.1 418 I'm a teapot UnityEngine.Debug:LogError (object) PlayFabLogin:OnLoginFailure (PlayFab.PlayFabError) (at Assets/scripts/PlayFabLogin.cs:25) PlayFab.Internal.PlayFabUnityHttp:OnError (string,PlayFab.Internal.CallRequestContainer) (at Assets/PlayFabSDK/Shared/Internal/PlayFabHttp/PlayFabUnityHttp.cs:235) PlayFab.Internal.PlayFabUnityHttp/<Post>d__12:MoveNext () (at Assets/PlayFabSDK/Shared/Internal/PlayFabHttp/PlayFabUnityHttp.cs:149) UnityEngine.SetupCoroutine:InvokeMoveNext (System.Collections.IEnumerator,intptr)

Here's some debug information: UnityEngine.Debug:LogError (object) PlayFabLogin:OnLoginFailure (PlayFab.PlayFabError) (at Assets/scripts/PlayFabLogin.cs:24) PlayFab.Internal.PlayFabUnityHttp:OnError (string,PlayFab.Internal.CallRequestContainer) (at Assets/PlayFabSDK/Shared/Internal/PlayFabHttp/PlayFabUnityHttp.cs:235) PlayFab.Internal.PlayFabUnityHttp/<Post>d__12:MoveNext () (at Assets/PlayFabSDK/Shared/Internal/PlayFabHttp/PlayFabUnityHttp.cs:149) UnityEngine.SetupCoroutine:InvokeMoveNext (System.Collections.IEnumerator,intptr)

apistest
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

We tried to change the TitleId in the sample code to our real TitleId and test this script in our test project, it can work fine. There should be no common error in our sample code. And, for this example code, the error messages of the API call of should be something like this.

/Client/LoginWithCustomID: User not found
UnityEngine.Debug:LogError (object)
PlayFabLogin:OnLoginFailure (PlayFab.PlayFabError) (at Assets/PlayFabLogin.cs:21)
PlayFab.Internal.PlayFabUnityHttp:OnResponse (string,PlayFab.Internal.CallRequestContainer) (at Assets/PlayFabSDK/Shared/Internal/PlayFabHttp/PlayFabUnityHttp.cs:218)
PlayFab.Internal.PlayFabUnityHttp/<Post>d__12:MoveNext () (at Assets/PlayFabSDK/Shared/Internal/PlayFabHttp/PlayFabUnityHttp.cs:157)
UnityEngine.SetupCoroutine:InvokeMoveNext (System.Collections.IEnumerator,intptr)

For clarification, there should be meaningful error messages after the “/Client/LoginWithCustomID:”, such as “User not found”. But in you log, the error message was replaced with your custom message - “I'm a teapot”. So we can’t locate the error according to the error messages you provided. Could you please check if the original PlayFab Unity SDK you have been modified? Or try to create a new Unity Project, import the PlayFab Unity SDK, then try the sample code again?

4 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.

sammy89 avatar image sammy89 commented ·

just created a new project and tried from fresh. got all the same errors. "i'm a teapot" this is really weird.

0 Likes 0 ·
Sarah Zhang avatar image Sarah Zhang sammy89 commented ·

@sammy89

I can't edit your comment, deleted it instead. For your original question, have you tried to download the PlayFab Unity SDK from our official GitHub page - GitHub - PlayFab/UnitySDK: Unity C# SDKs for PlayFab again, and try to use it in your project?

0 Likes 0 ·
sammy89 avatar image sammy89 Sarah Zhang commented ·

thanks. I got it working in the end. It was a problem on my end.

0 Likes 0 ·
sammy89 avatar image sammy89 commented ·

@sarahzhang

thanks. I got it working in the end. It was a problem on my end.

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.