Assignment 8 Message Sequences

II. Message Sequences

The following enumeration specifies how the seven possible interactions among the player registration procedure, the game administrator, the players, and the turns are translated into message sequences.

0. registering a player with the server

==================================================================
 server                                     client
==================================================================

	    <----- <string:x> --------------------------
   register player with name x 
	    ------ (<string:x> <color> <equations>) --->
   tell: confirm name x, first pebble, equations

1. inform: informing a player

==================================================================
 server                                     client
==================================================================

	    ------ (inform <string:s>) ---------------->
   inform player of s 
	    <----- (done) ------------------------------
   acknowledge information

2. punish: remove tokens from player

==================================================================
 server                                     client
==================================================================

	    ------ (punish <pebbles:s>) ---------------->
   punish player by taking away s pebbles
	    <----- (done) ------------------------------
   acknowledge punishment

3. take-turn: initiating a turn

==================================================================
 server                                     client
==================================================================

	    ------ (turn <card><card><card><card>) ---->
   initiate a turn with a deck of cards 

   { roll-die | trade } x { buy-card }[0|1]

	    <----- (done) ------------------------------
   acknowledge end of turn

4. turn: rolling the die

==================================================================
 server                                     client
==================================================================

	    <----- (roll-die <color:c>) ----------------
   request a roll of the die, with c as default color
	    ------ (okay <color>) --------------------->
   receive the result of the roll

5. turn: trading cards

==================================================================
 server                                     client
==================================================================

	    <----- (trade <pebbles:i> <pebbles:o>) ----
   request a trade of i for o
	    ------ (okay) ----------------------------->
   receive acknowledgment 

6. turn: buy-card

==================================================================
 server                                     client
==================================================================

	    <----- (buy <card:c>) ---------------------
   request to buy card c
	    ------ <number:n> ------------------------>
   receive score n


CSPP 51090 Software Construction