question

Byakuya avatar image
Byakuya asked

Statistics didn't update

Hello, I would like to update the statistics of a player via the Cloud. My code is recognized in Azure (retrieving data from the queue), and also runs in the player's PlayStream :

Here is my code :

I would like to understand why these statistics are not updated.

Thanks in advance for your answer.

Player Datadata
rule-playfab.png (29.4 KiB)
server-code.png (33.5 KiB)
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

·
Gosen Gao avatar image
Gosen Gao answered

According to API UpdatePlayerStatistics, the parameter PlayFabId is required, please add it to your code and try again.

Just in case, here is the official Azure documentation -- Create a function triggered by Azure Queue storage, you can have a look.

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

Byakuya avatar image Byakuya commented ·

Thanks, despite adding the PlayFabId and reading the documentation, the statistics do not update.

Here are my different tests:

0 Likes 0 ·
server-code.png (32.6 KiB)
Gosen Gao avatar image Gosen Gao Byakuya commented ·

Sorry for the confusion, the context.PlayerProfile.PlayerId is the PlayFabId. If it doesn't work, could you please check that is there any message added to the queue of your Storage account? You can also follow Debugging CloudScript using Azure Functions with Visual Studio Code to check the Streaming logs of your functions.

1 Like 1 ·
Byakuya avatar image Byakuya Byakuya commented ·

Thank you for your answer, yes I do receive the information in the queue with the non-update statistics :

1 Like 1 ·
inkedqueue.png (377.3 KiB)
Gosen Gao avatar image Gosen Gao Byakuya commented ·

Could you please click upload settings after deploying your project successfully to see if you still have this issue?

0 Likes 0 ·
Byakuya avatar image Byakuya commented ·

Despite this the statistics are not updated, as soon as I login my function in PlayFab updates the statistics (increment of 10) but when I give a value manually in the function using UpdatePlayerStatistics it does not update.

Here is what I get when I do Update settings :

0 Likes 0 ·
settings.png (35.0 KiB)
Gosen Gao avatar image Gosen Gao Byakuya commented ·

Are the messages in the queue dequeued? If not, the Azure Function you created is not connected to this queue. Please check the configuration of your Function APP in Azure portal and make sure the Value of Key { {Connection}}(the one in your code which has been hidden) matches the connection string of your storage account.

1 Like 1 ·
Byakuya avatar image Byakuya Gosen Gao commented ·

This unlocked me thank you. But I have one last problem. When I connect in Unity the data is stored in the queue : ( using the player_logged_in rule )

The Playfab function is now running fine. But nothing is updated. On the other hand, when I manually activate this function with F5. The function in question :

The data is updated. I then used ExecuteFunction, but it does not work, could you please tell me how to launch this function directly in a Unity script for example and also, if with Queue trigger it is possible to pass parameters.

Thanks in advance

0 Likes 0 ·
1.png (14.5 KiB)
2.png (59.4 KiB)
Show more comments

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.