Добавьте файлы проекта.

This commit is contained in:
User
2021-07-19 21:25:07 +03:00
parent 93934555f6
commit 99ba577733
272 changed files with 19884 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
</startup>
</configuration>

View File

@@ -0,0 +1,153 @@
using DTLib;
using System;
using System.IO;
using System.Net;
using System.Net.Sockets;
using System.Threading;
namespace dtlauncher_client
{
class Program
{
static ConsoleGUI gui = new ConsoleGUI(90, 30);
static Socket mainSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
static string logfile = $"logs\\client-{DateTime.UtcNow}.log".Replace(':', '-').Replace(' ', '_');
static bool enter = false;
static void Main()
{
try
{
Console.Title = "dtlauncher";
gui.ReadFromFile("gui\\start_tab.gui");
gui.ShowAll();
NetWork.Log += Log;
// подключение к серверу
/*mainSocket.Connect(new IPEndPoint(Dns.GetHostAddresses(
FileWork.ReadFromConfig("client.cfg", "central server ip"))[0],
Convert.ToInt32(FileWork.ReadFromConfig("client.cfg", "central server port"))));
mainSocket.ReceiveTimeout = 5000;
gui.ChangeLine(3, 4, 'y', "trying to connect to the main server...");
string recieved = mainSocket.Request("new user connection try").ToStr();
if (recieved != "new user connection created")
throw new Exception("can't connect to the main server");
gui.ChangeLine(3, 5, 'g', "connected to the main server");
//NetWork.RequestServersList(mainSocket);
gui.ResetCursor();*/
Input();
}
catch (Exception e)
{
Log("r", "\nerror:\n" + e.Message + "\n" + e.StackTrace + '\n');
Console.ReadLine();
}
}
static string inputText = "";
static void Input()
{
while (true)
{
ConsoleKeyInfo readKeyResult = Console.ReadKey(true); // Считывание ввода
switch (readKeyResult.Key)
{
case ConsoleKey.F1:
gui.ReadFromFile("gui\\files_tab.gui");
for (sbyte i = 3; i < 89; i++)
gui.ChangeColor(i, 1, 'w');
for (sbyte i = 3; i < 13; i++)
gui.ChangeColor(i, 1, 'c');
gui.UpdateAll();
break;
case ConsoleKey.F2:
gui.ReadFromFile("gui\\servers_tab.gui");
for (sbyte i = 3; i < 89; i++)
gui.ChangeColor(i, 1, 'w');
for (sbyte i = 19; i < 31; i++)
gui.ChangeColor(i, 1, 'c');
gui.UpdateAll();
break;
case ConsoleKey.F3:
gui.ReadFromFile("gui\\settings_tab.gui");
for (sbyte i = 3; i < 89; i++)
gui.ChangeColor(i, 1, 'w');
for (sbyte i = 37; i < 50; i++)
gui.ChangeColor(i, 1, 'c');
gui.UpdateAll();
break;
case ConsoleKey.F4:
return;
case ConsoleKey.F5:
Console.Clear();
gui.ShowAll();
break;
case ConsoleKey.F6:
break;
/*case ConsoleKey.F7:
break;
case ConsoleKey.F8:
break;
case ConsoleKey.F9:
break;
case ConsoleKey.F10:
break;
case ConsoleKey.F11:
break;
case ConsoleKey.F12:
break;
case ConsoleKey.UpArrow:
break;
case ConsoleKey.DownArrow:
break;
case ConsoleKey.LeftArrow:
break;
case ConsoleKey.RightArrow:
break;
case ConsoleKey.PageUp:
break;
case ConsoleKey.PageDown:
break;
case ConsoleKey.Home:
break;
case ConsoleKey.End:
break;
case ConsoleKey.Escape:
break;
case ConsoleKey.Enter:
enter = true;
break;
case ConsoleKey.Backspace:
if (inputText.Length > 0)
inputText = inputText.Remove(inputText.Length - 1);
break;*/
default:
inputText += readKeyResult.KeyChar;
break;
}
}
}
static void Log(string color, string msg)
{
ColoredText.WriteColored(color, msg);
FileWork.Log(logfile, msg);
}
static void Log(string[] input)
{
if (input.Length % 2 == 0)
{
ColoredText.WriteColored(input);
string str = "";
for (ushort i = 0; i < input.Length; i++)
{
str += input[++i];
}
FileWork.Log(logfile, str);
}
else
{
throw new Exception("error in Log(): every text string must have color string before");
}
}
}
}

View File

@@ -0,0 +1,35 @@
using System.Reflection;
using System.Runtime.InteropServices;
// Общие сведения об этой сборке предоставляются следующим набором
// набора атрибутов. Измените значения этих атрибутов для изменения сведений,
// связанные с этой сборкой.
[assembly: AssemblyTitle("dtlauncher-client")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("dtlauncher-client")]
[assembly: AssemblyCopyright("Copyright © 2021")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Установка значения False для параметра ComVisible делает типы в этой сборке невидимыми
// для компонентов COM. Если необходимо обратиться к типу в этой сборке через
// из модели COM задайте для атрибута ComVisible этого типа значение true.
[assembly: ComVisible(false)]
// Следующий GUID представляет идентификатор typelib, если этот проект доступен из модели COM
[assembly: Guid("eab95dec-0d9b-4e17-8875-0159358ac240")]
// Сведения о версии сборки состоят из указанных ниже четырех значений:
//
// Основной номер версии
// Дополнительный номер версии
// Номер сборки
// Номер редакции
//
// Можно задать все значения или принять номера сборки и редакции по умолчанию
// используя "*", как показано ниже:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{EAB95DEC-0D9B-4E17-8875-0159358AC240}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>dtlauncher_client</RootNamespace>
<AssemblyName>dtlauncher-client</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Build|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>none</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\DTLib\DTLib.csproj">
<Project>{ce793497-2d5c-42d8-b311-e9b32af9cdfb}</Project>
<Name>DTLib</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>del /f /q dtlauncher-client.exe.config</PostBuildEvent>
</PropertyGroup>
</Project>