メインコンテンツまでスキップ

Introduction to matchmaking customization

Last updated on August 13, 2024
備考

Extend is in Open Beta for AGS Private Cloud! This means that the Extend add-on is available for you to try in your development environment. You can submit your feedback via our Extend Open Beta feedback form.

Overview

This article walks you through how to modify the Extend Override app template for matchmaking function and transform it into your own app that fits your requirements.

Contract functions

The following are the functions in the contract:

service MatchFunction {
rpc ValidateTicket(ValidateTicketRequest) returns (ValidateTicketResponse);
rpc EnrichTicket(EnrichTicketRequest) returns (EnrichTicketResponse);
rpc MakeMatches(stream MakeMatchesRequest) returns (stream MatchResponse);
}

EnrichTicket

EnrichTicket is called before ValidateTicket and is meant to be used for adding additional logic to the match ticket. For example, you can add additional ticket attributes here to be used in the later step.

In the app template, the following function can be found in src/master/src/AccelByte.PluginArch.Demo.Server/Services/MatchFunctionService.cs.

public override Task<EnrichTicketResponse> EnrichTicket(EnrichTicketRequest request, ServerCallContext context)
{
...
}

ValidateTicket

ValidateTicket is called next and returns a boolean if the match ticket is valid or not. Here, you can can implement your own logic to validate tickets.

In the app template, the following function can be found in src/master/src/AccelByte.PluginArch.Demo.Server/Services/MatchFunctionService.cs.

public override Task<ValidateTicketResponse> ValidateTicket(ValidateTicketRequest request, ServerCallContext context)
{
...
}

MakeMatches

After the matchTicket is decorated and validated, you can start making some matches! For example, you can implement a logic to create matches wih the minimum number of players without going over the maximum limit, aiming to reach the maximum capacity.

In the app template, the following function can be found in src/master/src/AccelByte.PluginArch.Demo.Server/Services/MatchFunctionService.cs.

public override async Task MakeMatches(IAsyncStreamReader<MakeMatchesRequest> requestStream, IServerStreamWriter<MatchResponse> responseStream, ServerCallContext context)
{
...
}