commit 6ba1e5f09468a112913eb6ad1f7f3beec5ca01bc Author: mikx Date: Mon Sep 22 18:44:37 2025 -0400 first commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3c4efe2 --- /dev/null +++ b/.gitignore @@ -0,0 +1,261 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ + +# Visual Studio 2015 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# DNX +project.lock.json +project.fragment.lock.json +artifacts/ + +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# TODO: Comment the next line if you want to checkin your web deploy settings +# but database connection strings (with potential passwords) will be unencrypted +#*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/packages/repositories.config +# NuGet v3's project.json files produces more ignoreable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +node_modules/ +orleans.codegen.cs + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +*.mdf +*.ldf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# JetBrains Rider +.idea/ +*.sln.iml + +# CodeRush +.cr/ + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc \ No newline at end of file diff --git a/MxWManager.sln b/MxWManager.sln new file mode 100644 index 0000000..e2e95f7 --- /dev/null +++ b/MxWManager.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.14.36414.22 d17.14 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MxWManager", "MxWManager\MxWManager.csproj", "{377DC521-9578-44BC-A856-23CE08E7168E}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {377DC521-9578-44BC-A856-23CE08E7168E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {377DC521-9578-44BC-A856-23CE08E7168E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {377DC521-9578-44BC-A856-23CE08E7168E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {377DC521-9578-44BC-A856-23CE08E7168E}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {299AE0D6-4F1F-4417-B38C-CA5A963CD6B8} + EndGlobalSection +EndGlobal diff --git a/MxWManager/App.config b/MxWManager/App.config new file mode 100644 index 0000000..56efbc7 --- /dev/null +++ b/MxWManager/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/MxWManager/MainForm.Designer.cs b/MxWManager/MainForm.Designer.cs new file mode 100644 index 0000000..2721e37 --- /dev/null +++ b/MxWManager/MainForm.Designer.cs @@ -0,0 +1,163 @@ +namespace MxWManager +{ + partial class MainForm + { + /// + /// Variable nécessaire au concepteur. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Nettoyage des ressources utilisées. + /// + /// true si les ressources managées doivent être supprimées ; sinon, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Code généré par le Concepteur Windows Form + + /// + /// Méthode requise pour la prise en charge du concepteur - ne modifiez pas + /// le contenu de cette méthode avec l'éditeur de code. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm)); + this.dataGridView_MainForm_EnvList = new System.Windows.Forms.DataGridView(); + this.timer_MainForm_ProcessWatchDog = new System.Windows.Forms.Timer(this.components); + this.contextMenuStrip_MainForm_ConfList = new System.Windows.Forms.ContextMenuStrip(this.components); + this.contextMenuStrip_MainForm_Manage = new System.Windows.Forms.ContextMenuStrip(this.components); + this.textBox_MainForm_Console = new System.Windows.Forms.TextBox(); + this.button_MainForm_NewEnv = new System.Windows.Forms.Button(); + this.button_MainForm_Settings = new System.Windows.Forms.Button(); + this.button_MainForm_Backup = new System.Windows.Forms.Button(); + this.label_MainForm_Info = new System.Windows.Forms.Label(); + ((System.ComponentModel.ISupportInitialize)(this.dataGridView_MainForm_EnvList)).BeginInit(); + this.SuspendLayout(); + // + // dataGridView_MainForm_EnvList + // + this.dataGridView_MainForm_EnvList.AllowUserToAddRows = false; + this.dataGridView_MainForm_EnvList.AllowUserToDeleteRows = false; + this.dataGridView_MainForm_EnvList.AllowUserToResizeColumns = false; + this.dataGridView_MainForm_EnvList.AllowUserToResizeRows = false; + this.dataGridView_MainForm_EnvList.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.dataGridView_MainForm_EnvList.ColumnHeadersVisible = false; + this.dataGridView_MainForm_EnvList.Location = new System.Drawing.Point(12, 12); + this.dataGridView_MainForm_EnvList.Name = "dataGridView_MainForm_EnvList"; + this.dataGridView_MainForm_EnvList.RowHeadersVisible = false; + this.dataGridView_MainForm_EnvList.Size = new System.Drawing.Size(622, 303); + this.dataGridView_MainForm_EnvList.TabIndex = 0; + this.dataGridView_MainForm_EnvList.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView_MainForm_EnvList_CellClick); + // + // timer_MainForm_ProcessWatchDog + // + this.timer_MainForm_ProcessWatchDog.Enabled = true; + this.timer_MainForm_ProcessWatchDog.Interval = 2000; + this.timer_MainForm_ProcessWatchDog.Tick += new System.EventHandler(this.timer_MainForm_ProcessWatchDog_Tick); + // + // contextMenuStrip_MainForm_ConfList + // + this.contextMenuStrip_MainForm_ConfList.Name = "contextMenuStrip_MainForm_ConfList"; + this.contextMenuStrip_MainForm_ConfList.Size = new System.Drawing.Size(61, 4); + this.contextMenuStrip_MainForm_ConfList.ItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.contextMenuStrip_MainForm_ConfList_ItemClicked); + // + // contextMenuStrip_MainForm_Manage + // + this.contextMenuStrip_MainForm_Manage.Name = "contextMenuStrip1"; + this.contextMenuStrip_MainForm_Manage.Size = new System.Drawing.Size(61, 4); + this.contextMenuStrip_MainForm_Manage.ItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.contextMenuStrip_MainForm_Manage_ItemClicked); + // + // textBox_MainForm_Console + // + this.textBox_MainForm_Console.BackColor = System.Drawing.Color.Black; + this.textBox_MainForm_Console.Font = new System.Drawing.Font("Consolas", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.textBox_MainForm_Console.ForeColor = System.Drawing.Color.White; + this.textBox_MainForm_Console.Location = new System.Drawing.Point(12, 350); + this.textBox_MainForm_Console.Multiline = true; + this.textBox_MainForm_Console.Name = "textBox_MainForm_Console"; + this.textBox_MainForm_Console.Size = new System.Drawing.Size(622, 264); + this.textBox_MainForm_Console.TabIndex = 2; + // + // button_MainForm_NewEnv + // + this.button_MainForm_NewEnv.Location = new System.Drawing.Point(12, 321); + this.button_MainForm_NewEnv.Name = "button_MainForm_NewEnv"; + this.button_MainForm_NewEnv.Size = new System.Drawing.Size(75, 23); + this.button_MainForm_NewEnv.TabIndex = 3; + this.button_MainForm_NewEnv.Text = "New Env"; + this.button_MainForm_NewEnv.UseVisualStyleBackColor = true; + // + // button_MainForm_Settings + // + this.button_MainForm_Settings.Location = new System.Drawing.Point(559, 321); + this.button_MainForm_Settings.Name = "button_MainForm_Settings"; + this.button_MainForm_Settings.Size = new System.Drawing.Size(75, 23); + this.button_MainForm_Settings.TabIndex = 5; + this.button_MainForm_Settings.Text = "Settings"; + this.button_MainForm_Settings.UseVisualStyleBackColor = true; + // + // button_MainForm_Backup + // + this.button_MainForm_Backup.Location = new System.Drawing.Point(478, 321); + this.button_MainForm_Backup.Name = "button_MainForm_Backup"; + this.button_MainForm_Backup.Size = new System.Drawing.Size(75, 23); + this.button_MainForm_Backup.TabIndex = 6; + this.button_MainForm_Backup.Text = "Backup"; + this.button_MainForm_Backup.UseVisualStyleBackColor = true; + // + // label_MainForm_Info + // + this.label_MainForm_Info.AutoSize = true; + this.label_MainForm_Info.Font = new System.Drawing.Font("Verdana", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label_MainForm_Info.Location = new System.Drawing.Point(93, 325); + this.label_MainForm_Info.Name = "label_MainForm_Info"; + this.label_MainForm_Info.Size = new System.Drawing.Size(137, 14); + this.label_MainForm_Info.TabIndex = 7; + this.label_MainForm_Info.Text = "Developped by mikx."; + // + // MainForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.Color.Orange; + this.ClientSize = new System.Drawing.Size(647, 626); + this.Controls.Add(this.label_MainForm_Info); + this.Controls.Add(this.button_MainForm_Backup); + this.Controls.Add(this.button_MainForm_Settings); + this.Controls.Add(this.button_MainForm_NewEnv); + this.Controls.Add(this.textBox_MainForm_Console); + this.Controls.Add(this.dataGridView_MainForm_EnvList); + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.MaximizeBox = false; + this.Name = "MainForm"; + this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; + this.Text = "MxWManager"; + this.Load += new System.EventHandler(this.MainForm_Load); + ((System.ComponentModel.ISupportInitialize)(this.dataGridView_MainForm_EnvList)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.DataGridView dataGridView_MainForm_EnvList; + private System.Windows.Forms.Timer timer_MainForm_ProcessWatchDog; + private System.Windows.Forms.ContextMenuStrip contextMenuStrip_MainForm_ConfList; + private System.Windows.Forms.ContextMenuStrip contextMenuStrip_MainForm_Manage; + private System.Windows.Forms.TextBox textBox_MainForm_Console; + private System.Windows.Forms.Button button_MainForm_NewEnv; + private System.Windows.Forms.Button button_MainForm_Settings; + private System.Windows.Forms.Button button_MainForm_Backup; + private System.Windows.Forms.Label label_MainForm_Info; + } +} + diff --git a/MxWManager/MainForm.cs b/MxWManager/MainForm.cs new file mode 100644 index 0000000..e39668b --- /dev/null +++ b/MxWManager/MainForm.cs @@ -0,0 +1,465 @@ +using Newtonsoft.Json.Linq; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Diagnostics; +using System.Drawing; +using System.IO; +using System.Linq; +using System.Net.NetworkInformation; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace MxWManager +{ + public partial class MainForm : Form + { + [DllImport("kernel32.dll", SetLastError = true)] + static extern bool GenerateConsoleCtrlEvent(int dwCtrlEvent, int dwProcessGroupId); + + // P/Invoke declarations for Windows API functions + [DllImport("user32.dll")] + private static extern bool SetForegroundWindow(IntPtr hWnd); + + [DllImport("user32.dll")] + private static extern bool ShowWindowAsync(IntPtr hWnd, int nCmdShow); + + // Constant to restore a minimized window + private const int SW_RESTORE = 9; + + public static string version = "1.0.0"; + public Stopwatch stopwatch = new Stopwatch(); + public TimeSpan ts; + public string elapsedTime = ""; + + private static string contextMenuEnv = ""; + + public MainForm() + { + InitializeComponent(); + } + + private void MainForm_Load(object sender, EventArgs e) + { + label_MainForm_Info.Text = $"Developped by mikx. Version: {version}"; + dataGridView_MainForm_EnvList.BackgroundColor = Color.FromArgb(22,23,23); + textBox_MainForm_Console.BackColor = Color.FromArgb(22, 23, 23); + int envc = 0; + var env = Directory.GetDirectories(Directory.GetCurrentDirectory()); + foreach (var dir in env) + { + bool envcheck = File.Exists($@"{dir}\env.json"); + if (envcheck) + { + envc++; + } + + } + MainConsole("System",$"MxWManager Launched with {envc} managed env."); + UpdateEnvList(); + dataGridView_MainForm_EnvList.ClearSelection(); + dataGridView_MainForm_EnvList.CurrentCell = null; + } + + private void dataGridView_MainForm_EnvList_CellClick(object sender, DataGridViewCellEventArgs e) + { + if (dataGridView_MainForm_EnvList.Rows[e.RowIndex].Cells[e.ColumnIndex].Value != null) + { + string clickedButtonText = dataGridView_MainForm_EnvList.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString(); + string envName = dataGridView_MainForm_EnvList.Rows[e.RowIndex].Cells[2].Value.ToString(); + + Process p = new Process(); + + switch (clickedButtonText) + { + case "Browse": + Process.Start(new ProcessStartInfo($@"{envName}")); + MainConsole($"{envName}", $"Browsing {envName}."); + break; + + case "IDE": + MainConsole($"{envName}", $"Starting IDE for {envName}."); + p.StartInfo.FileName = "devenv.exe"; + p.StartInfo.Arguments = $@"{envName}/build/AzerothCore.sln"; + p.Start(); + UpdateEnvList(); + break; + + case "Manage": + contextMenuStrip_MainForm_Manage.Items.Clear(); + contextMenuEnv = envName; + contextMenuStrip_MainForm_Manage.Items.Add($@"CC|{envName}| Copy built Core"); + var env = Directory.GetDirectories(Directory.GetCurrentDirectory()); + foreach (var dir in env) + { + bool envcheck = File.Exists($@"{dir}\env.json"); + if (envcheck && Path.GetFileName(dir) != envName && !envName.Contains("DEV")) + { + contextMenuStrip_MainForm_Manage.Items.Add($@"GS|{Path.GetFileName(dir)}| Get Sources From"); + } + } + contextMenuStrip_MainForm_Manage.Show(Cursor.Position.X, Cursor.Position.Y); + break; + + case "Config": + if ((Control.ModifierKeys & Keys.Shift) == Keys.Shift) + { + MainConsole($"{envName}", $"Opening {envName} env config..."); + p.StartInfo.FileName = @"code"; + p.StartInfo.Arguments = $@"{envName}\env.json"; + p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; + p.Start(); + dataGridView_MainForm_EnvList.ClearSelection(); + dataGridView_MainForm_EnvList.CurrentCell = null; + break; + } + else + { + stopwatch.Start(); + p.StartInfo.FileName = "cmd.exe"; + p.StartInfo.Arguments = $"/C cd {envName}/build && cmake ..\\sources -G \"Visual Studio 17 2022\" -A x64 -DWITH_WARNINGS=0 -DTOOLS_BUILD=none -DSCRIPTS=static -DMODULES=static -DMYSQL_LIBRARY=\"..\\..\\_DEPS\\mysql\\lib\\libmysql.lib\" -DMYSQL_INCLUDE_DIR=\"..\\..\\_DEPS\\mysql\\include\""; + p.Start(); + MainConsole($"{envName}", $"Configuring {envName}..."); + p.WaitForExit(); + stopwatch.Stop(); + ts = stopwatch.Elapsed; + elapsedTime = String.Format("{0:00}:{1:00}:{2:00}", ts.Hours, ts.Minutes, ts.Seconds); + MainConsole($"{envName}", $"Configured {envName} in {elapsedTime}."); + UpdateEnvList(); + break; + } + + case "Clean": + p.StartInfo.FileName = "cmd.exe"; + p.StartInfo.Arguments = $"/C cd {envName}/build && cmake --build . --target clean --config RelWithDebInfo"; + MainConsole($"{envName}", $"Cleaned {envName}."); + p.Start(); + break; + + case "Build": + stopwatch.Start(); + p.StartInfo.FileName = "cmd.exe"; + p.StartInfo.Arguments = $"/C cd {envName}/build && cmake --build . --config RelWithDebInfo"; + p.Start(); + MainConsole($"{envName}", $"Building {envName}..."); + p.WaitForExit(); + stopwatch.Stop(); + ts = stopwatch.Elapsed; + elapsedTime = String.Format("{0:00}:{1:00}:{2:00}", ts.Hours, ts.Minutes, ts.Seconds); + MainConsole($"{envName}", $"Built {envName} in {elapsedTime}."); + stopwatch.Reset(); + UpdateEnvList(); + break; + case "Auth": + int apid = GetEnvProcessID(envName, "auth"); + if (apid == 0 || !ProcessExists(apid)) + { + p.StartInfo.FileName = "cmd.exe"; + p.StartInfo.Arguments = $@"/C cd {Directory.GetCurrentDirectory()}\{envName}\core && authserver.exe"; + p.Start(); + SetEnvProcessID(envName, "auth", p.Id); + MainConsole($"{envName}", $"Started Auth with pid {p.Id}."); + UpdateEnvList(); + } else + { + MainConsole($"{envName}", $"Auth is running with pid {apid}, focusing."); + SetActiveWindowByProcessId(apid); + } + break; + case "World": + int wpid = GetEnvProcessID(envName, "world"); + if (wpid == 0 || !ProcessExists(wpid)) + { + p.StartInfo.FileName = "cmd.exe"; + p.StartInfo.Arguments = $@"/C cd {Directory.GetCurrentDirectory()}\{envName}\core && worldserver.exe"; + p.Start(); + SetEnvProcessID(envName, "world", p.Id); + MainConsole($"{envName}", $"Started World with pid {p.Id}."); + UpdateEnvList(); + } else + { + MainConsole($"{envName}", $"World is running with pid {wpid}, focusing."); + SetActiveWindowByProcessId(wpid); + } + break; + case "Configs": + contextMenuStrip_MainForm_ConfList.Items.Clear(); + contextMenuEnv = envName; + var configs = Directory.GetFiles($@"{envName}\core\configs", "*.conf"); + foreach (var c in configs) + { + contextMenuStrip_MainForm_ConfList.Items.Add(Path.GetFileName(c)); + } + contextMenuStrip_MainForm_ConfList.Show(Cursor.Position.X, Cursor.Position.Y); + break; + + } + } + } + + public void UpdateEnvList() + { + dataGridView_MainForm_EnvList.Rows.Clear(); + dataGridView_MainForm_EnvList.Columns.Clear(); + DataGridViewImageColumn imgColumn = new DataGridViewImageColumn(); + dataGridView_MainForm_EnvList.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.DisplayedCells; + dataGridView_MainForm_EnvList.RowTemplate.Height = 31; + dataGridView_MainForm_EnvList.ReadOnly = true; + //dataGridView_MainForm_EnvList.Columns.Add(new DataGridViewImageColumn()); + dataGridView_MainForm_EnvList.Columns.Add(new DataGridViewImageColumn()); + dataGridView_MainForm_EnvList.Columns.Add(new DataGridViewTextBoxColumn()); + dataGridView_MainForm_EnvList.Columns.Add(new DataGridViewTextBoxColumn()); + dataGridView_MainForm_EnvList.Columns.Add(new DataGridViewButtonColumn()); + dataGridView_MainForm_EnvList.Columns.Add(new DataGridViewButtonColumn()); + dataGridView_MainForm_EnvList.Columns.Add(new DataGridViewButtonColumn()); + dataGridView_MainForm_EnvList.Columns.Add(new DataGridViewButtonColumn()); + dataGridView_MainForm_EnvList.Columns.Add(new DataGridViewButtonColumn()); + dataGridView_MainForm_EnvList.Columns.Add(new DataGridViewButtonColumn()); + dataGridView_MainForm_EnvList.Columns.Add(new DataGridViewImageColumn()); + dataGridView_MainForm_EnvList.Columns.Add(new DataGridViewButtonColumn()); + dataGridView_MainForm_EnvList.Columns.Add(new DataGridViewImageColumn()); + dataGridView_MainForm_EnvList.Columns.Add(new DataGridViewButtonColumn()); + dataGridView_MainForm_EnvList.Columns.Add(new DataGridViewButtonColumn()); + + var env = Directory.GetDirectories(Directory.GetCurrentDirectory()); + foreach (var dir in env) + { + bool envcheck = File.Exists($@"{dir}\env.json"); + if (envcheck) + { + Image imgSource = Image.FromFile(@"_DATA\img\Source_Off.png"); + if (Directory.GetFileSystemEntries($@"{dir}\sources").Length == 0) + { + imgSource = Image.FromFile(@"_DATA\img\Source_Off.png"); + } + else + { + imgSource = Image.FromFile(@"_DATA\img\Source_On.png"); + } + + Image imgBuild = Image.FromFile(@"_DATA\img\Build_Off.png"); + if (Directory.GetFileSystemEntries($@"{dir}\build\bin").Length == 0) + { + imgBuild = Image.FromFile(@"_DATA\img\Build_Off.png"); + } + else + { + imgBuild = Image.FromFile(@"_DATA\img\Build_On.png"); + } + + Image imgAuth = Image.FromFile(@"_DATA\img\Auth_Off.png"); + int authpid = GetEnvProcessID(Path.GetFileName(dir), "auth"); + if (authpid != 0 && ProcessExists(authpid)) + { + imgAuth = Image.FromFile(@"_DATA\img\Auth_On.png"); + } else + { + imgAuth = Image.FromFile(@"_DATA\img\Auth_Off.png"); + } + + Image imgWorld = Image.FromFile(@"_DATA\img\World_Off.png"); + int worldpid = GetEnvProcessID(Path.GetFileName(dir), "world"); + if (worldpid != 0 && ProcessExists(worldpid)) + { + imgWorld = Image.FromFile(@"_DATA\img\World_On.png"); + } + else + { + imgWorld = Image.FromFile(@"_DATA\img\World_Off.png"); + } + + // Add env to datagridview + DataGridViewRow rowEnv = new DataGridViewRow(); + //rowEnv.Cells.Add(new DataGridViewImageCell { Value = imgSource }); + rowEnv.Cells.Add(new DataGridViewImageCell { Value = imgBuild }); + rowEnv.Cells.Add(new DataGridViewTextBoxCell { Value = $"{GetEnvTag(Path.GetFileName(dir))[0]}:{GetEnvTag(Path.GetFileName(dir))[1]}" }); + rowEnv.Cells.Add(new DataGridViewTextBoxCell { Value = Path.GetFileName(dir) }); + rowEnv.Cells.Add(new DataGridViewButtonCell { Value = "Browse" }); + rowEnv.Cells.Add(new DataGridViewButtonCell { Value = "IDE" }); + rowEnv.Cells.Add(new DataGridViewButtonCell { Value = "Manage" }); + rowEnv.Cells.Add(new DataGridViewButtonCell { Value = "Config" }); + rowEnv.Cells.Add(new DataGridViewButtonCell { Value = "Clean" }); + rowEnv.Cells.Add(new DataGridViewButtonCell { Value = "Build" }); + rowEnv.Cells.Add(new DataGridViewImageCell { Value = imgAuth }); + rowEnv.Cells.Add(new DataGridViewButtonCell { Value = "Auth" }); + rowEnv.Cells.Add(new DataGridViewImageCell { Value = imgWorld }); + rowEnv.Cells.Add(new DataGridViewButtonCell { Value = "World" }); + rowEnv.Cells.Add(new DataGridViewButtonCell { Value = "Configs" }); + dataGridView_MainForm_EnvList.Rows.Add(rowEnv); + } + } + } + + public static bool ProcessExists(int pid) + { + try + { + Process.GetProcessById(pid); + return true; + } + catch (ArgumentException) + { + return false; + } + } + + public static int GetEnvProcessID(string env, string type) + { + string jsonFilePath = $@"{env}/env.json"; + string jsonContent = File.ReadAllText(jsonFilePath); + JObject jsonObject = JObject.Parse(jsonContent); + if (type == "auth") { return jsonObject["authpid"].Value(); } + if (type == "world") { return jsonObject["worldpid"].Value(); } + return 0; + } + + public static string[] GetEnvTag(string env) + { + string jsonFilePath = $@"{env}/env.json"; + string jsonContent = File.ReadAllText(jsonFilePath); + JObject jsonObject = JObject.Parse(jsonContent); + string[] tags = { jsonObject["tag"].ToString().Split('|')[0], jsonObject["tag"].ToString().Split('|')[1] }; + return tags; + } + + public static void SetEnvProcessID(string env, string type, int pid) + { + string jsonFilePath = $@"{env}/env.json"; + string jsonContent = File.ReadAllText(jsonFilePath); + JObject jsonObject = JObject.Parse(jsonContent); + if (type == "auth") { jsonObject["authpid"] = pid; } + if (type == "world") { jsonObject["worldpid"] = pid; } + string updatedJson = jsonObject.ToString(Newtonsoft.Json.Formatting.Indented); + File.WriteAllText(jsonFilePath, updatedJson); + } + + public static void SetActiveWindowByProcessId(int processId) + { + try + { + Process process = Process.GetProcessById(processId); + + // Check if the process has a main window + if (process.MainWindowHandle == IntPtr.Zero) + { + Console.WriteLine($"Process with ID {processId} has no main window."); + return; + } + + IntPtr handle = process.MainWindowHandle; + + // Restore the window if it's minimized + ShowWindowAsync(handle, SW_RESTORE); + + // Bring the window to the foreground and activate it + SetForegroundWindow(handle); + + Console.WriteLine($"Window for process with ID {processId} has been activated."); + } + catch (ArgumentException) + { + Console.WriteLine($"Error: A process with ID {processId} does not exist."); + } + } + + private void timer_MainForm_ProcessWatchDog_Tick(object sender, EventArgs e) + { + var env = Directory.GetDirectories(Directory.GetCurrentDirectory()); + foreach (var dir in env) + { + bool envcheck = File.Exists($@"{dir}\env.json"); + if (envcheck) + { + string envName = Path.GetFileName(dir); + int apid = GetEnvProcessID(Path.GetFileName(dir), "auth"); + if (apid == 0 || !ProcessExists(apid)) + { + SetEnvProcessID(envName, "auth", 0); + } + + int wpid = GetEnvProcessID(Path.GetFileName(dir), "world"); + if (wpid == 0 || !ProcessExists(wpid)) + { + SetEnvProcessID(envName, "world", 0); + } + } + } + } + + private void contextMenuStrip_MainForm_ConfList_ItemClicked(object sender, ToolStripItemClickedEventArgs e) + { + ToolStripItem item = e.ClickedItem; + MainConsole($"{contextMenuEnv}", $"Opening {item.Text}..."); + Process p = new Process(); + p.StartInfo.FileName = @"code"; + p.StartInfo.Arguments = $@"{contextMenuEnv}\core\configs\{item.Text}"; + p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; + p.Start(); + } + + private void contextMenuStrip_MainForm_Manage_ItemClicked(object sender, ToolStripItemClickedEventArgs e) + { + ToolStripItem item = e.ClickedItem; + string clickedType = item.Text.Split('|')[0]; + string clickedEnv = item.Text.Split('|')[1]; + switch (clickedType) + { + case "CC": + File.Copy($@"{clickedEnv}\build\bin\RelWithDebInfo\worldserver.exe", $@"{clickedEnv}\core\worldserver.exe", true); + break; + case "GS": + // Get sources from another env + Process p = new Process(); + p.StartInfo.FileName = "cmd.exe"; + p.StartInfo.Arguments = $@"/C xcopy {Directory.GetCurrentDirectory()}\{clickedEnv}\sources\src {Directory.GetCurrentDirectory()}\{contextMenuEnv}\sources\src /S /E /H /Y && xcopy {Directory.GetCurrentDirectory()}\{clickedEnv}\sources\modules {Directory.GetCurrentDirectory()}\{contextMenuEnv}\sources\modules /S /E /H /Y"; + p.Start(); + p.WaitForExit(); + break; + } + } + + public void MainConsole(string env, string msg) + { + 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(); + } + if (textBox_MainForm_Console.Text == "") + { + textBox_MainForm_Console.Text = $"[{hours}:{minutes}:{seconds}][{env}] {msg}"; + } + else + { + textBox_MainForm_Console.AppendText("\r\n" + $"[{hours}:{minutes}:{seconds}][{env}] {msg}"); + } + } + } +} diff --git a/MxWManager/MainForm.resx b/MxWManager/MainForm.resx new file mode 100644 index 0000000..320a8ca --- /dev/null +++ b/MxWManager/MainForm.resx @@ -0,0 +1,206 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + + 260, 17 + + + 517, 17 + + + + + AAABAAEAICAAAAEAIACoEAAAFgAAACgAAAAgAAAAQAAAAAEAIAAAAAAAABAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABgAAABwAAQI+BA0TXwga + JncKIjKECiQ0hAkgK3cFExdfAAIDPgAAABwAAAAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGAAAAHAED + Az4KGBlfDywvdxAyOYQNLTeECR8rdwQPFl8AAgI+AAAAHAAAAAYAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAA/8AD//8AAP/8AAA/gAAAAYAAAAGAAAABgAAAAYAAAAGAAAABgAAAAQAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAGAAAABwAAAA8AA + AAPAAAADwAAAA8AAAAP8AAA//wAA///AA/8= + + + \ No newline at end of file diff --git a/MxWManager/MxWManager.csproj b/MxWManager/MxWManager.csproj new file mode 100644 index 0000000..c88a433 --- /dev/null +++ b/MxWManager/MxWManager.csproj @@ -0,0 +1,93 @@ + + + + + Debug + AnyCPU + {377DC521-9578-44BC-A856-23CE08E7168E} + WinExe + MxWManager + MxWManager + v4.7.2 + 512 + true + true + + + AnyCPU + true + full + false + \\192.168.1.160\MxWCore\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + WoW_icon.svg.ico + + + + ..\packages\Newtonsoft.Json.13.0.4\lib\net45\Newtonsoft.Json.dll + + + + + + + + + + + + + + + + Form + + + MainForm.cs + + + + + MainForm.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + + + + + + \ No newline at end of file diff --git a/MxWManager/Program.cs b/MxWManager/Program.cs new file mode 100644 index 0000000..3ce34ca --- /dev/null +++ b/MxWManager/Program.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace MxWManager +{ + internal static class Program + { + /// + /// Point d'entrée principal de l'application. + /// + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new MainForm()); + } + } +} diff --git a/MxWManager/Properties/AssemblyInfo.cs b/MxWManager/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..6fc226d --- /dev/null +++ b/MxWManager/Properties/AssemblyInfo.cs @@ -0,0 +1,33 @@ +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("MxWManager")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("MxWManager")] +[assembly: AssemblyCopyright("Copyright © 2025")] +[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("377dc521-9578-44bc-a856-23ce08e7168e")] + +// Les informations de version pour un assembly se composent des quatre valeurs suivantes : +// +// Version principale +// Version secondaire +// Numéro de build +// Révision +// +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/MxWManager/Properties/Resources.Designer.cs b/MxWManager/Properties/Resources.Designer.cs new file mode 100644 index 0000000..e552c5b --- /dev/null +++ b/MxWManager/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// +// Ce code a été généré par un outil. +// Version du runtime :4.0.30319.42000 +// +// Les modifications apportées à ce fichier peuvent provoquer un comportement incorrect et seront perdues si +// le code est régénéré. +// +//------------------------------------------------------------------------------ + +namespace MxWManager.Properties +{ + + + /// + /// Une classe de ressource fortement typée destinée, entre autres, à la consultation des chaînes localisées. + /// + // Cette classe a été générée automatiquement par la classe StronglyTypedResourceBuilder + // à l'aide d'un outil, tel que ResGen ou Visual Studio. + // Pour ajouter ou supprimer un membre, modifiez votre fichier .ResX, puis réexécutez ResGen + // avec l'option /str ou régénérez votre projet VS. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources + { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() + { + } + + /// + /// Retourne l'instance ResourceManager mise en cache utilisée par cette classe. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MxWManager.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Remplace la propriété CurrentUICulture du thread actuel pour toutes + /// les recherches de ressources à l'aide de cette classe de ressource fortement typée. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff --git a/MxWManager/Properties/Resources.resx b/MxWManager/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/MxWManager/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/MxWManager/Properties/Settings.Designer.cs b/MxWManager/Properties/Settings.Designer.cs new file mode 100644 index 0000000..4b1129d --- /dev/null +++ b/MxWManager/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace MxWManager.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff --git a/MxWManager/Properties/Settings.settings b/MxWManager/Properties/Settings.settings new file mode 100644 index 0000000..3964565 --- /dev/null +++ b/MxWManager/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/MxWManager/WoW_icon.svg.ico b/MxWManager/WoW_icon.svg.ico new file mode 100644 index 0000000..2dd5fc2 Binary files /dev/null and b/MxWManager/WoW_icon.svg.ico differ diff --git a/MxWManager/packages.config b/MxWManager/packages.config new file mode 100644 index 0000000..4b1297f --- /dev/null +++ b/MxWManager/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file