static void NET_Query_QueryLoop(net_query_callback_t callback, void *user_data) { query_loop_running = true; while (query_loop_running && NET_Query_Poll(callback, user_data)) { // Don't thrash the CPU I_Sleep(1); } }
static void QueryPeriodicCallback(TXT_UNCAST_ARG(results_table)) { TXT_CAST_ARG(txt_table_t, results_table); if (!NET_Query_Poll(QueryResponseCallback, results_table)) { TXT_SetPeriodicCallback(NULL, NULL, 0); if (query_servers_found == 0) { TXT_AddWidget(results_table, NULL); TXT_AddWidget(results_table, TXT_NewLabel("No servers found.")); } } }