Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions EXILED/Exiled.Loader/Loader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public Loader()
Log.Warn("You are running a public beta build. It is not compatible with another version of the game.");
#endif

Log.SendRaw($"Exiled.API - Version {PluginAPI.Loader.AssemblyLoader.Dependencies.FirstOrDefault(x => x.GetName().Name == "Exiled.API").GetCustomAttribute<AssemblyInformationalVersionAttribute>().InformationalVersion}", ConsoleColor.DarkRed);
Log.SendRaw($"{Assembly.GetExecutingAssembly().GetName().Name} - Version {Assembly.GetExecutingAssembly().GetCustomAttribute<AssemblyInformationalVersionAttribute>().InformationalVersion}", ConsoleColor.DarkRed);

if (MultiAdminFeatures.MultiAdminUsed)
Expand Down Expand Up @@ -145,8 +146,7 @@ public static void LoadPlugins()

AssemblyInformationalVersionAttribute attribute = plugin.Assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>();

Log.Info($"Loaded plugin {plugin.Name}@{(plugin.Version is not null ? $"{plugin.Version.Major}.{plugin.Version.Minor}.{plugin.Version.Build}" : attribute is not null ? attribute.InformationalVersion : string.Empty)}");

Log.Info($"Loaded plugin {plugin.Name}@{(attribute is not null ? attribute.InformationalVersion : plugin.Version is not null ? $"{plugin.Version.Major}.{plugin.Version.Minor}.{plugin.Version.Build}" : string.Empty)}");
Server.PluginAssemblies.Add(assembly, plugin);
Plugins.Add(plugin);
}
Expand Down
15 changes: 12 additions & 3 deletions EXILED/Exiled.Loader/Updater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ namespace Exiled.Loader
using System.Reflection;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading;

using Exiled.API.Features;
using Exiled.Loader.GHApi;
Expand Down Expand Up @@ -112,9 +113,16 @@ internal static Updater Initialize(Config config)
/// </summary>
internal void CheckUpdate()
{
using HttpClient client = CreateHttpClient();
if (Busy = FindUpdate(client, !File.Exists(Path.Combine(Paths.Dependencies, "Exiled.API.dll")), out NewVersion newVersion))
Update(client, newVersion);
try
{
using HttpClient client = CreateHttpClient();
if (Busy = FindUpdate(client, !PluginAPI.Loader.AssemblyLoader.Dependencies.Exists(x => x.GetName().Name == "Exiled.API"), out NewVersion newVersion))
Update(client, newVersion);
}
catch (Exception e)
{
Log.Error(e);
}
}

/// <summary>
Expand Down Expand Up @@ -144,6 +152,7 @@ private bool FindUpdate(HttpClient client, bool forced, out NewVersion newVersio
{
try
{
Thread.Sleep(5000); // Wait for the assemblies to load
ExiledLib smallestVersion = ExiledLib.Min();

Log.Info($"Found the smallest version of Exiled - {smallestVersion.Library.GetName().Name}:{smallestVersion.Version}");
Expand Down