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
Copyright By PowCoder代写 加微信 powcoder
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 specific 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.
Likewise, when another player enters the room a
player is in, the server should notify them of the
new player so it can be reported accordingly.
Continuing the above example, when Bob enters
the room and Alice is already in the room, Alice will
be notified of Bob’s entry.
joust:game katchab$ python3 player.py Alice room://localhost:5555
entry wau to an old house.
Weathered, but
still tidu and clean
doorwau leads awau from the room to the north.
this room, there are:
Bob entered the room
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 will 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:
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 different
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
dougtigane katchab& python3 player.py Bob room://localhost:5555
entru wau to an old house
Weathered.
but still tidu and clean
A doorway leads awau trom the room to the north
this room, there are
left the game.
Players can now say things using the “say
command. Whatever message they write on the
line following the say command is passed to the
server, and the server then distributes it to all
other lavers currentlv in the room, who then
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:
joust :game katchab$ python3 player.py Alice room://localhost:5555
The entry way
an old house
Weathered,
still tidy and clean
A doorway leads awau from the room to the north.
In this room, there are:
Baa enterer the ranm
An old study.
Some mammer of business apparentlu was run from here
A doorwau leads awau from the room to the south.
this room, there are:
When a player leaves a room and moves to
another, they take all their inventory items with
them to the new room. This does mean that
players can pick something up in one room and
drop it in a different room. (Please note that
players can never pick up other players though!) In
effect, moving from one room to another amounts
to exiting the one server and joining the other.
Players will also see other players leave the room
that they share with them, being notified of such
occurrences by the server. Continuing the above
example, if Alice headed north, the server would
notify Bob that Alice left, indicating the direction
程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com