Skip to content
This repository has been archived by the owner on Sep 1, 2021. It is now read-only.

Commit

Permalink
2.16.1 Bugs fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Deliay committed Jan 23, 2018
1 parent 843ed70 commit 31eadff
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 17 deletions.
29 changes: 20 additions & 9 deletions Sync/Plugins/PluginManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -295,20 +295,31 @@ internal int LoadPlugins()
allList = new List<Type>();

//Load all plugins first

foreach (Assembly asm in asmList)
{
foreach (Type item in asm.GetExportedTypes())
try
{
Type it = asm.GetType(item.FullName);
if (it == null ||
!it.IsClass || !it.IsPublic ||
!typeof(Plugin).IsAssignableFrom(it) ||
typeof(Plugin) == it)
continue;
allList.Add(it);
foreach (Type item in asm.GetExportedTypes())
{
Type it = asm.GetType(item.FullName);
if (it == null ||
!it.IsClass || !it.IsPublic ||
!typeof(Plugin).IsAssignableFrom(it) ||
typeof(Plugin) == it)
continue;
allList.Add(it);
}
}
catch(Exception e)
{
//Not up to date
IO.CurrentIO.WriteColor(String.Format(LANG_LoadPluginErr, asm.FullName, e.Message), ConsoleColor.Red);
continue;
}
}


lazylist = allList.ToList();
//looping add for resolve dependency
do
Expand Down Expand Up @@ -494,7 +505,7 @@ private void CheckGUIDUpdate(SyncPluginDependency item)
{
if (Updater.update.CheckUpdate(item.GUID))
{
SyncHost.Instance.RestartSync();
SyncHost.Instance.ForceRestartSync();
throw new SyncPluginOutdateException($"Need restart application to update {item.GUID}");
}
else
Expand Down
4 changes: 2 additions & 2 deletions Sync/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
// 方法是按如下所示使用“*”: :
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.16.0.0")]
[assembly: AssemblyFileVersion("2.16.0.0")]
[assembly: AssemblyVersion("2.16.1.0")]
[assembly: AssemblyFileVersion("2.16.1.0")]
23 changes: 20 additions & 3 deletions Sync/SyncHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,14 @@ public MessageDispatcher Messages

public void ExitSync()
{
SaveSync();
Environment.Exit(0);
try
{
SaveSync();
}
finally
{
Environment.Exit(0);
}
}

public void SaveSync()
Expand All @@ -155,7 +161,18 @@ public void SaveSync()

public void RestartSync()
{
SaveSync();
try
{
SaveSync();
}
finally
{
ForceRestartSync();
}
}

public void ForceRestartSync()
{
Process.Start(Assembly.GetEntryAssembly().Location);
Environment.Exit(0);
}
Expand Down
1 change: 0 additions & 1 deletion Sync/Tools/PluginConfiuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ namespace Sync.Tools
public sealed class ConfigurationElement
{
private string _cfg = string.Empty;
private PluginConfiuration parent;
public ConfigurationElement()
{

Expand Down
2 changes: 0 additions & 2 deletions Sync/Tools/Updater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,13 @@
using System.Diagnostics;
using System.IO;
using System.IO.Compression;
using System.IO.Packaging;
using System.Linq;
using System.Net;
using System.Reflection;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Json;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;

namespace Sync.Tools
{
Expand Down

0 comments on commit 31eadff

Please sign in to comment.