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

Feature: ensureTorunamentEntered option in submitScoreForPlayer #12

Closed planadecu closed 5 years ago

planadecu commented 5 years ago

It would be nice that the submitScoreForPlayerfunction would support the flag ensureTorunamentEntered to automatically enter a tournament if the user has not. This feature already exists for a match as ensureMatchEntered but is not so useful if the user is not in a tournament.

Example usage:

    await client.submitScoreForPlayer({ 
        matchId: GAMEON.matchId,
        submitScoreRequest: { score },
        player: alexaPlayer,
        ensureMatchEntered: true,
        ensureTournamentEntered: true,
    });
superkew commented 5 years ago

You would need to specify the tournamentId in the payload in the same way the matchId is submitted.

Please feel free to submit a PR for this. https://github.com/alexa-games/skills-gameon-sdk-js/blob/develop/CONTRIBUTING.md