Skip to content

This C++ project implements a chess server and client for multiplayer interaction using OOP concepts. Players connect to the server to play chess. Communication occurs securely via sockets, ensuring accurate move transmission. Concurrency, facilitated by fork() in UNIX systems, allows simultaneous handling of multiple client connections.

Notifications You must be signed in to change notification settings

EmilCosma/Chess-Server-Client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

Chess-Server-Client

This project is a chess server and client implemented in the C++ programming language. The main purpose of this project is to provide a platform where two or more players can interact in a game of chess through a connection to the server. The implementation is done using object-oriented programming (OOP) concepts.

Communication between the server and clients is done through sockets. This ensures the correct and secure transmission of information regarding the moves made by the players.

The server verifies and validates the moves sent by the clients, and provides them with correct information about the opponent's moves in real-time. If a client sends an invalid move, the server waits to receive another command until it receives a valid one.

A key feature of this server is the implementation of concurrency using the fork() function in UNIX-based operating systems. This approach allows the server to handle connections from multiple clients simultaneously without affecting the performance and reliability of the system.

The server uses the "Game" class, which contains two vectors of pointers to "Piece". "Piece" is an abstract class inherited by all types of pieces and contains methods such as "moveTo", "typeOfPiece", and "changeCoord". The "Game" class processes the moves received from clients through the "movePiece" method, which returns 1 if the move was valid. Furthermore, the server transmits this result to the client who sent the move to indicate that it was valid and also transmits the move to the other client.

About

This C++ project implements a chess server and client for multiplayer interaction using OOP concepts. Players connect to the server to play chess. Communication occurs securely via sockets, ensuring accurate move transmission. Concurrency, facilitated by fork() in UNIX systems, allows simultaneous handling of multiple client connections.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages