This commit is contained in:
@@ -61,7 +61,11 @@ namespace PluginManager.Loaders
|
||||
|
||||
Functions.WriteLogFile("Starting plugin loader...");
|
||||
if (LanguageSystem.Language.ActiveLanguage != null)
|
||||
Console_Utilities.WriteColorText(LanguageSystem.Language.ActiveLanguage.FormatText(LanguageSystem.Language.ActiveLanguage.LanguageWords["PLUGIN_LOADING_START"]));
|
||||
Console_Utilities.WriteColorText(
|
||||
LanguageSystem.Language.ActiveLanguage.FormatText(
|
||||
LanguageSystem.Language.ActiveLanguage.LanguageWords["PLUGIN_LOADING_START"]
|
||||
)
|
||||
);
|
||||
|
||||
//Load commands
|
||||
CommandsLoader CMDLoader = new CommandsLoader(pluginCMDFolder, pluginCMDExtension);
|
||||
|
||||
@@ -27,11 +27,6 @@ namespace PluginManager.Online
|
||||
|
||||
try
|
||||
{
|
||||
/*#pragma warning disable SYSLIB0014
|
||||
WebClient client = new WebClient();
|
||||
#pragma warning restore SYSLIB0014
|
||||
Stream data = await client.OpenReadTaskAsync(link);
|
||||
string[] lines = (await new StreamReader(data).ReadToEndAsync()).Split('\n');*/
|
||||
List<string> list = await ServerCom.ReadTextFromFile(link);
|
||||
string[] lines = list.ToArray();
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ namespace PluginManager.Online
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else if (op == PluginManager.Others.OperatingSystem.LINUX)
|
||||
else if (op == Others.OperatingSystem.LINUX)
|
||||
{
|
||||
if (content[4].Contains("Linux"))
|
||||
{
|
||||
|
||||
@@ -57,11 +57,8 @@ namespace PluginManager.Online
|
||||
bool isDownloading = true;
|
||||
int c_progress = 0;
|
||||
|
||||
long secondsPast = 0;
|
||||
long m_dwBytes = 0;
|
||||
double c_downloadSpeed = 0f;
|
||||
string c_downloadUnit = "MB";
|
||||
|
||||
//long m_dwBytes = 0;
|
||||
|
||||
Others.Console_Utilities.ProgressBar pbar = new Others.Console_Utilities.ProgressBar(100, "");
|
||||
|
||||
IProgress<float> progress = new Progress<float>(percent =>
|
||||
@@ -71,39 +68,20 @@ namespace PluginManager.Online
|
||||
|
||||
IProgress<long> progress_downloaded = new Progress<long>(downloadedBytes =>
|
||||
{
|
||||
m_dwBytes = downloadedBytes;
|
||||
//m_dwBytes = downloadedBytes;
|
||||
});
|
||||
|
||||
Task updateProgressBarTask = new Task(async () =>
|
||||
{
|
||||
while (isDownloading)
|
||||
{
|
||||
//pbar.Update(c_progress, c_downloadSpeed, c_downloadUnit);
|
||||
pbar.Update(c_progress);
|
||||
if (c_progress == 100)
|
||||
break;
|
||||
System.Threading.Thread.Sleep(500);
|
||||
}
|
||||
});
|
||||
|
||||
Task calculateDownloadSpeed = new Task(async () =>
|
||||
{
|
||||
|
||||
while (isDownloading)
|
||||
{
|
||||
secondsPast++;
|
||||
c_downloadSpeed = m_dwBytes / secondsPast;
|
||||
|
||||
c_downloadSpeed /= 1024; // in KB
|
||||
c_downloadSpeed /= 1024; // in MB
|
||||
|
||||
c_downloadSpeed = Math.Round(c_downloadSpeed, 2, MidpointRounding.AwayFromZero);
|
||||
|
||||
System.Threading.Thread.Sleep(1000);
|
||||
}
|
||||
});
|
||||
|
||||
// new System.Threading.Thread(calculateDownloadSpeed.Start).Start();
|
||||
|
||||
new System.Threading.Thread(updateProgressBarTask.Start).Start();
|
||||
await DownloadFileAsync(URL, location, progress, progress_downloaded);
|
||||
|
||||
|
||||
@@ -96,7 +96,6 @@ namespace PluginManager.Others
|
||||
|
||||
foreach (string[] row in data)
|
||||
{
|
||||
//Console.Write("\t");
|
||||
if (row[0][0] == tableLine) Console.Write(tableCross);
|
||||
else Console.Write(tableWall);
|
||||
for (int l = 0; l < row.Length; l++)
|
||||
@@ -135,7 +134,6 @@ namespace PluginManager.Others
|
||||
|
||||
/// <summary>
|
||||
/// Write the text using color options( &g-green; &b-blue; &r-red; &c-clear; )
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="text">The text</param>
|
||||
public static void WriteColorText(string text, bool appendNewLine = true)
|
||||
|
||||
Reference in New Issue
Block a user