Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
ThePurpleJedi committed Jun 13, 2023
2 parents c32dc3f + 4c87bcc commit 42a4d4e
Showing 1 changed file with 27 additions and 38 deletions.
65 changes: 27 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@

### _Welcome to Mercurys!_

Mercurys is a fun little side-project I'm working on in between my studies.
It's basically a console-based chat application that uses a simple Socket connection to transmit and receive data. This
is my first real programming project, and I have a lot of hopes for this!
Mercurys is a side-project I've been working on in between my studies.
It's essentially a console-based chat application that uses a simple Socket connection to transmit and receive data.

#### Features:

Expand All @@ -15,77 +14,67 @@ is my first real programming project, and I have a lot of hopes for this!

### How Do You Use Mercurys?

Well it's as simple as can be, really. Here is what you do:
It's quite simple to get the server/client connection up and running:

#### _To start the connection:_

The first step is to download the project and open it in your IDE of choice. Then the steps differ slightly based on
whether you are the one who wishes to host the server [the host] or the one who wishes to request a connection to an
already hosted server [the client].
The first step is to download the project and open it in any IDE.

_If you are the host:_
_For hosting the server:_

1. Compile and run the MercurysServer.java file `[project-mercurys/src/com/mercurys/MercurysServer.java]`
2. Enter your computer's LAN IP address when prompted [it should look something like 192.168._.\___]
3. The server has now been initialised, and it will wait for a client to request a connection.
4. Once a client socket has connected to the IP [entered by you in step 3], the program will notify you
2. Enter the device LAN IP address and the server name [it can be anything] when prompted
3. The server has now been initialised, and it will wait for a client to request a connection
4. Once a client socket has connected to the IP entered in step 3, the program should display a confirmatory message

_If you are the client:_
_For connecting to the server:_

1. Compile and run the MercurysClient.java file `[project-mercurys/src/com/mercurys/MercurysClient.java]`
2. Enter the IP address of the host you wish to connect to when prompted
3. Once the connection is successful, the program will notify you
2. Enter the IP address of the host server along with the client's username
3. Once the connection is successful, the program should display a confirmatory message

Now the 2 computers have been connected, and you can easily send and receive text messages and images while the
connection is active.
Now the 2 devices have been successfully connected, and they can send and receive text messages and media files
while the connection is active.

***To send a message***

Simply type the message and press enter.

***To send a file***

To send any media file, make sure you have the file downloaded on your computer. Then, go to the image and copy its "
absolute path".
To send any media file, ensure that the file is present locally on the device. The, go to the console and use the
following format to send the file:

An absolute file path is the complete and unique "name" of a file. More technically, it is the string of characters used
to uniquely identify a file in a device's directory structure. For example:
`/<file type> <absolute file path>`

The absolute file path should look like this on different operating systems:

* On Windows - `C:\Pictures\Nature\SummerLeaves.jpg`
* On Linux - `/home/xyz/Documents/Sustainability_Report.pdf`
* On macOS - `/Users/xyz/Documents/ProjectDeadlineNotice.pdf`

After copying the absolute path, go to the console and use the following format to send the file:

`/<file type> <absolute path>`

Currently, the accepted file types are:
Note: Currently, the accepted file types are:

* `image` -> for image files
* `pdf` -> for pdf files

The console will display a confirmatory message that the file has been sent if all goes well.
The console will display a confirmatory message that the file has been sent if the transfer is successful,
and it should display the path of the file downloaded for the user on the opposite end.

The console will also display the path of the file downloaded.

Once you have finished with your talks and wish to close the connection, both the users must
enter `-x-`[without the double quotes] to stop the program.
If the connection is to be closed, both the users must enter `-x-` to stop the program.

#### Why Am I Doing This?

Many a times I receive questions from friends and family asking how and why do I devote time to this ultimately
meaningless project instead of focusing more on my studies.

Well, apart from serving as a productive way of ~~procrastinating~~ taking a break, this helps me keep in touch with
Java during my otherwise non-programming related studies. Plus, I'm using this as a way to explore OOP concepts such as
encapsulation and inheritance by myself, and learning to effectively implement them in real world scenarios.
Apart from serving as a productive way of taking breaks, Mercurys helps me keep in touch with
Java during my otherwise non-programming related studies. I use this as a way to explore OOP concepts such as
encapsulation and inheritance, while also trying to to effectively implement them in real world scenarios.

#### Plans For The Future:

I have many new features and upgrades planned for this project, such as:
I have many new features and upgrades planned for this project, including:

* Enabling WAN connections
* Upgrading to multi-client chatting, thus making it a sort of chat room
* Upgrading to multi-client chatting
* Adding a GUI and making this a proper chat application

## Thank you for visiting!

0 comments on commit 42a4d4e

Please sign in to comment.