[Solved]-Question 2 Networked Game Requires Two Players Controlled Central Server Server Applicatio Q37200608
Please answer question carefully &correctly for a thumbs up.


Question 2 A networked game requires two players and is controlled by a central server. The server application implements the following methods with functionality as described o waitForConnections O Waits for two client applications to connect; e playGame( Socket player1, Socket player2) Executes the game logic for the two connected players (a) A single server class can be implemented that allows one game to be played at a time Write a pseudocode description for the waitForConnections ) method including the functionality listed above and the expected sequence of operations (b) Explain how the server class could be altered to allow for multiple, simultaneous games to be played independently Your answer should include a description of the changes to the class structure, where the functionality listed above is placed in this new structure, and how multiple games can be achieved Explain the changes that would be made to your pseudocode in part (a) (c) A simple game is designed where players take turns to guess whether the next number will be higher or lower than the current value. The rules can be defined as follows (i) The server notifies both players that a game will start (ii) The server generates a random integer in the range [0,10 and passes it to botlh players (iii) The server randomly selects a player to start and notifies them (iv) That player guesses higher (H) or lower (L) and passes that message to the server (v) The server generates a random integer in the range [0,10 and passes it to both players (vi) i. If the player was correct (or the integers are equal) the server notifies the other player it is their turn and we go to (iv) ii. If the player was wrong they lose, both players are notified, and the game is over Assuming you are the first player to guess, describe the sequence of communications on the client-side that would be required to implement a client application for this game in Java (d) What type of communication protocol does this game represent? How does this influence the implementation of the game logic in the server application? (e) Assuming TCP-based communication, how do the client and server applications make use of blocking behaviour in their implementation? Show transcribed image text Question 2 A networked game requires two players and is controlled by a central server. The server application implements the following methods with functionality as described o waitForConnections O Waits for two client applications to connect; e playGame( Socket player1, Socket player2) Executes the game logic for the two connected players (a) A single server class can be implemented that allows one game to be played at a time Write a pseudocode description for the waitForConnections ) method including the functionality listed above and the expected sequence of operations (b) Explain how the server class could be altered to allow for multiple, simultaneous games to be played independently Your answer should include a description of the changes to the class structure, where the functionality listed above is placed in this new structure, and how multiple games can be achieved Explain the changes that would be made to your pseudocode in part (a) (c) A simple game is designed where players take turns to guess whether the next number will be higher or lower than the current value. The rules can be defined as follows (i) The server notifies both players that a game will start (ii) The server generates a random integer in the range [0,10 and passes it to botlh players (iii) The server randomly selects a player to start and notifies them (iv) That player guesses higher (H) or lower (L) and passes that message to the server (v) The server generates a random integer in the range [0,10 and passes it to both players (vi) i. If the player was correct (or the integers are equal) the server notifies the other player it is their turn and we go to (iv) ii. If the player was wrong they lose, both players are notified, and the game is over Assuming you are the first player to guess, describe the sequence of communications on the client-side that would be required to implement a client application for this game in Java (d) What type of communication protocol does this game represent? How does this influence the implementation of the game logic in the server application?
(e) Assuming TCP-based communication, how do the client and server applications make use of blocking behaviour in their implementation?
Expert Answer
Answer to Please answer question carefully & correctly for a thumbs up…. . . .
OR

