This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
<StartupObject />
|
||||
<SignAssembly>False</SignAssembly>
|
||||
<IsPublishable>True</IsPublishable>
|
||||
<AssemblyVersion>1.0.1.1</AssemblyVersion>
|
||||
<AssemblyVersion>1.0.1.2</AssemblyVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
|
||||
@@ -322,15 +322,19 @@ public class ConsoleCommandsHandler
|
||||
try
|
||||
{
|
||||
var pName = string.Join(' ', args, 1, args.Length - 1);
|
||||
var client = new HttpClient();
|
||||
var url = (await manager.GetPluginLinkByName(pName))[1];
|
||||
if (url is null) throw new Exception($"Invalid plugin name {pName}.");
|
||||
var s = await client.GetStreamAsync(url);
|
||||
var str = new MemoryStream();
|
||||
await s.CopyToAsync(str);
|
||||
var asmb = Assembly.Load(str.ToArray());
|
||||
using (var client = new HttpClient())
|
||||
{
|
||||
var url = (await manager.GetPluginLinkByName(pName))[1];
|
||||
if (url is null) throw new Exception($"Invalid plugin name {pName}.");
|
||||
var s = await client.GetStreamAsync(url);
|
||||
var str = new MemoryStream();
|
||||
await s.CopyToAsync(str);
|
||||
var asmb = Assembly.Load(str.ToArray());
|
||||
|
||||
await PluginLoader.LoadPluginFromAssembly(asmb, this.client);
|
||||
}
|
||||
|
||||
|
||||
await PluginLoader.LoadPluginFromAssembly(asmb, this.client);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -351,6 +355,7 @@ public class ConsoleCommandsHandler
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.WriteLine(ex.Message);
|
||||
Logger.WriteErrFile(ex);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -126,5 +126,6 @@ namespace PluginManager
|
||||
if (!isInitialized) throw new Exception("Logger is not initialized");
|
||||
WriteErrFile(ex.ToString());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using System.Collections.Generic;
|
||||
|
||||
using PluginManager.Items;
|
||||
using PluginManager.Others;
|
||||
@@ -30,12 +31,22 @@ public class PluginUpdater
|
||||
return false;
|
||||
}
|
||||
|
||||
public static async Task Download(string pakName)
|
||||
public static async Task<List<string>> GetInfo(string pakName)
|
||||
{
|
||||
|
||||
Utilities.WriteColorText("An update was found for &g" + pakName + "&c. Version: &r" +
|
||||
(await ServerCom.GetVersionOfPackageFromWeb(pakName))?.ToShortString() +
|
||||
"&c. Current Version: &y" +
|
||||
ServerCom.GetVersionOfPackage(pakName)?.ToShortString());
|
||||
|
||||
List<string> fileInfo = await ServerCom.ReadTextFromURL("");
|
||||
return fileInfo;
|
||||
}
|
||||
|
||||
public static async Task Download(string pakName)
|
||||
{
|
||||
var pakUpdateInfo = await GetInfo(pakName);
|
||||
Logger.Log(string.Join("\n", pakUpdateInfo));
|
||||
await ConsoleCommandsHandler.ExecuteCommad("dwplug " + pakName);
|
||||
}
|
||||
}
|
||||
@@ -17,6 +17,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Roles", "..\DiscordBotItems
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DBEconomy", "..\DiscordBotItems\Plugins\DBEconomy\DBEconomy.csproj", "{0321365B-4ADC-4B1D-BD98-F573D36E83B2}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Updater", "..\DiscordBotItems\Updater\Updater.csproj", "{1A411BE0-6AE4-4129-A0BD-0D1D5D4E2D1A}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@@ -51,6 +53,10 @@ Global
|
||||
{0321365B-4ADC-4B1D-BD98-F573D36E83B2}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{0321365B-4ADC-4B1D-BD98-F573D36E83B2}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{0321365B-4ADC-4B1D-BD98-F573D36E83B2}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{1A411BE0-6AE4-4129-A0BD-0D1D5D4E2D1A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{1A411BE0-6AE4-4129-A0BD-0D1D5D4E2D1A}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{1A411BE0-6AE4-4129-A0BD-0D1D5D4E2D1A}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{1A411BE0-6AE4-4129-A0BD-0D1D5D4E2D1A}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
Reference in New Issue
Block a user