Skip to content

Commit 1a577eb

Browse files
committed
Moved logging of game version info into GameDetector()
1 parent 1be21e4 commit 1a577eb

File tree

6 files changed

+9
-8
lines changed

6 files changed

+9
-8
lines changed

Build/InstallerExtensions.dll

0 Bytes
Binary file not shown.

Build/QModInstaller.dll

0 Bytes
Binary file not shown.

Build/QModManager.exe

0 Bytes
Binary file not shown.

Build/QModManager_Setup.exe

362 Bytes
Binary file not shown.

QModManager/Patching/GameDetector.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using System;
44
using System.Collections.Generic;
55
using System.IO;
6+
using System.Reflection;
67
using QModManager.API;
78
using QModManager.Utility;
89

@@ -53,9 +54,16 @@ internal GameDetector()
5354
throw new FatalPatchingException("No game executable was found!");
5455
}
5556

57+
Logger.Info($"Game Version: {SNUtils.GetPlasticChangeSetOfBuild()} Build Date: {SNUtils.GetDateTimeOfBuild():dd-MMMM-yyyy}");
58+
Logger.Info($"Loading QModManager v{Assembly.GetExecutingAssembly().GetName().Version.ToStringParsed()}{(IsValidGameRunning && MinimumBuildVersion != 0 ? $" built for {CurrentlyRunningGame} v{MinimumBuildVersion}" : string.Empty)}...");
59+
Logger.Info($"Today is {DateTime.Today:dd-MMMM-yyyy}");
60+
5661
CurrentGameVersion = SNUtils.GetPlasticChangeSetOfBuild(-1);
5762
if (!IsValidGameVersion)
63+
{
5864
Logger.Fatal("A fatal error has occurred. An invalid game version was detected!");
65+
throw new FatalPatchingException("An invalid game version was detected!");
66+
}
5967
}
6068
}
6169
}

QModManager/Patching/Patcher.cs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,9 @@ internal static void Patch()
4343

4444
var gameDetector = new GameDetector();
4545

46-
Logger.Info($"Game Version: {SNUtils.GetPlasticChangeSetOfBuild()} Build Date: {SNUtils.GetDateTimeOfBuild():dd-MMMM-yyyy}");
47-
Logger.Info($"Loading QModManager v{Assembly.GetExecutingAssembly().GetName().Version.ToStringParsed()}{(gameDetector.IsValidGameRunning && gameDetector.MinimumBuildVersion != 0 ? $" built for {gameDetector.CurrentlyRunningGame} v{gameDetector.MinimumBuildVersion}" : string.Empty)}...");
48-
Logger.Info($"Today is {DateTime.Today:dd-MMMM-yyyy}");
49-
50-
if (!gameDetector.IsValidGameRunning)
46+
if (!gameDetector.IsValidGameRunning || !gameDetector.IsValidGameVersion)
5147
return;
5248

53-
if (!gameDetector.IsValidGameVersion)
54-
throw new FatalPatchingException("An invalid game version was detected!");
55-
5649
CurrentlyRunningGame = gameDetector.CurrentlyRunningGame;
5750

5851
if (QModBaseDir == null)

0 commit comments

Comments
 (0)