From 5669859ac1bd618ea42775c3fd99e166fd1aa42c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment?= Date: Tue, 4 Mar 2025 18:18:41 +0100 Subject: [PATCH] Update README.md --- ChatApp/README.md | 46 +++++++++++++++++++++++++++++++++++++++------- 1 file changed, 39 insertions(+), 7 deletions(-) diff --git a/ChatApp/README.md b/ChatApp/README.md index a29ec88..11d25df 100644 --- a/ChatApp/README.md +++ b/ChatApp/README.md @@ -3,15 +3,47 @@ An instant messaging app using Java and the UDP protocol. ## How to run -> [!WARNING] -> As of now, the app rely on ANSI escape character, thus not available on Windows. -> However, this feature is under development. +### Console -You can run the app by launching the `ChatApp` class. This will create the server (port `6665`) and a first client, -(creating by the way a room (`101`)). +#### Server + Client -You can then create more clients by launching the `Client` class. It will connect to the server -(be sure you launched it first) on the default port `6665`. +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 +``` + +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