diff --git a/Launcher/GameSession.cs b/Launcher/GameSession.cs index 50ae377e7..66d31c4b7 100644 --- a/Launcher/GameSession.cs +++ b/Launcher/GameSession.cs @@ -25,7 +25,7 @@ namespace Launcher { protected HttpWebResponse MakeRequest( string uri, string referer, string data ) { HttpWebRequest request = (HttpWebRequest)WebRequest.Create( uri ); - request.UserAgent = "ClassicalSharp Launcher 0.1"; + request.UserAgent = MainForm.AppName; request.ReadWriteTimeout = 15 * 1000; request.Timeout = 15 * 1000; request.Referer = referer; diff --git a/Launcher/MainForm.Designer.cs b/Launcher/MainForm.Designer.cs index ba6e3efdb..e07d22248 100644 --- a/Launcher/MainForm.Designer.cs +++ b/Launcher/MainForm.Designer.cs @@ -764,7 +764,7 @@ namespace Launcher this.ClientSize = new System.Drawing.Size(432, 393); this.Controls.Add(this.tabs); this.Name = "MainForm"; - this.Text = "ClassicalSharp Launcher"; + this.Text = Launcher.MainForm.AppName; this.ResizeEnd += new System.EventHandler(this.MainFormResizeEnd); this.tabMinecraftNet.ResumeLayout(false); this.tabMC.ResumeLayout(false); diff --git a/Launcher/MainForm.cs b/Launcher/MainForm.cs index 9f9b62cad..58b0cafae 100644 --- a/Launcher/MainForm.cs +++ b/Launcher/MainForm.cs @@ -13,6 +13,8 @@ namespace Launcher { public partial class MainForm : Form { + public const string AppName = "ClassicalSharp Launcher 0.5"; + public MainForm() { InitializeComponent(); AdjustTabs(); @@ -35,7 +37,8 @@ namespace Launcher { "Some required resources weren't found. Would you like to download them now?", "Missing resources", MessageBoxButtons.OKCancel ); if( result == DialogResult.OK ) { - fetcher.Run(); + fetcher.Run( this ); + Text = AppName; } } } diff --git a/Launcher/ResourceFetcher.cs b/Launcher/ResourceFetcher.cs index 491085566..b5a6e296c 100644 --- a/Launcher/ResourceFetcher.cs +++ b/Launcher/ResourceFetcher.cs @@ -11,17 +11,18 @@ namespace Launcher { const string cloudsUri = "https://raw.githubusercontent.com/andrewphorn/ClassiCube-Client/master/src/main/resources/clouds.png"; const string charUri = "https://raw.githubusercontent.com/andrewphorn/ClassiCube-Client/master/src/main/resources/char.png"; - public void Run() { + public void Run( MainForm form ) { using( WebClient client = new WebClient() ) { - client.Proxy = null; - if( !DownloadData( terrainUri, client, "terrain.png" ) ) return; - if( !DownloadData( cloudsUri, client, "clouds.png" ) ) return; - if( !DownloadData( charUri, client, "char.png" ) ) return; + client.Proxy = null; + if( !DownloadData( terrainUri, client, "terrain.png", form ) ) return; + if( !DownloadData( cloudsUri, client, "clouds.png", form ) ) return; + if( !DownloadData( charUri, client, "char.png", form ) ) return; } } - static bool DownloadData( string uri, WebClient client, string output ) { + static bool DownloadData( string uri, WebClient client, string output, MainForm form ) { if( File.Exists( output ) ) return true; + form.Text = MainForm.AppName + " - fetching " + output; byte[] data = null; try {