Skip to main content

Pragma logo

Pragma can be configured to use IDEM's matchmaking, instead of its own. For this purpose we provide a plugin called IdemIntegrator. It manages all necessary interaction necessary between Pragma and IDEM.

Pragma architecture

To help you setup, we provide the following resources:

  1. Integration Guide
  2. The below integration guide, to walk you step by step through integration and testing.
  3. Integration
  4. The code for the plugin, that will run on Pragma and connect to IDEM in the background. Written in Kotlin. Git: idem-matchmaking/pragma-integration
  5. Example Pragma Project
  6. For testing purposes, an example Pragma Project is provided. Git: pragmaplatform/idem-idem-pragma-engine (access controlled)

Integration Guide

Before running the following steps, make sure you have an Idem account (register here).

Add the client library to the ext module:

        <dependency>
<groupId>idemmatchmaking</groupId>
<artifactId>client</artifactId>
<version>0.1.0</version>
</dependency>

Pragma Configuration

Users should create a class to hold IDEM-related configuration and include this class in both MatchmakingPluginConfig and GameInstancePluginConfig.

Pragma Proto Changes

We recommend adding two new fields to ExtGameInstance to associate an IDEM match with a Pragma instance:

message ExtGameInstance {
string idem_match_id = 10;
string idem_mode = 11;
}

Using IdemIntegrator

Matchmaking Plugin

In your MatchmakingPlugin, create an instance of IdemIntegrator.

In the matchParties function, use anchor.takePartiesFrom(other, other.parties) to move all parties into a single Pragma matchable object. This ensures the complete party list is available in the endOfLoop function.

In endOfLoop, convert Pragma parties in the anchor to a list of objects that implement idemmatchmaking.integration.Party, then call the IdemIntegrator::refreshParties method. The IDEM client will detect changes and automatically issue commands to synchronize with the IDEM server.

Also in endOfLoop, handle match suggestions produced by IDEM by calling the IdemIntegrator::tryConfirmAndGetNextMatchSuggestion method. If a suggestion is found, create a Pragma game instance and return.

An example of the plugin can be found here (access controlled).

GameInstance Plugin

In your GameInstancePlugin, create an instance of IdemIntegrator.

In the onEndGame callback, determine the game outcome and call IdemIntegrator::completeMatch to report the game results.

An example of the plugin can be found here (access controlled).

Testing: Example Pragma Project

Git: pragmaplatform/idem-idem-pragma-engine

Idem provides an example Pragma Project to test the success of the integration. The service simulates player connections and a game server for testing the matchmaking code. The source is available here.

An example code snippet for simulating a full matchmaking cycle of two parties can be found here.

Users can further customize the code to suit their needs.