Testing the Battlepass #

In this section, we’ll test out the battlepass by checking a player’s on-login grants, and run through a basic match end scenario where the XP gained from a match advances a battlepass and grants the player their rewards.


Start Pragma Engine #

Run Pragma Engine via one of the following methods.

Running via Make
Run make run to start the platform. Run this in a terminal with platform as the working directory.
Running in IntelliJ

From the IntelliJ toolbar in the upper right, ensure MainKt - LocalConfigured is selected, then click the play button.

If MainKt - LocalConfigured isn’t available, you will need to configure it. In the IntelliJ toolbar, click the dropdown next to the run button, then click Edit Configurations…. In the Run/Debug Configurations window that appears, expand Kotlin in the left hand side, then select MainKt - LocalConfigured. Click OK. Click the play button in the IntelliJ toolbar to start Pragma Engine.

Once the engine has started successfully, it prints the message [main] INFO main - Pragma server startup complete.

Simulate a standard match end battlepass update #

  1. Open Postman.
  2. Log in by sending PragmaDev ➨ Game ➨ RPC - Player ➨ Inventory ➨ getInventoryV2.
  3. Verify the player’s inventory doesn’t contain this battlepass yet with PragmaDev ➨ Game ➨ RPC - Player ➨ Inventory ➨ getInventoryV2.
  4. Send PragmaDev ➨ Game ➨ RPC - Player ➨ GameData ➨ getLoginDataV3 to process limited grants.
    • Any limited grants issued can be seen in the body of the response under issuedLimitedGrantTrackerIds. You should see the list contains battlepass_tracker. This endpoint also fetches the player’s full inventory, which should include the battlepass.
  5. Copy the instanceId for the battlepass and save it.
  6. Open PragmaDevGameRPC - PartnerMatchManagementMatchEndV4 and edit the body with the following payload. Swap the “[INPUT ID HERE]” field with the battlepass instanceId from step 5.
    • This step sends a completed match where the player gets a server item update from the plugin to complete an XP update of 100.
{
    "requestId": 1,
    "type": "MatchLifecycleRpc.MatchEndV4Request",
    "payload": {
        "matchId" : "51a7f830-e84c-46a8-ad14-d83d99d045c3",
        "matchEnd": {
            "matchId" : "51a7f830-e84c-46a8-ad14-d83d99d045c3",
            "playerMatchEnds": [
                {
                    "playerId": "{{test01PlayerId}}",
                    "serverItemUpdates":  [
                        {"instanced": {
                                "instanceId": "[INPUT ID HERE]",
                                "updateEntryId": "battlepass-update",
                                "requestExt": {
                                    "xpUpdate":{
                                        "amount": 100
                                    }
                                } 
                            }
                        }
                    ]
                }
            ]
        }
    }
}
  1. Send PragmaDev ➨ Game ➨ RPC - Player ➨ Inventory ➨ getInventoryV2 to get the player’s inventory and confirm the player has now reached level 1 on their battlepass.
    • The following table depicts a type of progression you might see in a game. Each row is a completed match where the player earns experience towards their battlepass. As shown in the last column, rewards are granted upon achieving a new battlepass level. For this specific example, changing the amount in XP_Update would result in the corresponding matchends.
      XP_UPDATETotal XP earnedBattlepass.levelBattlepass.xpRewards
      0000N
      5050050N
      5010010Y
      110111N
      992001100N
      242241124N
      122520Y
      987896522520N