alexa-games / skills-gameon-sdk-js

The Skills GameOn SDK (Beta) is a Node.js package that makes creating leaderboards and competitions, powered by Amazon GameOn, easier for Alexa Skill developers.
https://skills-gameon-sdk.github.io
Apache License 2.0
19 stars 11 forks source link

Question: How to support Monthly Leaderboards #43

Closed rmtuckerphx closed 4 years ago

rmtuckerphx commented 4 years ago

Question

What would the code in LaunchRequestHandler look like if we wanted to support monthly leaderboards?

There are comments in the code for enterMatch that references getTournamentsByTitle and getMatchListForPlayer.

The following functions use matchId:

The following function uses tournamentId:

anfazio commented 4 years ago

Good question - instead of calling newPlayer you would look up the available tournaments using getMatchListForPlayer and then call enterMatch with the tournament ID for your monthly tournament. This should be fairly simple if you're only running a single monthly tournament at a time, but you might need to add some logic to select the right one if you're running more than one tournament at a time.