private static async Task WaitUntilInMenu() { var timeout = 30000; var wait = 1000; var elapsed = 0; while (!Client.IsInMenu()) { await Task.Delay(wait); elapsed += wait; if (elapsed >= timeout) { return; } } }
private static async Task WaitUntilInMenu() { var timeout = 30000; var wait = 1000; var elapsed = 0; while (!Client.IsInMenu()) { await Task.Delay(wait); elapsed += wait; if (elapsed >= timeout) { Logger.Debug($"EndGame: InMenu wait timed out after {timeout / 1000}s"); return; } } }