diff --git a/.vs/PoE-MxFilterGen/v15/.suo b/.vs/PoE-MxFilterGen/v15/.suo index 5475b5a..bc99a0c 100644 Binary files a/.vs/PoE-MxFilterGen/v15/.suo and b/.vs/PoE-MxFilterGen/v15/.suo differ diff --git a/PoE-MxFilterGen/FodyWeavers.xml b/PoE-MxFilterGen/FodyWeavers.xml new file mode 100644 index 0000000..a5dcf04 --- /dev/null +++ b/PoE-MxFilterGen/FodyWeavers.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/PoE-MxFilterGen/FodyWeavers.xsd b/PoE-MxFilterGen/FodyWeavers.xsd new file mode 100644 index 0000000..44a5374 --- /dev/null +++ b/PoE-MxFilterGen/FodyWeavers.xsd @@ -0,0 +1,111 @@ + + + + + + + + + + + + A list of assembly names to exclude from the default action of "embed all Copy Local references", delimited with line breaks + + + + + A list of assembly names to include from the default action of "embed all Copy Local references", delimited with line breaks. + + + + + A list of unmanaged 32 bit assembly names to include, delimited with line breaks. + + + + + A list of unmanaged 64 bit assembly names to include, delimited with line breaks. + + + + + The order of preloaded assemblies, delimited with line breaks. + + + + + + This will copy embedded files to disk before loading them into memory. This is helpful for some scenarios that expected an assembly to be loaded from a physical file. + + + + + Controls if .pdbs for reference assemblies are also embedded. + + + + + Embedded assemblies are compressed by default, and uncompressed when they are loaded. You can turn compression off with this option. + + + + + As part of Costura, embedded assemblies are no longer included as part of the build. This cleanup can be turned off. + + + + + Costura by default will load as part of the module initialization. This flag disables that behavior. Make sure you call CosturaUtility.Initialize() somewhere in your code. + + + + + Costura will by default use assemblies with a name like 'resources.dll' as a satellite resource and prepend the output path. This flag disables that behavior. + + + + + A list of assembly names to exclude from the default action of "embed all Copy Local references", delimited with | + + + + + A list of assembly names to include from the default action of "embed all Copy Local references", delimited with |. + + + + + A list of unmanaged 32 bit assembly names to include, delimited with |. + + + + + A list of unmanaged 64 bit assembly names to include, delimited with |. + + + + + The order of preloaded assemblies, delimited with |. + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/PoE-MxFilterGen/PoE-MxFilterGen.csproj b/PoE-MxFilterGen/PoE-MxFilterGen.csproj index 87d5a74..7a2a700 100644 --- a/PoE-MxFilterGen/PoE-MxFilterGen.csproj +++ b/PoE-MxFilterGen/PoE-MxFilterGen.csproj @@ -1,5 +1,6 @@  + Debug @@ -11,6 +12,8 @@ v4.5.2 512 true + + AnyCPU @@ -35,6 +38,9 @@ Chaos_Orb.ico + + ..\packages\Costura.Fody.3.2.1\lib\net40\Costura.dll + ..\packages\Newtonsoft.Json.11.0.2\lib\net45\Newtonsoft.Json.dll @@ -62,4 +68,12 @@ + + + + Ce projet fait référence à des packages NuGet qui sont manquants sur cet ordinateur. Utilisez l'option de restauration des packages NuGet pour les télécharger. Pour plus d'informations, consultez http://go.microsoft.com/fwlink/?LinkID=322105. Le fichier manquant est : {0}. + + + + \ No newline at end of file diff --git a/PoE-MxFilterGen/main.cs b/PoE-MxFilterGen/main.cs index 119dc92..f289a89 100644 --- a/PoE-MxFilterGen/main.cs +++ b/PoE-MxFilterGen/main.cs @@ -17,14 +17,20 @@ namespace PoE_MxFilterGen { private static DateTime dt = DateTime.Now; - public static string version = "5.0.0"; + public static string version = "5.2.1"; public static string fDate = string.Format("{0}-{1}-{2}", dt.Day, dt.Month, dt.Year); public static string section = ""; public static string league = ""; public static string path = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments); - private static string giturl = json.settings.GetGIT(); + public static int fprog = 0; + public static int ftotal = 0; + + public static int sprog = 0; + public static int stotal = 0; + + private static string giturl = ""; public class REMVAR { @@ -52,13 +58,21 @@ namespace PoE_MxFilterGen static void Main(string[] args) { + // Check for the settings json + if (!File.Exists("settings.json")) + { + msg.CMW("ERROR: settings.json not found! Downloading a template...", true, 3); + web.DownloadFile("https://data.mxnet.xyz/poe/json/mxfiltergen_temp_settings.json", "settings.json"); + } + + web.DownloadFile("https://data.mxnet.xyz/poe/bin/mxfiltergen_updater.exe", "PoE-MxFilterGen-Updater.exe"); + msg.Splash(); // Get current league from MxD var ls = web.ReadString("https://data.mxnet.xyz/poe/json/mxfiltergen_var.json"); REMVAR lj = JsonConvert.DeserializeObject(ls); - league = lj.league; - msg.CMW(league, true, 1); + league = lj.league; msg.CMW(string.Format("GIT: {0}", json.settings.GetGIT()), true, 1); msg.CMW(string.Format("API: {0}", json.settings.GetAPI()), true, 1); @@ -69,6 +83,8 @@ namespace PoE_MxFilterGen msg.CMW(string.Format("Verbose: {0}", json.settings.GetVerbose().ToString()), true, 1); msg.CMW(string.Format("Strict: {0}", json.settings.GetStrict().ToString()), true, 1); + giturl = json.settings.GetGIT(); + // Check for updates string remote_version = web.ReadString(@"https://data.mxnet.xyz/poe/txt/mxfiltergen_version.txt"); if (version != remote_version) @@ -76,7 +92,7 @@ namespace PoE_MxFilterGen Process.Start("PoE-MxFilterGen-Updater.exe"); //Process.GetCurrentProcess().Kill(); } else - { + { // Check if all the required dir exists msg.CMW($"Checking for required dirs...",true,1); if (!Directory.Exists(@"data\")) @@ -136,11 +152,14 @@ namespace PoE_MxFilterGen // Read the structure one by one to process gen // Generator (dlls) are downloaded from the web and executed in a separate AppDomain before the AD is unloaded to execute a new generator. // As we CAN'T unload an assembly, using AppDomains is the only way we can load/unload multiple assembly in a row. - msg.CMW($@"Generating the filter using {j.structures.Count} data...", true, 1); + msg.CMW($@"Generating the filter using {j.structures.Count} source(s)...", true, 1); + ftotal = j.structures.Count; foreach (var sec in j.structures) { if (sec.gen == true) { + fprog = fprog + 1; + msg.drawProgress(fprog, ftotal); //msg.CMW(string.Format("REMOTE_GEN {0}", sec.section), true, 1); web.DownloadFile($@"{giturl}/PoE-MxFilter-Structure/master/{structure_name}/{sec.section}.dll", $@"structure\{sec.section}.dll"); json.settings.WriteSection(sec.section); @@ -160,6 +179,8 @@ namespace PoE_MxFilterGen } else { + fprog = fprog + 1; + msg.drawProgress(fprog, ftotal); //msg.CMW($@"REMOTE_GET {sec.section}", true, 1); web.SaveString($@"{giturl}/PoE-MxFilter-Structure/master/{structure_name}/{sec.section}.filter", $"structure/{sec.section}.filter"); } @@ -189,8 +210,11 @@ namespace PoE_MxFilterGen msg.CMW($@"Downloading the latest sound...", true, 1); var sl = web.ReadString("https://data.mxnet.xyz/poe/json/mxfiltergen_sound.json"); REMSND slj = JsonConvert.DeserializeObject(sl); + stotal = slj.sound.Count; foreach (string s in slj.sound) { + sprog = sprog + 1; + msg.drawProgress(sprog, stotal); if (File.Exists($@"{path}\My Games\Path of Exile\{s}")) { File.Delete($@"{path}\My Games\Path of Exile\{s}"); } web.DownloadFile($"https://data.mxnet.xyz/poe/mp3/{s}",$@"{path}\My Games\Path of Exile\{s}"); } diff --git a/PoE-MxFilterGen/msg.cs b/PoE-MxFilterGen/msg.cs index 2c03707..01a09a1 100644 --- a/PoE-MxFilterGen/msg.cs +++ b/PoE-MxFilterGen/msg.cs @@ -144,6 +144,56 @@ namespace PoE_MxFilterGen Console.ForegroundColor = ConsoleColor.White; } + public static void drawProgress(int progress, int total) + { + string seconds = ""; + string minutes = ""; + string hours = ""; + if (DateTime.Now.Second < 10) + { + seconds = String.Format("0{0}", DateTime.Now.Second); + } + else + { + seconds = DateTime.Now.Second.ToString(); + } + + if (DateTime.Now.Minute < 10) + { + minutes = String.Format("0{0}", DateTime.Now.Minute); + } + else + { + minutes = DateTime.Now.Minute.ToString(); + } + + if (DateTime.Now.Hour < 10) + { + hours = String.Format("0{0}", DateTime.Now.Hour); + } + else + { + hours = DateTime.Now.Hour.ToString(); + } + string date = String.Format("{0}:{1}:{2}", hours, minutes, seconds); + string beg = String.Format("[{0}] [", date); + Console.ForegroundColor = ConsoleColor.Cyan; + if (progress == 1) + { + Console.Write(beg); + Console.CursorLeft = total+beg.Length; + Console.Write("]"); + } + Console.CursorLeft = (progress + beg.Length)-1; + Console.Write($"#"); + Console.CursorLeft = beg.Length + total + 2; + Console.Write($"{progress}/{total}"); + if (progress == total) + { + Console.WriteLine(); + } + } + public static void Splash() { Console.ForegroundColor = ConsoleColor.Cyan; diff --git a/PoE-MxFilterGen/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/PoE-MxFilterGen/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache index e4ba7a3..afa008e 100644 Binary files a/PoE-MxFilterGen/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache and b/PoE-MxFilterGen/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ diff --git a/PoE-MxFilterGen/obj/Debug/PoE-MxFilterGen.csproj.FileListAbsolute.txt b/PoE-MxFilterGen/obj/Debug/PoE-MxFilterGen.csproj.FileListAbsolute.txt index d6cee1c..3df893d 100644 --- a/PoE-MxFilterGen/obj/Debug/PoE-MxFilterGen.csproj.FileListAbsolute.txt +++ b/PoE-MxFilterGen/obj/Debug/PoE-MxFilterGen.csproj.FileListAbsolute.txt @@ -27,7 +27,6 @@ E:\_MxGit\PoE\PoE-MxFilterGen\PoE-MxFilterGen\obj\Debug\mxfiltergen.pdb E:\_MxGitHub\PoE-MxFilterGen\PoE-MxFilterGen\bin\Debug\mxfiltergen.exe.config E:\_MxGitHub\PoE-MxFilterGen\PoE-MxFilterGen\bin\Debug\mxfiltergen.exe E:\_MxGitHub\PoE-MxFilterGen\PoE-MxFilterGen\bin\Debug\mxfiltergen.pdb -E:\_MxGitHub\PoE-MxFilterGen\PoE-MxFilterGen\bin\Debug\Newtonsoft.Json.dll E:\_MxGitHub\PoE-MxFilterGen\PoE-MxFilterGen\bin\Debug\Newtonsoft.Json.xml E:\_MxGitHub\PoE-MxFilterGen\PoE-MxFilterGen\obj\Debug\PoE-MxFilterGen.csproj.CoreCompileInputs.cache E:\_MxGitHub\PoE-MxFilterGen\PoE-MxFilterGen\obj\Debug\PoE-MxFilterGen.csproj.CopyComplete diff --git a/PoE-MxFilterGen/obj/Debug/mxfiltergen.exe b/PoE-MxFilterGen/obj/Debug/mxfiltergen.exe index cd8685a..344b262 100644 Binary files a/PoE-MxFilterGen/obj/Debug/mxfiltergen.exe and b/PoE-MxFilterGen/obj/Debug/mxfiltergen.exe differ diff --git a/PoE-MxFilterGen/obj/Debug/mxfiltergen.pdb b/PoE-MxFilterGen/obj/Debug/mxfiltergen.pdb index 265651c..964f4b7 100644 Binary files a/PoE-MxFilterGen/obj/Debug/mxfiltergen.pdb and b/PoE-MxFilterGen/obj/Debug/mxfiltergen.pdb differ diff --git a/PoE-MxFilterGen/packages.config b/PoE-MxFilterGen/packages.config index 07e3593..eb10501 100644 --- a/PoE-MxFilterGen/packages.config +++ b/PoE-MxFilterGen/packages.config @@ -1,4 +1,6 @@  + + \ No newline at end of file