[SOLVED] CS3357 - Assignments P0

100.00 $

Category:
Click Category Button to View Your Next Assignment | Homework

You will receive the following solution file(s) instantly after successful payment:

zip file icon CS3357-Assignment-3-ihaefp.zip (186.9 KB)
Assignment Instructions Updated Recently? Submit Below and we will provide new Solution!
Submit New Instructions
🔒 Securely Powered by:
Secure Checkout
5/5 - (3 votes)

Assignment #3 – In progress
Draft – In progress
Submitted
Returned
Assignment Details
Title
Assignment #3
Number of resubmissions allowed
Unlimited
Accept Resubmission Until
Status
Not Started Grade Scale
Points (max 100.00)
Instructions Add
CS3357 Assignment #3

Purpose of the Assignment
The general purpose of this assignment is to continue to explore network programming and more advanced concepts by a extending the text adventure game built in Assignment #2. This assignment is designed to give you further experience in:
writing networked applications the socket API in Python writing software supporting a simple protocol
Late Penalty
Individual E ort
Your assignment is expected to be an individual e ort. Feel free to discuss ideas with others in the class; however, your assignment submission must be your own work. If it is determined that you are guilty of cheating on the assignment, you could receive a grade of zero with a notice of thisAdd o ence submitted to the Dean of your home faculty for inclusion in your academic record.
What to Hand in
Assignment Task
You are required to implement a more robust client-server text adventure game, leveraging the client and server you implemented as part of Assignment #2. A sample implementation of Assignment #2 will be provided in the near future (after all submissions are in) that you can use as a basis for development in this assignment, if you would rather do that than use your own previous work.
For this assignment you will be adding a collection of new features to the application. The main addition is that the game now must support multiple simultaneous players across multiple servers. Players will be able to see and say things to one another and also move from room to room (which means from server to server). Some Particulars
Here are some speci c requirements and other important notes:
When a player receives a room description from the room server, either by joining a room or by using the look command, other players will now be listed among what they can see in the room. A player should never see themselves listed as being present in the room; only other players in the room should be visible. For example, if Alice is in a room and Bob enters the room, Bob will see Alice in the description of the room.

Continuing the above example, when Bob enters the room and Alice is already in the room, Alice will be noti ed of Bob’s entry.
This does mean that the server must be able to send messages to the client on its own and not simply in response to messages from the client.
More on that below.
Players will be able to move from room to room now, using the commands north, south, east, west, up, and down. When a room server is started, optional parameters must now be given for those directions leading away from the room hosted by the server. These parameters willAdd indicate the direction and give an address of the room in that direction in the form room://host:port (like the client uses in connecting with servers.) For example, if the Foyer was running on port 5555 on localhost, and the Study was located on port 4444, they might be executed as follows:

As you can see, the -n and -s options are used for specifying rooms to the north and the south. Likewise, -e, -w, -u, and -d will allow you to specify rooms to the east, west, up, and down directions respectively. Rooms do not need connections to other rooms in every direction; you only need to specify the directions that are actually needed and used in the game. Continuing the previous example, if Alice was to head north using the north command, it would appear like this:
Players will also see other players leave the room that they share with them, being noti ed of such occurrences by the server. Continuing theAdd above example, if Alice headed north, the server would notify Bob that Alice left, indicating the direction she headed in at the same time.
Alternatively, if a player in the same room leaves the game entirely, the server should still notify the players in that room, but use a slightly di erent message. For example, if Alice had instead exited the game using the exit command, Bob would have seen a message like what is depicted below.
Add

server, and the server then distributes it to all other players currently in the room, who then immediately display it. (The player who spoke does not receive a copy of things in that fashion, but rather gets an acknowledgement that they said what they said.) If no additional text is given, the player is given an error message notifying them of this. For example, if Alice said something in the same room as Bob, her display would look likeAdd this. Add
Bob would get immediately noti ed of Alice speaking by the room server, without having to enter any commands. His display would appear asfollows.
Now that the room server can message clients whenever they need to, and clients will receive them and process them even if they are waiting for user input, the server can now have a signal handler that noti es players when it is shut down using a Ctrl-C signal. When that is done, it should send a “disconnect” message to every client on the server. Clients receiving such messages should exit right away. For example, let’s suppose the Foyer room server is shut down. Its display would look like:
Note that it also prints a message when shutting down. Alice would receive the disconnect message from the server and shut down immediately. Her display would appear as follows.

same time. (There is no way to tell which will be happening when … both could happen at any time.) Messages from the server will include activity of other players in the same room (coming, going, saying things) as well as potential disconnect messages. To enable this, I recommend using the selectors package in Python or the lower-level Add select package. This will allow you to wait from input from multiple sources (the keyboard and your client’s socket) at the same time instead of just a single source (the keyboard) in the previous assignment.

Submission
Assignment Text
This assignment allows submissions using both the text box below and attached documents. Type your submission in the box below and/or use the Browse button or the “select les” button to include other documents. Save frequently while working.
Source

Font Size
Styles Format
Words: 0, Characters (with HTML): 0/1000000
Attachments
or select les from ‘Home’ or site
Don’t forget to save or proceed!

  • CS3357-Assignment-3-ihaefp.zip