Skip to content

Commit ebd8bb2

Browse files
v1.0.0.8 with some changes
1 parent a5485b7 commit ebd8bb2

File tree

10 files changed

+162
-98
lines changed

10 files changed

+162
-98
lines changed

ConquerLoader/CLCore/Constants.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ public static class Constants
2121
public static class CLTheme
2222
{
2323
public static Control.ControlCollection MainControls = null;
24+
public static object MainForm = null;
2425
}
2526
public enum PluginType
2627
{

ConquerLoader/CLCore/Models/LoaderConfig.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ public class LoaderConfig
1818
public string Lang { get; set; }
1919
public string LicenseKey { get; set; }
2020
public bool DisableScreenChanges { get; set; }
21+
public bool UseCustomDLLs { get; set; }
2122

2223
public LoaderConfig()
2324
{

ConquerLoader/CLCore/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@
3232
// Puede especificar todos los valores o usar los valores predeterminados de número de compilación y de revisión
3333
// utilizando el carácter "*", como se muestra a continuación:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("1.0.0.6")]
36-
[assembly: AssemblyFileVersion("1.0.0.6")]
35+
[assembly: AssemblyVersion("1.0.0.8")]
36+
[assembly: AssemblyFileVersion("1.0.0.8")]

ConquerLoader/ConquerLoader/Core.cs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,20 @@ public static void LoadRemotePlugins()
145145

146146
public static void InitPlugins()
147147
{
148+
148149
foreach (IPlugin plugin in PluginLoader.Plugins)
149150
{
150-
plugin.Init();
151-
LogWritter.Write("Init plugin: " + plugin.Name + ".");
151+
try
152+
{
153+
plugin.Init();
154+
LogWritter.Write("Init plugin: " + plugin.Name + ".");
155+
}
156+
catch (Exception ex)
157+
{
158+
{
159+
MessageBox.Show($"Error loading plugin {plugin.Name}: " + ex.Message.ToString(), "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
160+
}
161+
}
152162
}
153163
}
154164

ConquerLoader/ConquerLoader/Forms/Main.cs

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,11 @@ public partial class Main : MetroFramework.Forms.MetroForm
2121
public string HookDLL = "CLHook.dll";
2222
public bool AllStarted = false;
2323
public bool DX9Allowed = false;
24+
public bool CustomDLLs = false;
2425
public Main()
2526
{
2627
InitializeComponent();
28+
CLTheme.MainForm = this;
2729
CLTheme.MainControls = this.Controls;
2830
this.Resizable = false;
2931
this.Theme = MetroFramework.MetroThemeStyle.Light;
@@ -32,6 +34,7 @@ public Main()
3234
{
3335
btnSettings.Enabled = false;
3436
}
37+
CustomDLLs = LoaderConfig.UseCustomDLLs;
3538
Core.LoadControlTranslations(Controls);
3639
LoaderEvents.LauncherLoaded += LoaderEvents_LauncherLoaded;
3740
LoaderEvents.ConquerLaunched += LoaderEvents_ConquerLaunched;
@@ -393,9 +396,12 @@ private void Worker_DoWork(object sender, System.ComponentModel.DoWorkEventArgs
393396
if (SelectedServer.ServerVersion >= 6371 && SelectedServer.ServerVersion <= Constants.MaxVersionUseServerDat)
394397
{
395398
RebuildServerDat();
396-
Core.LogWritter.Write("Generating required files for use Custom Server.dat... (Using DX8)");
397399
SafeIO.TryWriteAllBytes(Path.Combine(WorkingDir, "TQAnp.dll"), Properties.Resources.TQAnp, ex => Core.LogWritter.Write(ex.ToString()));
398-
SafeIO.TryWriteAllBytes(Path.Combine(Application.StartupPath, HookDLL), Properties.Resources.COHook6371, ex => Core.LogWritter.Write(ex.ToString()));
400+
if (!CustomDLLs)
401+
{
402+
Core.LogWritter.Write("Generating required files for use Custom Server.dat... (Using DX8)");
403+
SafeIO.TryWriteAllBytes(Path.Combine(Application.StartupPath, HookDLL), Properties.Resources.COHook6371, ex => Core.LogWritter.Write(ex.ToString()));
404+
}
399405
}
400406
}
401407
NoUseDX8_DX9 = false;
@@ -418,34 +424,41 @@ private void Worker_DoWork(object sender, System.ComponentModel.DoWorkEventArgs
418424
if (SelectedServer.ServerVersion >= 6600)
419425
{
420426
RebuildServerDat();
421-
Core.LogWritter.Write("Generating required files for use Custom Server.dat... (Using DX9)");
422427
SafeIO.TryWriteAllBytes(Path.Combine(WorkingDir, "TQAnp.dll"), Properties.Resources.TQAnp, ex => Core.LogWritter.Write(ex.ToString()));
423-
SafeIO.TryWriteAllBytes(Path.Combine(Application.StartupPath, HookDLL), Properties.Resources.COHook6371, ex => Core.LogWritter.Write(ex.ToString()));
428+
if (!CustomDLLs)
429+
{
430+
Core.LogWritter.Write("Generating required files for use Custom Server.dat... (Using DX9)");
431+
SafeIO.TryWriteAllBytes(Path.Combine(Application.StartupPath, HookDLL), Properties.Resources.COHook6371, ex => Core.LogWritter.Write(ex.ToString()));
432+
}
424433
}
425434
}
426435
NoUseDX8_DX9 = false;
427436
}
428437
}
429438
if (NoUseDX8_DX9 && UseDecryptedServerDat && SelectedServer.ServerVersion >= Constants.MinVersionUseServerDat)
430439
{
431-
if (!AlreadyUsingLoader)
432-
{
433-
File.WriteAllBytes(Path.Combine(WorkingDir, "COFlashFixer.dll"), Properties.Resources.COFlashFixer_DLL); // Fix for flash
434-
}
435-
if (SelectedServer.ServerVersion >= 6176 && SelectedServer.ServerVersion <= 6370)
440+
if (!CustomDLLs)
436441
{
437442
if (!AlreadyUsingLoader)
438443
{
439-
File.WriteAllBytes(Path.Combine(WorkingDir, HookDLL), Properties.Resources.COHook6176); // 6176 TO 6370 Hook
444+
File.WriteAllBytes(Path.Combine(WorkingDir, "COFlashFixer.dll"), Properties.Resources.COFlashFixer_DLL); // Fix for flash
440445
}
441-
} else
442-
{
443-
if (!AlreadyUsingLoader)
446+
if (SelectedServer.ServerVersion >= 6176 && SelectedServer.ServerVersion <= 6370)
447+
{
448+
if (!AlreadyUsingLoader)
449+
{
450+
File.WriteAllBytes(Path.Combine(WorkingDir, HookDLL), Properties.Resources.COHook6176); // 6176 TO 6370 Hook
451+
}
452+
}
453+
else
444454
{
445-
File.WriteAllBytes(Path.Combine(WorkingDir, HookDLL), Properties.Resources.COHook6022); // V5717 TO V6175 Hook
455+
if (!AlreadyUsingLoader)
456+
{
457+
File.WriteAllBytes(Path.Combine(WorkingDir, HookDLL), Properties.Resources.COHook6022); // V5717 TO V6175 Hook
458+
}
446459
}
460+
Core.LogWritter.Write("Generating required files for use Custom Server.dat...");
447461
}
448-
Core.LogWritter.Write("Generating required files for use Custom Server.dat...");
449462
RebuildServerDat();
450463
}
451464
Process conquerProc = Process.Start(new ProcessStartInfo() { FileName = PathToConquerExe, WorkingDirectory = WorkingDir, Arguments = "blacknull" });

0 commit comments

Comments
 (0)