diff --git a/MxWa.sln b/MxWa.sln new file mode 100644 index 0000000..9f25622 --- /dev/null +++ b/MxWa.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30503.244 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MxWa", "MxWa\MxWa.csproj", "{834F795E-DAE8-4BF7-A411-8F75D13FB301}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {834F795E-DAE8-4BF7-A411-8F75D13FB301}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {834F795E-DAE8-4BF7-A411-8F75D13FB301}.Debug|Any CPU.Build.0 = Debug|Any CPU + {834F795E-DAE8-4BF7-A411-8F75D13FB301}.Release|Any CPU.ActiveCfg = Release|Any CPU + {834F795E-DAE8-4BF7-A411-8F75D13FB301}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {79B18C3C-A15F-4E0B-B23C-67B107BC0382} + EndGlobalSection +EndGlobal diff --git a/MxWa/App.config b/MxWa/App.config new file mode 100644 index 0000000..56efbc7 --- /dev/null +++ b/MxWa/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/MxWa/FodyWeavers.xml b/MxWa/FodyWeavers.xml new file mode 100644 index 0000000..5029e70 --- /dev/null +++ b/MxWa/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/MxWa/FodyWeavers.xsd b/MxWa/FodyWeavers.xsd new file mode 100644 index 0000000..44a5374 --- /dev/null +++ b/MxWa/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/MxWa/MxWa.csproj b/MxWa/MxWa.csproj new file mode 100644 index 0000000..dfd9c36 --- /dev/null +++ b/MxWa/MxWa.csproj @@ -0,0 +1,76 @@ + + + + + + Debug + AnyCPU + {834F795E-DAE8-4BF7-A411-8F75D13FB301} + Exe + MxWa + MxWa + v4.7.2 + 512 + true + true + + + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + mxw%282%29.ico + + + + ..\packages\LibGit2Sharp.0.26.2\lib\net46\LibGit2Sharp.dll + + + ..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll + + + + + + + + + + + + + + + + + + + + + + + + + + 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/MxWa/Program.cs b/MxWa/Program.cs new file mode 100644 index 0000000..7d1e079 --- /dev/null +++ b/MxWa/Program.cs @@ -0,0 +1,71 @@ +using LibGit2Sharp; +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Net; +using System.Security.AccessControl; +using System.Security.Principal; +using System.Text; +using System.Threading.Tasks; + +namespace MxWa +{ + public class Addon + { + public string name { get; set; } + public string git { get; set; } + } + + public class Root + { + public List addons { get; set; } + } + class Program + { + public static string version = "1.0.0"; + + static void Main(string[] args) + { + msg.Splash(); + + string listurl = @"https://wow.mikx.xyz/mxwa/addons.json"; + + WebClient web = new WebClient(); + var js = web.DownloadString(listurl); + Root lj = JsonConvert.DeserializeObject(js); + + foreach (var a in lj.addons) + { + if (Directory.Exists($@"AddOns\{a.name}")) + { + msg.CMW($"Fixing [{a.name}] folder permissions...",true,1); + FixPermission($@"AddOns\{a.name}"); + msg.CMW($"Deleting old [{a.name}] files...", true, 1); + Directory.Delete($@"AddOns\{a.name}", true); + msg.CMW($"Installing latest [{a.name}] data...", true, 1); + Repository.Clone(a.git, $@"AddOns\{a.name}"); + } + else + { + msg.CMW($"Installing latest [{a.name}] data...", true, 1); + Repository.Clone(a.git, $@"AddOns\{a.name}"); + } + } + } + + static void FixPermission(string path) + { + var dl = Directory.GetDirectories(path, "*", SearchOption.AllDirectories); + foreach (var d in dl) + { + var fl = Directory.GetFiles(d); + foreach (var f in fl) + { + File.SetAttributes(f, FileAttributes.Normal); + } + } + } + } +} diff --git a/MxWa/Properties/AssemblyInfo.cs b/MxWa/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..2d8c222 --- /dev/null +++ b/MxWa/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// Les informations générales relatives à un assembly dépendent de +// l'ensemble d'attributs suivant. Changez les valeurs de ces attributs pour modifier les informations +// associées à un assembly. +[assembly: AssemblyTitle("MxWa")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("MxWa")] +[assembly: AssemblyCopyright("Copyright © 2020")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// L'affectation de la valeur false à ComVisible rend les types invisibles dans cet assembly +// aux composants COM. Si vous devez accéder à un type dans cet assembly à partir de +// COM, affectez la valeur true à l'attribut ComVisible sur ce type. +[assembly: ComVisible(false)] + +// Le GUID suivant est pour l'ID de la typelib si ce projet est exposé à COM +[assembly: Guid("834f795e-dae8-4bf7-a411-8f75d13fb301")] + +// Les informations de version pour un assembly se composent des quatre valeurs suivantes : +// +// Version principale +// Version secondaire +// Numéro de build +// Révision +// +// Vous pouvez spécifier toutes les valeurs ou indiquer les numéros de build et de révision par défaut +// en utilisant '*', comme indiqué ci-dessous : +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/MxWa/msg.cs b/MxWa/msg.cs new file mode 100644 index 0000000..dbe1852 --- /dev/null +++ b/MxWa/msg.cs @@ -0,0 +1,210 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace MxWa +{ + class msg + { + public static void CM(string msg, bool time, int color) + { + 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); + + + //color switch + ConsoleColor cc = ConsoleColor.White; + switch (color) + { + case 0: + //nothing + break; + case 1: + cc = ConsoleColor.Cyan; + break; + case 2: + cc = ConsoleColor.Green; + break; + case 3: + cc = ConsoleColor.Red; + break; + } + + if (time) + { + Console.ForegroundColor = cc; + Console.WriteLine(String.Format("[{0}] {1}", date, msg)); + } + else + { + Console.ForegroundColor = cc; + Console.WriteLine(String.Format("{0}", msg)); + } + + Console.ForegroundColor = ConsoleColor.White; + } + + public static void CMW(string msg, bool time, int color) + { + 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); + + File.AppendAllText("mxfiltergen.logs", String.Format("[{0}] {1}", date, msg) + Environment.NewLine); + + //color switch + ConsoleColor cc = ConsoleColor.White; + switch (color) + { + case 0: + //nothing + break; + case 1: + cc = ConsoleColor.Cyan; + break; + case 2: + cc = ConsoleColor.Green; + break; + case 3: + cc = ConsoleColor.Red; + break; + } + + if (time) + { + Console.ForegroundColor = cc; + Console.WriteLine(String.Format("[{0}] {1}", date, msg)); + } + else + { + Console.ForegroundColor = cc; + Console.WriteLine(String.Format("")); + } + + 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; + Console.WriteLine(""); + Console.WriteLine("#### MxWa"); + Console.WriteLine(string.Format("#### VERSION: {0}", Program.version)); + Console.WriteLine("#### DEV: mikx"); + Console.WriteLine("#### wow.mikx.xyz"); + Console.WriteLine(""); + Console.ForegroundColor = ConsoleColor.White; + } + + } +} diff --git a/MxWa/mxw(2).ico b/MxWa/mxw(2).ico new file mode 100644 index 0000000..3fbdd8a Binary files /dev/null and b/MxWa/mxw(2).ico differ diff --git a/MxWa/packages.config b/MxWa/packages.config new file mode 100644 index 0000000..1ff80c6 --- /dev/null +++ b/MxWa/packages.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file