first commit
This commit is contained in:
30
PoEco.Net/Web/PoBLua.cs
Normal file
30
PoEco.Net/Web/PoBLua.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace PoEco.Net.Web
|
||||
{
|
||||
internal class PoBLua
|
||||
{
|
||||
public class LuaRoot
|
||||
{
|
||||
public List<string> lua { get; set; }
|
||||
}
|
||||
public static void GetLatestLUA()
|
||||
{
|
||||
if (!Directory.Exists(@"data\lua")) { Directory.CreateDirectory(@"data\lua"); }
|
||||
WebClient wc = new WebClient();
|
||||
LuaRoot lr = JsonConvert.DeserializeObject<LuaRoot>(File.ReadAllText(@"data\lua.json"));
|
||||
foreach (var l in lr.lua)
|
||||
{
|
||||
if(File.Exists($@"data\lua\{l}.lua")) { File.Delete($@"data\lua\{l}.lua"); }
|
||||
wc.DownloadFile($"https://github.com/PathOfBuildingCommunity/PathOfBuilding/raw/dev/src/Data/Bases/{l}.lua", $@"data\lua\{l}.lua");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user