/// <summary> /// Query the server list. Task result will be true when finished /// </summary> /// <returns></returns> public async Task <bool> RunQueryAsync(float timeoutSeconds = 10) { var stopwatch = System.Diagnostics.Stopwatch.StartNew(); Reset(); LaunchQuery(); var thisRequest = request; while (IsRefreshing) { await Task.Delay(33); // // The request has been cancelled or changed in some way // if (request == IntPtr.Zero || thisRequest.Value != request.Value) { return(false); } var r = Responsive.Count; UpdatePending(); UpdateResponsive(); if (r != Responsive.Count) { OnChanges?.Invoke(); } if (stopwatch.Elapsed.TotalSeconds > timeoutSeconds) { break; } } MovePendingToUnresponsive(); OnChanges?.Invoke(); return(true); }
internal void InvokeChanges() { OnChanges?.Invoke(); }
public void Stop() { StopGame = true; OnChanges?.Invoke(); }
public void InvokeChanges() { OnChanges?.Invoke(); }