# How to get a list of connected players in a world?

**URL:** <https://community.coherence.io/t/how-to-get-a-list-of-connected-players-in-a-world/609>\
**Category:** Help\
**Created:** [November 4, 2024, 9:20pm UTC](https://community.coherence.io/t/how-to-get-a-list-of-connected-players-in-a-world/609 "2024-11-04T21:20:30Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![MythicalJJ](https://avatars.discourse-cdn.com/v4/letter/m/6de8d8/32.png) [@MythicalJJ](https://community.coherence.io/u/MythicalJJ)\
**Post date:** [November 4, 2024, 9:20pm UTC](https://community.coherence.io/t/how-to-get-a-list-of-connected-players-in-a-world/609/1 "2024-11-04T21:20:31Z")

</div>

Is there a way to get a list of players in the world? and/or a player count? ie: we may want to show worlds that are close to being full, and also we want to avoid the player choosing a team that has too many players on it.

---

<div class="post-metadata">

**Author:** ![brit](https://dub1.discourse-cdn.com/flex017/user_avatar/community.coherence.io/brit/32/34_2.png) [@brit](https://community.coherence.io/u/brit)\
**Post date:** [November 4, 2024, 9:45pm UTC](https://community.coherence.io/t/how-to-get-a-list-of-connected-players-in-a-world/609/2 "2024-11-04T21:45:24Z")

</div>

We have a Lobbies system meant for this sort of metadata. If you’d like to attach metadata to your game sessions, like teams, and assign players to teams etc. you can use a lobby to accomplish that: [Lobbies | coherence Documentation](https://docs.coherence.io/hosting/coherence-cloud/lobbies)

---

<div class="post-metadata">

**Author:** ![MythicalJJ](https://avatars.discourse-cdn.com/v4/letter/m/6de8d8/32.png) [@MythicalJJ](https://community.coherence.io/u/MythicalJJ)\
**Post date:** [November 4, 2024, 9:48pm UTC](https://community.coherence.io/t/how-to-get-a-list-of-connected-players-in-a-world/609/3 "2024-11-04T21:48:43Z")

</div>

Do lobbies support persistent worlds? if so what’s the difference between the lobbies and worlds?

---

<div class="post-metadata">

**Author:** ![brit](https://dub1.discourse-cdn.com/flex017/user_avatar/community.coherence.io/brit/32/34_2.png) [@brit](https://community.coherence.io/u/brit)\
**Post date:** [November 4, 2024, 9:52pm UTC](https://community.coherence.io/t/how-to-get-a-list-of-connected-players-in-a-world/609/4 "2024-11-04T21:52:21Z")

</div>

Lobbies are not related to a replication server and are just a data layer you can interact with with the SDK.

You can use a lobby to manage metadata about the current state of a world or room.

If you’d like to outline at a high level what you’re trying to accomplish we can suggest some implementation plans with out tech

---

<div class="post-metadata">

**Author:** ![ciro](https://dub1.discourse-cdn.com/flex017/user_avatar/community.coherence.io/ciro/32/82_2.png) [@ciro](https://community.coherence.io/u/ciro)\
**Post date:** [November 5, 2024, 2:34pm UTC](https://community.coherence.io/t/how-to-get-a-list-of-connected-players-in-a-world/609/5 "2024-11-05T14:34:04Z")

</div>

> [@MythicalJJ](#):
>
> if so what’s the difference between the lobbies and worlds?

Hey JJ! (from Mythical City Games, right? 🙂 )

Check out this page: [Rooms and Worlds | coherence Documentation](https://docs.coherence.io/manual/replication-server/rooms-and-worlds)

I think it would be useful to understand the difference.

---

<div class="post-metadata">

**Author:** ![MythicalJJ](https://avatars.discourse-cdn.com/v4/letter/m/6de8d8/32.png) [@MythicalJJ](https://community.coherence.io/u/MythicalJJ)\
**Post date:** [November 5, 2024, 8:45pm UTC](https://community.coherence.io/t/how-to-get-a-list-of-connected-players-in-a-world/609/6 "2024-11-05T20:45:17Z")

</div>

Yes, that’s right 🙂 thanks, I will review this!

---

<div class="post-metadata">

**Author:** ![ciro](https://dub1.discourse-cdn.com/flex017/user_avatar/community.coherence.io/ciro/32/82_2.png) [@ciro](https://community.coherence.io/u/ciro)\
**Post date:** [November 6, 2024, 2:20pm UTC](https://community.coherence.io/t/how-to-get-a-list-of-connected-players-in-a-world/609/7 "2024-11-06T14:20:29Z")

</div>

Great. To add some more stuff, I also wanted to mention about the existence of ClientConnections: [Client Connections | coherence Documentation](https://docs.coherence.io/manual/client-connections)

In short, ClientConnections are network entities that are visible to all connected Clients (and Simulator), whose lifetime is managed by coherence. So a Client connects, a CC is created, when they disconnect, it’s destroyed.

And so you can understand that if you connect to a World (or Room), you can use CCs to “see” all connected players, regarding of where their character is in space. This allows to do things like display clans, teams, and send messages to each other.

However, CCs are only available **after** you are also connected to the Room or World, so you’re counting against the maximum limit of that space too. If you want to maintain a more lightweight space where clients can see each other, matchmake, chat, **before** they join a Room or World, that’s what Lobbies are for.

Hope it helps, but in any case it’s pretty much what’s in the docs.

---

<div class="post-metadata">

**Author:** ![MythicalJJ](https://avatars.discourse-cdn.com/v4/letter/m/6de8d8/32.png) [@MythicalJJ](https://community.coherence.io/u/MythicalJJ)\
**Post date:** [November 12, 2024, 5:22pm UTC](https://community.coherence.io/t/how-to-get-a-list-of-connected-players-in-a-world/609/8 "2024-11-12T17:22:19Z")

</div>

Awesome, thank you! This is helpful indeed.

---

<div class="post-metadata">

**Author:** ![system](https://europe1.discourse-cdn.com/flex017/uploads/coherence/original/1X/b3aa79eb9519fac7aad7eba18f15a1e8ce60f6e2.png) [@system](https://community.coherence.io/u/system)\
**Post date:** [February 10, 2025, 5:22pm UTC](https://community.coherence.io/t/how-to-get-a-list-of-connected-players-in-a-world/609/9 "2025-02-10T17:22:47Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
