question

Jérémie Fouché avatar image
Jérémie Fouché asked

Reset Leaderboard with Azure Function ?

Hello,

i would like reset a Leaderboard on PlayFab every monday at 00h30min, after the normal weelkly reseting and prizetable, so i need to do that with Azure Function because we cant with with Legacy CloudScript.

I did what they call the "Tutorial" and I did the HelloWorld Azurefunction with difficulties, i regret they didnt make more documentation, exemple, videos about that, we have just a guy he try to beat an AI in TicTac Toe with no deep explication. :/

So im lost about that :/

Any helps will be very appreciate, Thanks you guys

CloudScriptLeaderboards and Statisticsscheduled tasks
3 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.

Seth Du avatar image Seth Du ♦ commented ·

May I ask are you implementing additional features via Azure Function? Because simply resetting and prize table don't require Azure Function. Feel free to let me know the scenario so that I can provide more help.

0 Likes 0 ·
Jérémie Fouché avatar image Jérémie Fouché Seth Du ♦ commented ·

I make a Racing Game.

This Racing Game have :

- "Track of the Hour" (reset Hourly

- "Track of the Day" (reset Daily

- "Track of the Week" (reset Weekly

Each times theses "Track of the ***" reset : the best TimeScores win via the PrizeTable "Racing Points" to increment this leaderboard :

"Ranking Season" (each season is during 1week, so i need to reset this "Ranking Season" just after the incrementation of the "Track of the Week", for see the final ranking of the week before to reset it and start the next "season"(the next week)

So i need to reset my "Ranking Season" leaderboard every time after the "Track of the Week" leaderboard (who is reset weekly).(so maybe every monday about at 0h30m or 0h45 i dont know)

0 Likes 0 ·
Jérémie Fouché avatar image Jérémie Fouché Seth Du ♦ commented ·

I have find that :

Reset LB from Azure Function

that seems its what i need but its "Failed" when i try that on Scheduled Task

Do i need to fill some arguments ?

0 Likes 0 ·

1 Answer

·
Seth Du avatar image
Seth Du answered

The thread you have referred has been a while. If you have the similar issue, please follow the suggestions below.

  • replace the following line
var context = await FunctionContext<dynamic>.Create(req);

with

FunctionExecutionContext<dynamic> context = JsonConvert.DeserializeObject<FunctionExecutionContext<dynamic>>(await req.ReadAsStringAsync());
10 |1200

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

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.