// Token: 0x060015E1 RID: 5601
 // RVA: 0x00070B94 File Offset: 0x0006ED94
 internal void Perform(bool doPatching = false)
 {
     this.isRunning = true;
     this.progress = 0f;
     this.downloaded_bytes = 0;
     this.isPatching = false;
     if (doPatching && this.url_patch == null)
     {
         throw new Exception("patch not available for this file!");
     }
     string text = "_staging/" + this.filename + (doPatching ? "_patch" : ".zip");
     this.netRequest = new FileNetRequest(text, doPatching ? this.url_patch : (this.url_full + ".zip"));
     this.netRequest.method_1(delegate(object sender, long current, long total)
     {
         this.progress = (float)current / (float)total * (float)(doPatching ? 50 : 100);
         this.downloaded_bytes = (int)current;
         this.filesize = (int)total;
     });
     try
     {
         this.netRequest.Perform(true);
         if (!File.Exists(text))
         {
             throw new Exception("couldn't find downloaded file (" + text + ")");
         }
     }
     catch (ThreadAbortException)
     {
         this.isRunning = false;
         return;
     }
     if (this.netRequest.string_1.EndsWith(".zip"))
     {
         Class203 class = new Class203();
Ejemplo n.º 2
0
 // Token: 0x06003133 RID: 12595
 // RVA: 0x001423C8 File Offset: 0x001405C8
 internal static void Initialize()
 {
     if (Class836.bool_1)
     {
         return;
     }
     Class836.bool_1 = true;
     if (File.Exists("Data/filter.txt") && (DateTime.Now - File.GetLastWriteTime("Data/filter.txt")).TotalDays <= 7.0)
     {
         Class836.smethod_1();
         return;
     }
     FileNetRequest fileNetRequest = new FileNetRequest("Data/filter.txt", "http://osu.ppy.sh/release/filter.txt");
     FileNetRequest arg_75_0 = fileNetRequest;
     if (Class836.delegate10_0 == null)
     {
         Class836.delegate10_0 = new FileNetRequest.Delegate10(Class836.smethod_2);
     }
     arg_75_0.method_2(Class836.delegate10_0);
     Class169.smethod_0(fileNetRequest);
 }
Ejemplo n.º 3
0
 // Token: 0x060011FD RID: 4605
 // RVA: 0x00060A00 File Offset: 0x0005EC00
 public void method_2(FileNetRequest.Delegate10 delegate10_1)
 {
     FileNetRequest.Delegate10 delegate = this.delegate10_0;
     FileNetRequest.Delegate10 delegate2;
     do
     {
         delegate2 = delegate;
         FileNetRequest.Delegate10 value = (FileNetRequest.Delegate10)Delegate.Combine(delegate2, delegate10_1);
         delegate = Interlocked.CompareExchange<FileNetRequest.Delegate10>(ref this.delegate10_0, value, delegate2);
     }
     while (delegate != delegate2);
 }
Ejemplo n.º 4
0
 private void method_58(string string_3, Exception exception_0)
 {
     this.enum69_0 = Enum69.const_3;
     lock (Class537.list_3)
     {
         Class537.list_3.Remove(this.fileNetRequest_0);
     }
     this.fileNetRequest_0 = null;
 }
Ejemplo n.º 5
0
 private bool method_57(FileNetRequest fileNetRequest_1)
 {
     return fileNetRequest_1 != null && fileNetRequest_1.string_1 == this.string_2 && fileNetRequest_1.string_0 == this.string_1;
 }
Ejemplo n.º 6
0
 // Token: 0x06002D18 RID: 11544
 // RVA: 0x00124C18 File Offset: 0x00122E18
 internal override Class731 vmethod_6()
 {
     Predicate<FileNetRequest> predicate = null;
     FileNetRequest.Delegate10 delegate = null;
     if (this.enum69_0 == Enum69.const_0)
     {
         if (this.string_1 == null)
         {
             return null;
         }
         if (this.int_8 > 0 && Class115.int_1 - this.int_8 < 200)
         {
             this.int_9 += Class115.int_1 - this.int_8;
         }
         else
         {
             this.int_9 = 0;
         }
         this.int_8 = Class115.int_1;
         if (this.int_9 < this.int_7)
         {
             return null;
         }
         if (this.class731_0 != null)
         {
             this.class731_0.Dispose();
         }
         List<FileNetRequest> arg_9C_0 = Class537.list_3;
         if (predicate == null)
         {
             predicate = new Predicate<FileNetRequest>(this.method_57);
         }
         this.fileNetRequest_0 = arg_9C_0.Find(predicate);
         if (this.fileNetRequest_0 != null)
         {
             return null;
         }
         if (!File.Exists(this.method_53()))
         {
             string directoryName = Path.GetDirectoryName(this.method_53());
             if (!Directory.Exists(Path.GetDirectoryName(this.method_53())))
             {
                 Directory.CreateDirectory(directoryName);
             }
             this.enum69_0 = Enum69.const_1;
             this.fileNetRequest_0 = new FileNetRequest(this.method_53(), this.method_51());
             FileNetRequest arg_11A_0 = this.fileNetRequest_0;
             if (delegate == null)
             {
                 delegate = new FileNetRequest.Delegate10(this.method_58);
             }
             arg_11A_0.method_2(delegate);
             Class169.smethod_0(this.fileNetRequest_0);
             lock (Class537.list_3)
             {
                 Class537.list_3.Add(this.fileNetRequest_0);
                 goto IL_159;
             }
         }
         this.enum69_0 = Enum69.const_3;
     }
     IL_159:
     if (this.enum69_0 == Enum69.const_3)
     {
         this.enum69_0 = Enum69.const_2;
         Class731 result;
         try
         {
             this.vmethod_7(Class731.smethod_2(this.method_53()));
             if (this.vmethod_6() != null)
             {
                 if (!this.bool_15)
                 {
                     base.vmethod_6().bool_3 = true;
                 }
                 Class742.Load(this, !this.bool_15);
                 if (this.float_7 != 0f)
                 {
                     this.float_2 = this.float_7 / (float)Math.Max(this.int_6, this.int_5);
                 }
                 if (this.float_3 == 1f && this.class26_0.Count == 0)
                 {
                     this.color_1 = new Color(this.color_1.get_R(), this.color_1.get_G(), this.color_1.get_B(), 0);
                     base.method_15(200);
                 }
                 this.method_56();
                 goto IL_269;
             }
             try
             {
                 File.Delete(this.method_53());
             }
             catch
             {
             }
             this.enum69_0 = Enum69.const_4;
             result = null;
         }
         catch
         {
             try
             {
                 File.Delete(this.method_53());
             }
             catch
             {
             }
             this.enum69_0 = Enum69.const_4;
             goto IL_269;
         }
         return result;
     }
     IL_269:
     return base.vmethod_6();
 }