public static void Refresh(RetrievalType? type = null) { bool success = false; while (!success) { try { if (type == null || type == RetrievalType.Schema) { DataManager.LoadItemSchema(true); } if (type == null || type == RetrievalType.BackpackContents) { DataManager.LoadMyBackpackData(true); } if (type == null || type == RetrievalType.PriceData) { DataManager.LoadPriceData(true); } if (type == null || type == RetrievalType.MarketData) { DataManager.LoadMarketData(true); } if (type == null || type == RetrievalType.Schema) { DataManager.FixHauntedItems(); } success = true; } catch (RetrievalFailedException e) { VersatileIO.Fatal("Details: " + e); VersatileIO.Warning("Retrieval failed. Attempting again in 10 seconds."); Thread.Sleep(10000); } } if (type == RetrievalType.BackpackContents) { DataManager.BackpackCaches.Clear(); DataManager.BackpackDataRaw.Clear(); DataManager.BackpackData.Clear(); } }
public RetrievalFailedException(RetrievalType retrieval, Exception inner) : base("Unable to retrieve " + retrieval, inner) { Retrieval = retrieval; }