Multiplayer Game Server
Network Game Platform with C++ Sockets & Python GUI
Overview
Far more than a simple tic-tac-toe game — this is a complete online gaming platform built from scratch using TCP/IP sockets. Multiple clients connect simultaneously to play games, chat, observe matches, send mail, and manage profiles. The server handles 27+ commands with non-blocking I/O multiplexing via select(), while the Python GUI client provides an interactive graphical interface.
Key Features
- Multi-client TCP server using select() for non-blocking I/O multiplexing
- User registration and login system with persistent credential storage
- Real-time turn-based gameplay with per-player countdown timers and auto-timeout
- Observer mode allowing spectators to watch live games in progress
- Asynchronous mail system with inbox management (read, delete, unread notifications)
- Social features: broadcast messaging (shout), private messaging (tell), observer chat (kibitz)
- Player statistics tracking with win/loss history and game records
- Block/unblock system and quiet mode for privacy control
- Python Tkinter GUI with interactive 3x3 game grid and real-time server communication
Architecture
The server is built as a single-threaded event loop using POSIX select() to handle multiple concurrent client connections. Each client maintains session state (logged in, in-game, observing), and game state is managed through a Game class with move validation, win/tie detection, and timer enforcement. Data persistence uses flat files with binary encoding for mail. The Python GUI client communicates over TCP sockets, rendering the game board and providing button-based controls for all 27+ server commands.