Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Multithreaded Battleship Game - Server and Client Description This assignment will utilize your programming skills in socket programming, threading, and use of the Observer pattern.

Multithreaded Battleship Game - Server and Client Description

This assignment will utilize your programming skills in socket programming, threading, and use of the Observer pattern. These skills will be used to develop a multithreaded socket program of the Battleship game implemented with a server and game client. Both the client and the server must have a GUI interface. The servers GUI will be used to display and monitor game traffic; the clients GUI will contain a fleet map, a target map, and any other components required to play the game and chat during gameplay

I am using Eclipse as IDE and Java as the language.

You will be required to write a:

1. Multithreaded server capable of supporting multiple pairs of Battleship players logged on to chat and play the game concurrently.

2. Client that will allow the user to register on the server and play the game of Battleship with the next available player logged on to the server. Communications between the 2 players are handled using the observer pattern as discussed in class.

3. The game server will wait until two players have logged on to the server. It will pair these players off under a separate thread of control which, when created, will notify each player that they can start playing the game. The game will randomly select which player goes first.

4. At the end of each game, the players should be given a choice if they wish to continue playing. CPRG 311 ASSIGNMENT 1: A CLIENT SERVER APPLICATION PAGE 2

a) If they both choose yes to quitting, they are logged off the system and their sockets are dropped.

b) If one responds yes and the other no, then the player responding yes should be paired up with the next available player on the server. The chat history should remain on-screen.

c) If both players wish to keep playing, then the gameboard will reset and the player who won the last game will go first in the next game. The chat history should remain on-screen.

Battleship Rules: The map grids are to be set up as a minimum 10 X 10 grid. The ships in a fleet are: 1. Aircraft carrier occupies 5 squares 2. Battleship occupies 4 squares 3. Cruiser occupies 3 squares 4. Submarine occupies 3 squares 5. Destroyer occupies 2 squares Note: Ships are placed only horizontally or vertically (not diagonally). Once players are selected for a game to begin, they must be allowed to place their ships on their tactical map before game play can resume.

image text in transcribed

Appealing, intuitive, user-friendly GUI for the client side 15 12 Readmes/Instructions, javadoc documentation Proper system/project structure and naming 12 12 Server GUI shows real-time log of connections and game traffic Use of streams 11 Use of sockets 1 1 Use of threads 1 1 Use of the Observer pattern 11 12 Exceptions are handled properly Players can chat during game Players can play game and game logic is correct 12 12 Players can be reinstated to play via the server 1 2 Synchronization of key method(s) 1 2 Appealing, intuitive, user-friendly GUI for the client side 15 12 Readmes/Instructions, javadoc documentation Proper system/project structure and naming 12 12 Server GUI shows real-time log of connections and game traffic Use of streams 11 Use of sockets 1 1 Use of threads 1 1 Use of the Observer pattern 11 12 Exceptions are handled properly Players can chat during game Players can play game and game logic is correct 12 12 Players can be reinstated to play via the server 1 2 Synchronization of key method(s) 1 2

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Concepts Of Database Management

Authors: Philip J. Pratt, Joseph J. Adamski

4th Edition

0619064625, 978-0619064624

More Books

Students also viewed these Databases questions

Question

1. Who will you assemble on the team?

Answered: 1 week ago

Question

4. Who would lead the group?

Answered: 1 week ago