CS490 Supervised Undergraduate Reserach Computer Game Design - Spring 2003 Assignment #3 --------------------- ** NOTE: In order to do this assignment you will need a computer with a network connection. The network card and connection is necessary for sockets to be established. Note that you DO NOT NEED two computers. You can run the client and the server on the same computer by just starting the program twice and pressing 'c' for one, and 's' for the other. ** NOTE: If you are doing your assignment in a lab, make sure that someone else is not trying to implement the assignment at the same time. If this occurs, your client/server may talk to their client/server rather than the client/server you are testing on your computer. If you and another student are both trying to implement the assignment in the same lab at the same time, I would suggest collaborating on the homwork. Using the NetDemo as a starting point, implement ONE (or optionally TWO) of the following: 1) Prevent the server from being able to transmit keyboard input or display data to its own console. These are non-essential operations for the server. Only the clients need to recieve keyboard input and display data. (Eliminate the data from the server console, but leave the server state messages). 2) Have the server send and show the servers current time on each client every 20 secs. 3) When the server recieves a char from a client, have the server selectively send that char to a single client at random rather than to all of them. 4) Have the client block incoming data from the server if the server sends it a char from a specific client. That is, if client #1 is "blocking" client #3, then if the server sends data to client #1 from client #3, client #1 should not display the data. (Optional: Allow the user to enter as input which client # should be blocked). 5) Provide a disconnect key (like ESC) for the client. This should send a cDISCON message to the server, instructing the server to remove the client from its list of clients. 6) Have the server buffer keys from each client until the return key is recieved. Once the return key is pressed, the server should send that buffer to every client, including the new-line character. This should make the Chat Client-Server into a "real" chat program in the sense that you do not see what others type until they press return. In addition, each line written by someone will be written on a different line (rather than all the chars getting mixed together). Hint: You will need to maintain a buffer in the server for >each< client that is connected.