async void PVPTimer_Elapsed(object sender, ElapsedEventArgs e) { if (main.autoPvPCheckbox.Checked) { PVPTimer.Stop(); if (!PlayFab.PlayFabClientAPI.IsClientLoggedIn()) { await main.login(); } int size = Math.Max(3, 2 * (int)Math.Max(main.playersAboveCount.Value, main.playersBelowCount.Value + 1)); while (!await main.pf.getLeaderboard(size)) { ; } Random r = new Random(); int index; do { index = r.Next(0, PFStuff.nearbyPlayersIDs.Length); } while (index == PFStuff.userIndex || index > PFStuff.userIndex + (int)main.playersBelowCount.Value || index < PFStuff.userIndex - (int)main.playersAboveCount.Value); main.taskQueue.Enqueue(() => sendFight(index), "PVP"); } }
async void FreeChestTimer_Elapsed(object sender, ElapsedEventArgs e) { if (!PlayFab.PlayFabClientAPI.IsClientLoggedIn()) { await main.login(); } await main.getCurr(); }