Question: Please the read previous instructions box carefully before start working in your project. Objectives: 1 . Process Communication: Client - Server using sockets for communication

Please the read previous instructions box carefully before start working in your project.
Objectives:
1. Process Communication: Client-Server using sockets for communication between
processes.
2. Multi-threading: Using threads and threads pools.
3. Synchronization: Using locks for synchronization. Critical sections and shared
resources.
4. Practical Problem Solving: Apply theoretical knowledge to solve a practical problem.
Requirements
This project involves implementing a guess (2)/(3) of the average game server that supports
multiple interactive games, each with multiple players.
Rules
Each game is made up of multiple rounds. In each round, every player participating in
that game selects an integer between 0 and 100(inclusive) within a given time frame
and share with the game server.
The winner of a round is the player whose selection is closest to two-thirds of the
average of all numbers chosen by all players for that round. For example, if four
players select 0,50,67, and 100, the player with 50 wins the round, as 50 is the
closest to two-thirds of the average (36.1667). There can be multiple winners per
round, for instance, if the numbers chosen identical.
Q A T A R U N I V E R S I T Y
College of Engineering
Dept. of Computer Science & Eng.
P r o j e c t 2 Operating Systems Lab (CMPS 405)
Spring 2024 Semester
.
Cheating is an academic violation according to Qatar University rules and regulations, and in some cases, it
may result in final dismissal from the University. Students should not under any circumstances commit or
participate in any cheating attempt or any act that violates student code of conduct.
It is the right of the instructor to test the students undersetting of the project in any way during the demo and
discussion session. So, a project that is 100% working might be may be graded (-100%) due to student not
being able to explain a functionality they have implemented.
Each player starts with 5 points and loses a single point per losing round. A player is
eliminated from the game when they run out of points. After each round, the
following information is announced to all players: the round number, the players in
the game, the numbers chosen, the remaining points for each player, the outcome
(winner or loser) of that round, and which players have been eliminated, if any. The
game is won by the last remaining player.
There is one additional rule to enhance gameplay and discourage players from
selecting 0 all the time: In the last round, when there are two players left in the game
and when one chooses 0, the other player will win the game (guess >0).
Game
A game cannot start until at least two players have joined and is limited to a
maximum of 6 players. Whenever a player joins a game, they are shown a list of
players already in the game, and other players are notified of the new player joining.
The game starts once the player receives a ticket indicating that he already shared his
nickname. A ticket is =(unique id + nickname). Note that only players who received
their tickets can play together.
Once a game starts, it is activated and locked, and no other players can join.
When a player is eliminated, they do not participate in number selection but continue
watching the game.
An active game automatically ends when there is only one player left that has not
been eliminated.
Server
The server issues tickets to uniquely identify the player across games and
connections. When a client connects to the server, they either provide an
alphanumeric pseudonym (nickname) to receive a new ticket associated with their
pseudonym or send a previously issued ticket, which has an associated pseudonym on
the server.
After identifying themselves, the player is presented with a list of games that they can
join and a list of players that are connected to the server. The player can join a pre-
existing game or create a new game with a name and automatically be added to it.
There is always a default empty game on the server, even when no players are
connected. A player can join only one game at a time.
The server regularly sends a message to each client and expects a reply; if no reply is
received, the player is timed out and dropped from their game, if any.
The server also maintains a list of top-5 rankings (leaderboard) based on the total
number of games won by a player. This leaderboard is sent to a player when they first
connect to the server, before receiving the list oPlease the read previous instructions box carefully before start working in your project.
Objectives:
1. Process Communication: Client-Server using sockets for communication between
processes.
2. Multi-threading: Using threads and threads pools.
3. Synchronization: Using locks for synchronization. Crit

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!