24.21 (Modifications to the Multithreaded Tic-Tac-Toe Program) The programs in Fig. 24.13 and Fig. 24.15 implemented a multithreaded, client/server version of the game of Tic-Tac-Toe. Our goal in developing this game was to demonstrate a multithreaded server that could process multiple connections from clients at the same time. The server in the example is really a mediator between the two client appletsit makes sure that each move is valid and that each client moves in the proper order. The server does not determine who won or lost or whether there was a draw. Also, there is no capability to allow a new game to be played or to terminate an existing game.
The following is a list of suggested modifications to Fig. 24.13 and Fig. 24.15:
Modify the TicTacToeServer class to test for a win, loss or draw on each move in the game. Send a message to each client applet that indicates the result of the game when the game is over.
Modify the TicTacToeClient class to display a button that when clicked allows the client to play another game. The button should be enabled only when a game completes. Note that both class TicTacToeClient and class TicTacToeServer must be modified to reset the board and all state information. Also, the other TicTacToeClient should be notified that a new game is about to begin so that its board and state can be reset.
Modify the TicTacToeClient class to provide a button that allows a client to terminate the programat any time. When the user clicks the button, the server and the other client should be notified. The server should then wait for a connection from another client so that a new game can begin.
Modify the TicTacToeClient class and the TicTacToeServer class so that the winner of a game can choose game piece X or O for the next game. Remember: X always goes first.
-------------
TicTacToeClient class:
and you can get codes that we wana edit from here:
http://www.cs.fit.edu/~mmahoney/cis5100/examples/ch24/fig24_13_16/TicTacToeClient.java
main for it :
http://www.cs.fit.edu/~mmahoney/cis5100/examples/ch24/fig24_13_16/TicTacToeClientTest.java
TicTacToeServer Class:
http://www.cs.fit.edu/~mmahoney/cis5100/examples/ch24/fig24_13_16/TicTacToeServer.java
Main for it :
http://www.cs.fit.edu/~mmahoney/cis5100/examples/ch24/fig24_13_16/TicTacToeServerTest.java
please help me ..
i wana full solution of this
i worked before 2 weeks on it and i must send the solution next sunday...
please help me :(