Giving the Limited Grant #
There are several circumstances where players might be granted a one-time reward:
- new player bonus
- returning player incentives
- seasonal or event reward (such as logging in at least once during an event)
For demonstration purposes, we’ll be manually simulating service calls with Postman. This guide currently covers a basic reward scenario where the player is granted items shortly after logging in.
Start Pragma Engine #
Run Pragma Engine via one of the following methods.
make runto start the platform. Run this in a terminal with
platformas the working directory.
From the IntelliJ toolbar in the upper right, ensure
MainKt - LocalConfigured is selected, then click the play button.
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.
Grant the reward #
- Log in using Postman by sending
PragmaDev ➨ Public ➨ Player - AuthenticateOrCreateV2.
- Verify the player’s inventory is empty with
PragmaDev ➨ Game ➨ RPC - Player ➨ Inventory ➨ getInventoryV2.
PragmaDev ➨ Game ➨ RPC - Player ➨ GameData ➨ getLoginDataV3which will process limited grants. Any limited grants issued can be seen in the body of the response under
response.payload.loginData.issuedLimitedGrantTrackingIds. You should see the list contains
StarterPack, but does not contain
NewYear2023Grantas the window for this grant has already passed. This endpoint will also fetch the player’s full inventory. You should see 50
PragmaDev ➨ Game ➨ RPC - Player ➨ GameData ➨ getLoginDataV3. Confirm that
loginData.issuedLimitedGrantTrackingIdsis empty which indicates no limited grants were issued on this login. You can also confirm the user still has 50