# Questions about presences \[Relayed\]

**URL:** <https://forum.heroiclabs.com/t/questions-about-presences-relayed/6303>\
**Category:** Runtime Framework\
**Tags:** server-framework, sdk-godot\
**Created:** [July 5, 2025, 3:04am UTC](https://forum.heroiclabs.com/t/questions-about-presences-relayed/6303 "2025-07-05T03:04:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![wantg](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/wantg/32/2588_2.png) [@wantg](https://forum.heroiclabs.com/u/wantg)\
**Post date:** [July 5, 2025, 3:04am UTC](https://forum.heroiclabs.com/t/questions-about-presences-relayed/6303/1 "2025-07-05T03:04:44Z")

</div>

### Part 1

There is three players want to play match.

Amy and Bob create matchmaker by

```auto
socket.add_matchmaker_async(...)

```

when the matchmaker matched, socket will notice by

```auto
socket.received_matchmaker_matched.connect(on_received_matchmaker_matched)

func on_received_matchmaker_matched(matchmaker_matched: NakamaRTAPI.MatchmakerMatched)

```

Amy and Bob will get same user list (same order) by

```auto
matchmaker_matched.users

```

That array is [Amy’s user, Bob’s user] or [Bob’s user, Amy’s user]

Use deterministic sorting to decide who is the host, like Official Documentation

> **[Client Relayed Multiplayer](https://heroiclabs.com/docs/nakama/concepts/multiplayer/relayed/#match-host-rotation)**
>
> The real-time multiplayer engine makes it easy for users to set up and join matches where they can rapidly exchange data with opponents. Users can create, join, and leave matches with messages sent from clients, with matches existing on the server...

### Part 2

Amy and Bob join the match immediately by ticket

```auto
var current_match = await socket.join_matched_async(matchmaker_matched)

```

They will get different users(in presences) by

```auto
current_match.presences

```

Amy get [Bob’s presence] and Bob get empty list  
or  
Amy get empty list and Bob get [Amy’s presence]

#### Question 1

Is this reasonable?

### Part 3

When Amy and Bob playing in match, Chris found that match by

```auto
client.list_matches_async(session, min_presences, max_presences, limit, false)

```

Join later by match\_id

```auto
var current_match = await socket.join_match_async(p_match_id)

```

He will get all user presence in match(not including himself) but in different order  
That will be  
[Bob’s presence, Amy’s presence]  
or  
[Amy’s presence, Bob’s presence]

#### Question 2

Since nakama has saved the user list, why can’t the same order be given?  
Is there a API to implementnt ?

#### Question 3

How can the all clients get consistent user list (same content and same order) ?

#### Question 4

If the clients cannot obtain consistent presences, is it only broadcasted through the host?

In multiplayer games Players order is important which Related to game rules.

---

<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:** [July 7, 2025, 2:07pm UTC](https://forum.heroiclabs.com/t/questions-about-presences-relayed/6303/2 "2025-07-07T14:07:17Z")

</div>

Hello @wantg,

Q1: Yes, this is expected, it depends on who joins first. Match is empty, A joins, gets empty list as there’s no one else in the match yet. B joins, receives A’s presence as part of Join, then A receives B’s presence through callback.

Q2: The ordering of the presences list maintained by the server shouldn’t matter, only that joins and leaves are received in-order. Nakama may send joins and leaves in the same batch for optimization reasons, but the presence ordering within the same message is not guaranteed.

Q3: If you want to keep your presence tracking data structure ordered to reliably elect the 1st entry as the host, then it should up to your client implementation to keep it ordered, and all clients should eventually converge to the same presence list as they receive the joins and leaves messages.

Q4: I believe this is already addressed in the previous responses.

Hope this clarifies.

---

<div class="post-metadata">

**Author:** ![wantg](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/wantg/32/2588_2.png) [@wantg](https://forum.heroiclabs.com/u/wantg)\
**Post date:** [July 8, 2025, 1:06am UTC](https://forum.heroiclabs.com/t/questions-about-presences-relayed/6303/3 "2025-07-08T01:06:18Z")

</div>

Thank you sesposito.
