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 make run
to start Pragma Engine. Run this in a terminal with platform
as the working directory.
- Alternatively, Pragma Engine can be run from IntelliJ. From the IntelliJ toolbar in the upper right, ensure
MainKt - LocalConfigured
is selected, then click the play button. - If not, click Add Configuration…. 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 ➨ Social ➨ Player ➨ Account ➨ authenticateOrCreateV2
. - Send
PragmaDev ➨ Game ➨ RPC - Player ➨ Inventory ➨ getInventoryV2
to confirm that the player has an empty inventory. - Send
PragmaDev ➨ Game ➨ RPC - Player ➨ GameData ➨ getLoginDataV1
to perform the limited grant. The items granted can be seen in the body of the response. - Resend
PragmaDev ➨ Game ➨ RPC - Player ➨ Inventory ➨ getInventoryV2
and confirm that the player was granted alaserSword
and 50coins
. Also note the presence of aStarterPack
, which is used to prevent the player from receiving more limited grants than they are entitled to. - Resend
PragmaDev ➨ Game ➨ RPC - Player ➨ GameData ➨ getLoginDataV1
then resendPragmaDev ➨ Game ➨ RPC - Player ➨ Inventory ➨ getInventoryV2
. Confirm that the player did not receive an additionallaserSword
or any additionalcoins
.