Exemplo n.º 1
0
 public static int GetWebSeedData(ArrayList returnarray)
 {
     int count = 0;
     if (File.Exists(TorrentBuild.LocalPath + "wsa.configure"))
     {
         int fileNumber = FileSystem.FreeFile();
         FileSystem.FileOpen(fileNumber, TorrentBuild.LocalPath + "wsa.configure", OpenMode.Binary, OpenAccess.Read, OpenShare.LockRead, -1);
         string str = Strings.Space((int) FileSystem.FileLen(TorrentBuild.LocalPath + "wsa.configure"));
         FileSystem.FileGet(fileNumber, ref str, -1L, false);
         FileSystem.FileClose(new int[] { fileNumber });
         TorrentDictionary dictionary = new TorrentDictionary();
         dictionary.Parse(str);
         if (dictionary.Contains("seedlist"))
         {
             TorrentList list = new TorrentList();
             list = (TorrentList) dictionary["seedlist"];
             returnarray = list.Value;
             count = returnarray.Count;
         }
         else
         {
             TorrentString str2 = new TorrentString();
             TorrentString str3 = new TorrentString();
             TorrentString str4 = new TorrentString();
             TorrentString str5 = new TorrentString();
             TorrentString str6 = new TorrentString();
             str2 = (TorrentString) dictionary["seed1"];
             str3 = (TorrentString) dictionary["seed2"];
             str4 = (TorrentString) dictionary["seed3"];
             str5 = (TorrentString) dictionary["seed4"];
             str6 = (TorrentString) dictionary["seed5"];
             ArrayList list2 = new ArrayList();
             TorrentList list3 = new TorrentList();
             if (str2.Value != "")
             {
                 returnarray.Add(str2);
                 count++;
             }
             if (str3.Value != "")
             {
                 returnarray.Add(str3);
                 count++;
             }
             if (str4.Value != "")
             {
                 returnarray.Add(str4);
                 count++;
             }
             if (str5.Value != "")
             {
                 returnarray.Add(str5);
                 count++;
             }
             if (str6.Value != "")
             {
                 returnarray.Add(str6);
                 count++;
             }
         }
         if (TorrentBuild.GenerateVerbose)
         {
             Interaction.MsgBox("Number of Webseeds loaded: " + Conversions.ToString(count), MsgBoxStyle.OkOnly, null);
         }
     }
     return count;
 }
Exemplo n.º 2
0
 private void TorrentBuild_Load(object sender, EventArgs e)
 {
     string[] commandLineArgs = Environment.GetCommandLineArgs();
     if (commandLineArgs.GetLength(0) > 1)
     {
         this.FileNameToMake.Text = commandLineArgs[1];
     }
     TorrentString str3 = new TorrentString();
     TorrentString str = new TorrentString();
     TorrentString str2 = new TorrentString();
     str3.Value = ".sfv";
     str.Value = ".cdp";
     str2.Value = ".cdt";
     BlackListedFiles.Add(str3);
     BlackListedFiles.Add(str);
     BlackListedFiles.Add(str2);
     int length = Strings.Left(commandLineArgs[0], Strings.Len(commandLineArgs[0])).LastIndexOf(@"\");
     LocalPath = Path.GetFullPath(Strings.Left(commandLineArgs[0], length)) + @"\";
     if (File.Exists(LocalPath + "tgen.configure"))
     {
         int fileNumber = FileSystem.FreeFile();
         FileSystem.FileOpen(fileNumber, LocalPath + "tgen.configure", OpenMode.Binary, OpenAccess.Read, OpenShare.LockRead, -1);
         string str4 = Strings.Space((int) FileSystem.FileLen(LocalPath + "tgen.configure"));
         FileSystem.FileGet(fileNumber, ref str4, -1L, false);
         FileSystem.FileClose(new int[] { fileNumber });
         TorrentDictionary dictionary = new TorrentDictionary();
         dictionary.Parse(str4);
         TorrentString str5 = new TorrentString();
         TorrentNumber number2 = new TorrentNumber();
         TorrentNumber number8 = new TorrentNumber();
         TorrentNumber number7 = new TorrentNumber();
         TorrentNumber number5 = new TorrentNumber();
         TorrentString str6 = new TorrentString();
         TorrentNumber number6 = new TorrentNumber();
         TorrentNumber number9 = new TorrentNumber();
         TorrentNumber number = new TorrentNumber();
         TorrentNumber number3 = new TorrentNumber();
         TorrentNumber number4 = new TorrentNumber();
         str5 = (TorrentString) dictionary["tracker"];
         number2 = (TorrentNumber) dictionary["piecesize"];
         if (dictionary.Contains("externals"))
         {
             number4 = (TorrentNumber) dictionary["externals"];
             this.MakeExternals.Checked = number4.Value > 0L;
         }
         if (dictionary.Contains("folder"))
         {
             number3 = (TorrentNumber) dictionary["folder"];
             this.MakeSeparateTorrents.Checked = number3.Value > 0L;
         }
         if (dictionary.Contains("sha1"))
         {
             number8 = (TorrentNumber) dictionary["sha1"];
             this.IncludeSHA1.Checked = number8.Value > 0L;
         }
         if (dictionary.Contains("md5"))
         {
             number7 = (TorrentNumber) dictionary["md5"];
             this.IncludeMD5.Checked = number7.Value > 0L;
         }
         if (dictionary.Contains("crc"))
         {
             number5 = (TorrentNumber) dictionary["crc"];
             this.IncludeCRC32.Checked = number5.Value > 0L;
         }
         if (dictionary.Contains("ed2k"))
         {
             number6 = (TorrentNumber) dictionary["ed2k"];
             this.IncludeED2K.Checked = number6.Value > 0L;
         }
         if (dictionary.Contains("tiger"))
         {
             number9 = (TorrentNumber) dictionary["tiger"];
             this.IncludeTiger.Checked = number9.Value > 0L;
         }
         if (dictionary.Contains("comment"))
         {
             str6 = (TorrentString) dictionary["comment"];
             this.TorrentComment.Text = str6.Value;
         }
         if (dictionary.Contains("advanced"))
         {
             TorrentDictionary dictionary2 = new TorrentDictionary();
             dictionary2 = (TorrentDictionary) dictionary["advanced"];
             TorrentNumber number12 = new TorrentNumber();
             TorrentNumber number11 = new TorrentNumber();
             TorrentNumber number10 = new TorrentNumber();
             number12 = (TorrentNumber) dictionary2["verbose"];
             number11 = (TorrentNumber) dictionary2["usewsa"];
             number10 = (TorrentNumber) dictionary2["delay"];
             GenerateVerbose = number12.Value > 0L;
             UseWSAConfig = number11.Value > 0L;
             DelayMessages = number10.Value > 0L;
         }
         else
         {
             GenerateVerbose = true;
             UseWSAConfig = false;
             DelayMessages = true;
         }
         if (dictionary.Contains("blankblacklist"))
         {
             TorrentNumber number13 = new TorrentNumber();
             if (number13.Value == -1L)
             {
                 BlackListedFiles = new ArrayList();
             }
         }
         if (dictionary.Contains("blacklist"))
         {
             TorrentList list = new TorrentList();
             list = (TorrentList) dictionary["blacklist"];
             BlackListedFiles = list.Value;
         }
         if (dictionary.Contains("multitracker"))
         {
             MultiTrackerGenerator.MultiTrackerTiers = (TorrentList) dictionary["multitracker"];
             this.Multitracker.UpdateInput();
         }
         if (dictionary.Contains("usemultitracker"))
         {
             TorrentNumber number14 = new TorrentNumber();
             number14 = (TorrentNumber) dictionary["usemultitracker"];
             this.MultiTrackerEnabled.Checked = number14.Value > 0L;
         }
         number = (TorrentNumber) dictionary["autopiece"];
         this.AutomaticPieceSize.Checked = number.Value > 0L;
         this.AnnounceURL.Text = str5.Value;
         this.PieceSize.Text = Conversions.ToString(number2.Value);
     }
     this.AutomaticPieceSize_CheckedChanged(RuntimeHelpers.GetObjectValue(sender), e);
     GC.Collect();
 }