> For the complete documentation index, see [llms.txt](https://rocket-networking.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://rocket-networking.gitbook.io/docs/rocket-networking-code/rooms/showallclientsinroom-room_name-and-callback_showallclientsinroom.md).

# ShowAllClientsInRoom(room\_name  ) and callback\_ShowAllClientsInRoom()

## Description

This function tells you about all the clients in a room. Enter the room name you want to check for.

#### Syntax

```
ShowAllClientsInRoom(room_name);
```

| Argument    | Description                                                                 |
| ----------- | --------------------------------------------------------------------------- |
| `room_name` | <p>The name of the RNet room you want to scan.<br>This must be a String</p> |

#### Returns

```
N/A
```

## How do I see which clients are on this room

After a successful scan of the room name you entered, the callback function **callback\_ShowAllClientsInRoom()** is called. So under Scripts/Rocket Networking/Callback Functions , you can edit this to do whatever you want…

❓ This function returns an array of all client id’s in a room. For example if there are 3 clients with clientId’s 3, 6 and 11 respectively in the room “public”, this function’s callback will return the array \[ “3” , “6” , “11” ] . It is worth noting that these are not numbers in the array, they are strings of the numbers.

### Example Implementation of function call

* So firstly I made 2 clients join the room “public”
* Then I wrote some basic code to try out this function

<figure><img src="/files/5Nh1K8RHSMTzAr2pSDA5" alt=""><figcaption></figcaption></figure>

### Example Implementation of callback(continued)

* Then after I pressed okay, this callback code took place
* Here I’ve just done a show\_message so the user is shown a dialog box with that message but you get the idea

<figure><img src="/files/34xyNX59fmQeRkhZtB0W" alt=""><figcaption></figcaption></figure>

* So what it returned in the end was

```
[7,9]in public
```

## If the room does not exist?

&#x20;⚠️ If the room you entered does not exist, this callback function will not return an array. **Instead the “array\_of\_clients” variable will be the integer -1.** So a good practice would be to first check if it is an array. If not then the room doesn’t exist. If yes then treat it as an array.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://rocket-networking.gitbook.io/docs/rocket-networking-code/rooms/showallclientsinroom-room_name-and-callback_showallclientsinroom.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
