# Matchmaker Min-Max

**URL:** <https://forum.heroiclabs.com/t/matchmaker-min-max/3646>\
**Category:** Runtime Framework\
**Created:** [March 17, 2023, 8:57am UTC](https://forum.heroiclabs.com/t/matchmaker-min-max/3646 "2023-03-17T08:57:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![emredarak](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/emredarak/32/1235_2.png) [@emredarak](https://forum.heroiclabs.com/u/emredarak)\
**Post date:** [March 17, 2023, 8:57am UTC](https://forum.heroiclabs.com/t/matchmaker-min-max/3646/1 "2023-03-17T08:57:22Z")

</div>

```auto
export const beforeMatchmakerAdd: nkruntime.RtBeforeHookFunction<nkruntime.EnvelopeMatchmakerAdd> = function (ctx: nkruntime.Context, logger: nkruntime.Logger, nk: nkruntime.Nakama, envelope: nkruntime.EnvelopeMatchmakerAdd): nkruntime.EnvelopeMatchmakerAdd | void {

    envelope.matchmakerAdd.query = "*"
    envelope.matchmakerAdd.minCount = 30
    envelope.matchmakerAdd.maxCount = 30

    return envelope;
}

```

I set the min and max values of matchmaker to 30. In the test environment, 30 people search the game at the same time, but 30 people cannot match at once. Is there something wrong with what I did or is there somewhere I should check?

---

<div class="post-metadata">

**Author:** ![emredarak](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/emredarak/32/1235_2.png) [@emredarak](https://forum.heroiclabs.com/u/emredarak)\
**Post date:** [March 17, 2023, 2:57pm UTC](https://forum.heroiclabs.com/t/matchmaker-min-max/3646/2 "2023-03-17T14:57:26Z")

</div>

I solved the problem, it was a situation related to those who entered with the party. In addition, using Envelope Matchmaker And, I also override made those who entered with the party.

```auto
export const beforePartyMatchmakerAdd: nkruntime.RtBeforeHookFunction<nkruntime.EnvelopePartyMatchmakerAdd> = function (ctx: nkruntime.Context, logger: nkruntime.Logger, nk: nkruntime.Nakama, envelope: nkruntime.EnvelopePartyMatchmakerAdd): nkruntime.EnvelopePartyMatchmakerAdd | void {

    envelope.partyMatchmakerAdd.query = "*"
    envelope.partyMatchmakerAdd.minCount = 30
    envelope.partyMatchmakerAdd.maxCount = 30

    return envelope;
}

```
