Skip to content

Commit

Permalink
Add NWNX.NET version to server log. Use anvil to resolve NWNX.NET dep…
Browse files Browse the repository at this point in the history
…endency. (#800)
  • Loading branch information
jhett12321 authored Jan 26, 2025
1 parent 3075e2d commit 69ed36a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions NWN.Anvil/src/main/AnvilCore.RuntimeInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ private struct RuntimeInfo
public string? AssemblyVersion;
public string? CoreVersion;
public string? NativeVersion;
public string? NWNXDotNetVersion;
}
}
}
5 changes: 3 additions & 2 deletions NWN.Anvil/src/main/AnvilCore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ private void Init()
AssemblyVersion = AssemblyInfo.VersionInfo.InformationalVersion,
CoreVersion = Assemblies.Core.GetName().Version?.ToString(),
NativeVersion = Assemblies.Native.GetName().Version?.ToString(),
NWNXDotNetVersion = Assemblies.NWNXDotNet.GetName().Version?.ToString(),
};

serviceManager.Init();
Expand All @@ -110,11 +111,11 @@ private void Init()
}
catch (Exception e)
{
Log.Fatal(e, $"Failed to load {runtimeInfo.AssemblyName} {runtimeInfo.AssemblyVersion} (NWN.Core: {runtimeInfo.CoreVersion}, NWN.Native: {runtimeInfo.NativeVersion})");
Log.Fatal(e, $"Failed to load {runtimeInfo.AssemblyName} {runtimeInfo.AssemblyVersion} (NWN.Core: {runtimeInfo.CoreVersion}, NWN.Native: {runtimeInfo.NativeVersion}, NWNX.NET: {runtimeInfo.NWNXDotNetVersion})");
throw;
}

Log.Info($"Loading {runtimeInfo.AssemblyName} {runtimeInfo.AssemblyVersion} (NWN.Core: {runtimeInfo.CoreVersion}, NWN.Native: {runtimeInfo.NativeVersion})");
Log.Info($"Loading {runtimeInfo.AssemblyName} {runtimeInfo.AssemblyVersion} (NWN.Core: {runtimeInfo.CoreVersion}, NWN.Native: {runtimeInfo.NativeVersion}, NWNX.NET: {runtimeInfo.NWNXDotNetVersion})");
CheckServerVersion();
}

Expand Down
2 changes: 2 additions & 0 deletions NWN.Anvil/src/main/Internal/Assemblies.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ internal static class Assemblies
public static readonly Assembly Anvil = typeof(Assemblies).Assembly;
public static readonly Assembly Core = typeof(NWN.Core.NWNCore).Assembly;
public static readonly Assembly Native = typeof(NWN.Native.API.NWNXLib).Assembly;
public static readonly Assembly NWNXDotNet = typeof(NWNX.NET.NWNXAPI).Assembly;

public static readonly Assembly[] AllAssemblies;
public static readonly Type[] AllTypes;
Expand All @@ -27,6 +28,7 @@ static Assemblies()
Anvil,
Core,
Native,
NWNXDotNet,
typeof(NLog.Logger).Assembly,
typeof(LightInject.ServiceContainer).Assembly,
typeof(Newtonsoft.Json.JsonConvert).Assembly,
Expand Down

0 comments on commit 69ed36a

Please sign in to comment.