# Matchmaking timeout

**URL:** <https://forum.heroiclabs.com/t/matchmaking-timeout/5956>\
**Category:** Runtime Framework\
**Tags:** server-framework, typescript\
**Created:** [January 20, 2025, 1:27pm UTC](https://forum.heroiclabs.com/t/matchmaking-timeout/5956 "2025-01-20T13:27:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![MinatoTW](https://avatars.discourse-cdn.com/v4/letter/m/58956e/32.png) [@MinatoTW](https://forum.heroiclabs.com/u/MinatoTW)\
**Post date:** [January 20, 2025, 1:27pm UTC](https://forum.heroiclabs.com/t/matchmaking-timeout/5956/1 "2025-01-20T13:27:34Z")

</div>

Hello,

I’ve read a post on this topic previously [here](https://forum.heroiclabs.com/t/matchmaking-with-bots/4326/4).

In my case I would like to match the player with a bot after they didn’t find a game for 2 minutes. The issue is that I don’t want to expose this API to the client as they can abuse it to keep matching themselves with bots and boost ranks.

How do I know if a matchmaking request has timed out after X seconds or somehow keep this data while requesting a ticket so I know the player did search for X seconds.

---

<div class="post-metadata">

**Author:** ![sesposito](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/sesposito/32/2594_2.png) [@sesposito](https://forum.heroiclabs.com/u/sesposito)\
**Post date:** [January 21, 2025, 2:40pm UTC](https://forum.heroiclabs.com/t/matchmaking-timeout/5956/2 "2025-01-21T14:40:01Z")

</div>

Hello @MinatoTW,

I think you can use a before and after hook on `MatchmakerAdd` and `MatchmakerRemove` respectively and check whether a minimum amount of time was spent matchmaking for that player, then mark the player as eligible for bots (also always set this to false on `MatchmakerAdd`), that way you can trigger the bots from the client after the maximum time has elapsed but check that the system isn’t being abused.

Best.

---

<div class="post-metadata">

**Author:** ![MinatoTW](https://avatars.discourse-cdn.com/v4/letter/m/58956e/32.png) [@MinatoTW](https://forum.heroiclabs.com/u/MinatoTW)\
**Post date:** [January 21, 2025, 3:36pm UTC](https://forum.heroiclabs.com/t/matchmaking-timeout/5956/3 "2025-01-21T15:36:09Z")

</div>

Hello, Thanks for getting back. Where would I store this info? In session variables or something else?

---

<div class="post-metadata">

**Author:** ![sesposito](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/sesposito/32/2594_2.png) [@sesposito](https://forum.heroiclabs.com/u/sesposito)\
**Post date:** [January 21, 2025, 3:46pm UTC](https://forum.heroiclabs.com/t/matchmaking-timeout/5956/4 "2025-01-21T15:46:06Z")

</div>

A storage object under the user or the user’s metadata.
