1

I am trying to create a simple online card game with multiple players. Basically, there's a dealer and multiple players. I have have already implemented most of the game and it's working fine. now I want to implement a universal timer for a single game. For example, when the dealer starts a new game the timer starts and the players will be notified that the game started, and then there will be a countdown which will be seen by the players and the dealer.

Any strategy on how I can implement this?

Additional info about my system:

  • I am using spring and jms and the system is divided into 3 applications.
  • 2 web applications, 1 for players and 1 for dealers. the web applications do not do any processing, they just receive request and delegate processing to the server.
  • 1 console application as my server.
  • Im currently using javascipt to update info in the clients. for example in the dealer client side, i have a js script that makes a query every 3 seconds to identify whether each of the players wants to make a "hit" or "deal".

Now there's a possibility that a player may become idle so I want to implement a timer so that when the timer expires the server can do some processing on that idle player.

  • Are you talking about a global timer that shows the same time for all players? If so that is not quite possible, you have to live with some differences (<100ms typically). Are you talking about making a timeout server side? If so state your language constraints, clarify your question and ask on stackoverflow. – nwp Sep 16 '14 at 7:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.