82 lines
1.6 KiB
Markdown
82 lines
1.6 KiB
Markdown
# ChatAPP
|
|
An instant messaging app using Java and the UDP protocol.
|
|
|
|
## How to run
|
|
|
|
### Console
|
|
|
|
#### Server + Client
|
|
|
|
You can create a server and an "admin" client by using:
|
|
|
|
```shell
|
|
./gradlew admin # Linux
|
|
.\gradlew.bat admin # Windows
|
|
```
|
|
|
|
You will receive the notifications of the server (handshakes, ...).
|
|
|
|
#### Server
|
|
|
|
You can create a server by launching:
|
|
|
|
```shell
|
|
./gradlew server # Linux
|
|
.\gradlew server # Windows
|
|
```
|
|
|
|
If you want to create a server on a specific port, you can use:
|
|
|
|
```shell
|
|
./gradlew server --args="port" # Linux
|
|
.\gradlew server --args="port" # Windows
|
|
```
|
|
|
|
where `port` is the port you want to use.
|
|
|
|
This will create the server on a random port available and indicate it through the terminal.
|
|
|
|
To launch the server on a particular port, simply use:
|
|
|
|
```shell
|
|
./gradlew server --args="port" # Linux
|
|
.\gradlew server --args="port" # Windows
|
|
```
|
|
|
|
where `port` is the port you want to use.
|
|
|
|
#### Client
|
|
|
|
To create a client, you may use:
|
|
|
|
```shell
|
|
./gradlew client # Linux
|
|
.\gradlew client # Windows
|
|
```
|
|
|
|
## How to use
|
|
As soon as you launch a client, you will be prompted to enter your name. You will then be in the lobby. From here you
|
|
can join whatever room that is created, and you will be able to chat with the other clients in the room.
|
|
You will also be able to create a new room.
|
|
|
|
## Commands
|
|
> [!TIP]
|
|
> The commands can be found by typing `/help` in the chat, in the lobby or in any room.
|
|
|
|
> [!NOTE]
|
|
> All the commands are prefixed by `/`.
|
|
|
|
- /createRoom *roomName*
|
|
- /listRooms
|
|
- /joinRoom *roomName*
|
|
- /leaveRoom
|
|
- /room
|
|
- /bye
|
|
- /help
|
|
|
|
> [!NOTE]
|
|
> There are some aliases for the commands:
|
|
> - /create
|
|
> - /list
|
|
> - /join
|
|
> - /leave |