In main in ClientInterface you create one CI and one Client. In your description, you talk about Client 1, Client 2, etcetera.
Can you show us the full code, or at least the Client class?
cannot communicate to threads in another process.
Why are you using an Object as a lock, rather than a Lock instance?
Why do you have wait() calls not inside a loop?
Probably not in a simple case like this. What would happen if you change line 64 to the following?
Sean Mcleod wrote:. . . Would it change the functionality? . . .
What would happen if you change line 64 to the following?
Piet Souris wrote:I use a Lock too, as Stephan did, but I did not use Conditions (never used so far).
But I'm not sure about some things: is a Lock necessary?
How about the visibility of all players and their field "hasBall"?
The code seems to work, but if anyone has some useful comments, I'd like to hear them.