예제 #1
0
 private void method_2(List <GClass30> list_2)
 {
     this.dataSize_0 = new DataSize(0UL);
     this.timeSpan_2 = new TimeSpan(0L);
     this.timeSpan_1 = new TimeSpan(0L);
     this.gstruct3_0 = new GStruct3(0UL);
     this.dataSize_1 = new DataSize(0UL);
     this.list_1     = list_2;
     this.method_3();
     for (int int0 = this.int_0; int0 < list_2.Count; ++int0)
     {
         // ISSUE: reference to a compiler-generated field
         EventHandler <GClass79> eventHandler4 = this.eventHandler_4;
         if (eventHandler4 != null)
         {
             eventHandler4((object)this, new GClass79(list_2[int0], int0));
         }
         this.method_17(string.Format("----Downloading game #{0} out of {1}----", (object)(this.int_0 + 1), (object)list_2.Count));
         int num = this.method_14(list_2[int0]) == GClass80.Enum1.const_0 ? 1 : 0;
         list_2[int0].CurrentlyDownloaded = false;
         list_2[int0].method_6();
         if (num == 0 || !this.bool_0)
         {
             break;
         }
         ++this.int_0;
     }
 }
예제 #2
0
 public static TimeSpan smethod_1(DataSize dataSize_0, GStruct3 gstruct3_0)
 {
     if (gstruct3_0.ulong_0 == 0UL)
     {
         return(new TimeSpan(0L));
     }
     return(TimeSpan.FromSeconds((double)(dataSize_0.TotalBytes / gstruct3_0.ulong_0)));
 }
예제 #3
0
 public static string smethod_13(DataSize dataSize_0, GStruct3 gstruct3_0)
 {
     if (gstruct3_0.ulong_0 > 0UL)
     {
         return(GClass6.smethod_12(GStruct3.smethod_1(dataSize_0, gstruct3_0)));
     }
     return("Not available at the moment.");
 }
예제 #4
0
 public void method_2(int int_0, GStruct3 gstruct3_0)
 {
     // ISSUE: object of a compiler-generated type is created
     // ISSUE: reference to a compiler-generated method
     this.BeginInvoke((Delegate) new Action(new FrmFtpProgress.Class111()
     {
         int_0            = int_0,
         frmFtpProgress_0 = this,
         gstruct3_0       = gstruct3_0
     }.method_0));
 }
예제 #5
0
        private void method_8(object object_0, Class58 class58_0)
        {
            GClass78 gclass78 = (GClass78)object_0;

            if (!this.bool_1)
            {
                this.method_5("Network lost");
            }
            if (!this.bool_0)
            {
                this.gclass78_0.method_0();
            }
            this.gstruct3_0 = gclass78.DownloadSpeed;
            ulong ulong0 = this.gstruct3_0.ulong_0;

            if (ulong0 > this.MaxSpeed)
            {
                this.MaxSpeed = ulong0;
            }
            try
            {
                this.timeSpan_1 = GStruct3.smethod_1(this.dataSize_0.Diff(gclass78.TotalDownloadedCurrentGame), this.gstruct3_0);
                this.timeSpan_2 = GStruct3.smethod_1(this.dataSize_1.Diff(gclass78.TotalDataDownloaded), this.gstruct3_0);
                this.timeSpan_0 = GStruct3.smethod_1(new DataSize((ulong)class58_0.long_2).Diff(new DataSize((ulong)class58_0.long_1)), this.gstruct3_0);
                this.int_4      = GClass80.smethod_0(this.dataSize_0, gclass78.TotalDownloadedCurrentGame);
                this.int_5      = GClass80.smethod_0(this.dataSize_1, gclass78.TotalDataDownloaded);
                this.int_3      = (int)((double)class58_0.long_1 / (double)class58_0.long_2 * 100.0);
                if (this.int_1++ == 8)
                {
                    this.list_0.Add((int)this.gstruct3_0.ulong_0);
                    this.int_1 = 0;
                }
                this.method_16(this.int_4, this.int_5, this.int_3, this.timeSpan_1, this.timeSpan_2, this.timeSpan_0, this.gstruct3_0, (GClass30)null);
            }
            catch
            {
            }
        }
예제 #6
0
 public override string ToString()
 {
     return(GStruct3.smethod_0(this, TimeSpan.FromSeconds(1.0)).ToString() + " /s");
 }
예제 #7
0
 public GStruct3 method_0(GStruct3 gstruct3_0)
 {
     return(new GStruct3((this.ulong_0 + gstruct3_0.ulong_0) / 2UL));
 }
예제 #8
0
 public static DataSize smethod_0(GStruct3 gstruct3_0, TimeSpan timeSpan_0)
 {
     return(new DataSize((ulong)((double)gstruct3_0.ulong_0 * timeSpan_0.TotalSeconds)));
 }
예제 #9
0
 internal GEventArgs0(int int_3, int int_4, int int_5, TimeSpan timeSpan_3, TimeSpan timeSpan_4, TimeSpan timeSpan_5, GStruct3 gstruct3_1, GClass30 gclass30_1)
 {
     this.GameProgress  = int_3;
     this.TotalProgress = int_4;
     this.GameEta       = timeSpan_3;
     this.TotalEta      = timeSpan_4;
     this.Speed         = gstruct3_1;
     this.FileEta       = timeSpan_5;
     this.FileProgress  = int_5;
     this.Title         = gclass30_1;
 }
예제 #10
0
        private void method_16(int int_6, int int_7, int int_8, TimeSpan timeSpan_3, TimeSpan timeSpan_4, TimeSpan timeSpan_5, GStruct3 gstruct3_1, GClass30 gclass30_0)
        {
            // ISSUE: reference to a compiler-generated field
            EventHandler <GEventArgs0> eventHandler6 = this.eventHandler_6;

            if (eventHandler6 == null)
            {
                return;
            }
            eventHandler6((object)this, new GEventArgs0(int_6, int_7, int_8, timeSpan_3, timeSpan_4, timeSpan_5, gstruct3_1, gclass30_0));
        }
예제 #11
0
        private GClass80.Enum1 method_14(GClass30 gclass30_0)
        {
            // ISSUE: object of a compiler-generated type is created
            // ISSUE: variable of a compiler-generated type
            GClass80.Class63 class63 = new GClass80.Class63();
            // ISSUE: reference to a compiler-generated field
            class63.gclass30_0 = gclass30_0;
            // ISSUE: reference to a compiler-generated field
            GEnum2 genum20 = class63.gclass30_0.GEnum2_0;

            this.gclass78_0.method_9();
            this.timeSpan_1 = new TimeSpan(0L);
            this.timeSpan_0 = new TimeSpan(0L);
            this.gstruct3_0 = new GStruct3(0UL);
            // ISSUE: reference to a compiler-generated field
            class63.gclass30_0.CurrentlyDownloaded = true;
            // ISSUE: reference to a compiler-generated field
            if (!Directory.Exists(class63.gclass30_0.OutputPath))
            {
                // ISSUE: reference to a compiler-generated field
                Directory.CreateDirectory(class63.gclass30_0.OutputPath);
            }
            // ISSUE: reference to a compiler-generated field
            if (class63.gclass30_0.Boolean_0)
            {
                // ISSUE: reference to a compiler-generated field
                return(this.method_12((GClass32)class63.gclass30_0));
            }
            // ISSUE: reference to a compiler-generated field
            TMDExcractionAndProcessing gclass100_0 = this.method_15(class63.gclass30_0, true);
            // ISSUE: reference to a compiler-generated field
            GClass99 gclass99 = this.method_11(class63.gclass30_0);

            // ISSUE: reference to a compiler-generated field
            // ISSUE: reference to a compiler-generated field
            if (class63.gclass30_0.System == SystemType.SystemWiiU || class63.gclass30_0.System == SystemType.SystemWii)
            {
                // ISSUE: reference to a compiler-generated field
                // ISSUE: reference to a compiler-generated field
                this.method_9(class63.gclass30_0, gclass100_0, class63.gclass30_0.OutputPath);
            }
            this.dataSize_0 = gclass100_0.DataSize_0;
            this.method_17(string.Format("Content size is {0}", (object)this.dataSize_0));
            // ISSUE: reference to a compiler-generated field
            this.method_16(0, this.int_5, 0, this.timeSpan_1, this.timeSpan_2, this.timeSpan_0, new GStruct3(0UL), class63.gclass30_0);
label_7:
            for (int index = 0; index < (int)gclass100_0.NumOfContents; ++index)
            {
                bool flag1 = false;
                if (!this.bool_0)
                {
                    return(GClass80.Enum1.const_1);
                }
                GClass101 gclass101_0;
                DataSize  size;
                while (true)
                {
                    gclass101_0 = gclass100_0.GClass101_0[index];
                    this.method_17(string.Format("Downloading Content #{0} ({1:x8}) of {2}... ({3})", (object)(index + 1), (object)gclass101_0.ContentId, (object)gclass100_0.NumOfContents, (object)gclass101_0.ContentSize));
                    // ISSUE: reference to a compiler-generated field
                    string string_0 = Path.Combine(class63.gclass30_0.OutputPath, gclass101_0.ContentId.ToString("x8"));
                    ulong  num1     = 0;
                    GClass6.smethod_6(string_0 + ".app.partial");
                    if (System.IO.File.Exists(string_0 + ".app"))
                    {
                        goto label_35;
                    }
label_9:
                    try
                    {
                        int num2 = (int)Class64.SetThreadExecutionState(2147483649U);
                        this.method_17("Downloading content...");
                        if (gclass101_0.Boolean_0)
                        {
                            // ISSUE: reference to a compiler-generated field
                            int num3 = (int)this.method_10(class63.gclass30_0, gclass101_0, string_0, GClass80.Enum0.const_0, 0UL);
                        }
                        bool flag2 = false;
                        // ISSUE: reference to a compiler-generated field
                        if (class63.gclass30_0 is GClass33 && gclass101_0.Boolean_0)
                        {
                            // ISSUE: reference to a compiler-generated field
                            // ISSUE: reference to a compiler-generated field
                            // ISSUE: reference to a compiler-generated field
                            // ISSUE: reference to a compiler-generated method
                            foreach (GClass30 gclass30 in class63.gclass30_0.GClass32_0.Updates.Where <GClass33>(class63.func_0 ?? (class63.func_0 = new Func <GClass33, bool>(class63.method_0))))
                            {
                                string str1 = Path.Combine(gclass30.OutputPath, gclass101_0.ContentId.ToString("x8"));
                                string str2 = str1 + ".app";
                                string path = str1 + ".h3";
                                if (System.IO.File.Exists(path) && System.IO.File.Exists(str2) && System.IO.File.ReadAllBytes(path).smethod_5(System.IO.File.ReadAllBytes(string_0 + ".h3")))
                                {
                                    long length = new FileInfo(str2).Length;
                                    size = gclass101_0.ContentSize;
                                    long totalBytes1 = (long)size.TotalBytes;
                                    if (length == totalBytes1)
                                    {
                                        this.method_17("Found similar file in older update. Copying...");
                                        System.IO.File.Copy(str2, string_0 + ".app", true);
                                        GClass78 gclass780             = this.gclass78_0;
                                        DataSize downloadedCurrentGame = gclass780.TotalDownloadedCurrentGame;
                                        size = gclass101_0.ContentSize;
                                        long totalBytes2 = (long)size.TotalBytes;
                                        gclass780.TotalDownloadedCurrentGame = downloadedCurrentGame + (ulong)totalBytes2;
                                        this.gclass78_0.TotalDataDownloaded += gclass101_0.ContentSize;
                                        flag2 = true;
                                        break;
                                    }
                                }
                            }
                        }
                        if (!flag2)
                        {
                            // ISSUE: reference to a compiler-generated field
                            if (this.method_10(class63.gclass30_0, gclass101_0, string_0, GClass80.Enum0.const_1, num1) == GClass80.Enum1.const_1)
                            {
                                return(GClass80.Enum1.const_1);
                            }
                            if (this.bool_2)
                            {
                                if (gclass101_0.Boolean_0)
                                {
                                    if (genum20 != GEnum2.const_2)
                                    {
                                        goto label_7;
                                    }
                                }
                                this.method_17("Verifying download...");
                                this.method_13(true);
                                // ISSUE: reference to a compiler-generated field
                                GStruct7 gstruct7 = Class85.smethod_4(class63.gclass30_0, gclass101_0, gclass99.Byte_0);
                                this.method_13(false);
                                if (!gstruct7.Boolean_0)
                                {
                                    this.gclass78_0.TotalDataDownloaded        -= gclass101_0.ContentSize;
                                    this.gclass78_0.TotalDownloadedCurrentGame -= gclass101_0.ContentSize;
                                    continue;
                                }
                                goto label_7;
                            }
                            else
                            {
                                goto label_7;
                            }
                        }
                        else
                        {
                            goto label_7;
                        }
                    }
                    catch (Exception ex)
                    {
                        bool         flag2 = false;
                        WebException webException;
                        if ((webException = ex as WebException) != null && webException.Status == WebExceptionStatus.ProtocolError && webException.Response != null)
                        {
                            flag2 = ((HttpWebResponse)webException.Response).StatusCode == HttpStatusCode.NotFound;
                        }
                        if (!flag2)
                        {
                            this.method_17(string.Format("Downloading Content #{0} of {1} failed...", (object)(index + 1), (object)gclass100_0.NumOfContents));
                            this.method_17(ex.Message);
                            // ISSUE: reference to a compiler-generated field
                            class63.gclass30_0.CurrentlyDownloaded = false;
                            this.method_5("Downloading Content Failed:\n" + ex.Message);
                            goto label_48;
                        }
                        else
                        {
                            this.method_17(string.Format("Downloading Content #{0} of {1} failed... (File not on NUS)", (object)(index + 1), (object)gclass100_0.NumOfContents));
                            goto label_48;
                        }
                    }
label_35:
                    num1 = (ulong)new FileInfo(string_0 + ".app").Length;
                    this.method_17("Local file detected. Checking size...");
                    long num4 = (long)num1;
                    size = gclass101_0.ContentSize;
                    long totalBytes = (long)size.TotalBytes;
                    if (num4 == totalBytes)
                    {
                        this.method_17("Sizes match. Checking file....");
                        if (gclass101_0.Boolean_0 && !System.IO.File.Exists(string_0 + ".h3"))
                        {
                            // ISSUE: reference to a compiler-generated field
                            int num2 = (int)this.method_10(class63.gclass30_0, gclass101_0, string_0, GClass80.Enum0.const_0, 0UL);
                        }
                        if (this.bool_3)
                        {
                            this.method_13(true);
                            // ISSUE: reference to a compiler-generated field
                            GStruct7 gstruct7 = Class85.smethod_4(class63.gclass30_0, gclass101_0, gclass99.Byte_0);
                            this.method_13(false);
                            if (!gstruct7.Boolean_0)
                            {
                                // ISSUE: reference to a compiler-generated field
                                if (gclass101_0.Boolean_0 && class63.gclass30_0.Platform != Platform.Wii_U_Custom && !flag1)
                                {
                                    this.method_17(string.Format("File has {0} corrupted block(s) for a total of  {1} bytes", (object)gstruct7.list_0.Count, (object)(gstruct7.list_0.Count * 65536)));
                                    this.method_17("Attempting repair. This may take a while depending on the state of the file.");
                                    string str = gclass101_0.ContentId.ToString("x8");
                                    // ISSUE: reference to a compiler-generated field
                                    // ISSUE: reference to a compiler-generated field
                                    GClass78.smethod_0(class63.gclass30_0.String_1 + str, string_0 + ".app", System.IO.File.ReadAllBytes(string_0 + ".h3"), class63.gclass30_0.Ticket.Byte_0, (IEnumerable <int>)gstruct7.list_0);
                                    flag1 = true;
                                }
                                else
                                {
                                    this.method_17("This file is corrupted but cannot be repaired. Now redownloading...");
                                    GClass6.smethod_6(string_0 + ".app");
                                }
                            }
                            else
                            {
                                break;
                            }
                        }
                        else
                        {
                            break;
                        }
                    }
                    else
                    {
                        size = gclass101_0.ContentSize;
                        if (size.TotalBytes < num1)
                        {
                            this.method_17("This file does not qualify for intelligent resuming. Redownloading...");
                            GClass6.smethod_6(string_0 + ".app");
                        }
                        else
                        {
                            this.method_17(string.Format("Sizes mismatch. Resuming download at {0}", (object)new DataSize(num1)));
                            goto label_9;
                        }
                    }
                }
                this.method_17("This file is good, skipping...");
                GClass78 gclass780_1            = this.gclass78_0;
                DataSize downloadedCurrentGame1 = gclass780_1.TotalDownloadedCurrentGame;
                size = gclass101_0.ContentSize;
                long totalBytes3 = (long)size.TotalBytes;
                gclass780_1.TotalDownloadedCurrentGame = downloadedCurrentGame1 + (ulong)totalBytes3;
                this.gclass78_0.TotalDataDownloaded   += gclass101_0.ContentSize;
                continue;
label_48:
                GC.Collect();
            }
            // ISSUE: reference to a compiler-generated field
            this.method_17(string.Format("Downloading Title {0} v{1} Finished...", (object)class63.gclass30_0.TitleId, (object)gclass100_0.TitleVersion));
            // ISSUE: reference to a compiler-generated field
            this.method_16(100, this.int_5, 100, new TimeSpan(0L), this.timeSpan_2, new TimeSpan(0L), this.gstruct3_0, class63.gclass30_0);
            return(GClass80.Enum1.const_0);
        }
예제 #12
0
 public string method_0(GStruct3 gstruct3_0)
 {
     return(GClass6.smethod_13(this.Size, gstruct3_0));
 }