# Recommendation to Read db While Matchmaking a Player

**URL:** <https://forum.heroiclabs.com/t/recommendation-to-read-db-while-matchmaking-a-player/1545>\
**Category:** Game Design\
**Created:** [April 10, 2021, 7:52pm UTC](https://forum.heroiclabs.com/t/recommendation-to-read-db-while-matchmaking-a-player/1545 "2021-04-10T19:52:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mohammed](https://avatars.discourse-cdn.com/v4/letter/m/13edae/32.png) [@Mohammed](https://forum.heroiclabs.com/u/Mohammed)\
**Post date:** [April 10, 2021, 7:52pm UTC](https://forum.heroiclabs.com/t/recommendation-to-read-db-while-matchmaking-a-player/1545/1 "2021-04-10T19:52:54Z")

</div>

Hi,

So I am making a game and using the lovely matchmaker using one parameter to match the player, `CupsCount `  
players in the same range of `CupsCount` will be matched. I could make the player submit the query and parameters but I want to avoid cheating (submitting lower `CupsCount` to match with low experience players)

So I used RegisterBeforeRt hook with Id “MatchmakerAdd” to create the query and assigned the `CupsCount`

`CupsCount` is stored in the account metadata so I have to retrieve the user account.  
Next the played added to the pool and get matched,

when the player join the match i will retrieve his account to use some data in metadata in the game logic

To avoid reading the player account twice (before adding the pool and when joined the match), Do you recommend me to pass user metadata fetched before adding player the pool to match like below

```auto
envelope.GetMatchmakerAdd().StringProperties["user_metadata"] = accountMetadata

```

```auto
matchID, err := nk.MatchCreate(ctx, modulename, entries) // entries contains StringProperties["user_metadata"]

```

---

<div class="post-metadata">

**Author:** ![zyro](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/zyro/32/14_2.png) [@zyro](https://forum.heroiclabs.com/u/zyro)\
**Post date:** [April 13, 2021, 1:20pm UTC](https://forum.heroiclabs.com/t/recommendation-to-read-db-while-matchmaking-a-player/1545/2 "2021-04-13T13:20:18Z")

</div>

If you’ve already read the user account metadata before placing the user in the matchmaker, and you need that data when the matchmaking process completes, then it’s fine to put it in the user’s matchmaking properties.

As you’ve observed the properties are available in the [matchmaking matched hook](https://heroiclabs.com/docs/gameplay-multiplayer-server-multiplayer/#matchmaker) where you might then create an authoritative match, and it’s perfectly fine to have properties not actively used in matchmaking filters. 👍
