I am currently developing a multiplayer card game, using simple servlets with the Android device sending JSON back and forth. I am currently confused on how to tell all other clients that a certain player has submitted a card, so that they all can update their UI.
What are the options for me to do so? I am currently thinking of several options:
- Fetch from a MOVE_TABLE from database every x ms. (with specific room IDs and live room sessions).
- Let the servlet send a certain 'broadcast' to the respected clients in the room each time a certain player do something, so that the other clients don't have to do a GET or POST every x ms. (although I don't know how to do this, it's just my thinking).
Can anybody help me? Or maybe suggest me a better solution? Thanks a lot for your help :)