question

ichigomashimaro77 avatar image
ichigomashimaro77 asked

Login Succeeding but Result Null?

I have a very strange issue in Unity, it's especially strange because i didn't change anything in the code, this issue just randomly started occuring? First it occurred and i realized it was because playfab editor extensions had forcefully logged itself out. I fixed that, it started working again... then I tried it the next day, and it no longer worked. But Playfab editor extensions is logged in...

I've tried reinstalling Playfab from scratch, logging out and back in, updating to the latest version(both the SDK and editor extensions) but it's always returning null...

Here's my code, the print is printing off "Null" and then there's a null reference on the debug.log right after,

         public void OnLoginSuccessful(CBSLoginResult result)
         {
             print(result.Result);
             Debug.Log($"You have logged in into Playfab, playfab id : {result.Result.PlayFabId}");
    
             m_playfabId = result.Result.PlayFabId;
             Global.UserName = result.Result.InfoResultPayload.AccountInfo.Username;
    
             string customId = result.Result.InfoResultPayload.AccountInfo.CustomIdInfo?.CustomId;
             Global.IsGuest = string.IsNullOrEmpty(customId);
    
             if(!Global.IsGuest)
             {
                 Global.AccountWalletAddress = customId;
             }
    
             GetPlayerInfo(m_playfabId);
    
             Global.Save(Global.Const.AUTO_LOGIN, m_autoLogin ? 1 : 0);
         }

And again, this code always worked perfectly fine, i never even touched the script, it just randomly stopped working... It is logging in, this is the login success callback..

Any help would be appreciated!

Player DataAuthentication
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

·
Neils Shi avatar image
Neils Shi answered

In general, the PlayFab Editor Extensions don't cause the login API to return null. In fact, you can install the SDK without using the PlayFab Editor Extensions, please refer to Download and install the SDK only for more detail. Since the login success callback of LoginWithCustomID usually returns the object of type “LoginResult”. However, in the code you provided, the callback function OnLoginSuccessful receives an object of type “CBSLoginResult”, could you provide us with more details about how you complete it?

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.

ichigomashimaro77 avatar image ichigomashimaro77 commented ·

You mean how I'm calling it? I'm using an external plugin, CBS, which basically just logs in the old fashioned way, like
PlayFabClientAPI.LoginWithCustomID(Global.AccountWalletAddress, OnLoginWithWalletSuccessful,OnLoginError); As i said, this was working just fine up until recently, i never changed anything related to the login code.

Edit: I just tried it without the editor extensions and it did the same. Edit2: I also tried using playfab's login system just to test it out, this time the result wasnt null but this bit was returning null

  Global.UserName = result.Result.InfoResultPayload.AccountInfo.Username
0 Likes 0 ·
ichigomashimaro77 avatar image ichigomashimaro77 ichigomashimaro77 commented ·

Ah, my bad, the issue was Azure, which the plugin runs a lot of it's code through, had run out of it's free trial. Pretty annoying that this plugin does it this way, also annoying because i'm doing this for a client and he's paying for it, i expected he would have renewed it lol

Well, this thread probably won't be help to anyone, but i hope someone comes across it lol

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.