jordansoans2002 / Games_Arcade

1 stars 0 forks source link

hand cricket networking #9

Open jordansoans2002 opened 2 years ago

jordansoans2002 commented 2 years ago
  1. one player starts a server (P0), other player joins that server (P1)
  2. batsman and bowler is chosen by toss, client waits for boolean message from server to be assigned as bowler or batsman
  3. the innings, target, runs and balls are initialized for bowler and batsman
  4. server accepts the input from P0
  5. client accepts input from P1
  6. servers sends input to client and client to server
  7. based on whether the batting or bowling the game takes the incoming message as runs or ball
  8. if the batsman is out the innings is ended and second innings begins
  9. the innings, runs, target, balls and batting/bowling status is modified
  10. if not out the runs and balls are updated in client and server
jordansoans2002 commented 2 years ago

send all server setting to initialize client settings add multithreading

jordansoans2002 commented 2 years ago

multi-threading is added. the incoming message must come before the umpire puts his hand up otherwise the last input will be taken.

jordansoans2002 commented 2 years ago

Every time the game is the umpire is clicked or value of game loop is changed (or whenever startAnimation() is called) send a message to the other player. To start game send a message to other computer and receive an instant acknowledgement. Start game when acknowledgement is received