Skip to content

Commit

Permalink
Fixed local plugins not being loaded.
Browse files Browse the repository at this point in the history
  • Loading branch information
BigETI committed Dec 31, 2018
1 parent e7ffbc2 commit 36697b1
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 8 deletions.
Binary file modified .vs/SAMPLauncherNET/v15/.suo
Binary file not shown.
4 changes: 2 additions & 2 deletions SAMPLauncherNET/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
// übernehmen, indem Sie "*" eingeben:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.6.7")]
[assembly: AssemblyFileVersion("1.0.6.7")]
[assembly: AssemblyVersion("1.0.6.8")]
[assembly: AssemblyFileVersion("1.0.6.8")]
32 changes: 32 additions & 0 deletions SAMPLauncherNET/Source/SAMPLauncherNET/Core/PluginDataContract.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ public class PluginDataContract : IComparable, IComparable<PluginDataContract>,
/// </summary>
private bool updateFrequencyItemParsed;

/// <summary>
/// Path
/// </summary>
private string path;

/// <summary>
/// Name
/// </summary>
Expand Down Expand Up @@ -152,6 +157,33 @@ public string TranslatableText
}
}

/// <summary>
/// Path
/// </summary>
public string Path
{
get
{
if (path == null)
{
try
{
Uri uri = new Uri(URI);
path = (uri.IsFile ? uri.AbsolutePath : uri.AbsoluteUri);
}
catch (Exception e)
{
Console.Error.WriteLine(e);
}
if (path == null)
{
path = "";
}
}
return path;
}
}

/// <summary>
/// Constructor
/// </summary>
Expand Down
8 changes: 2 additions & 6 deletions SAMPLauncherNET/Source/SAMPLauncherNET/Core/PluginProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,9 @@ public static InstalledPlugin Update(PluginDataContract plugin)
case EPluginProvider.URI:
if (uri.IsFile)
{
if (!(File.Exists(plugin.URI)))
if (File.Exists(plugin.Path))
{
ret = new InstalledPlugin(plugin.URI);
ret = new InstalledPlugin(plugin.Path);
}
}
else
Expand All @@ -148,10 +148,6 @@ public static InstalledPlugin Update(PluginDataContract plugin)
}
else
{
if (File.Exists(download_path))
{
File.Delete(download_path);
}
download_url = plugin.URI;
}
break;
Expand Down

0 comments on commit 36697b1

Please sign in to comment.