Skip to content

sadeep654/Client-Server-Mastermind-Game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Project Banner


🔹 Overview

This project implements a multi-player Mastermind game using a client–server architecture in C, demonstrating practical skills in network programming, concurrency handling, and real-time communication. It was built on Linux using TCP for control messages and UDP for gameplay, showcasing strong understanding of low-level socket operations and system programming.

See the demo video below for a quick visual explanation of how the system works.

Vehicle Accident Alert Demo

Full system description referenced from project documentation.

C Linux Ubuntu TCP/UDP Makefile Client-Server Apache Status


🔹 Architecture

Client-Server Architecture Diagram

Architecture Summary

  • TCP: Login, commands, matchmaking, state updates
  • UDP: Real-time gameplay messaging
  • Server: Tracks online players, pending requests, game sessions
  • Clients: Handle gameplay logic + UI interaction

🔹 Key Features

  • 🌐 Client–server architecture using TCP & UDP
  • 🧩 Turn-based Mastermind gameplay
  • 🕒 60-second timeout system
  • 👥 Multi-client support
  • 📝 Command-based interface
  • 🛡️ Username & session validation
  • 🔄 Real-time updates between two players

✔ Supported Commands

Command Description
!help Show all commands
!who List online players
!start <user> Send a match request
!accept / !reject Respond to match requests
!combination Submit your guess
!disconnect Leave the match
!quit Exit the server

🔹 Installation & Build

🔧 Requirements

  • Linux OS (Ubuntu, Fedora, etc.)
  • GCC Compiler
  • Make utility

🛠 Build the Project

# Compile
make -f makefile

# Run server
./MServer 127.0.0.1 1234

# Run client (in new terminal)
./MClient 127.0.0.1 1234

🔹 Project Structure

MServer.c      # Server program
MClient.c      # Client program
makefile       # Build instructions
README.md      # Documentation

🔹 Notes

  • Developed and tested on Fedora Linux.
  • Uses numerical symbols (0–9) instead of colours for Mastermind logic.
  • Based on coursework requirements documented in the assignment.

🔹 License

This project is licensed under the MIT License. See the LICENSE file for details.


🔹 Authors

Copyright (c) 2021 Sadeep Dilshan Kasthuriarachchi

🔹 Citation

If you reference this work, please cite:

Kasthuriarachchi, S.D. (2024) Client-Server Mastermind Game. GitHub repository. Available at: https://github.com/sadeep654/Client-Server-Mastermind-Game (Accessed: date-you-accessed).

📩 Contact

Feel free to explore, fork, or reach out for collaboration or opportunities.

About

Linux-based Mastermind game using TCP/UDP sockets, client–server architecture, and custom protocol logic.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published