Skip to content

Commit

Permalink
Added buildversion fetch from asset servers
Browse files Browse the repository at this point in the history
  • Loading branch information
TheCheatsrichter committed Nov 1, 2021
1 parent adf077f commit c422d5b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
12 changes: 10 additions & 2 deletions Gw2 Launchbuddy/ObjectManagers/ApiManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,18 @@ public static class Api
static Api()
{
WebClient api = new WebClient();
Regex filter = new Regex(@"\d*\d");
Regex filter_officialapi = new Regex(@"\d*\d");
try
{
ClientBuild = filter.Match(api.DownloadString("https://api.guildwars2.com/v2/build")).Value;
ClientBuild = filter_officialapi.Match(api.DownloadString("https://api.guildwars2.com/v2/build")).Value;

if(ClientBuild == "115267")
{
Regex filter_assetserver = new Regex(@"\d+");
ClientBuild = filter_assetserver.Match(api.DownloadString("http://assetcdn.101.arenanetworks.com/latest64/101")).Value;

}

Online = true;
}
catch
Expand Down
2 changes: 1 addition & 1 deletion Gw2 Launchbuddy/ObjectManagers/LBConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,6 @@ public class LBConfigDataSet
public string taco_path;
public string blish_path;
// Defaultvalue should be changed to false when API works again
public bool forcegameclientupdate = true;
public bool forcegameclientupdate = false;
}
}

0 comments on commit c422d5b

Please sign in to comment.