Matchmaking

Finding match

For this, you need to add a Matchmaking Module in Initialisation. Refer Initialize the RGN SDK
RGNCoreBuilder.AddModule(newMatchmakingModule());

API call:

MatchmakingModule module = RGNCoreBuilder.I.GetModule<MatchmakingModule>();
string gameType = "practice";
StartMatchResponseData response = await module.StartMatch(gameType);

Required parameters:

  • string gameType - game mode for match

Response:

Return StartMatchResponseData object, which contains following fields:
  • string matchId - empty if finding match is failed by any reason

Submitting scores

API call:

MatchmakingModule module = RGNCoreBuilder.I.GetModule<MatchmakingModule>();
string gameType = "practice";
string matchId = "matchId";
float score = 322;
SubmitMatchScoreResponseData response = await module
.SubmitMatchScore(gameType, matchId, score);

Required parameters:

  • string gameType - game mode for match
  • string matchId - identifier of current match
  • float score - score to submit

Response:

Return SubmitMatchScoreResponseData object, which contains following fields:
  • int status - 200 if ok

Retrieve user history

API call:

MatchmakingModule module = RGNCoreBuilder.I.GetModule<MatchmakingModule>();
GetMatchmakingHistoryResponseData response = await module.GetHistory();

Response:

Return GetMatchmakingHistoryResponseData object, which contains following fields:
  • List<MatchmakingRecord> history - detailed list of previous played matches
Details of MatchmakingRecord:
  • string id - unique address of wallet
  • long createdAt - time of start match
  • long finishedAt - time of finish match
  • string gameType - game mode which was selected when finding match
  • string hostId - user id of match initiator
  • float hostSkill - level of play skill of match initiator
  • float hostScore - score of match initiator
  • string opponentId - user id of connected player
  • float opponentSkill - level of play skill of connected player
  • float opponentScore - score of connected player
  • string appPackageName - game identifier where was match
Last modified 5mo ago