From 9afa03d9eec65796ae3bdafccab37e0b3164f173 Mon Sep 17 00:00:00 2001
From: Timerix22 <87668556+Timerix22@users.noreply.github.com>
Date: Mon, 19 Jul 2021 21:35:39 +0300
Subject: [PATCH] Delete .old 5 directory
---
.old 5/dtlauncher-client-win/App.config | 6 -
.old 5/dtlauncher-client-win/App.xaml | 166 -----------
.old 5/dtlauncher-client-win/App.xaml.cs | 11 -
.../dtlauncher-client-win/LauncherWindow.xaml | 98 -------
.../LauncherWindow.xaml.cs | 102 -------
.old 5/dtlauncher-client-win/LoginWindow.xaml | 42 ---
.../dtlauncher-client-win/LoginWindow.xaml.cs | 122 --------
.../dtlauncher-client-win/ProgramLabel.xaml | 33 ---
.../ProgramLabel.xaml.cs | 115 --------
.../Properties/AssemblyInfo.cs | 53 ----
.../Properties/Resources.Designer.cs | 70 -----
.../Properties/Resources.resx | 117 --------
.../Properties/Settings.Designer.cs | 29 --
.../Properties/Settings.settings | 7 -
.../dtlauncher-client-win.csproj | 125 --------
.old 5/dtlauncher-client-win/dtscript.ico | Bin 9662 -> 0 bytes
.old 5/dtlauncher-server-win/App.config | 6 -
.old 5/dtlauncher-server-win/Program.cs | 121 --------
.../Properties/AssemblyInfo.cs | 53 ----
.../Properties/Resources.Designer.cs | 70 -----
.../Properties/Resources.resx | 117 --------
.../Properties/Settings.Designer.cs | 29 --
.../Properties/Settings.settings | 7 -
.../dtlauncher-server-win.csproj | 111 -------
.old 5/dtlauncher.sln | 45 ---
.old 5/updater/App.config | 6 -
.old 5/updater/Program.cs | 39 ---
.old 5/updater/Properties/AssemblyInfo.cs | 36 ---
.old 5/updater/dtlib/ColoredConsole.cs | 83 ------
.old 5/updater/dtlib/FileWork.cs | 168 -----------
.old 5/updater/dtlib/Hasher.cs | 59 ----
.old 5/updater/dtlib/NetWork.cs | 277 ------------------
.old 5/updater/dtlib/SimpleConverter.cs | 88 ------
.old 5/updater/dtlib/TImer.cs | 36 ---
.old 5/updater/dtlib/XXHash.cs | 180 ------------
.old 5/updater/updater.csproj | 82 ------
36 files changed, 2709 deletions(-)
delete mode 100644 .old 5/dtlauncher-client-win/App.config
delete mode 100644 .old 5/dtlauncher-client-win/App.xaml
delete mode 100644 .old 5/dtlauncher-client-win/App.xaml.cs
delete mode 100644 .old 5/dtlauncher-client-win/LauncherWindow.xaml
delete mode 100644 .old 5/dtlauncher-client-win/LauncherWindow.xaml.cs
delete mode 100644 .old 5/dtlauncher-client-win/LoginWindow.xaml
delete mode 100644 .old 5/dtlauncher-client-win/LoginWindow.xaml.cs
delete mode 100644 .old 5/dtlauncher-client-win/ProgramLabel.xaml
delete mode 100644 .old 5/dtlauncher-client-win/ProgramLabel.xaml.cs
delete mode 100644 .old 5/dtlauncher-client-win/Properties/AssemblyInfo.cs
delete mode 100644 .old 5/dtlauncher-client-win/Properties/Resources.Designer.cs
delete mode 100644 .old 5/dtlauncher-client-win/Properties/Resources.resx
delete mode 100644 .old 5/dtlauncher-client-win/Properties/Settings.Designer.cs
delete mode 100644 .old 5/dtlauncher-client-win/Properties/Settings.settings
delete mode 100644 .old 5/dtlauncher-client-win/dtlauncher-client-win.csproj
delete mode 100644 .old 5/dtlauncher-client-win/dtscript.ico
delete mode 100644 .old 5/dtlauncher-server-win/App.config
delete mode 100644 .old 5/dtlauncher-server-win/Program.cs
delete mode 100644 .old 5/dtlauncher-server-win/Properties/AssemblyInfo.cs
delete mode 100644 .old 5/dtlauncher-server-win/Properties/Resources.Designer.cs
delete mode 100644 .old 5/dtlauncher-server-win/Properties/Resources.resx
delete mode 100644 .old 5/dtlauncher-server-win/Properties/Settings.Designer.cs
delete mode 100644 .old 5/dtlauncher-server-win/Properties/Settings.settings
delete mode 100644 .old 5/dtlauncher-server-win/dtlauncher-server-win.csproj
delete mode 100644 .old 5/dtlauncher.sln
delete mode 100644 .old 5/updater/App.config
delete mode 100644 .old 5/updater/Program.cs
delete mode 100644 .old 5/updater/Properties/AssemblyInfo.cs
delete mode 100644 .old 5/updater/dtlib/ColoredConsole.cs
delete mode 100644 .old 5/updater/dtlib/FileWork.cs
delete mode 100644 .old 5/updater/dtlib/Hasher.cs
delete mode 100644 .old 5/updater/dtlib/NetWork.cs
delete mode 100644 .old 5/updater/dtlib/SimpleConverter.cs
delete mode 100644 .old 5/updater/dtlib/TImer.cs
delete mode 100644 .old 5/updater/dtlib/XXHash.cs
delete mode 100644 .old 5/updater/updater.csproj
diff --git a/.old 5/dtlauncher-client-win/App.config b/.old 5/dtlauncher-client-win/App.config
deleted file mode 100644
index 193aecc..0000000
--- a/.old 5/dtlauncher-client-win/App.config
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.old 5/dtlauncher-client-win/App.xaml b/.old 5/dtlauncher-client-win/App.xaml
deleted file mode 100644
index 56be4b8..0000000
--- a/.old 5/dtlauncher-client-win/App.xaml
+++ /dev/null
@@ -1,166 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/.old 5/dtlauncher-client-win/App.xaml.cs b/.old 5/dtlauncher-client-win/App.xaml.cs
deleted file mode 100644
index 4aa3d80..0000000
--- a/.old 5/dtlauncher-client-win/App.xaml.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-using System.Windows;
-
-namespace dtlauncher_client_win
-{
- ///
- /// Логика взаимодействия для App.xaml
- ///
- public partial class App : Application
- {
- }
-}
diff --git a/.old 5/dtlauncher-client-win/LauncherWindow.xaml b/.old 5/dtlauncher-client-win/LauncherWindow.xaml
deleted file mode 100644
index f639199..0000000
--- a/.old 5/dtlauncher-client-win/LauncherWindow.xaml
+++ /dev/null
@@ -1,98 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/.old 5/dtlauncher-client-win/LauncherWindow.xaml.cs b/.old 5/dtlauncher-client-win/LauncherWindow.xaml.cs
deleted file mode 100644
index 7c54642..0000000
--- a/.old 5/dtlauncher-client-win/LauncherWindow.xaml.cs
+++ /dev/null
@@ -1,102 +0,0 @@
-using DTLib;
-using System;
-using System.IO;
-using System.Net.Sockets;
-using System.Windows;
-
-namespace dtlauncher_client_win
-{
- ///
- /// Логика взаимодействия для LauncherWindow.xaml
- ///
- public partial class LauncherWindow : Window
- {
- public Socket mainSocket;
- string logfile;
- public delegate void LaunchDel();
- public LaunchDel Launch = () => { };
- public delegate void InstallDel();
- public LaunchDel Install = () => { };
- public ProgramLabel[] programsArray;
- public int PreviousProgramNum = 0;
-
- public LauncherWindow(Socket _socket, string _logfile, string _log)
- {
- InitializeComponent();
- try
- {
- mainSocket = _socket;
- logfile = _logfile;
- LogBox.Text += _log;
- PublicLog.LogDel += Log;
- // переключение вкладок кнопками
- var green = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromRgb(44, 220, 17));
- var white = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromRgb(240, 240, 240));
- HomeButton.Click += (s, e) =>
- {
- LogGrid.Visibility = Visibility.Hidden;
- SettingsGrid.Visibility = Visibility.Hidden;
- HomeGrid.Visibility = Visibility.Visible;
- LogButton.Foreground = white;
- SettingsButton.Foreground = white;
- HomeButton.Foreground = green;
- };
- LogButton.Click += (s, e) =>
- {
- HomeGrid.Visibility = Visibility.Hidden;
- SettingsGrid.Visibility = Visibility.Hidden;
- LogGrid.Visibility = Visibility.Visible;
- HomeButton.Foreground = white;
- SettingsButton.Foreground = white;
- LogButton.Foreground = green;
- };
- SettingsButton.Click += (s, e) =>
- {
- HomeGrid.Visibility = Visibility.Hidden;
- LogGrid.Visibility = Visibility.Hidden;
- SettingsGrid.Visibility = Visibility.Visible;
- HomeButton.Foreground = white;
- LogButton.Foreground = white;
- SettingsButton.Foreground = green;
- };
- // считывание дескрипторов программ
- var descriptors = Directory.GetFiles("descroptors", "*.desc");
- programsArray = new ProgramLabel[descriptors.Length];
- Log(descriptors.Length + " descriptors found\n");
- for (int i = 0; i < descriptors.Length; i++)
- {
- programsArray[i] = new ProgramLabel(descriptors[i], i, this);
- ProgramsPanel.Children.Add(programsArray[i]);
- Log(programsArray[i].Text + " added to ProgramsPanel\n");
- }
- LaunchButton.Click += (s, e) => Launch();
- InstallButton.Click += (s, e) => Install();
- //mainSocket.FSP_Download(new FSP_FileObject("share\\file.arc", "downloads\\file.arc"));
- }
- catch (Exception e)
- {
- Log("error:\n" + e.Message + "\n" + e.StackTrace + '\n');
- }
- }
-
- public void Log(string msg)
- {
-
- if (LogBox.Text[LogBox.Text.Length - 1] == '\n') msg = "[" + DateTime.Now.ToString() + "]: " + msg;
- FileWork.Log(logfile, msg);
- LogBox.Text += msg;
- }
-
- public void Log(params string[] input)
- {
- if (input.Length % 2 == 0)
- {
- string str = "";
- for (ushort i = 0; i < input.Length; i++)
- str += input[++i];
- Log(str);
- }
- else throw new Exception("error in Log(): every text string must have color string before");
- }
- }
-}
\ No newline at end of file
diff --git a/.old 5/dtlauncher-client-win/LoginWindow.xaml b/.old 5/dtlauncher-client-win/LoginWindow.xaml
deleted file mode 100644
index c5ba562..0000000
--- a/.old 5/dtlauncher-client-win/LoginWindow.xaml
+++ /dev/null
@@ -1,42 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/.old 5/dtlauncher-client-win/LoginWindow.xaml.cs b/.old 5/dtlauncher-client-win/LoginWindow.xaml.cs
deleted file mode 100644
index 7233c33..0000000
--- a/.old 5/dtlauncher-client-win/LoginWindow.xaml.cs
+++ /dev/null
@@ -1,122 +0,0 @@
-using DTLib;
-using System;
-using System.IO;
-using System.Net;
-using System.Net.Sockets;
-using System.Windows;
-
-namespace dtlauncher_client_win
-{
- ///
- /// Логика взаимодействия для LoginWindow.xaml
- ///
- public partial class LoginWindow : Window
- {
- public Socket mainSocket { private set; get; } = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
- public string logfile { private set; get; } = $"logs\\client-{DateTime.Now}.log".Replace(':', '-').Replace(' ', '_');
-
- public LoginWindow()
- {
- try
- {
- InitializeComponent();
- FileWork.DirCreate("logs");
- FileWork.DirCreate("downloads");
- PublicLog.LogDel += Log;
- LoginButton.Click += Login;
- RegisterButton.Click += Register;
- Closed += CloseWindow;
- Log("[" + DateTime.Now.ToString() + "]: launcher is starting\n");
- }
- catch (Exception e)
- {
- Log("error:\n" + e.Message + "\n" + e.StackTrace + '\n');
- }
- }
-
- void Log(string msg)
- {
- lock (new object())
- {
- if (LogBox.Text.Length - 1 >= 0 && LogBox.Text[LogBox.Text.Length - 1] == '\n') msg = "[" + DateTime.Now.ToString() + "]: " + msg;
- FileWork.Log(logfile, msg);
- LogBox.Text += msg;
- }
- }
-
- void Log(params string[] input)
- {
- var str = new System.Text.StringBuilder();
- if (input.Length == 1) str.Append(input[0]);
- else if (input.Length % 2 == 0) for (ushort i = 0; i < input.Length; i++) str.Append(input[++i]);
- else throw new Exception("error in Log(): every text string must have color string before");
- lock (new object())
- {
- FileWork.Log(logfile, str.ToString());
- LogBox.Text += str.ToString();
- }
- }
-
- void Register(object sender, EventArgs e)
- {
- try
- {
- var hasher = new Hasher();
- File.WriteAllText($"register-{LoginBox.Text}.req",
- hasher.HashCycled(hasher.Hash(LoginBox.Text.ToBytes(), PasswBox.Password.ToBytes()), 512).HashToString()
- + ": " + LoginBox.Text);
- Log($"request file created:{Directory.GetCurrentDirectory()}\\register-{LoginBox.Text}.req {hasher.Hash(LoginBox.Text.ToBytes(), PasswBox.Password.ToBytes()).Length}");
- }
- catch (Exception ex)
- {
- Log("registration error: " + ex.Message);
- }
- }
-
- void Login(object sender, EventArgs e)
- {
- try
- {
- if (mainSocket.Connected)
- {
- mainSocket.Shutdown(SocketShutdown.Both);
- mainSocket.Close();
- mainSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
- }
- mainSocket.Connect(new IPEndPoint(
- Dns.GetHostAddresses(FileWork.ReadFromConfig("client.cfg", "central server ip"))[0],
- FileWork.ReadFromConfig("client.cfg", "central server port").ToInt()));
- mainSocket.ReceiveTimeout = 2000;
- string request = mainSocket.GetPackageClear(16).ToStr();
- if (request != "requesting hash") throw new Exception($"Login() error: invalid request <{request}> <{request.Length}>");
- var hasher = new Hasher();
- mainSocket.SendPackage(32, hasher.HashCycled(hasher.Hash(LoginBox.Text.ToBytes(), PasswBox.Password.ToBytes()), 512));
- request = mainSocket.GetPackageClear(16).ToStr();
- if (request != "success") throw new Exception($"Login() error: invalid success message <{request}>");
- Log("succesfully logined\n");
- // вызов нового окна
- var lauWin = new LauncherWindow(mainSocket, logfile, LogBox.Text);
- lauWin.Show();
- Hide();
- PublicLog.LogDel -= Log;
- lauWin.Closed += CloseWindow;
- }
- catch (Exception ex)
- {
- Log("login error: " + ex.Message + '\n' + ex.StackTrace);
- }
- }
-
- void CloseWindow(object sender, EventArgs e)
- {
- if (mainSocket.Connected)
- {
- mainSocket.Shutdown(SocketShutdown.Both);
- mainSocket.Close();
- }
- Log("DTchat closed");
- Close();
- App.Current.Shutdown();
- }
- }
-}
diff --git a/.old 5/dtlauncher-client-win/ProgramLabel.xaml b/.old 5/dtlauncher-client-win/ProgramLabel.xaml
deleted file mode 100644
index f6a6073..0000000
--- a/.old 5/dtlauncher-client-win/ProgramLabel.xaml
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/.old 5/dtlauncher-client-win/ProgramLabel.xaml.cs b/.old 5/dtlauncher-client-win/ProgramLabel.xaml.cs
deleted file mode 100644
index 29a0f8d..0000000
--- a/.old 5/dtlauncher-client-win/ProgramLabel.xaml.cs
+++ /dev/null
@@ -1,115 +0,0 @@
-using DTLib;
-using System;
-using System.Diagnostics;
-using System.IO;
-using System.Windows;
-using System.Windows.Controls;
-
-namespace dtlauncher_client_win
-{
- ///
- /// Логика взаимодействия для ProgramLabel.xaml
- ///
- public partial class ProgramLabel : UserControl
- {
- public static DependencyProperty TextProperty = DependencyProperty.Register("Text", typeof(string), typeof(ProgramLabel));
- public string Text
- {
- get { return (string)GetValue(TextProperty); }
- set { SetValue(TextProperty, value); }
- }
-
- public static DependencyProperty IconProperty = DependencyProperty.Register("Icon", typeof(System.Windows.Media.Imaging.BitmapImage), typeof(ProgramLabel));
- public System.Windows.Media.Imaging.BitmapImage Icon
- {
- get { return (System.Windows.Media.Imaging.BitmapImage)GetValue(IconProperty); }
- set { SetValue(IconProperty, value); }
- }
-
- public static DependencyProperty CornerRadiusProperty = DependencyProperty.Register("CornerRadius", typeof(CornerRadius), typeof(ProgramLabel));
- public CornerRadius CornerRadius
- {
- get { return (CornerRadius)GetValue(CornerRadiusProperty); }
- set { SetValue(CornerRadiusProperty, value); }
- }
-
- public string BackgroundImage;
- public string Script;
- public string InstallDir;
- public string LaunchFile;
- public string Arguments;
- public string Description;
- public int Number;
- LauncherWindow Window;
-
- public ProgramLabel()
- {
- InitializeComponent();
- }
-
- public ProgramLabel(string descriptorPath, int number, LauncherWindow window)
- {
- try
- {
- InitializeComponent();
- Window = window;
- Number = number;
- FontSize = 14;
- Foreground = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromRgb(240, 240, 240));
- Text = FileWork.ReadFromConfig(descriptorPath, "name");
- NameLabel.Content = FileWork.ReadFromConfig(descriptorPath, "name");
- IconImage.Source = new System.Windows.Media.Imaging.BitmapImage(new Uri(Directory.GetCurrentDirectory() + "\\descroptors\\" + FileWork.ReadFromConfig(descriptorPath, "icon"), UriKind.Absolute));
- BackgroundImage = Directory.GetCurrentDirectory() + "\\descroptors\\" + FileWork.ReadFromConfig(descriptorPath, "background");
- Script = FileWork.ReadFromConfig(descriptorPath, "script");
- InstallDir = FileWork.ReadFromConfig(descriptorPath, "installdir");
- LaunchFile = FileWork.ReadFromConfig(descriptorPath, "launchfile");
- Arguments = FileWork.ReadFromConfig(descriptorPath, "arguments");
- Description = FileWork.ReadFromConfig(descriptorPath, "description").Replace("\\n", "\n");
- //Window.Log(Text + " " + Icon + " " + Number);
- }
- catch (Exception e)
- {
- Window.Log("error:\n" + e.Message + "\n" + e.StackTrace + '\n');
- }
- }
-
- void ProgramShow(object sender, System.Windows.Input.MouseButtonEventArgs e)
- {
- try
- {
- Window.programsArray[Window.PreviousProgramNum].Foreground = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromRgb(240, 240, 240));
- Window.programsArray[Window.PreviousProgramNum].FontWeight = FontWeights.Normal;
- Window.programsArray[Window.PreviousProgramNum].FontSize = 14;
- Window.PreviousProgramNum = Number;
- Foreground = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromRgb(170, 170, 240));
- FontWeight = FontWeights.Bold;
- FontSize = 13;
- Window.NameLabel.Content = Text;
- Window.DescriptionBox.Text = Description;
- Window.BackgroundImage.Source = new System.Windows.Media.Imaging.BitmapImage(new Uri(BackgroundImage, UriKind.Absolute));
- Window.Launch = () =>
- {
- var startInfo = new ProcessStartInfo()
- {
- FileName = LaunchFile,
- Arguments = Arguments,
- };
- Process.Start(startInfo);
- };
- Window.Install = () =>
- {
- var scriptrunner = new DTScript.ScriptRunner
- {
- debug = false,
- mainSocket = Window.mainSocket
- };
- scriptrunner.RunScriptFile(Directory.GetCurrentDirectory() + "\\scripts\\" + Script);
- };
- }
- catch (Exception ex)
- {
- Window.Log("error:\n" + ex.Message + "\n" + ex.StackTrace + '\n');
- }
- }
- }
-}
diff --git a/.old 5/dtlauncher-client-win/Properties/AssemblyInfo.cs b/.old 5/dtlauncher-client-win/Properties/AssemblyInfo.cs
deleted file mode 100644
index bbd57be..0000000
--- a/.old 5/dtlauncher-client-win/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,53 +0,0 @@
-using System.Reflection;
-using System.Runtime.InteropServices;
-using System.Windows;
-
-// Общие сведения об этой сборке предоставляются следующим набором
-// набор атрибутов. Измените значения этих атрибутов, чтобы изменить сведения,
-// связанные со сборкой.
-[assembly: AssemblyTitle("dtlauncher-client-win")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("dtlauncher-client-win")]
-[assembly: AssemblyCopyright("Copyright © 2021")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Установка значения False для параметра ComVisible делает типы в этой сборке невидимыми
-// для компонентов COM. Если необходимо обратиться к типу в этой сборке через
-// из модели COM, установите атрибут ComVisible для этого типа в значение true.
-[assembly: ComVisible(false)]
-
-//Чтобы начать создание локализуемых приложений, задайте
-//CultureYouAreCodingWith в файле .csproj
-//в . Например, при использовании английского (США)
-//в своих исходных файлах установите в en-US. Затем отмените преобразование в комментарий
-//атрибута NeutralResourceLanguage ниже. Обновите "en-US" в
-//строка внизу для обеспечения соответствия настройки UICulture в файле проекта.
-
-//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
-
-
-[assembly: ThemeInfo(
- ResourceDictionaryLocation.None, //где расположены словари ресурсов по конкретным тематикам
- //(используется, если ресурс не найден на странице,
- // или в словарях ресурсов приложения)
- ResourceDictionaryLocation.SourceAssembly //где расположен словарь универсальных ресурсов
- //(используется, если ресурс не найден на странице,
- // в приложении или в каких-либо словарях ресурсов для конкретной темы)
-)]
-
-
-// Сведения о версии для сборки включают четыре следующих значения:
-//
-// Основной номер версии
-// Дополнительный номер версии
-// Номер сборки
-// Номер редакции
-//
-// Можно задать все значения или принять номера сборки и редакции по умолчанию
-// используя "*", как показано ниже:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/.old 5/dtlauncher-client-win/Properties/Resources.Designer.cs b/.old 5/dtlauncher-client-win/Properties/Resources.Designer.cs
deleted file mode 100644
index 615ca67..0000000
--- a/.old 5/dtlauncher-client-win/Properties/Resources.Designer.cs
+++ /dev/null
@@ -1,70 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// Этот код был создан программным средством.
-// Версия среды выполнения: 4.0.30319.42000
-//
-// Изменения в этом файле могут привести к неправильному поведению и будут утрачены, если
-// код создан повторно.
-//
-//------------------------------------------------------------------------------
-
-
-namespace dtlauncher_client_win.Properties
-{
- ///
- /// Класс ресурсов со строгим типом для поиска локализованных строк и пр.
- ///
- // Этот класс был автоматически создан при помощи StronglyTypedResourceBuilder
- // класс с помощью таких средств, как ResGen или Visual Studio.
- // Для добавления или удаления члена измените файл .ResX, а затем перезапустите ResGen
- // с параметром /str или заново постройте свой VS-проект.
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- internal class Resources
- {
-
- private static global::System.Resources.ResourceManager resourceMan;
-
- private static global::System.Globalization.CultureInfo resourceCulture;
-
- [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
- internal Resources()
- {
- }
-
- ///
- /// Возврат кэшированного экземпляра ResourceManager, используемого этим классом.
- ///
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Resources.ResourceManager ResourceManager
- {
- get
- {
- if ((resourceMan == null))
- {
- global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("dtlauncher_client_win.Properties.Resources", typeof(Resources).Assembly);
- resourceMan = temp;
- }
- return resourceMan;
- }
- }
-
- ///
- /// Переопределяет свойство CurrentUICulture текущего потока для всех
- /// подстановки ресурсов с помощью этого класса ресурсов со строгим типом.
- ///
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Globalization.CultureInfo Culture
- {
- get
- {
- return resourceCulture;
- }
- set
- {
- resourceCulture = value;
- }
- }
- }
-}
diff --git a/.old 5/dtlauncher-client-win/Properties/Resources.resx b/.old 5/dtlauncher-client-win/Properties/Resources.resx
deleted file mode 100644
index af7dbeb..0000000
--- a/.old 5/dtlauncher-client-win/Properties/Resources.resx
+++ /dev/null
@@ -1,117 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 2.0
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
\ No newline at end of file
diff --git a/.old 5/dtlauncher-client-win/Properties/Settings.Designer.cs b/.old 5/dtlauncher-client-win/Properties/Settings.Designer.cs
deleted file mode 100644
index 1c4561e..0000000
--- a/.old 5/dtlauncher-client-win/Properties/Settings.Designer.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// This code was generated by a tool.
-// Runtime Version:4.0.30319.42000
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-//
-//------------------------------------------------------------------------------
-
-
-namespace dtlauncher_client_win.Properties
-{
- [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
- internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
- {
-
- private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
-
- public static Settings Default
- {
- get
- {
- return defaultInstance;
- }
- }
- }
-}
diff --git a/.old 5/dtlauncher-client-win/Properties/Settings.settings b/.old 5/dtlauncher-client-win/Properties/Settings.settings
deleted file mode 100644
index 033d7a5..0000000
--- a/.old 5/dtlauncher-client-win/Properties/Settings.settings
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.old 5/dtlauncher-client-win/dtlauncher-client-win.csproj b/.old 5/dtlauncher-client-win/dtlauncher-client-win.csproj
deleted file mode 100644
index 2bb81e5..0000000
--- a/.old 5/dtlauncher-client-win/dtlauncher-client-win.csproj
+++ /dev/null
@@ -1,125 +0,0 @@
-
-
-
-
- Debug
- AnyCPU
- {367793EE-4757-4ADD-BF7E-960DC9EB6DF9}
- WinExe
- dtlauncher_client_win
- dtlauncher-client-win
- v4.8
- 512
- {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
- 4
- true
- true
-
-
- AnyCPU
- none
- true
- bin\
- TRACE
- prompt
- 4
- true
-
-
- dtlauncher_client_win.App
-
-
- dtscript.ico
-
-
-
-
-
-
-
-
-
-
-
- 4.0
-
-
-
-
-
-
-
- MSBuild:Compile
- Designer
-
-
- Designer
- MSBuild:Compile
-
-
- MSBuild:Compile
- Designer
-
-
- App.xaml
- Code
-
-
- LauncherWindow.xaml
-
-
- LoginWindow.xaml
- Code
-
-
- Designer
- MSBuild:Compile
-
-
-
-
- ProgramLabel.xaml
-
-
- Code
-
-
- True
- True
- Resources.resx
-
-
- True
- Settings.settings
- True
-
-
- ResXFileCodeGenerator
- Resources.Designer.cs
-
-
- SettingsSingleFileGenerator
- Settings.Designer.cs
-
-
-
-
-
-
-
- {ce793497-2d5c-42d8-b311-e9b32af9cdfb}
- DTLib
-
-
- {e02ea967-fd29-47d2-b25b-ba684b784aee}
- dtscript
-
-
-
-
-
-
-
- del /f /q dtlauncher-client-win.exe.config
-
-
\ No newline at end of file
diff --git a/.old 5/dtlauncher-client-win/dtscript.ico b/.old 5/dtlauncher-client-win/dtscript.ico
deleted file mode 100644
index df420bb92a63e0b82c9ac76bf38dfb82e8229cba..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 9662
zcmeI2cU;tGw*T2p?1Bi=r3efi!~zx&M0)SN!_a$Yn1Nv^BE=RJTPzq*qiL2zv(a>S
zO*YADHf1;2T$9`+Zmzl6Y;rd@n|t$m|IQ5RW`D2W@Aud5&x@}Q&-2WT^ZlIjoO7OY
z&V!NBFXW%UzmfcQGCHj=GO{!>GV&0}OGYIE{p*Gw*V*C!_B(Z+o6$Wq|I)`OW3HQb
z`aHMplzED)@$+48M=wzP7`Z?}lmTusx)Hs=^&eQMAV%Jk&k?=Q{Vv>yk$KD_4`LR3
z%3MM00vDp^uOMpP3L*_~B4Vx{jzrFN`Z0E%^X+7LX8Jt$?#y`}-r5E0?(@>~`#=5M
zu?^P7*4Qkzz|O=HM>AUkR+ulx*~%41
zD=!>u{Bf}Kz-gJQz!_&VYuuOF;bG;3yXA6RP0VmJHp70QDHih=V=-?LX7d+eK5rrB
zbLL|)XAvvrni4qA`lsl5PPbC$x@}9J>+YoIc8}-JWw`fR#yo{l`dqj8g!wKv0~b5v
zu+#+$b7#zjhncwob5naP7MftOcqta9w%A%YvD{jLjjcbn%LB1>*ockeCTwkdSZ->D
z#iE5QH(rd*q6OG4UVy8GIc|1#I4)Tt+!xAsEoO;)-;#yKEEX6qGQnig5=`X#jTf6@
zZn6wJV+#ToFDG$<;%1s~OPlNdPcq!&F1$tWZUs>bJ??lcb;ZuY5nD?K>@1zIwpfAH
zQqlR6rP!ESU}NDdoL6CIzX3bpyWA-Zd*^T*Tq1FDi^bk4*dU|j{P|eTU%>JOi$
z9^RIscPk5)FEvB|o*u>)YnbPp#vI4wS*%E9zDpJsRzBFsp4nMD;bh~;YAY9FjXm$A
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7IR5TI?bPYvJ
z^vD_6C%!t+B)Lij4-Zr`HP+0`E;Uo*9Xvc(A~|&u-MO(;Z3-d7#8d9?Tn+bkhWlT+
z`%Rsrh)Y@ObthrVAlcOGPP|V5v73U33kfzLUgn8X8zf47lN2JOyq*{;{jM-Mzr#aG3ExcemQX<$
z$r0fsMMRJo9wB=fF7Jnv8W~Pz^sH|cCq+}59D_1Fp6cu*8VlvzDb1FB$)LM3OU|7%
z`jp9RtxsjVIfGrQGPZX~9iI_PuCK;8}3xW`~=zyV(BT1qpvIqjm+ydZXwIm`)2Zkin!zl
z{+au|zk|3h!>ldoZEIVyiRY~ZJHMZz-BuIfEAU?{b^cl+RtFdmxh9ZE=^aI_T~Fj1
zfs9cibEIJQGxFJ0YvljTB5F;5q0g7Fe!bL1>q!-vGGrgK1UX^B6hwwlDz$4xi)RTKik$K8ePg0k92|P(N^CI2M>&J8x55u`C
zcG4}py;mA7yw6+D@#jAu>lgEkj9%1_4;UHs>&IW{fBnzT|4$9{>%UC&`l5amJ%6kp
HMeqL$C_4~(
diff --git a/.old 5/dtlauncher-server-win/App.config b/.old 5/dtlauncher-server-win/App.config
deleted file mode 100644
index 193aecc..0000000
--- a/.old 5/dtlauncher-server-win/App.config
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.old 5/dtlauncher-server-win/Program.cs b/.old 5/dtlauncher-server-win/Program.cs
deleted file mode 100644
index 8479647..0000000
--- a/.old 5/dtlauncher-server-win/Program.cs
+++ /dev/null
@@ -1,121 +0,0 @@
-using DTLib;
-using System;
-using System.Net;
-using System.Net.Sockets;
-using System.Threading;
-using static DTLib.NetWork;
-
-namespace dtlauncher_server
-{
- class Program
- {
- static Socket mainSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
-
- static void Main(string[] args)
- {
- while (true)
- {
- try
- {
- Console.Title = "dtlauncher server";
- PublicLog.LogDel += Log;
- Log("b", $"<{FileWork.ReadFromConfig("server.cfg", "server ip")}:{FileWork.ReadFromConfig("server.cfg", "server port")}>\n");
- mainSocket.Bind(new IPEndPoint(IPAddress.Parse(
- FileWork.ReadFromConfig("server.cfg", "server ip")),
- FileWork.ReadFromConfig("server.cfg", "server port").ToInt()));
- Log("g", "server started succesfully\n");
- mainSocket.Listen(1000);
- while (true)
- {
- var userSocket = mainSocket.Accept();
- var userThread = new Thread(new ParameterizedThreadStart(UserHandle));
- //users.Add(userSocket, userThread);
- userThread.Start(userSocket);
- }
- }
- catch (Exception ex)
- {
- if (mainSocket.IsBound)
- {
- mainSocket.Shutdown(SocketShutdown.Both);
- mainSocket.Close();
- }
- Log("r", $"dtlauncher_server.Main() error:\n{ex.Message}\n{ex.StackTrace}\n");
- }
- Log("gray", "\n");
- }
- }
-
- // лог в консоль и файл
- static readonly string logfile = $"logs\\dtlauncher-server-{DateTime.Now}.log".Replace(':', '-').Replace(' ', '_');
- static void Log(params string[] msg)
- {
- lock (new object())
- {
- if (msg.Length == 1)
- {
- msg[0] = "[" + DateTime.Now.ToString() + "]: " + msg[0];
- FileWork.Log(logfile, msg[0]);
- }
- else if (msg.Length % 2 != 0) throw new Exception("incorrect array to log\n");
- else
- {
- msg[1] = "[" + DateTime.Now.ToString() + "]: " + msg[1];
- var str = new System.Text.StringBuilder();
- for (int i = 0; i < msg.Length; i++) str.Append(msg[++i]);
- FileWork.Log(logfile, str.ToString());
- }
- ColoredConsole.Write(msg);
- }
- }
-
- // запускается для каждого юзера в отдельном потоке
- static void UserHandle(object _handlerSocket)
- {
- Log("g", "user connecting\n");
- Socket handlerSocket = (Socket)_handlerSocket;
- try
- {
- handlerSocket.SendPackage(16, "requesting hash".ToBytes());
- string login;
- lock (new object())
- {
- login = FileWork.ReadFromConfig("users.db", handlerSocket.GetPackageRaw(32).HashToString());
- }
- handlerSocket.SendPackage(16, "success".ToBytes());
- Log("g", $"user <{login}> succesfully logged\n");
- while (true)
- {
- if (handlerSocket.Available >= 64)
- {
- var request = handlerSocket.GetPackageClear(64).ToStr();
- switch (request)
- {
- // ответ на NetWork.Ping()
- /*case "ping":
- handlerSocket.Send("pong".ToBytes());
- break;*/
- // отправка списка активных серверов
- /*case "requesting servers list":
-
- break;*/
- case "requesting file download":
- handlerSocket.FSP_Upload();
- break;
- default:
- throw new Exception("unknown request: " + request);
- }
- }
- else Thread.Sleep(10);
- }
- }
- catch (Exception ex)
- {
- Log("y", $"UserStart() error:\n message:\n {ex.Message}\n{ex.StackTrace}\n");
- handlerSocket.Shutdown(SocketShutdown.Both);
- handlerSocket.Close();
- Thread.CurrentThread.Abort();
- }
- }
- }
-}
diff --git a/.old 5/dtlauncher-server-win/Properties/AssemblyInfo.cs b/.old 5/dtlauncher-server-win/Properties/AssemblyInfo.cs
deleted file mode 100644
index 340af78..0000000
--- a/.old 5/dtlauncher-server-win/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,53 +0,0 @@
-using System.Reflection;
-using System.Runtime.InteropServices;
-using System.Windows;
-
-// Общие сведения об этой сборке предоставляются следующим набором
-// набор атрибутов. Измените значения этих атрибутов, чтобы изменить сведения,
-// связанные со сборкой.
-[assembly: AssemblyTitle("dtlauncher-server-win")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("dtlauncher-server-win")]
-[assembly: AssemblyCopyright("Copyright © 2021")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Установка значения False для параметра ComVisible делает типы в этой сборке невидимыми
-// для компонентов COM. Если необходимо обратиться к типу в этой сборке через
-// из модели COM, установите атрибут ComVisible для этого типа в значение true.
-[assembly: ComVisible(false)]
-
-//Чтобы начать создание локализуемых приложений, задайте
-//CultureYouAreCodingWith в файле .csproj
-//в . Например, при использовании английского (США)
-//в своих исходных файлах установите в en-US. Затем отмените преобразование в комментарий
-//атрибута NeutralResourceLanguage ниже. Обновите "en-US" в
-//строка внизу для обеспечения соответствия настройки UICulture в файле проекта.
-
-//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
-
-
-[assembly: ThemeInfo(
- ResourceDictionaryLocation.None, //где расположены словари ресурсов по конкретным тематикам
- //(используется, если ресурс не найден на странице,
- // или в словарях ресурсов приложения)
- ResourceDictionaryLocation.SourceAssembly //где расположен словарь универсальных ресурсов
- //(используется, если ресурс не найден на странице,
- // в приложении или в каких-либо словарях ресурсов для конкретной темы)
-)]
-
-
-// Сведения о версии для сборки включают четыре следующих значения:
-//
-// Основной номер версии
-// Дополнительный номер версии
-// Номер сборки
-// Номер редакции
-//
-// Можно задать все значения или принять номера сборки и редакции по умолчанию
-// используя "*", как показано ниже:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/.old 5/dtlauncher-server-win/Properties/Resources.Designer.cs b/.old 5/dtlauncher-server-win/Properties/Resources.Designer.cs
deleted file mode 100644
index 9d42357..0000000
--- a/.old 5/dtlauncher-server-win/Properties/Resources.Designer.cs
+++ /dev/null
@@ -1,70 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// Этот код был создан программным средством.
-// Версия среды выполнения: 4.0.30319.42000
-//
-// Изменения в этом файле могут привести к неправильному поведению и будут утрачены, если
-// код создан повторно.
-//
-//------------------------------------------------------------------------------
-
-
-namespace dtlauncher_server_win.Properties
-{
- ///
- /// Класс ресурсов со строгим типом для поиска локализованных строк и пр.
- ///
- // Этот класс был автоматически создан при помощи StronglyTypedResourceBuilder
- // класс с помощью таких средств, как ResGen или Visual Studio.
- // Для добавления или удаления члена измените файл .ResX, а затем перезапустите ResGen
- // с параметром /str или заново постройте свой VS-проект.
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- internal class Resources
- {
-
- private static global::System.Resources.ResourceManager resourceMan;
-
- private static global::System.Globalization.CultureInfo resourceCulture;
-
- [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
- internal Resources()
- {
- }
-
- ///
- /// Возврат кэшированного экземпляра ResourceManager, используемого этим классом.
- ///
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Resources.ResourceManager ResourceManager
- {
- get
- {
- if ((resourceMan == null))
- {
- global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("dtlauncher_server_win.Properties.Resources", typeof(Resources).Assembly);
- resourceMan = temp;
- }
- return resourceMan;
- }
- }
-
- ///
- /// Переопределяет свойство CurrentUICulture текущего потока для всех
- /// подстановки ресурсов с помощью этого класса ресурсов со строгим типом.
- ///
- [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Globalization.CultureInfo Culture
- {
- get
- {
- return resourceCulture;
- }
- set
- {
- resourceCulture = value;
- }
- }
- }
-}
diff --git a/.old 5/dtlauncher-server-win/Properties/Resources.resx b/.old 5/dtlauncher-server-win/Properties/Resources.resx
deleted file mode 100644
index af7dbeb..0000000
--- a/.old 5/dtlauncher-server-win/Properties/Resources.resx
+++ /dev/null
@@ -1,117 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 2.0
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
\ No newline at end of file
diff --git a/.old 5/dtlauncher-server-win/Properties/Settings.Designer.cs b/.old 5/dtlauncher-server-win/Properties/Settings.Designer.cs
deleted file mode 100644
index cb2dff3..0000000
--- a/.old 5/dtlauncher-server-win/Properties/Settings.Designer.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-//------------------------------------------------------------------------------
-//
-// This code was generated by a tool.
-// Runtime Version:4.0.30319.42000
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-//
-//------------------------------------------------------------------------------
-
-
-namespace dtlauncher_server_win.Properties
-{
- [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
- internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
- {
-
- private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
-
- public static Settings Default
- {
- get
- {
- return defaultInstance;
- }
- }
- }
-}
diff --git a/.old 5/dtlauncher-server-win/Properties/Settings.settings b/.old 5/dtlauncher-server-win/Properties/Settings.settings
deleted file mode 100644
index 033d7a5..0000000
--- a/.old 5/dtlauncher-server-win/Properties/Settings.settings
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.old 5/dtlauncher-server-win/dtlauncher-server-win.csproj b/.old 5/dtlauncher-server-win/dtlauncher-server-win.csproj
deleted file mode 100644
index 9c05b3a..0000000
--- a/.old 5/dtlauncher-server-win/dtlauncher-server-win.csproj
+++ /dev/null
@@ -1,111 +0,0 @@
-
-
-
-
- Debug
- AnyCPU
- {8B9889A7-93DC-4914-92D1-8209BD3BA71A}
- Exe
- dtlauncher_server_win
- dtlauncher-server-win
- v4.8
- 512
- {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
- 4
- true
- true
- publish\
- true
- Disk
- false
- Foreground
- 7
- Days
- false
- false
- true
- 0
- 1.0.0.%2a
- false
- false
- true
-
-
- AnyCPU
- none
- true
- bin\
- TRACE
- prompt
- 4
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 4.0
-
-
-
-
-
-
-
-
- Code
-
-
- True
- True
- Resources.resx
-
-
- True
- Settings.settings
- True
-
-
- ResXFileCodeGenerator
- Resources.Designer.cs
-
-
- SettingsSingleFileGenerator
- Settings.Designer.cs
-
-
-
-
-
-
-
- {ce793497-2d5c-42d8-b311-e9b32af9cdfb}
- DTLib
-
-
-
-
- False
- Microsoft .NET Framework 4.8 %28x86 и x64%29
- true
-
-
- False
- .NET Framework 3.5 SP1
- false
-
-
-
-
- del /f /q dtlauncher-server-win.exe.config
-
-
\ No newline at end of file
diff --git a/.old 5/dtlauncher.sln b/.old 5/dtlauncher.sln
deleted file mode 100644
index 0d389f2..0000000
--- a/.old 5/dtlauncher.sln
+++ /dev/null
@@ -1,45 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio Version 16
-VisualStudioVersion = 16.0.30907.101
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DTLib", "..\DTLib\DTLib.csproj", "{CE793497-2D5C-42D8-B311-E9B32AF9CDFB}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "dtlauncher-client-win", "dtlauncher-client-win\dtlauncher-client-win.csproj", "{367793EE-4757-4ADD-BF7E-960DC9EB6DF9}"
- ProjectSection(ProjectDependencies) = postProject
- {4784D974-A342-4202-9430-90FE5AC00FC7} = {4784D974-A342-4202-9430-90FE5AC00FC7}
- {CE793497-2D5C-42D8-B311-E9B32AF9CDFB} = {CE793497-2D5C-42D8-B311-E9B32AF9CDFB}
- EndProjectSection
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "dtlauncher-server-win", "dtlauncher-server-win\dtlauncher-server-win.csproj", "{8B9889A7-93DC-4914-92D1-8209BD3BA71A}"
- ProjectSection(ProjectDependencies) = postProject
- {CE793497-2D5C-42D8-B311-E9B32AF9CDFB} = {CE793497-2D5C-42D8-B311-E9B32AF9CDFB}
- EndProjectSection
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "dtscript", "..\dtscript\dtscript.csproj", "{E02EA967-FD29-47D2-B25B-BA684B784AEE}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "updater", "updater\updater.csproj", "{4784D974-A342-4202-9430-90FE5AC00FC7}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Build|Any CPU = Build|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {CE793497-2D5C-42D8-B311-E9B32AF9CDFB}.Build|Any CPU.ActiveCfg = Build|Any CPU
- {CE793497-2D5C-42D8-B311-E9B32AF9CDFB}.Build|Any CPU.Build.0 = Build|Any CPU
- {367793EE-4757-4ADD-BF7E-960DC9EB6DF9}.Build|Any CPU.ActiveCfg = Build|Any CPU
- {367793EE-4757-4ADD-BF7E-960DC9EB6DF9}.Build|Any CPU.Build.0 = Build|Any CPU
- {8B9889A7-93DC-4914-92D1-8209BD3BA71A}.Build|Any CPU.ActiveCfg = Build|Any CPU
- {8B9889A7-93DC-4914-92D1-8209BD3BA71A}.Build|Any CPU.Build.0 = Build|Any CPU
- {E02EA967-FD29-47D2-B25B-BA684B784AEE}.Build|Any CPU.ActiveCfg = Build|Any CPU
- {E02EA967-FD29-47D2-B25B-BA684B784AEE}.Build|Any CPU.Build.0 = Build|Any CPU
- {4784D974-A342-4202-9430-90FE5AC00FC7}.Build|Any CPU.ActiveCfg = Build|Any CPU
- {4784D974-A342-4202-9430-90FE5AC00FC7}.Build|Any CPU.Build.0 = Build|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
- GlobalSection(ExtensibilityGlobals) = postSolution
- SolutionGuid = {E6569C0C-DD32-4F7D-AD4C-DBC5434D2F8C}
- EndGlobalSection
-EndGlobal
diff --git a/.old 5/updater/App.config b/.old 5/updater/App.config
deleted file mode 100644
index 193aecc..0000000
--- a/.old 5/updater/App.config
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.old 5/updater/Program.cs b/.old 5/updater/Program.cs
deleted file mode 100644
index ac35391..0000000
--- a/.old 5/updater/Program.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.IO;
-using System.Net;
-using System.Net.Sockets;
-using System.Threading;
-
-namespace updater
-{
- class Program
- {
- static void Main(string[] args)
- {
-
- }
-
- // вывод лога в консоль и файл
- static readonly string logfile = $"logs-updater\\updater-{DateTime.Now}.log".Replace(':', '-').Replace(' ', '_');
-
- static public void Log(params string[] msg)
- {
- if (msg.Length == 1)
- {
- msg[0] = "[" + DateTime.Now.ToString() + "]: " + msg[0];
- FileWork.Log(logfile, msg[0]);
- }
- else if (msg.Length % 2 != 0) throw new Exception("incorrect array to log\n");
- else
- {
- msg[1] = "[" + DateTime.Now.ToString() + "]: " + msg[1];
- var str = new System.Text.StringBuilder();
- for (int i = 0; i < msg.Length; i++) str.Append(msg[++i]);
- FileWork.Log(logfile, str.ToString());
- }
- ColoredConsole.Write(msg);
- }
- }
-}
diff --git a/.old 5/updater/Properties/AssemblyInfo.cs b/.old 5/updater/Properties/AssemblyInfo.cs
deleted file mode 100644
index 3f58293..0000000
--- a/.old 5/updater/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// Общие сведения об этой сборке предоставляются следующим набором
-// набора атрибутов. Измените значения этих атрибутов для изменения сведений,
-// связанные с этой сборкой.
-[assembly: AssemblyTitle("updater")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("updater")]
-[assembly: AssemblyCopyright("Copyright © 2021")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Установка значения False для параметра ComVisible делает типы в этой сборке невидимыми
-// для компонентов COM. Если необходимо обратиться к типу в этой сборке через
-// из модели COM задайте для атрибута ComVisible этого типа значение true.
-[assembly: ComVisible(false)]
-
-// Следующий GUID представляет идентификатор typelib, если этот проект доступен из модели COM
-[assembly: Guid("4784d974-a342-4202-9430-90fe5ac00fc7")]
-
-// Сведения о версии сборки состоят из указанных ниже четырех значений:
-//
-// Основной номер версии
-// Дополнительный номер версии
-// Номер сборки
-// Номер редакции
-//
-// Можно задать все значения или принять номера сборки и редакции по умолчанию
-// используя "*", как показано ниже:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/.old 5/updater/dtlib/ColoredConsole.cs b/.old 5/updater/dtlib/ColoredConsole.cs
deleted file mode 100644
index 09e6ac8..0000000
--- a/.old 5/updater/dtlib/ColoredConsole.cs
+++ /dev/null
@@ -1,83 +0,0 @@
-using System;
-
-namespace updater
-{
- //
- // вывод и ввод цветного текста в консоли
- // работает медленнее чем хотелось бы
- //
- public static class ColoredConsole
- {
- // парсит название цвета в ConsoleColor
- public static ConsoleColor ParseColor(string color)
- {
- switch (color)
- {
- //case "magneta":
- case "m":
- return ConsoleColor.Magenta;
- //case "green":
- case "g":
- return ConsoleColor.Green;
- //case "red":
- case "r":
- return ConsoleColor.Red;
- //case "yellow":
- case "y":
- return ConsoleColor.Yellow;
- //case "white":
- case "w":
- return ConsoleColor.White;
- //case "blue":
- case "b":
- return ConsoleColor.Blue;
- //case "cyan":
- case "c":
- return ConsoleColor.Cyan;
- //case "gray":
- case "gray":
- return ConsoleColor.Gray;
- //case "black":
- case "black":
- return ConsoleColor.Black;
- default:
- throw new Exception("incorrect color: " + color);
- }
- }
-
- // вывод цветного текста
- public static void Write(params string[] input)
- {
- if (input.Length == 1)
- {
- if (Console.ForegroundColor != ConsoleColor.Green) Console.ForegroundColor = ConsoleColor.Gray;
- Console.Write(input[0]);
- }
- else if (input.Length % 2 == 0)
- {
- string str = "";
- for (ushort i = 0; i < input.Length; i++)
- {
- var c = ParseColor(input[i]);
- if (Console.ForegroundColor != c)
- {
- Console.Write(str);
- Console.ForegroundColor = c;
- str = "";
- }
- str += input[++i];
- }
- if (str != "") Console.Write(str);
- }
- else throw new Exception("error in Write(): every text string must have color string before");
- }
-
- // ввод цветного текста
- public static string Read(string color)
- {
- var c = ParseColor(color);
- if (Console.ForegroundColor != c) Console.ForegroundColor = c;
- return Console.ReadLine();
- }
- }
-}
\ No newline at end of file
diff --git a/.old 5/updater/dtlib/FileWork.cs b/.old 5/updater/dtlib/FileWork.cs
deleted file mode 100644
index 9838fe0..0000000
--- a/.old 5/updater/dtlib/FileWork.cs
+++ /dev/null
@@ -1,168 +0,0 @@
-using System.Collections.Generic;
-using System.IO;
-
-namespace updater
-{
- //
- // методы для работы с файловой системой
- //
- public static class FileWork
- {
- // записывает текст в файл и закрывает файл
- public static void Log(string logfile, string msg)
- {
- lock (new object())
- {
- if (logfile.Contains("\\")) DirCreate(logfile.Remove(logfile.LastIndexOf('\\')));
- var st = File.Open(logfile, FileMode.Append);
- var writer = new StreamWriter(st, SimpleConverter.UTF8);
- writer.Write(msg);
- writer.Close();
- st.Close();
- }
- }
-
- // создает папку если её не существует
- public static void DirCreate(string dir)
- {
- if (!Directory.Exists(dir))
- {
- // проверяет существование папки, в которой нужно создать dir
- if (dir.Contains("\\") && !Directory.Exists(dir.Remove(dir.LastIndexOf('\\'))))
- DirCreate(dir.Remove(dir.LastIndexOf('\\')));
- Directory.CreateDirectory(dir);
- }
- }
-
- // чтение параметров из конфига
- public static string ReadFromConfig(string configfile, string key)
- {
- key += ": ";
- var reader = new StreamReader(configfile);
- while (!reader.EndOfStream)
- {
- string st = reader.ReadLine();
- if (st.StartsWith(key))
- {
- string value = "";
- for (int i = key.Length; i < st.Length; i++)
- {
- if (st[i] == '#') return value;
- if (st[i] == '%')
- {
- bool stop = false;
- string placeholder = "";
- i++;
- while (!stop)
- {
- if (st[i] == '%')
- {
- stop = true;
- value += ReadFromConfig(configfile, placeholder);
- }
- else
- {
- placeholder += st[i];
- i++;
- }
- }
- }
- else value += st[i];
- }
- return value;
- }
- }
- reader.Close();
- return null;
- }
-
- // копирует все файли и папки
- public static void DirCopy(string source_dir, string new_dir, bool Override)
- {
- DirCreate(new_dir);
- List subdirs = new List();
- List files = GetAllFiles(source_dir, ref subdirs);
- for (int i = 0; i < subdirs.Count; i++)
- {
- DirCreate(subdirs[i].Replace(source_dir, new_dir));
- }
- for (int i = 0; i < files.Count; i++)
- {
- string f = files[i].Replace(source_dir, new_dir);
- File.Copy(files[i], f, Override);
- //PublicLog.Log(new string[] {"g", $"file <", "c", files[i], "b", "> have copied to <", "c", newfile, "b", ">\n'" });
- }
- }
-
- // копирует все файли и папки и выдаёт список конфликтующих файлов
- public static void DirCopy(string source_dir, string new_dir, bool owerwrite, out List conflicts)
- {
- conflicts = new List();
- var subdirs = new List();
- var files = GetAllFiles(source_dir, ref subdirs);
- DirCreate(new_dir);
- for (int i = 0; i < subdirs.Count; i++)
- {
- DirCreate(subdirs[i].Replace(source_dir, new_dir));
- }
- for (int i = 0; i < files.Count; i++)
- {
- string newfile = files[i].Replace(source_dir, new_dir);
- if (File.Exists(newfile)) conflicts.Add(newfile);
- File.Copy(files[i], newfile, owerwrite);
- //PublicLog.Log(new string[] {"g", $"file <", "c", files[i], "b", "> have copied to <", "c", newfile, "b", ">\n'" });
- }
- }
-
- // выдает список всех файлов
- public static List GetAllFiles(string dir)
- {
- List all_files = new List();
- string[] cur_files = Directory.GetFiles(dir);
- for (int i = 0; i < cur_files.Length; i++)
- {
- all_files.Add(cur_files[i]);
- //PublicLog.Log(new string[] { "b", "file found: <", "c", cur_files[i], "b", ">\n" });
- }
- string[] cur_subdirs = Directory.GetDirectories(dir);
- for (int i = 0; i < cur_subdirs.Length; i++)
- {
- //PublicLog.Log(new string[] { "b", "subdir found: <", "c", cur_subdirs[i], "b", ">\n" });
- all_files.AddRange(GetAllFiles(cur_subdirs[i]));
- }
- return all_files;
- }
-
- // выдает список всех файлов и подпапок в папке
- public static List GetAllFiles(string dir, ref List all_subdirs)
- {
- List all_files = new List();
- string[] cur_files = Directory.GetFiles(dir);
- for (int i = 0; i < cur_files.Length; i++)
- {
- all_files.Add(cur_files[i]);
- //PublicLog.Log(new string[] { "b", "file found: <", "c", cur_files[i], "b", ">\n" });
- }
- string[] cur_subdirs = Directory.GetDirectories(dir);
- for (int i = 0; i < cur_subdirs.Length; i++)
- {
- all_subdirs.Add(cur_subdirs[i]);
- //PublicLog.Log(new string[] { "b", "subdir found: <", "c", cur_subdirs[i], "b", ">\n" });
- all_files.AddRange(GetAllFiles(cur_subdirs[i], ref all_subdirs));
- }
- return all_files;
- }
-
- // удаляет папку со всеми подпапками и файлами
- public static void DirDelete(string dir)
- {
- var subdirs = new List();
- var files = GetAllFiles(dir, ref subdirs);
- for (int i = 0; i < files.Count; i++)
- File.Delete(files[i]);
- for (int i = subdirs.Count - 1; i >= 0; i--)
- Directory.Delete(subdirs[i]);
- Directory.Delete(dir);
- }
- }
-}
diff --git a/.old 5/updater/dtlib/Hasher.cs b/.old 5/updater/dtlib/Hasher.cs
deleted file mode 100644
index a4403ed..0000000
--- a/.old 5/updater/dtlib/Hasher.cs
+++ /dev/null
@@ -1,59 +0,0 @@
-using System.Collections.Generic;
-using System.IO;
-using System.Security.Cryptography;
-
-namespace updater
-{
- //
- // хеширует массивы байтов алшоритмом SHA256 и файлы алгоримом XXHash32
- //
- public class Hasher
- {
- readonly HashAlgorithm sha256 = SHA256.Create();
- readonly HashAlgorithm xxh32 = XXHash32.Create();
-
- public Hasher() { }
-
- // хеш массива
- public byte[] Hash(byte[] input)
- => sha256.ComputeHash(input);
-
- // хеш из двух массивов
- public byte[] Hash(byte[] input, byte[] salt)
- {
- List rez = new List();
- rez.AddRange(input);
- rez.AddRange(salt);
- return sha256.ComputeHash(rez.ToArray());
- }
-
- // хеш двух массивов зацикленный
- public byte[] HashCycled(byte[] input, byte[] salt, ushort cycles)
- {
- for (uint i = 0; i < cycles; i++)
- {
- input = Hash(input, salt);
- }
- return input;
- }
- // хеш зацикленный
- public byte[] HashCycled(byte[] input, ushort cycles)
- {
- for (uint i = 0; i < cycles; i++)
- {
- input = Hash(input);
- }
- return input;
- }
-
- // хеш файла
- public byte[] HashFile(string filename)
- {
- //var then = DateTime.Now.Hour * 3600 + DateTime.Now.Minute * 60 + DateTime.Now.Second;
- var hash = xxh32.ComputeHash(File.OpenRead(filename));
- //var now = DateTime.Now.Hour * 3600 + DateTime.Now.Minute * 60 + DateTime.Now.Second;
- //PublicLog.Log($"xxh32 hash: {hash.HashToString()} time: {now - then}\n");
- return hash;
- }
- }
-}
diff --git a/.old 5/updater/dtlib/NetWork.cs b/.old 5/updater/dtlib/NetWork.cs
deleted file mode 100644
index c44029b..0000000
--- a/.old 5/updater/dtlib/NetWork.cs
+++ /dev/null
@@ -1,277 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.IO;
-using System.Net;
-using System.Net.Sockets;
-using System.Threading;
-using static updater.Program;
-
-namespace updater
-{
- //
- // весь униврсальный неткод тут
- // большинство методов предназначены для работы с TCP сокетами (Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp))
- //
- public static class NetWork
- {
- /*
- // получение информации (сокет должен быть в режиме Listen)
- public static byte[] GetData(this Socket socket)
- {
- List output = new List();
- byte[] data = new byte[256];
- do
- {
- int amount = socket.Receive(data, data.Length, 0);
- for (int i = 0; i < amount; i++)
- {
- output.Add(data[i]);
- }
- }
- while (socket.Available > 0);
- return output.ToArray();
- }
-
- // отправка запроса и получение ответа на него (сокет должен быть в режиме Listen)
- public static byte[] Request(this Socket socket, string request)
- {
- socket.Send(request.ToBytes());
- return GetData(socket);
- }
- public static byte[] Request(this Socket socket, byte[] request)
- {
- socket.Send(request);
- return GetData(socket);
- }
- */
-
- // скачивание файла с фтп сервера
- public static void FtpDownload(string address, string login, string password, string outfile)
- {
- try
- {
- // debug
- Log("y", "file on server: <", "c", address, "y", ">\nfile on client: <", "c", outfile, "y", ">\n" );
- // создание запроса
- // "ftp://m1net.keenetic.pro:20000/" + @infile
- FtpWebRequest request = (FtpWebRequest)WebRequest.Create(address);
- request.Credentials = new NetworkCredential(login, password);
- request.Method = WebRequestMethods.Ftp.DownloadFile;
- // получение ответа на запрос
- FtpWebResponse response = (FtpWebResponse)request.GetResponse();
- Stream responseStream = response.GetResponseStream();
- FileStream fs = new FileStream(@Directory.GetCurrentDirectory() + '\\' + @outfile, FileMode.Create);
- byte[] buffer = new byte[64];
- int size = 0;
-
- while ((size = responseStream.Read(buffer, 0, buffer.Length)) > 0)
- fs.Write(buffer, 0, size);
- fs.Close();
- response.Close();
- }
- catch (WebException e) { throw new Exception("ftp error:\n" + ((FtpWebResponse)e.Response).StatusDescription + '\n'); }
- }
-
- // запрашивает список серверов с главного сервера
- /*public static ServerObject[] RequestServersList(Socket centralServer)
- {
- List servers = new List();
- string[] lines = Request(centralServer, "a356a4257dbf9d87c77cf87c3c694b30160b6ddfd3db82e7f62320207109e352").ToStr().Split('\n');
- for (int i = 0; i < lines.Length; i++)
- {
- string[] properties = lines[i].Split(',');
- servers.Add(new ServerObject(properties[0], properties[1], properties[2]));
- }
- return servers.ToArray();
- }*/
-
- // пингует айпи с помощью встроенной в винду проги, возвращает задержку
- public static string PingIP(string address)
- {
- Process proc = new Process();
- proc.StartInfo.FileName = "cmd.exe";
- proc.StartInfo.Arguments = "/c @echo off & chcp 65001 >nul & ping -n 5 " + address;
- proc.StartInfo.CreateNoWindow = true;
- proc.StartInfo.UseShellExecute = false;
- proc.StartInfo.RedirectStandardOutput = true;
- proc.Start();
- var outStream = proc.StandardOutput;
- var rezult = outStream.ReadToEnd();
- rezult = rezult.Remove(0, rezult.LastIndexOf('=') + 2);
- return rezult.Remove(rezult.Length - 4);
- }
-
- // пингует сервер (сервер должен уметь принимать такой запрос от клиента), возвращает true если сервер правильно ответил
- /*public static bool Ping(this Socket socket)
- {
- if (Request(socket, "ab53bf045004875fb17086f7f992b0514fb96c038f336e0bfc21609b20303f07").ToStr() == "91b5c0383b75fb1708f00486f7f9b96c038ab3bfc21059b20176f603692b05e0") return true;
- else return false;
- } */
-
- // скачивает файл с помощью FSP протокола
- public static void FSP_Download(this Socket mainSocket, FSP_FileObject file)
- {
- Log(new string[] { "c", $"remote socket accepted download request: {file.ClientFilePath}\n" });
- mainSocket.Send("requesting file download".ToBytes());
- string answ = mainSocket.GetPackageClear(64).ToStr();
- if (answ != "download request accepted")
- throw new Exception($"FSP_Download() error: a download socket recieved an incorrect message: {answ}\n");
-
- mainSocket.SendPackage(256, file.ServerFilePath.ToBytes());
- file.Size = Convert.ToUInt32(mainSocket.GetPackageClear(64).ToStr());
- file.Hash = mainSocket.GetPackageClear(64);
- mainSocket.SendPackage(64, "ready".ToBytes());
- file.Stream = File.Open(file.ClientFilePath, FileMode.Create, FileAccess.Write);
- int packagesCount = 0;
- byte[] buffer = new byte[5120];
- var hashstr = file.Hash.HashToString();
- int fullPackagesCount = SimpleConverter.Truncate(file.Size / buffer.Length);
- // рассчёт скорости
- int seconds = 0;
- var speedCounter = new Timer(true, 1000, () =>
- {
- seconds++;
- Log("c", $"speed= {packagesCount * buffer.Length / (seconds * 1000)} kb/s\n");
- });
- // получение файла
- for (; packagesCount < fullPackagesCount; packagesCount++)
- {
- buffer = mainSocket.GetPackageRaw(buffer.Length);
- file.Stream.Write(buffer, 0, buffer.Length);
- file.Stream.Flush();
- }
- Log(new string[] { "y", " full packages recieved\n" });
- speedCounter.Stop();
- // получение остатка
- mainSocket.SendPackage(64, "remain request".ToBytes());
- buffer = mainSocket.GetPackageRaw((file.Size - fullPackagesCount * 5120).ToInt());
- file.Stream.Write(buffer, 0, buffer.Length);
- file.Stream.Flush();
- file.Stream.Close();
- Log(new string[] { "g", $" file {file.ClientFilePath} ({packagesCount * 5120 + buffer.Length} of {file.Size} bytes) downloaded.\n" });
- }
-
- // отдаёт файл с помощью FSP протокола
- public static void FSP_Upload(this Socket mainSocket)
- {
- mainSocket.SendPackage(64, "download request accepted".ToBytes());
- var file = new FSP_FileObject
- {
- ServerFilePath = mainSocket.GetPackageClear(256).ToStr()
- };
- file.Size = new FileInfo(file.ServerFilePath).Length;
- file.Hash = new Hasher().HashFile(file.ServerFilePath);
- mainSocket.SendPackage(64, file.Size.ToString().ToBytes());
- mainSocket.SendPackage(64, file.Hash);
- if (mainSocket.GetPackageClear(64).ToStr() != "ready") throw new Exception("user socket isn't ready");
- Log(new string[] { "c", $"local socket accepted file download request: {file.ServerFilePath}\n" });
- file.Stream = new FileStream(file.ServerFilePath, FileMode.Open, FileAccess.Read);
- byte[] buffer = new byte[5120];
- var hashstr = file.Hash.HashToString();
- int packagesCount = 0;
- int seconds = 0;
- // рассчёт скорости
- var speedCounter = new Timer(true, 1000, () =>
- {
- seconds++;
- Log("c", $"speed= {packagesCount * buffer.Length / (seconds * 1000)} kb/s\n");
- });
- // отправка файла
- int fullPackagesCount = SimpleConverter.Truncate(file.Size / buffer.Length);
- for (; packagesCount < fullPackagesCount; packagesCount++)
- {
- file.Stream.Read(buffer, 0, buffer.Length);
- mainSocket.SendPackage(buffer.Length, buffer);
- }
- Log(new string[] { "y", " full packages send\n" });
- speedCounter.Stop();
- // досылка остатка
- if (mainSocket.GetPackageClear(64).ToStr() != "remain request")
- throw new Exception("FSP_Upload() error: didn't get remain request");
- buffer = new byte[Convert.ToInt32(file.Size - file.Stream.Position)];
- file.Stream.Read(buffer, 0, buffer.Length);
- mainSocket.SendPackage(buffer.Length, buffer);
- file.Stream.Close();
- Log(new string[] { "g", $" file {file.ServerFilePath} ({packagesCount * 5120 + buffer.Length} of {file.Size} bytes) uploaded.\n" });
- }
-
- // ждёт пакет заданного размера с заданным началом и концом
- // убирает пустые байты в конце пакета
- public static byte[] GetPackageClear(this Socket socket, int packageSize)
- {
- byte[] data = socket.GetPackageRaw(packageSize);
- bool clear = false;
- int toClean = packageSize;
- for (int i = packageSize - 1; !clear; i--)
- {
- if (data[i] == 00) toClean--;
- else clear = true;
- }
- if (toClean != packageSize) data = data.RemoveRange(toClean);
- return data;
- }
- //не убирает пустые байты в конце пакета
- public static byte[] GetPackageRaw(this Socket socket, int packageSize)
- {
- var startsWith = ("<" + packageSize.ToString() + ">").ToBytes();
- packageSize += startsWith.Length;
- byte[] data = new byte[packageSize];
- // цикл выполняется пока не пройдёт 1000 мс
- for (short s = 0; s < 1000; s += 10)
- {
- if (socket.Available >= packageSize)
- {
- socket.Receive(data, packageSize, 0);
- if (data.StartsWith(startsWith)) return data.RemoveRange(0, startsWith.Length);
- else throw new Exception($"GetPackage() error: has got incorrect package\n");
- }
- else Thread.Sleep(10);
- }
- throw new Exception($"GetPackage() error: timeout\n");
- }
-
- // отправляет пакет заданного размера, добавля в конец нули если длина data меньше чем packageSize
- public static void SendPackage(this Socket socket, int packageSize, byte[] data)
- {
- if (data.Length > packageSize) throw new Exception("SendPackage() error: data.Length > packageSize\n");
- var startsWith = ("<" + packageSize.ToString() + ">").ToBytes();
- packageSize += startsWith.Length;
- var list = new List();
- list.AddRange(startsWith);
- list.AddRange(data);
- for (int i = startsWith.Length + data.Length; i < packageSize; i++) list.Add(0);
- socket.Send(list.ToArray());
- }
-
-
- // хранит свойства файла, передаваемого с помощью моего протокола
- public class FSP_FileObject
- {
- public string ServerFilePath;
- public string ClientFilePath;
- public long Size;
- public byte[] Hash;
- public Stream Stream;
-
- public FSP_FileObject() { }
- }
-
- // хранит свойства сервера, полученные с помощью RequestServersList()
- public class ServerObject
- {
- public string Address;
- public string Name;
- public string Speed;
-
- public ServerObject(string address, string name, string speed)
- {
- Address = address;
- Name = name;
- Speed = speed;
- }
-
- public ServerObject() { }
- }
- }
-}
diff --git a/.old 5/updater/dtlib/SimpleConverter.cs b/.old 5/updater/dtlib/SimpleConverter.cs
deleted file mode 100644
index d1a0877..0000000
--- a/.old 5/updater/dtlib/SimpleConverter.cs
+++ /dev/null
@@ -1,88 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace updater
-{
- //
- // содержит методы расширения для различных операций и преобразований
- //
- public static class SimpleConverter
- {
- public static Encoding UTF8 = new UTF8Encoding(false);
- // байты в кодировке UTF8 в строку
- public static string ToStr(this byte[] bytes)
- => UTF8.GetString(bytes);
- public static string ToStr(this List bytes)
- => UTF8.GetString(bytes.ToArray());
-
- // хеш в виде массива байт в строку (хеш изначально не в кодировке UTF8, так что метод выше не работает с ним)
- public static string HashToString(this byte[] hash)
- {
- var builder = new StringBuilder();
- for (int i = 0; i < hash.Length; i++)
- {
- builder.Append(hash[i].ToString("x2"));
- }
- return builder.ToString();
- }
-
- // строку в байты
- public static byte[] ToBytes(this string str)
- => UTF8.GetBytes(str);
-
- // эти методы работают как надо, в отличии от стандартных, которые иногда дуркуют
- public static bool StartsWith(this byte[] source, byte[] startsWith)
- {
- for (int i = 0; i < startsWith.Length; i++)
- {
- if (source[i] != startsWith[i]) return false;
- }
- return true;
- }
-
- public static bool EndsWith(this byte[] source, byte[] endsWith)
- {
- for (int i = 0; i < endsWith.Length; i++)
- {
- if (source[source.Length - endsWith.Length + i] != endsWith[i]) return false;
- }
- return true;
- }
-
- // Math.Truncate принимает как decimal, так и doublе,
- // из-за чего вызов метода так: Math.Truncate(10/3) выдаст ошибку "неоднозначный вызов"
- public static int Truncate(decimal number)
- => Convert.ToInt32(Math.Truncate(number));
-
- // сортирует в порядке возрастания элементы если это возможно, используя стандартный метод list.Sort();
- public static T[] Sort(this T[] array)
- {
- var list = array.ToList();
- list.Sort();
- return list.ToArray();
- }
-
- // массив в лист
- public static List ToList(this T[] input)
- {
- var list = new List();
- list.AddRange(input);
- return list;
- }
-
- // удаление нескольких элементов массива
- public static T[] RemoveRange(this T[] input, int startIndex, int count)
- {
- List list = input.ToList();
- list.RemoveRange(startIndex, count);
- return list.ToArray();
- }
- public static T[] RemoveRange(this T[] input, int startIndex)
- => input.RemoveRange(startIndex, input.Length - startIndex);
-
- //
- public static int ToInt(this T input)
- => Convert.ToInt32(input);
- }
-}
\ No newline at end of file
diff --git a/.old 5/updater/dtlib/TImer.cs b/.old 5/updater/dtlib/TImer.cs
deleted file mode 100644
index 6a571e4..0000000
--- a/.old 5/updater/dtlib/TImer.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-using System;
-using System.Threading;
-
-namespace updater
-{
- //
- // простой и понятный класс для выполнения каких-либо действий в отдельном потоке раз в некоторое время
- //
- public class Timer
- {
- Thread TimerThread;
- bool Repeat;
-
- // таймер сразу запускается
- public Timer(bool repeat, int delay, Action method)
- {
- Repeat = repeat;
- TimerThread = new Thread(() =>
- {
- do
- {
- Thread.Sleep(delay);
- method();
- } while (Repeat);
- });
- TimerThread.Start();
- }
-
- // завершение потока
- public void Stop()
- {
- Repeat = false;
- TimerThread.Abort();
- }
- }
-}
diff --git a/.old 5/updater/dtlib/XXHash.cs b/.old 5/updater/dtlib/XXHash.cs
deleted file mode 100644
index 7d92d5a..0000000
--- a/.old 5/updater/dtlib/XXHash.cs
+++ /dev/null
@@ -1,180 +0,0 @@
-using System;
-using System.Security.Cryptography;
-namespace updater
-{
- //
- // честно взятый с гитхаба алгоритм хеширования
- // выдаёт хеш в виде массива четырёх байтов
- //
- sealed class XXHash32 : HashAlgorithm
- {
- private const uint PRIME32_1 = 2654435761U;
- private const uint PRIME32_2 = 2246822519U;
- private const uint PRIME32_3 = 3266489917U;
- private const uint PRIME32_4 = 668265263U;
- private const uint PRIME32_5 = 374761393U;
- private static readonly Func FuncGetLittleEndianUInt32;
- private static readonly Func FuncGetFinalHashUInt32;
- private uint _Seed32;
- private uint _ACC32_1;
- private uint _ACC32_2;
- private uint _ACC32_3;
- private uint _ACC32_4;
- private uint _Hash32;
- private int _RemainingLength;
- private long _TotalLength = 0;
- private int _CurrentIndex;
- private byte[] _CurrentArray;
-
- static XXHash32()
- {
- if (BitConverter.IsLittleEndian)
- {
- FuncGetLittleEndianUInt32 = new Func((x, i) =>
- {
- unsafe
- {
- fixed (byte* array = x)
- {
- return *(uint*)(array + i);
- }
- }
- });
- FuncGetFinalHashUInt32 = new Func(i => (i & 0x000000FFU) << 24 | (i & 0x0000FF00U) << 8 | (i & 0x00FF0000U) >> 8 | (i & 0xFF000000U) >> 24);
- }
- else
- {
- FuncGetLittleEndianUInt32 = new Func((x, i) =>
- {
- unsafe
- {
- fixed (byte* array = x)
- {
- return (uint)(array[i++] | (array[i++] << 8) | (array[i++] << 16) | (array[i] << 24));
- }
- }
- });
- FuncGetFinalHashUInt32 = new Func(i => i);
- }
- }
-
- // Creates an instance of class by default seed(0).
- //
- public static new XXHash32 Create() => new XXHash32();
-
- // Initializes a new instance of the class by default seed(0).
- public XXHash32() => Initialize(0);
-
- // Initializes a new instance of the class, and sets the to the specified value.
- // Represent the seed to be used for xxHash32 computing.
- public XXHash32(uint seed) => Initialize(seed);
-
- // Gets the value of the computed hash code.
- // Hash computation has not yet completed.
- public uint HashUInt32 => State == 0 ? _Hash32 : throw new InvalidOperationException("Hash computation has not yet completed.");
-
- // Gets or sets the value of seed used by xxHash32 algorithm.
- // Hash computation has not yet completed.
- public uint Seed
- {
- get => _Seed32;
- set
- {
- if (value != _Seed32)
- {
- if (State != 0) throw new InvalidOperationException("Hash computation has not yet completed.");
- _Seed32 = value;
- Initialize();
- }
- }
- }
-
- // Initializes this instance for new hash computing.
- public override void Initialize()
- {
- _ACC32_1 = _Seed32 + PRIME32_1 + PRIME32_2;
- _ACC32_2 = _Seed32 + PRIME32_2;
- _ACC32_3 = _Seed32 + 0;
- _ACC32_4 = _Seed32 - PRIME32_1;
- }
-
- // Routes data written to the object into the hash algorithm for computing the hash.
- // The input to compute the hash code for.
- // The offset into the byte array from which to begin using data.
- // The number of bytes in the byte array to use as data.
- protected override void HashCore(byte[] array, int ibStart, int cbSize)
- {
- if (State != 1) State = 1;
- var size = cbSize - ibStart;
- _RemainingLength = size & 15;
- if (cbSize >= 16)
- {
- var limit = size - _RemainingLength;
- do
- {
- _ACC32_1 = Round32(_ACC32_1, FuncGetLittleEndianUInt32(array, ibStart));
- ibStart += 4;
- _ACC32_2 = Round32(_ACC32_2, FuncGetLittleEndianUInt32(array, ibStart));
- ibStart += 4;
- _ACC32_3 = Round32(_ACC32_3, FuncGetLittleEndianUInt32(array, ibStart));
- ibStart += 4;
- _ACC32_4 = Round32(_ACC32_4, FuncGetLittleEndianUInt32(array, ibStart));
- ibStart += 4;
- } while (ibStart < limit);
- }
- _TotalLength += cbSize;
- if (_RemainingLength != 0)
- {
- _CurrentArray = array;
- _CurrentIndex = ibStart;
- }
- }
-
- // Finalizes the hash computation after the last data is processed by the cryptographic stream object.
- // The computed hash code.
- protected override byte[] HashFinal()
- {
- if (_TotalLength >= 16)
- {
- _Hash32 = RotateLeft32(_ACC32_1, 1) + RotateLeft32(_ACC32_2, 7) + RotateLeft32(_ACC32_3, 12) + RotateLeft32(_ACC32_4, 18);
- }
- else
- {
- _Hash32 = _Seed32 + PRIME32_5;
- }
- _Hash32 += (uint)_TotalLength;
- while (_RemainingLength >= 4)
- {
- _Hash32 = RotateLeft32(_Hash32 + FuncGetLittleEndianUInt32(_CurrentArray, _CurrentIndex) * PRIME32_3, 17) * PRIME32_4;
- _CurrentIndex += 4;
- _RemainingLength -= 4;
- }
- unsafe
- {
- fixed (byte* arrayPtr = _CurrentArray)
- {
- while (_RemainingLength-- >= 1)
- {
- _Hash32 = RotateLeft32(_Hash32 + arrayPtr[_CurrentIndex++] * PRIME32_5, 11) * PRIME32_1;
- }
- }
- }
- _Hash32 = (_Hash32 ^ (_Hash32 >> 15)) * PRIME32_2;
- _Hash32 = (_Hash32 ^ (_Hash32 >> 13)) * PRIME32_3;
- _Hash32 ^= _Hash32 >> 16;
- _TotalLength = State = 0;
- return BitConverter.GetBytes(FuncGetFinalHashUInt32(_Hash32));
- }
-
- private static uint Round32(uint input, uint value) => RotateLeft32(input + (value * PRIME32_2), 13) * PRIME32_1;
-
- private static uint RotateLeft32(uint value, int count) => (value << count) | (value >> (32 - count));
-
- private void Initialize(uint seed)
- {
- HashSizeValue = 32;
- _Seed32 = seed;
- Initialize();
- }
- }
-}
diff --git a/.old 5/updater/updater.csproj b/.old 5/updater/updater.csproj
deleted file mode 100644
index 301f0c6..0000000
--- a/.old 5/updater/updater.csproj
+++ /dev/null
@@ -1,82 +0,0 @@
-
-
-
-
- Debug
- AnyCPU
- {4784D974-A342-4202-9430-90FE5AC00FC7}
- Exe
- updater
- updater
- v4.8
- 512
- true
- true
- publish\
- true
- Disk
- false
- Foreground
- 7
- Days
- false
- false
- true
- 0
- 1.0.0.%2a
- false
- false
- true
-
-
- AnyCPU
- false
- none
- true
- bin\
- DEBUG;TRACE
- prompt
- 4
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- False
- Microsoft .NET Framework 4.8 %28x86 и x64%29
- true
-
-
- False
- .NET Framework 3.5 SP1
- false
-
-
-
-
- del /f /q updater.exe.config
-
-
\ No newline at end of file