Implementing Cooking #
In this section, we’ll cook a muffin using the previously built plugins.
Start Pragma Engine #
Run Pragma Engine via one of the following methods.
Once the engine has started successfully, it prints the message [main] INFO main - Pragma server startup complete
.
Cook the muffin with Postman #
- Open Postman, then send
PragmaDev ➨ Public ➨ GetInQueuev1
to enter the login queue. - Send
authenticateOrCreateV2
for bothplayer
andoperator
.
Player: PragmaDev ➨ Public ➨ Player - AuthenticateOrCreateV2
Operator: PragmaDev ➨ Public ➨ Operator - AuthenticateOrCreateV2
We will be sending player and operator service calls, hence the need to log into Pragma Engine with both roles.
Navigate to
PragmaDev [date] ➨ Game ➨ RPC - Player ➨ Inventory ➨ Crafting Scenarios
and double clickCooking A Muffin
.Click the Run button to set up the muffin cooking steps.
Check the Save responses box, then click
Run PragmaDev [date]
. The following processes will run:- operator: Grant Required Ingredients—obtain the required ingredients to craft
- We use
GrantItemsOperatorV1Request
to give the player the required ingredients to cook a muffin.
- We use
- test01: Set Expected Muffins—automated test setup
- Postman sends a
GetInventoryV2Request
and stores the result to validate the results of the remaining crafting steps.
- Postman sends a
- test01: craftV1 - start baking a muffin—exchange ingredients for
incompletePlainMuffin
- test01: craftV1 - not finished wait 3 seconds—attempt to redeem
incompletePlainMuffin
forplainMuffin
before cooking has finished- In
CraftingEntries.json
, we specified a 3 second cook time for ourplainMuffinRecipe
. We attempt to redeem ourincompletePlainMuffin
prior to its completion to ensure Pragma rejects our cooking attempt.
- In
- test01: craftV1 - finish baking muffin—successfully redeem
incompletePlainMuffin
forplainMuffin
- We again redeem our
incompletePlainMuffin
after 3 seconds and receive our completedplainMuffin
.
- We again redeem our
- operator: Grant Required Ingredients—obtain the required ingredients to craft
If all tests passed, you successfully implemented cooking as a plugin. More information can be found by looking at the request and response bodies of each service call.