Structure of a multiplayer card game (Hearts) with Java RMI -


i'm trying figure out best practice implementing "hearts" multiplayer game java rmi.

here's thought far:

  • a remote interface methods common tasks requested players (deal cards each player, passing cards other players, play card, etc).

  • the server contain 4 player objects containing cards, current effects (pursuing 2 of clubs, being allowed or not play heart cards game, etc) , variables defining current game state (cards played, current suit being used, if heart cards can played, etc).

  • the client instances deal gui (which changes based on results provided remote method calls)

what still have no idea:

  • after player plays card, how communicate other clients efficiently update gui right after action done? (i found examples client call server something, not reverse)

  • should implement each player object remote objects too? or regular objects server instance?

  • is possible control each client state (playing, waiting other players, end of round,...) using threads? if so, how can this?

  • any suggestions on how application structure better welcome too.


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -