diff --git a/Gw2 Launchbuddy/Helpers/BlockerInfo.xaml b/Gw2 Launchbuddy/Helpers/BlockerInfo.xaml
index ba386d3..817fa71 100644
--- a/Gw2 Launchbuddy/Helpers/BlockerInfo.xaml
+++ b/Gw2 Launchbuddy/Helpers/BlockerInfo.xaml
@@ -5,17 +5,20 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Gw2_Launchbuddy.Helpers"
mc:Ignorable="d"
- Title="BlockerInfo" Height="300" Width="300" Icon="/Gw2 Launchbuddy;component/launchbuddy.ico" AllowsTransparency="True" WindowStyle="None" ResizeMode="NoResize" WindowStartupLocation="CenterScreen" Closing="Window_Closing" >
+ Title="BlockerInfo" Height="280" Width="280" Icon="/Gw2 Launchbuddy;component/launchbuddy.ico" AllowsTransparency="True" WindowStyle="None" ResizeMode="NoResize" WindowStartupLocation="CenterScreen" Closing="Window_Closing" MouseDown="Window_MouseDown" >
-
+
-
-
-
-
+
+
+
+
+
+
+
diff --git a/Gw2 Launchbuddy/Helpers/BlockerInfo.xaml.cs b/Gw2 Launchbuddy/Helpers/BlockerInfo.xaml.cs
index a73370e..23a68ae 100644
--- a/Gw2 Launchbuddy/Helpers/BlockerInfo.xaml.cs
+++ b/Gw2 Launchbuddy/Helpers/BlockerInfo.xaml.cs
@@ -90,5 +90,15 @@ private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs
GC.Collect();
}
}
+ private void Window_MouseDown(object sender, MouseButtonEventArgs e)
+ {
+ try { this.DragMove(); } catch { }
+ }
+
+ private void bt_hide_Click(object sender, RoutedEventArgs e)
+ {
+ this.WindowState = WindowState.Minimized;
+ this.Topmost = false;
+ }
}
}
diff --git a/Gw2 Launchbuddy/MainWindow.xaml b/Gw2 Launchbuddy/MainWindow.xaml
index ee12cdc..6274888 100644
--- a/Gw2 Launchbuddy/MainWindow.xaml
+++ b/Gw2 Launchbuddy/MainWindow.xaml
@@ -1428,7 +1428,7 @@
-
+
diff --git a/Gw2 Launchbuddy/Modifiers/LocalDatManager.cs b/Gw2 Launchbuddy/Modifiers/LocalDatManager.cs
index f81714a..7c27635 100644
--- a/Gw2 Launchbuddy/Modifiers/LocalDatManager.cs
+++ b/Gw2 Launchbuddy/Modifiers/LocalDatManager.cs
@@ -119,6 +119,22 @@ public static void UpdateLocalDat(LocalDatFile file)
Helpers.BlockerInfo.Run("Loginfile Update", "Launchbuddy waits for the gameclient to be closed.", waitforprocessclose);
+ Action waitforprocoherentclose = () =>
+ {
+ int i = 0;
+ while (Process.GetProcessesByName("*CoherentUI_Host*.exe").Length == 1 && i <= 50)
+ {
+ Thread.Sleep(100);
+ i++;
+ }
+ if (i == 50)
+ {
+ MessageBox.Show("An unexpected Guild Wars 2 gameclient still is running. Please wait for the gameclient to update / close. Overwise close the gameclient manually");
+ }
+ };
+
+ Helpers.BlockerInfo.Run("Loginfile Update", "Launchbuddy waits for the gameclient to be closed.", waitforprocoherentclose);
+
if (!Apply(file)) return;
@@ -139,7 +155,7 @@ public static void UpdateLocalDat(LocalDatFile file)
Process pro = new Process { StartInfo = new ProcessStartInfo { FileName = EnviromentManager.GwClientExePath } };
pro.Start();
pro.Refresh();
- Action waitforlaunch = () => ModuleReader.WaitForModule("WINNSI.DLL", pro);
+ Action waitforlaunch = () => ModuleReader.WaitForModule("dwmapi.dll", pro);
Helpers.BlockerInfo.Run("Loginfile Update", "Launchbuddy is updating a Loginfile. This window should automatically close when the launcher login is ready.", waitforlaunch);
try
@@ -198,7 +214,7 @@ public static LocalDatFile CreateNewFile(string filename, string email = null, s
#endif
if (email != null && password != null)
{
- Action blockefunc = () => ModuleReader.WaitForModule("WINNSI.DLL", pro, null);
+ Action blockefunc = () => ModuleReader.WaitForModule("dwmapi.dll", pro, null);
Helpers.BlockerInfo.Run("Loginfile Creation", "LB is recreating your loginfile", blockefunc);
if (!Helpers.BlockerInfo.Done) MessageBox.Show("No Clean Login. Loginfile might be not set correctly! Proceed with caution.");
diff --git a/Gw2 Launchbuddy/Modifiers/Loginfiller.cs b/Gw2 Launchbuddy/Modifiers/Loginfiller.cs
index faba4e5..5589191 100644
--- a/Gw2 Launchbuddy/Modifiers/Loginfiller.cs
+++ b/Gw2 Launchbuddy/Modifiers/Loginfiller.cs
@@ -21,7 +21,7 @@ public static void Login(string email,string passwd,Process pro, bool clearfield
try
{
pro.Refresh();
- ModuleReader.WaitForModule("WINNSI.DLL", pro);
+ ModuleReader.WaitForModule("CoherentUI64.DLL", pro);
//SetForegroundWindow(pro.MainWindowHandle);
Thread.Sleep(1000);
for (int i = 0; i < 100; i++) PressKeyDown(Keys.Back, pro, false); //Very unclean method, but modifiers onyl work on focus
@@ -42,8 +42,9 @@ public static void Login(string email,string passwd,Process pro, bool clearfield
public static void PressLoginButton(Account acc)
{
- ModuleReader.WaitForModule("WINNSI.DLL", acc.Client.Process);
- if(!acc.Client.Process.HasExited)
+ ModuleReader.WaitForModule("CoherentUI64.DLL", acc.Client.Process);
+ Thread.Sleep(1000);
+ if (!acc.Client.Process.HasExited)
{
PressKeyDown(Keys.Enter, acc.Client.Process);
PressKeyUp(Keys.Enter, acc.Client.Process);
diff --git a/Gw2 Launchbuddy/Modifiers/ModuleReader.cs b/Gw2 Launchbuddy/Modifiers/ModuleReader.cs
index 2735b5c..abff8f9 100644
--- a/Gw2 Launchbuddy/Modifiers/ModuleReader.cs
+++ b/Gw2 Launchbuddy/Modifiers/ModuleReader.cs
@@ -62,14 +62,14 @@ public static void WaitForModule(string name, Process pro, int? timeout=1000)
int ct = 0;
if(timeout!=null)
{
- while (!CollectModules(pro).Any(m => m.ModuleName == name) && ct < timeout)
+ while (!CollectModules(pro).Any(m => m.ModuleName == name.ToLower()) && ct < timeout)
{
Thread.Sleep(10);
ct++;
}
}else
{
- while (!CollectModules(pro).Any(m => m.ModuleName == name) )
+ while (!CollectModules(pro).Any(m => m.ModuleName == name.ToLower()) )
{
Thread.Sleep(10);
}
@@ -143,7 +143,7 @@ public static List CollectModules(Process process)
StringBuilder moduleFilePath = new StringBuilder(1024);
Native.GetModuleFileNameEx(process.Handle, modulePointers[index], moduleFilePath, (uint)(moduleFilePath.Capacity));
- string moduleName = Path.GetFileName(moduleFilePath.ToString());
+ string moduleName = Path.GetFileName(moduleFilePath.ToString()).ToLower();
Native.ModuleInformation moduleInformation = new Native.ModuleInformation();
Native.GetModuleInformation(process.Handle, modulePointers[index], out moduleInformation, (uint)(IntPtr.Size * (modulePointers.Length)));
diff --git a/Gw2 Launchbuddy/ObjectManagers/ClientManager.cs b/Gw2 Launchbuddy/ObjectManagers/ClientManager.cs
index 3fad9b0..ada7d6c 100644
--- a/Gw2 Launchbuddy/ObjectManagers/ClientManager.cs
+++ b/Gw2 Launchbuddy/ObjectManagers/ClientManager.cs
@@ -148,6 +148,7 @@ public class Client : INotifyPropertyChanged
public readonly Account account;
private ClientStatus status = ClientStatus.None;
public Process Process = new Process();
+ //public Process CoherentUIProcess; Could be used to improve login timings; needs more testing
public event EventHandler StatusChanged;
public event PropertyChangedEventHandler PropertyChanged;
@@ -413,7 +414,7 @@ private void Window_Init()
private void Th_Window_Init()
{
// icm32.dll
- ModuleReader.WaitForModule("mscms.dll", Process, null);
+ ModuleReader.WaitForModule("icm32.dll", Process, null);
Console.WriteLine($"{account.Nickname} configuring Windowsize");
Window_MoveTo_Default();
@@ -647,14 +648,14 @@ private void PressLoginButton()
}
Action loginwait = () => { Thread.Sleep(timetowait); };
- Helpers.BlockerInfo.Run("Delaying Login", $"Launchbuddy is currently delaying the login for {timetowait / 1000} sec(s). This is a safety measure to avoid triggering GW2 DDOS protection. Press cancel to skip.", loginwait);
+ Helpers.BlockerInfo.Run("Delaying Login", $"Launchbuddy is currently delaying the login for {timetowait / 1000} sec(s). This is a safety measure to avoid triggering GW2 DDOS protection. Press cancel to skip.", loginwait,false);
Loginfiller.PressLoginButton(Account);
}
private void WaitForLogin()
{
- Action blockefunc = () => ModuleReader.WaitForModule("winbrand.dll", Process, null);
+ Action blockefunc = () => ModuleReader.WaitForModule("WINSTA.dll", Process, null);
Helpers.BlockerInfo.Run($"{account.Nickname} Login pending", $"{account.Nickname} Login requiring additional information.", blockefunc);
}