Testing the Battlepass #

In this section we’ll test out the battlepass by checking a player’s on-login grants, simulating the player progressing on their battlepass, and granting 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 player progressing through the battlepass #

  1. Open Postman.
  2. Log in as a player.
    • Send the PragmaDev ➨ Scenario Logins ➨ login with test01 request.
  3. Verify the player’s inventory is empty.
    • Send the PragmaDev ➨ Game ➨ RPC - Player ➨ Inventory ➨ GetInventoryV2 request.
    • Look at the body of the response to make sure there are no instanced or stackable items.
  4. Grant the player the battlepass.
    • Send the PragmaDev ➨ Game ➨ RPC - Player ➨ GameData ➨ GetLoginDataV3 request.
    • Any limited grants issued can be seen in the body of the response under issuedLimitedGrantTrackerIds. You should see the list contains battlepass_tracker.
  5. Access the battlepass instanceId and save it for later.
    • Send the PragmaDev ➨ Game ➨ RPC - Player ➨ Inventory ➨ GetInventoryV2 request.
    • Look for the battlepass in the body of the response and copy the instanceId.
  6. Simulate the player progressing on the battlepass.
    • Open the PragmaDev ➨ Game ➨ RPC - Partner ➨ Inventory ➨ UpdateItemsPartnerV2 request.
    • Copy and paste the following JSON into the body of the request.
    • Swap the “[INPUT ID HERE]” with the battlepass instanceId from step 5.
    • Send the request that simulates the player gaining 100 XP towards their battlepass.
{
  "requestId": 1,
  "type": "InventoryRpc.UpdateItemsPartnerV2Request",
  "payload": {
    "playerId": "{{test01PlayerId}}",
    "updates": [
      {
        "instanced": {
          "instanceId": "[INPUT ID HERE]",
          "updateEntryId": "battlepass-update",
          "requestExt": {
            "xpUpdate": {
              "amount": 100
            }
          }
        }
      }
    ]
  }
}
  1. Verify the player’s inventory shows they reached level 1 on their battlepass.
    • Send the PragmaDev ➨ Game ➨ RPC - Player ➨ Inventory ➨ GetInventoryV2 request.
    • Look at the body of the response to 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 game instance where the player earns experience towards their battlepass. As shown in the last column, rewards are granted upon achieving a new battlepass level.
XP_UPDATETotal XP earnedBattlepass.levelBattlepass.xpRewards
0000N
5050050N
5010010Y
110111N
992001100N
242241124N
122520Y
987896522520N