Overview

This assignment has two main objectives. It aims to establish a basic familiarity with the Java API (Java Thread class) for creating a multithreaded Java application, and the Java networking packages for creating a client-server Java application.

Objectives

On completion of this assignment a student should be able to write Java applications that:

  • Apply Java multithreading concepts
  • Make use of Java API “Net” package
  • Make use of Java API "Swing" and "AWT" packages
  • Handle generated events
  • Comprises classes designed based on object-oriented concepts
  • Makes use of Java programming fundamentals

Scope

This assignment is based on individual effort. You are required to enhance the one player Java GUI game application "Blackjack" done in Assignment 2 to a multi-players networking game (client- server architecture). This means that for your game application, the GUI should be run as a client, and all the computations for controlling the game should be carried out by a server. Your server should be able to serve multiple clients concurrently, meaning that it should be a threaded server. Besides providing the required functionalities, your program should incorporate appropriate error handling. Comments are also to be inserted to improve program clarity. Before you start coding your program, you are strongly advised to carry out proper problem analysis and program design. You are expected to explore object-oriented concepts to design appropriate classes for this

Requirements

There are two modules in this program; Client and Server.

Server Module

Admin Login This dialogue box allows the admin to login to the system. See image.

Admin Main menu Upon successful login, the administrator will be presented with the main menu. The administrator can then select the required task from the menu by clicking on the button. See image.

The five tasks on the left panel is the same as previous assignment.

The admin can use the right panel to start the game server.

The admin can specific the port number that the server listens to (default is 4444).

Then the admin selects how many players for the game (1 to 3 players).

After the admin click on “Start Game Server”, the server will be started and listens for new connections. See image.

(Assume the admin has selected 3 players for this game) The server will stop by itself when all the player choose to exit the game.

Client Module

Login The game starts by the player logging into the game. See image.

Waiting Upon logging in, if the server is still waiting for other player(s) to get connected, it will display a waiting message until all the players have connected to the server. See image.

Place bet When all the players are connected, the game starts by player placing the bet. The server will update the player betting status accordingly. See image.

Play Game The game starts after the player click on “Play Now!”. First, the dealer will shuffles the deck. See image.

Then the dealer deals two cards from the top of the deck to each player and itself. See image.

Player 1 will starts the game. In the above case IcePeak is the first player and the screen belongs to IcePeak as well. IcePeak can hit up to 4 cards. When IcePeak stands, it will move to BlackRanger until the dealer’s turn. After the dealer stands, all hidden cards will be shown and the dealer will compute the amount win and lose by each player. The status of each player (e.g. Waiting, Hit, Stand, Exit) will be updated at the server admin screen. Each player can view the status of other player’s status (e.g. Waiting, Hit, Stand, Exit) on their screen as well. And the game continues until all the players exit the game. See image.

Error Handling

Your program should be able to handle error situations like where a player enter wrong password or has insufficient chips. You should look out for other possible exceptions and handle them too.

Academic Honesty!
It is not our intention to break the school's academic policy. Projects posted are only used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly fill out the form. Please provide a valid email address and we'll get back to you in less than 24 hours. We will be sending an invoice through PayPal upon confirmation. We are a non profit organization however we need an amount to keep this organization running, and to be able to complete our research and development.