31
Oct
Black Art of Java Game Programming by Joel
Black Art of Java Game Programming by Joel Fan Sams, Macmillan Computer Publishing ISBN: 1571690433 Pub Date: 11/01/96 Previous Table of Contents Next Suggestion Box Here are some ideas for extending what you have learned in this chapter. Some are minor additions to the ChatClient, while others explore how you could extend these concepts to other projects. Use applet parameters (in the HTML APPLET tag) to embed the host and port the client should use in an HTML page. This first one is in the source code included with this book. Allow the server to use a user-defined port, instead of just 1123. (You ll need to use the args[] array.) Extend the ChatClient GUI to include some more components. How about labels that provide help and information for the user, like his or her current alias? You could create a Choice Component to allow the user to choose what color the TextArea should be. You could create another TextArea for displaying information about anything you want. Some suggestions: user information, advertising, information about the network connection or about the current version of the software. Modify the current applet and server to handle multiple selections in the List. This means that the user would be able to whisper to multiple people at one time. This will require some modifications to the protocol we use to send whisper messages, but, since we already use a flexible protocol for message sending, this is not too hard. Modify the server to collect and track information about each user logged on, like e-mail addresses, real names, and location. Then, program the client to display this information whenever a user double-clicks on another user in the List. (Remember that java.awt.List generates an ACTION_EVENT whenever an item is double-clicked. You can then check which item is currently selected to find out which one it was.) Use the protocols and code that we have established here to create a never-ending story applet. Each user logged on is invited to add a line to a continuing story, which is prompted by the server. Users may log on and review the current story and then contribute their own sentences to it. When a user logs into the chat room, he or she should see a summary of what has been said prior to their entry (perhaps the last 10 things said). This list should be kept by the server. Every time something is said, it should be added to a queue that is displayed for new logins. Have the client display different types of messages differently. There are a number of ways this could be handled. One would be to have say messages in normal font and whisper messages in bold. Or perhaps different colors. One last idea that works well with the previous suggestion is to extend the number of types
Note: If you are looking for inexpensive but high quality provider to host and run your jsp application check Astra jsp hosting services
