public static FirefallPatchData CreateError() { FirefallPatchData r = new FirefallPatchData(); r.error = true; return(r); }
public static FirefallPatchData Create(Stream data) { try { DataContractJsonSerializer serializer = new DataContractJsonSerializer(typeof(FirefallPatchData)); return((FirefallPatchData)serializer.ReadObject(data)); } catch (Exception) { FirefallPatchData nullPatchData = new FirefallPatchData(); nullPatchData.build = "none-0"; nullPatchData.environment = "none"; nullPatchData.region = "none"; nullPatchData.patch_level = "0"; return(nullPatchData); } }
public static FirefallPatchData GetFirefallPatchData() { if (FirefallPatchData == null) { using (WebClient wc = new WebClient()) { try { using (Stream s = GenerateStreamFromString(wc.DownloadString("http://operator.firefallthegame.com/api/v1/products/Firefall_Beta"))) { FirefallPatchData = FirefallPatchData.Create(s); } } catch (System.Net.WebException) { FirefallPatchData = FirefallPatchData.CreateError(); } } } return FirefallPatchData; }
public static FirefallPatchData CreateError() { FirefallPatchData r = new FirefallPatchData(); r.error = true; return r; }