Hello everybody,

I'm trying to make a multiplayer tetris. I wan't to synchronize the two games on each computer with each other. Now I'm stuck with the following problem:

On a certain moment in the game the client has to wait until a variable is set. The variable is send by the server. Now i'm wondering how the program can "wait" until the variable is set. I tried it like I would do it in C but my program crashed that way. I fully understand signals and slots but I think i can't use it in this case.

Qt Code:
  1. else
  2. {
  3. while(!ack_piece) // <---- I need a way to fix this
  4. {
  5. }
  6. this->set_ack_piece(false);
  7. qDebug()<<"beginstadium van nextpiece = "<<nextpiece_temp;
  8. nextPiece.setRandomShape(nextpiece_temp);
  9. }
To copy to clipboard, switch view to plain text mode 

Hope somebody can help me.

Thanks