# How to start ?

## **Starting the Server**

1. **Launch the Server:** Run the `r-type_server` executable.

This will start the server and it will listen for client connections.

```
./r-type_server [max_players]
```

### **Server Initialization Message:**&#x20;

Upon starting, the server will display an initialization message indicating its IP address and the port it's listening on. For example:

```
Server starting on IP: 192.168.0.93 Port: 4242
To join the game, use: ./r-type_client 192.168.0.93
Waiting for client connections...
```

Note the IP address, as they will be required to connect clients to the server.

##

## **Connecting Clients**

### **Start Client(s):**&#x20;

On a separate terminal window (or on different machines in the network), start the client executable with the server's IP address as an argument. Use the command provided by the server initialization message:

```
./r-type_client 192.168.0.93
```

### **Gameplay**

**Join the Game:** Upon successful connection, the client will join the game hosted by the server. Multiple clients can connect to the same server using the same command but from different machines or terminal windows.

### **Important Notes**

Once connected, clients can start interacting within the game environment as per the game's rules and mechanics.

* **Server-Client Communication:** Ensure that the server is running and reachable from the client's machine. If you're running the server and clients on different machines, they should be on the same network, and the server's firewall should allow incoming connections on the specified port.
* **IP Address and Port:** The IP address and port displayed by the server are crucial for the clients to connect. Ensure you use the correct IP address and port as indicated by the server.
* **Troubleshooting:** If a client cannot connect to the server, verify the network connectivity, check if the server's IP address and port are correctly entered, and ensure that no firewall or network settings are blocking the connection.

<br>


---

# Agent Instructions: 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:

```
GET https://r-type-5.gitbook.io/r-type/setup-guidelines/how-to-start.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
