public async void getWebsiteData() { PFStuff.getWebsiteData(main.KongregateId); main.currentBossLabel.setText(shortBossName(PFStuff.WBName) + (PFStuff.wbMode == 0 ? " NH" : " HA") + ", Attacks left: " + PFStuff.attacksLeft); main.auctionHouse.loadAuctions(false); double x = await main.auctionHouse.getAuctionInterval(); WBTimer.Interval = Math.Min(Math.Max(PFStuff.attacksLeft * 2500, 5000), x); nextWBRefresh = DateTime.Now.AddMilliseconds(WBTimer.Interval); main.currentDungLevelLabel.Text = PFStuff.DungLevel; }
public void loadAuctions(bool getData) { if (getData) { PFStuff.getWebsiteData(main.appSettings.KongregateId); main.currentDungLevelLabel.Text = PFStuff.DungLevel; } auctionList = new List <Auction>(); foreach (JObject jo in PFStuff.auctionData) { int id = Int32.Parse(jo["hero"].ToString()); string bidName = jo["bidname"].ToString(); int price = Int32.Parse(jo["bid"].ToString()); DateTime dt = DateTime.Now.AddMilliseconds(double.Parse(jo["timer"].ToString())); auctionList.Add(new Auction(id, bidName, dt, price)); } }
public void loadAuctions(bool getData) { if (getData) { PFStuff.getWebsiteData(main.appSettings.KongregateId); main.currentDungLevelLabel.Text = PFStuff.DungLevel; } auctionList = new List <Auction>(); try { foreach (JObject jo in PFStuff.auctionData) { int id = Int32.Parse(jo["hero"].ToString()); string bidName = jo["bidname"].ToString(); int price = Int32.Parse(jo["bid"].ToString()); DateTime dt = DateTime.Now.AddMilliseconds(double.Parse(jo["timer"].ToString())); auctionList.Add(new Auction(id, bidName, dt, price)); } } catch (Exception ex) { // we're probably just missing data because the server is offline } }