The University of Jordan
Faculty of Engineering and Technology
Department of Computer Engineering
Programming of Networks Protocol
Course Final Project – Spring2025
Eng. Asma Abdel Karim
In this course project, you are required to design and implement a network-based
client/server multiplayer game platform for challenges between players using TCP API
in Java.
In this project, you will build a multiplayer game platform where one player initiates a
challenge by selecting a secret name of a player, movie, actor, etc..., and other players join
the challenge to guess the name by asking yes/no questions. The game continues until a
correct guess is made or the guess limit is reached.
When the program starts, the player must connect to the server with a nickname.
Afterwards, he is asked whether he wants to start a new challenge or join an open challenge.
• If the player selects to start a new challenge, he submits the secret name and the
category to which the name belongs of the following categories:
➢ Movies
→ Example: Inception, The Matrix, Titanic
➢ Actors Actresses
→ Example: Tom Hanks, Scarlett Johansson
➢ Famous Athletes / Sports Figures
→ Example: Lionel Messi, Serena Williams
➢ Scientists / Inventors
→ Example: Albert Einstein, Marie Curie
➢ Historical Figures
→ Example: Napoleon Bonaparte, Cleopatra
➢ Famous Books / Novels
→ Example: 1984, To Kill a Mockingbird
➢ TV Series / Shows
→ Example: Breaking Bad, Friends
➢ Countries or Cities
→ Example: Japan, New York
The challenger must also indicate whether the challenge should have a limited
number of guessing attempts or allow unlimited attempts. In the case of unlimited
attempts, the game continues until a player correctly guesses the name.
Once this information is submitted, the challenge becomes active and visible to other
players who may request to join. Each challenge is limited to exactly two players. As
soon as a second player joins, the game begins, and no additional players are allowed
to participate.
• When a player chooses to join a challenge, they must be able to select from a list of
all currently active and open challenges. This list should display key details for each
challenge, including the name of the challenger, the selected category, the number of
allowed attempts, and the current number of participants—indicating whether no one
has joined yet or if one player is already waiting.
A challenge officially begins once two players have joined. The game proceeds in
alternating turns, with each player taking the opportunity to ask a yes/no question aimed
at uncovering the secret name. The player who joined the challenge first begins the
questioning.
Each question is broadcast to both players, and the challenger provides a response
("Yes", "No", or "I don’t know"), which is also shared with both participants to ensure
transparency. After receiving the answer, the player who asked the question is prompted
to decide whether they wish to submit a guess. If they choose to guess, the guess is
evaluated against the correct answer.
The game concludes in one of two ways:
1. A correct guess is submitted by either player, ending the challenge immediately and
declaring that player the winner.
2. The number of allowed attempts is exhausted by one of the players. In this case, if
only one player has reached the limit while the other still has remaining attempts, the
player who still has attempts left is declared the winner.
If the challenge has unlimited attempts, the game continues indefinitely until a correct
guess is made.
The server must:
• Accept multiple client connections concurrently
• Support multiple active games in parallel
• Keep track of:
o Connected players
o Open and running challenges
Proper handling of concurrent access to shared resources is required to avoid race conditions
and data inconsistencies. Use synchronization (e.g., thread-safe data structures or locks)
where necessary.
Your final submission must include the following:
1. Source code for both server and client.
2. A README file with instructions on how to run the project.
3. A short report (2-4 pages) describing:
- System design (UML Class Diagram).
- Implementation details (briefly describe how your client/server architecture works
and provide a brief description of methods in your program).