Skip to content

Commit

Permalink
Skipping broken data for Newly Listed scan
Browse files Browse the repository at this point in the history
So what?
  • Loading branch information
Maxx53 committed Sep 24, 2014
1 parent dc9dc09 commit c258737
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions scr/SCMBot/SteamSite.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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))
{
Expand All @@ -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)
{
Expand Down Expand Up @@ -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);

}
Expand Down Expand Up @@ -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++)
{
Expand Down

0 comments on commit c258737

Please sign in to comment.