0

I am completely new to Java/Corba, I am making a two player game. How can I make server notify all users when specific condition is met? For example: I have an array with [Player1, Player2] when both are not null I want all players to be notified that the game is ready. How can I do that? is there any simple method?

So far my only solution is: while game is not ready{ call function to check if both slots are filled every x seconds. } when it comes back and says both slots were filled - players begin game. I literally need this just for a small simple college project, any easy way?

arleitiss
  • 1,304
  • 1
  • 14
  • 38
  • Consider a CountDownLatch http://stackoverflow.com/questions/17827022/what-is-countdown-latch-in-java-multithreading – Jim Mar 03 '15 at 15:11
  • Have each player's JVM open a socket to the server, and have the server serialize objects over each player socket which indicate game status. – VGR Mar 03 '15 at 15:18

0 Answers0