From a046ece605476d401f772a2b68a1e6360532ed50 Mon Sep 17 00:00:00 2001 From: David_JonesDVN Date: Mon, 24 Jan 2022 20:51:50 +0330 Subject: [PATCH] Royalflare/TLS update. (1.01) Changed: Removed Royalflare's link in the replays tab in light of its approaching shutdown. Changed: Maribel Hearn's replay link now points to the site's top page. Changed: Switched to TLS 1.2 to fix thcrap/replay links that don't support older TLS versions. Changed: Added a check for repo crawling to prevent repeated requests. --- Touhou Launcher/MainForm.Designer.cs | 61 ++++++++-------------- Touhou Launcher/MainForm.cs | 5 +- Touhou Launcher/Properties/AssemblyInfo.cs | 4 +- Touhou Launcher/thcrap.cs | 13 +++-- 4 files changed, 36 insertions(+), 47 deletions(-) diff --git a/Touhou Launcher/MainForm.Designer.cs b/Touhou Launcher/MainForm.Designer.cs index 1681e14..8a20cd7 100644 --- a/Touhou Launcher/MainForm.Designer.cs +++ b/Touhou Launcher/MainForm.Designer.cs @@ -131,8 +131,7 @@ private void InitializeComponent() this.replayPanel = new System.Windows.Forms.Panel(); this.linkReplays = new System.Windows.Forms.TextBox(); this.appspotReplays = new System.Windows.Forms.RadioButton(); - this.royalflareReplays = new System.Windows.Forms.RadioButton(); - this.gensokyoReplays = new System.Windows.Forms.RadioButton(); + this.maribelReplays = new System.Windows.Forms.RadioButton(); this.customGames = new System.Windows.Forms.TabPage(); this.customAdd = new System.Windows.Forms.Button(); this.customList = new System.Windows.Forms.ListView(); @@ -626,9 +625,9 @@ private void InitializeComponent() this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label1.Location = new System.Drawing.Point(9, 16); this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(192, 24); + this.label1.Size = new System.Drawing.Size(202, 24); this.label1.TabIndex = 0; - this.label1.Text = "Touhou Launcher 1.0"; + this.label1.Text = "Touhou Launcher 1.01"; // // settings // @@ -1380,8 +1379,7 @@ private void InitializeComponent() this.replayPanel.BackColor = System.Drawing.Color.Transparent; this.replayPanel.Controls.Add(this.linkReplays); this.replayPanel.Controls.Add(this.appspotReplays); - this.replayPanel.Controls.Add(this.royalflareReplays); - this.replayPanel.Controls.Add(this.gensokyoReplays); + this.replayPanel.Controls.Add(this.maribelReplays); this.replayPanel.Location = new System.Drawing.Point(0, 0); this.replayPanel.Name = "replayPanel"; this.replayPanel.Size = new System.Drawing.Size(518, 29); @@ -1389,9 +1387,9 @@ private void InitializeComponent() // // linkReplays // - this.linkReplays.Location = new System.Drawing.Point(406, 3); + this.linkReplays.Location = new System.Drawing.Point(241, 3); this.linkReplays.Name = "linkReplays"; - this.linkReplays.Size = new System.Drawing.Size(109, 20); + this.linkReplays.Size = new System.Drawing.Size(274, 20); this.linkReplays.TabIndex = 3; this.linkReplays.KeyDown += new System.Windows.Forms.KeyEventHandler(this.linkReplays_KeyDown); // @@ -1400,7 +1398,7 @@ private void InitializeComponent() this.appspotReplays.Appearance = System.Windows.Forms.Appearance.Button; this.appspotReplays.AutoSize = true; this.appspotReplays.FlatStyle = System.Windows.Forms.FlatStyle.Popup; - this.appspotReplays.Location = new System.Drawing.Point(277, 3); + this.appspotReplays.Location = new System.Drawing.Point(112, 3); this.appspotReplays.Name = "appspotReplays"; this.appspotReplays.Size = new System.Drawing.Size(123, 23); this.appspotReplays.TabIndex = 2; @@ -1409,34 +1407,20 @@ private void InitializeComponent() this.appspotReplays.UseVisualStyleBackColor = true; this.appspotReplays.CheckedChanged += new System.EventHandler(this.Replays_CheckedChanged); // - // royalflareReplays - // - this.royalflareReplays.Appearance = System.Windows.Forms.Appearance.Button; - this.royalflareReplays.AutoSize = true; - this.royalflareReplays.FlatStyle = System.Windows.Forms.FlatStyle.Popup; - this.royalflareReplays.Location = new System.Drawing.Point(163, 3); - this.royalflareReplays.Name = "royalflareReplays"; - this.royalflareReplays.Size = new System.Drawing.Size(108, 23); - this.royalflareReplays.TabIndex = 1; - this.royalflareReplays.Text = "replay.royalflare.net"; - this.royalflareReplays.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - this.royalflareReplays.UseVisualStyleBackColor = true; - this.royalflareReplays.CheckedChanged += new System.EventHandler(this.Replays_CheckedChanged); - // - // gensokyoReplays - // - this.gensokyoReplays.Appearance = System.Windows.Forms.Appearance.Button; - this.gensokyoReplays.AutoSize = true; - this.gensokyoReplays.FlatStyle = System.Windows.Forms.FlatStyle.Popup; - this.gensokyoReplays.Location = new System.Drawing.Point(6, 3); - this.gensokyoReplays.Name = "gensokyoReplays"; - this.gensokyoReplays.Size = new System.Drawing.Size(151, 23); - this.gensokyoReplays.TabIndex = 0; - this.gensokyoReplays.TabStop = true; - this.gensokyoReplays.Text = "maribelhearn.com/gensokyo"; - this.gensokyoReplays.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - this.gensokyoReplays.UseVisualStyleBackColor = true; - this.gensokyoReplays.CheckedChanged += new System.EventHandler(this.Replays_CheckedChanged); + // maribelReplays + // + this.maribelReplays.Appearance = System.Windows.Forms.Appearance.Button; + this.maribelReplays.AutoSize = true; + this.maribelReplays.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.maribelReplays.Location = new System.Drawing.Point(6, 3); + this.maribelReplays.Name = "maribelReplays"; + this.maribelReplays.Size = new System.Drawing.Size(100, 23); + this.maribelReplays.TabIndex = 0; + this.maribelReplays.TabStop = true; + this.maribelReplays.Text = "maribelhearn.com"; + this.maribelReplays.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.maribelReplays.UseVisualStyleBackColor = true; + this.maribelReplays.CheckedChanged += new System.EventHandler(this.Replays_CheckedChanged); // // customGames // @@ -2545,8 +2529,7 @@ private void InitializeComponent() private System.Windows.Forms.WebBrowser replayBrowser; private System.Windows.Forms.Panel replayPanel; private System.Windows.Forms.RadioButton appspotReplays; - private System.Windows.Forms.RadioButton royalflareReplays; - private System.Windows.Forms.RadioButton gensokyoReplays; + private System.Windows.Forms.RadioButton maribelReplays; private System.Windows.Forms.TabPage customGames; private System.Windows.Forms.Button customAdd; private System.Windows.Forms.ListView customList; diff --git a/Touhou Launcher/MainForm.cs b/Touhou Launcher/MainForm.cs index 01c066a..3a2c385 100644 --- a/Touhou Launcher/MainForm.cs +++ b/Touhou Launcher/MainForm.cs @@ -519,6 +519,8 @@ private void RefreshList(ref ListView list, Dictionary files) public MainForm() { + System.Net.ServicePointManager.Expect100Continue = true; + System.Net.ServicePointManager.SecurityProtocol = (System.Net.SecurityProtocolType)3072; InitializeComponent(); if (totalGameCount > curCfg.gameCFG.Length) { @@ -886,8 +888,7 @@ private void linkReplays_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { - gensokyoReplays.Checked = false; - royalflareReplays.Checked = false; + maribelReplays.Checked = false; appspotReplays.Checked = false; Replays_CheckedChanged(sender, new EventArgs()); } diff --git a/Touhou Launcher/Properties/AssemblyInfo.cs b/Touhou Launcher/Properties/AssemblyInfo.cs index ad2ca83..d202862 100644 --- a/Touhou Launcher/Properties/AssemblyInfo.cs +++ b/Touhou Launcher/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyVersion("1.0.1.0")] +[assembly: AssemblyFileVersion("1.0.1.0")] diff --git a/Touhou Launcher/thcrap.cs b/Touhou Launcher/thcrap.cs index 7813bf3..eab9aab 100644 --- a/Touhou Launcher/thcrap.cs +++ b/Touhou Launcher/thcrap.cs @@ -40,6 +40,7 @@ internal class profileData ConfigForm cfgForm; string gamejs; Dictionary repos = new Dictionary(); + List checkedRepos = new List(); List patchStates = new List(); Dictionary games = new Dictionary(); @@ -112,10 +113,14 @@ private void thcrap_Load(object sender, EventArgs e) private void searchRepo(string address, bool child = false) { - WebClient wc = new WebClient(); - wc.Encoding = Encoding.UTF8; - wc.DownloadStringCompleted += onJsonGet; - wc.DownloadStringAsync(new Uri(address + "/repo.js"), new string[] { address, child.ToString() }); + if (!checkedRepos.Contains(address)) + { + checkedRepos.Add(address); + WebClient wc = new WebClient(); + wc.Encoding = Encoding.UTF8; + wc.DownloadStringCompleted += onJsonGet; + wc.DownloadStringAsync(new Uri(address + "/repo.js"), new string[] { address, child.ToString() }); + } } private void onJsonGet(object sender, DownloadStringCompletedEventArgs e)