From c258737756e6aae0fe2a8c07b66d5f03a08fb3c7 Mon Sep 17 00:00:00 2001 From: Maxx53 Date: Wed, 24 Sep 2014 19:00:05 +0400 Subject: [PATCH] Skipping broken data for Newly Listed scan So what? --- scr/SCMBot/SteamSite.cs | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/scr/SCMBot/SteamSite.cs b/scr/SCMBot/SteamSite.cs index de7e796..ef98584 100644 --- a/scr/SCMBot/SteamSite.cs +++ b/scr/SCMBot/SteamSite.cs @@ -563,7 +563,7 @@ public int BuyLogic(int wished, string sessid, ScanItem ourItem, saveTab Input, } - public bool fillLotList(string link, bool full, bool ismain) + public bool fillLotList(string content, bool full, bool ismain) { if (!isStillLogged(cookieCont)) { @@ -575,7 +575,7 @@ public bool fillLotList(string link, bool full, bool ismain) { lotList.Clear(); - byte ret = ParseLotList(SendGet(link, cookieCont, true, false), lotList, currencies, full, ismain); + byte ret = ParseLotList(content, lotList, currencies, full, ismain); if (ret != 7) { @@ -655,7 +655,7 @@ public void scanThread_DoWork(object sender, DoWorkEventArgs e) { try { - if (fillLotList(url, false, true)) + if (fillLotList(SendGet(url, cookieCont, true, false), false, true)) buyCounter = BuyLogic(Convert.ToInt32(GetSweetPrice(scanInput.Price)), sessid, lotList[0], scanInput, buyCounter, true); } @@ -706,7 +706,18 @@ public void listedThread_DoWork(object sender, DoWorkEventArgs e) { //Recent no-caching //Thanks to https://github.com/kitzik - if (fillLotList(string.Format("{0}{1}&nocache={2}", recentMarket, Main.jsonAddon, DateTime.Now.Ticks.ToString()), true, false)) + + start: + var cont = SendGet(string.Format("{0}{1}&nocache={2}", recentMarket, Main.jsonAddon, DateTime.Now.Ticks.ToString()), cookieCont, true, false); + + //Skipping broken data... + if (cont.Length < 40) + { + Thread.Sleep(75); + goto start; + } + + if (fillLotList(cont, true, false)) { for (int i = 0; i < lotList.Count; i++) {