コード例 #1
0
        public static FirefallPatchData CreateError()
        {
            FirefallPatchData r = new FirefallPatchData();

            r.error = true;
            return(r);
        }
コード例 #2
0
 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);
     }
 }
コード例 #3
0
ファイル: Statics.cs プロジェクト: Jotaro31/Meldii
        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;
        }
コード例 #4
0
ファイル: FirefallPatchData.cs プロジェクト: Jotaro31/Meldii
 public static FirefallPatchData CreateError()
 {
     FirefallPatchData r = new FirefallPatchData();
     r.error = true;
     return r;
 }