Java Chat Rooms
1. Basic Features
You are expected to implement a chat room using Java.
This project requires you to execute
multiple threads
and display multiple command-line interfaces, namely chat rooms.
Each chat room command-line interface should be able to send messages to all other command-line interfaces while receiving and displaying messages on the command-line interface.
The project should support the following features:
-
Multithreading Implementation (10 pts).
- Your program should be implemented based on Java multithreading techniques.
- Hence, your project should be able to display multiple command-line interfaces (i.e., chat rooms) concurrently in a single computer/workstation.
- Closing or starting a command-line interface should not affect the proper functioning of other command-line interfaces.
-
Chat Room Functions (10 pts)
- When creating a new chat room command-line interface, the system will automatically assign this user an ID of 5 digits (e.g., 01234). In the meantime, the user is able to input a username via keyboard input. Both the ID and the username should be displayed before each message the user sends.
- The user is able to send messages via keyboard input and view the messages of other users (which are sent by other command-line interfaces).
- The graphical user interface is NOT required since this is the first project for CSC1004.
- Message Display (5 pts):
- Your program can display the names and the ids of other users when a new user enters the chat room (only shown to the new user).
- Your program can display the name and ID of the user when he or her is leaving the chat room (shown to all users in the chatroom).
- You program can display the current time when a user sends or receives a message (shown to all users in the chatroom).
2. Advanced Features
Note that you can earn 75% of the scores by finishing all three projects with the only basic features.
That is to say, to get a higher score, you may want to consider adding some advanced features:
(Please pick some features from the followings.
The corresponding bonus scores will be added to your final score,
and the upper bound of your final score is 100 pts.
That's to say, you can get at most 100 pts by picking fives 5 pts features or a 10 pts feature with three 5 pts features.)
- Receiver Display (5 pts): The user can check the receivers of his or her last message. In specific, by inputting the command "[print-receiver]:the-message" to the program, the program can display the name and id of receivers at the time this message was sent. The entering and leaving of chatroom users should not influence this function.
- Chat Record Storage (5 pts) : The user can save all the chat records to a local file so that a user can view all messages even when entering the chat room. Note that the messages should be stored on the server side. The server should then deliver these messages to a client when he or she enters the chatroom
- Search Function (5 pts) : The user can search chat logs by keyword or username. Hint: you can specify a certain keyboard input pattern to start searching. For example, let "#search (keyword or username)" be the input pattern.
3. Submission
Submission should be made at the blackboard system. You need to submit:
- Video: Prepare a presentation for your project by recording a video. Ensure the video captures your screen to demonstrate how the code runs on your laptop or desktop.
Please prepare a clear introduction, explaining the implemented features, including both basic and advanced ones.
If needed, add captions or provide a voiceover to enhance clarity and understanding.
- Code: Prepare your code for submission. The main functions and classes in the code must have comments in a reader-friendly format.
4. Resources