question

mattdavidson2017 avatar image
mattdavidson2017 asked

PlayFab API is not being called

Can someone tell me if I am going crazy? My code gets to this point where the breakpoint is, but the call is not executed. Neither of the callback functions are ever reached. Any ideas?

10 |1200

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

Sarah Zhang avatar image
Sarah Zhang answered

The execution of your code would pause at the breakpoint before the code on that line is executed. In your case, the API ValidateEntityToken hasn't been called because the statement in red hasn't yet executed. Please navigate to the docs -- Use breakpoints in the Visual Studio debugger to learn more about the use of breakpoints.

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.

mattdavidson2017 avatar image mattdavidson2017 commented ·

I put the breakpoint there because I wanted to see exactly what was happening. I wasn't being clear; this is server side code and the I was unaware ValidateEntityToken had to be called by a logged-in user. The code was throwing a runtime error that was not showing up in the Unity Editor, so ValidateEntityToken was never called, and therefore neither of the callback functions were called.

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

Thanks for clarifying. If so, you can try to call ValidateEntityToken API after you have called GetEntityToken API.

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

There may be something wrong with my environemnt. No PlayFab calls are working. When I set breakpoints in PlayFab API source code, they are not hit and the breakpoints have this warning message in VS: "The breakpoint will not currently be hit. Unable to find a corresponding location".

Surrounding a playfab call in a try-catch catches the error "System.NullReferenceException: Object reference not set to an instance of an object" at line 22.

I have all of the PlayFabSdk and I can drill into PlayFab API classes, so I don't know why I am getting these errors. Any ideas?

0 Likes 0 ·
playfab.png (14.3 KiB)
Show more comments
mattdavidson2017 avatar image
mattdavidson2017 answered

Couldn't reply to your other comment, but after removing the "()", I still get the same error. I am very confused. I updated unity to it's latest version and none of the PlayFab directives could be found even though I had the SDK in my Assets folder. After downgrading, it can find the directives but I still get the above error. I'm wondering if in the older version of Unity I was using, the PlayFab dependencies couldn't be found but it wasn't indicated anywhere. It seems to be the case in the newer version of Unity I tried. After creating a new project and importing PlayFabSDK again, it still cannot be found in Visual Studio. No idea where to go from here.

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.

Sarah Zhang avatar image Sarah Zhang commented ·

Could you please try to reinstall the development environment, such as Visual Studio or OS, for troubleshooting?

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

PlayFab SDK has been verified to be usable in the latest Unity version with several Visual Studio versions. Such questions about configurations of development environments, please navigate to the Unity and Visual Studio's forum for professional supports.

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.