1 | |
1 | |
2 | /* |
2 | /* |
3 | * static char *rcsid_loop_c = |
3 | * static char *rcsid_loop_c = |
4 | * "$Id: loop.c,v 1.7 2006/04/28 16:24:03 root Exp $"; |
4 | * "$Id: loop.c,v 1.8 2006/05/21 23:46:39 root Exp $"; |
5 | */ |
5 | */ |
6 | |
6 | |
7 | /* |
7 | /* |
8 | CrossFire, A Multiplayer game for X-windows |
8 | CrossFire, A Multiplayer game for X-windows |
9 | |
9 | |
… | |
… | |
511 | while (select(socket_info.max_filedescriptor, &readfs, NULL, NULL, &Timeout)==0); |
511 | while (select(socket_info.max_filedescriptor, &readfs, NULL, NULL, &Timeout)==0); |
512 | |
512 | |
513 | reset_sleep(); /* Or the game would go too fast */ |
513 | reset_sleep(); /* Or the game would go too fast */ |
514 | } |
514 | } |
515 | |
515 | |
|
|
516 | void flush_sockets(void) |
|
|
517 | { |
|
|
518 | player *pl; |
|
|
519 | |
|
|
520 | for (pl = first_player; pl != NULL; pl = pl->next) |
|
|
521 | if (pl->socket.status != Ns_Dead) |
|
|
522 | Socket_Flush (&pl->socket); |
|
|
523 | } |
516 | |
524 | |
517 | /** |
525 | /** |
518 | * This checks the sockets for input and exceptions, does the right thing. |
526 | * This checks the sockets for input and exceptions, does the right thing. |
519 | * |
527 | * |
520 | * A bit of this code is grabbed out of socket.c |
528 | * A bit of this code is grabbed out of socket.c |