# Worlds - rooms flow

**URL:** <https://community.coherence.io/t/worlds-rooms-flow/654>\
**Category:** Help\
**Created:** [March 3, 2025, 2:45pm UTC](https://community.coherence.io/t/worlds-rooms-flow/654 "2025-03-03T14:45:17Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fikus](https://avatars.discourse-cdn.com/v4/letter/f/6f9a4e/32.png) [@Fikus](https://community.coherence.io/u/Fikus)\
**Post date:** [March 3, 2025, 2:45pm UTC](https://community.coherence.io/t/worlds-rooms-flow/654/1 "2025-03-03T14:45:17Z")

</div>

Greets,

I am exploring the correct flow for handling rooms & worlds -  
i have a world where clients can meet up & go to a separate room for a minigame (like a dungeon in the MMO stated here:[Rooms and Worlds | coherence Documentation](https://docs.coherence.io/manual/replication-server/rooms-and-worlds#use-case-1))

What is the correct flow of handling this - should one client create the room and then send a command with the room info to the other clients, or is there a nicer way?

Example:

```auto
otherClientSync.SendCommand<CharacterController>(nameof(JoinRoom), MessageTarget.AuthorityOnly,
            parameters);

        bridge.Disconnect();
        bridge.JoinRoom(room);

```

Thank you for your help,  
Fikus

---

<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:** [March 3, 2025, 3:19pm UTC](https://community.coherence.io/t/worlds-rooms-flow/654/2 "2025-03-03T15:19:34Z")

</div>

Yes, you have it right. Additionally if you need a little more coordination, you can use our Lobby system in the same way to have the people who would be joining the room associated with metadata, and then use the automatic Lobby room system to have them all enter the room automatically:

> **[Lobbies | coherence Documentation](https://docs.coherence.io/hosting/coherence-cloud/lobbies#game-session)**
>
> A way to do matchmaking using coherence Player accounts.

---

<div class="post-metadata">

**Author:** ![Fikus](https://avatars.discourse-cdn.com/v4/letter/f/6f9a4e/32.png) [@Fikus](https://community.coherence.io/u/Fikus)\
**Post date:** [March 6, 2025, 11:24am UTC](https://community.coherence.io/t/worlds-rooms-flow/654/3 "2025-03-06T11:24:23Z")

</div>

Reopening with more info and further questions since it’s related.  
I did some light research now and current most stable flow is for me to:  
Create room on 1 client:

\*\*I wanted to avoid matchmaking & lobbies since all clients exist in a common **world** beforehand and they “matchmake” amongst themselves by inviting each other to **rooms** for 1 on 1 activities.

```auto
var roomService = bridge.CloudService.Rooms.GetRoomServiceForRegion("eu");
        var roomOptions = new RoomCreationOptions
        {
            FindOrCreate = false,
            MaxClients = 2,
        };
        var room = await roomService.CreateRoomAsync(roomOptions);

//send the new room uniqueID to other clients
            otherPlayer.SendCommand<CustomCharacterController>(nameof(CustomCharacterController.JoinRoomFromData),
                MessageTarget.AuthorityOnly, room.UniqueId);

//WAIT for at least 1 frame & then disconnect & join the new room.
        GameManagerSystem.Instance.cohernceBridge.Disconnect();
        GameManagerSystem.Instance.cohernceBridge.JoinRoom(room);

On the other client I:
        var rooms = await roomsService.FetchRoomsAsync();
        var room = rooms.FirstOrDefault(x => x.UniqueId == roomId);

```

I also explored encoding the endPointData since its what only really being used in the JoinRoom API and sending rest of room info is not really needed, however even with encoding it to byte it’s still over the message size limit.

Is there a smoother way I am missing completely or is this ok?  
Thanks,  
Fikus

---

<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:** [April 23, 2025, 11:52pm UTC](https://community.coherence.io/t/worlds-rooms-flow/654/4 "2025-04-23T23:52:18Z")

</div>

My apologies - I just saw that this went unanswered. Did you find a solution to your question?

---

<div class="post-metadata">

**Author:** ![Fikus](https://avatars.discourse-cdn.com/v4/letter/f/6f9a4e/32.png) [@Fikus](https://community.coherence.io/u/Fikus)\
**Post date:** [April 29, 2025, 6:29am UTC](https://community.coherence.io/t/worlds-rooms-flow/654/5 "2025-04-29T06:29:33Z")

</div>

Hey no worries. I found a solution that works for my case. Thanks!

---

<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:** [July 28, 2025, 6:30am UTC](https://community.coherence.io/t/worlds-rooms-flow/654/6 "2025-07-28T06:30:02Z")

</div>

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