Table/Game Protocol

Ok. So we have finally had enough questions regarding the messages for tables and games.

Here goes.

Protocol Interaction: Join Table and Moderator launches game
Date: Apr-22 11:11 PM

Time GameManagerGUI TableManagerGUI UserManagerGUI TableManager GameManager
    join ("george" joins tbl 100
as moderator)
     
        join (received)  
        joined request broadcast to all connected clients  
      joined ("george") received and update to show which table user is on    
    joined ("george") received and update to show which table user is on      
    join ("alice" joins tbl 100
as player)
     
        join (received)  
        joined ("alice" request broadcast to all connected clients  
      joined ("alice") received and update to show which table user is on    
    joined ("alice") received and update to show which table user is on      
    start ("george" aims to start table)      
        start ("george" received)

tableinfo request for the one table broadcast to all clients [note: table is closed]

LOCAL started request sent to mbus for local processing

 
    All TMGUIs for all connected clients receive tableinfo request and update display accordingly      
          started request detected.

started request multi-cast to just players on the table

  started request received (by just "alice" and "george") so they know the game has started and can begin        

What happens when a client decides to leave a game?

Time GameManagerGUI TableManagerGUI UserManagerGUI MBus TableManager GameManager
  detects close-window or whatever and issues leave ("alice") command          
          leave ("alice") command received

left request broadcast to all clients

 
            leave ("alice") command received and processed. Nothing sent out
    left request received and GUIs updated        
  left request received. If that table id is the game id we are playing, we must deal.          

So what happens when a client logs out while a game is in progress.

Time GameManagerGUI TableManagerGUI UserManagerGUI MBus TableManager GameManager
      logout or "alice" command distribute logout to all components that want it server-side    
          logout (received). Find originator and treat this command as if it were a leave command.  

So what happens when game completes? For two person game with alice and george

Time GameManagerGUI TableManagerGUI UserManagerGUI TableManager GameManager
  finish for "alice"

window could close automatically or you can
left client close when desired

       
          finish for "alice" received.

removed from game. Nothing done
since one more player

  finish for "george"

window could close automatically or you can
left client close when desired

       
          finish for "george" received.

game is now complete.

finished request sent LOCALLY to be received by TableManager

        receive finished request

broadcast tableinfo showing the revised status to all clients

 
    All clients receive tableinfo and clear the status for table.      

If other teams have challenges to this protocol arrangement, bring to class on Thursday.