From e053882e86b50497ad851ec86f8795a7a7c4c607 Mon Sep 17 00:00:00 2001 From: lempamo Date: Tue, 28 Mar 2017 14:34:48 -0400 Subject: version number that updates --- TimeHACK.Main/Program.cs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'TimeHACK.Main/Program.cs') diff --git a/TimeHACK.Main/Program.cs b/TimeHACK.Main/Program.cs index 96aedaa..733ea02 100644 --- a/TimeHACK.Main/Program.cs +++ b/TimeHACK.Main/Program.cs @@ -4,6 +4,8 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using System.Windows.Forms; +using Newtonsoft.Json.Linq; +using System.Net; namespace TimeHACK { @@ -18,8 +20,17 @@ namespace TimeHACK [STAThread] static void Main() { - // Set the GameID - gameID = "1.0.44"; + try { + WebClient wc = new WebClient(); + + // Set the GameID + string json = wc.DownloadString("http://ci.appveyor.com/api/projects/timehack/timehack"); + JObject j = JObject.Parse(JObject.Parse(json)["build"].ToString()); + gameID = "1.0." + j["buildNumber"].ToString(); + } catch (WebException) + { + gameID = "1.0.42"; + } Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new TitleScreen()); -- cgit v1.2.3