- About the Project
- Features
- Current State and Future Development
- Technology Used
- Dependencies
- Getting Started
- Usage
- Contributors
- License
PyTermChat is a Python-based chat application that allows multiple clients to connect to a server and communicate with each other in real-time. Designed to operate in the terminal or console, PyTermChat provides a straightforward interface for users to chat, play games, and manage their presence in different chat groups. This project was originally based on a mandatory assignment in Networking and Cloud computing, but it has been significantly extended to include additional features like a Rock-Paper-Scissors game.
The code contains extensive comments, with almost every line commented. This level of detail was required by our lecturer for a course assignment to ensure clarity and thorough documentation of the code's functionality.
- Multi-threaded Server: Handles multiple clients simultaneously.
- Broadcast Messaging: Clients can send messages to all connected users.
- Private Messaging: Send private messages to specific users using the whisper command.
- Chat Groups: Join and communicate within specific chat groups.
- Rock-Paper-Scissors Game: Play a game of Rock-Paper-Scissors with other users.
- User Management: Change usernames, view online users, and track user locations.
- Command-based Interface: Intuitive commands for various actions (e.g., /shout, /list, /whisper, /rps).
- Robust Error Handling: Ensures smooth operation and provides meaningful error messages.
Currently, PyTermChat is fully functional with the features mentioned above. Future development may include:
- Enhanced Game Options: Adding more games and improving game mechanics.
- User Authentication: Implementing login systems with passwords.
- Improved UI: Enhancing the terminal interface for better user experience.
- Logging and Monitoring: Adding logging for server activity and user actions.
- Security Enhancements: Incorporating security features like encryption for messages.
- Python: The main programming language used for both the server and client.
- Socket Programming: For handling network communication.
- Multi-threading: To manage multiple clients concurrently.
- Terminal/Console Interface: For user interaction.
- Python 3.x
- Standard Python libraries:
socket
,threading
,time
Ensure you have Python 3.x installed on your machine. You can download Python from python.org.
-
Clone the repository:
git clone https://github.com/yourusername/PyTermChat.git
-
Navigate to the project directory:
cd PyTermChat
Start the server by running the following command:
python3 server.py
Open a new terminal window and navigate to the project directory. Start the client by running:
python3 client.py
Once connected to the server, you can use the following commands:
- /shout [message]: Sends a message to everyone including chat groups.
- /list: Lists all online users.
- /whisper [username] [message]: Sends a private message to a specific user.
- /chat [1-9]: Joins a chat group (1-9).
- /exit: Leaves the current chat group.
- /rps [username]: Starts a game of Rock-Paper-Scissors with a user.
- /newusername [username]: Changes your username.
- /whereami: Displays your current location (main area or chat group).
- /bye: Disconnects from the server.
- /instructions: Displays the list of available commands.
To start a game of Rock-Paper-Scissors with another user, use the /rps [username] command. The invited user must respond with y to accept or n to decline. Once the game starts, follow the prompts to choose Rock, Paper, or Scissors.
- This project was developed solely by me pholdahl.
This project is licensed under the MIT License.