Implements a simple leaderboard service, that will allow you to submit scores and retrieve a leaderboard +/-5 positions around specific player with global ranking.
The following requirements where considered while creating this scenario:
- Game client should be able to submit game scores using a REST API
- Game client should be able to retrieve a leaderboard using a REST API
- Demonstrate usage of Azure Functions that communicates with Cosmos DB
In order to follow along in this scenario the following prerequisite need to be fulfilled:
- You need to have access to a Microsoft Azure Subscription. If you don't have access you can sign up for an Azure Subscription at https://azure.com
- Deployment of Nether Base Architecture should be done. If you haven't deployed the Base Architecture, follow the instructions at Deploy the Base Architecture
- You need to remember or re-visit the instructions described in Deploy Scenario
- Installed the required SDK/Tools for the game client development, for example: Unity
When this scenario is deployed you'll have added one Azure function according to the following.
Resource | Verb | Parameters | Description |
---|---|---|---|
/api/score | POST | Body Application/Json | Posts a score to the leaderboard |
/api/leaderboard | GET | {leaderboard}/{playerId} | Retrieves the leaderboard |
Please refer to the instructions in Deploy a Nether Scenario for more detailed instructions on how to find your Kudu PowerShell interface and how deployment works.
From the Kudu PowerShell interface in your Azure Function App, execute the following command:
./deploy.ps1 -Group leaderboards -Scenario around-me
Wait for the deployment to finish before continuing.
To be provided
Even if the documentation is not yet fully provided, we do have a sample implementation and Client Side SDK developed for Unity that you could use as a starting poing. Please have a look at the implementation here.