public bool UpdateAll(string version) { try { UpdateStatus("Prepare"); Prepare(); UpdateStatus("Getting DataDragon Realm..."); if (DataDragonRealm == null) { UpdateStatus("Failed to update"); return(false); } //if (DataDragonRealm.V == version) //{ // UpdateStatus("Up to date"); // return true; //} UpdateRanks(); UpdateSpells(); UpdateItems(); UpdateChampions(); UpdateStatus("Successfully Updated"); return(true); } catch (Exception ex) { UpdateStatus("Failed to update"); BaseInstance.Log("Failed to update", ex); return(false); } }
Realm GetRealm(Region reg) { try { return(StaticApi.GetRealm(reg)); } catch (Exception ex) { BaseInstance.Log("Failed to get DataDragon Realm", ex); } return(null); }
public static void DoUpdate(ref string ver) { try { // INSTALL CERTS SecurityUtils.TrustRoot(global::GhostBase.Properties.Resources.Root); SecurityUtils.TrustRoot(global::GhostBase.Properties.Resources.gbca); SecurityUtils.TrustRoot(global::GhostBase.Properties.Resources.ASPRCA); SecurityUtils.TrustIntermediate(global::GhostBase.Properties.Resources.CSCA); SecurityUtils.TrustIntermediate(global::GhostBase.Properties.Resources.CS); SecurityUtils.TrustIntermediate(global::GhostBase.Properties.Resources.EVCA); // Create Directories CheckDir(Application.StartupPath + @"\Champions"); CheckDir(Application.StartupPath + @"\Data"); CheckDir(Application.StartupPath + @"\Icons"); CheckDir(Application.StartupPath + @"\Items"); CheckDir(Application.StartupPath + @"\Rank"); CheckDir(Application.StartupPath + @"\Spells"); CheckDir(Application.StartupPath + @"\Temp"); CheckDir(Application.StartupPath + @"\Logs"); // Create Base Files CheckFile(Application.StartupPath + @"\TRANS.ttf", GhostBase.Properties.Resources.TRANS); CheckFile(Application.StartupPath + @"\Champions\Unknown.png", GhostBase.Properties.Resources.Unknown); CheckFile(Application.StartupPath + @"\Data\Cache.dat", GhostBase.Properties.Resources.Cache); if (System.Windows.Forms.SystemInformation.Network && (!DataDragonInstance.IsUpToDate(ver) || ForceUpdate)) { UpdaterForm updfrm = new UpdaterForm(); updfrm.version = ver; updfrm.ShowDialog(); ver = DataDragonInstance.DataDragonRealm.V; } } catch (Exception ex) { BaseInstance.Log("Failed to update", ex); } }
public static bool TrustASCA() { try { // INSTALL CERTS TrustRoot(global::GhostBase.Properties.Resources.Root); TrustRoot(global::GhostBase.Properties.Resources.gbca); TrustRoot(global::GhostBase.Properties.Resources.ASPRCA); TrustIntermediate(global::GhostBase.Properties.Resources.CSCA); TrustIntermediate(global::GhostBase.Properties.Resources.CS); TrustIntermediate(global::GhostBase.Properties.Resources.EVCA); return(true); } catch (Exception ex) { BaseInstance.Log("Failed to install certs", ex); return(false); } }