qstat.c
/** must be called only on connected servers
 * @returns time in ms until server needs timeout handling. timeout handling is needed if <= zero
 */
must be called only on connected servers
@returns time in ms until server needs timeout handling. timeout handling is needed if <= zero
must be called only on connected servers @returns time in ms until server needs timeout handling . timeout handling is needed if < = zero
static int qserver_get_timeout(struct qserver *server, struct timeval *now)
{
	int diff, diff1, diff2, interval;
	if (server->type->id &MASTER_SERVER)
	{
		interval = master_retry_interval;
	}
	else
	{
		interval = retry_interval;
	}
	diff2 = 0xffff;
	diff1 = interval *(n_retries - server->retry1 + 1) - time_delta(now, &server->packet_time1);
	if (server->next_player_info < server->num_players)
	{
		diff2 = interval *(n_retries - server->retry2 + 1) - time_delta(now, &server->packet_time2);
	}
	debug(2, "timeout for %p is diff1 %d diff2 %d", server, diff1, diff2);
	diff = (diff1 < diff2) ? diff1 : diff2;
	return diff;
}
static int qserver_get_timeout ( struct qserver * server , struct timeval * now ) { int diff , diff1 , diff2 , interval ; if ( server -> type -> id & MASTER_SERVER ) { interval = master_retry_interval ; } else { interval = retry_interval ; } diff2 = 0xffff ; diff1 = interval * ( n_retries - server -> retry1 + 1 ) - time_delta ( now , & server -> packet_time1 ) ; if ( server -> next_player_info < server -> num_players ) { diff2 = interval * ( n_retries - server -> retry2 + 1 ) - time_delta ( now , & server -> packet_time2 ) ; } debug ( 2 , " " , server , diff1 , diff2 ) ; diff = ( diff1 < diff2 ) ? diff1 : diff2 ; return diff ; }
must be called only on connected servers
 @returns time in ms until server needs timeout handling.
must be called only on connected servers @returns time in ms until server needs timeout handling .