first commit
This commit is contained in:
commit
4c072483f9
69
Program.cs
Normal file
69
Program.cs
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
using System;
|
||||||
|
using System.Net.Sockets;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading;
|
||||||
|
|
||||||
|
class Client
|
||||||
|
{
|
||||||
|
static void Main(string[] args)
|
||||||
|
{
|
||||||
|
if (args.Length == 0)
|
||||||
|
{
|
||||||
|
Console.WriteLine("Zadejte IP serveru.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
TcpClient client = new TcpClient();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
client.Connect(args[0], 65500);
|
||||||
|
Console.WriteLine("Připojeno k serveru!");
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Console.WriteLine("Nepodařilo se připojit: " + ex.Message);
|
||||||
|
}
|
||||||
|
|
||||||
|
NetworkStream stream = client.GetStream();
|
||||||
|
|
||||||
|
Thread receiveThread = new Thread(() =>
|
||||||
|
{
|
||||||
|
byte[] buffer = new byte[4096];
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
int read = stream.Read(buffer, 0, buffer.Length);
|
||||||
|
if (read == 0)
|
||||||
|
break;
|
||||||
|
Console.Clear();
|
||||||
|
Console.Write(Encoding.UTF8.GetString(buffer, 0, read));
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
receiveThread.Start();
|
||||||
|
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
var key = Console.ReadKey(true).Key;
|
||||||
|
string move = key switch
|
||||||
|
{
|
||||||
|
ConsoleKey.W => "W",
|
||||||
|
ConsoleKey.S => "S",
|
||||||
|
ConsoleKey.A => "A",
|
||||||
|
ConsoleKey.D => "D",
|
||||||
|
_ => "",
|
||||||
|
};
|
||||||
|
if (!string.IsNullOrEmpty(move))
|
||||||
|
{
|
||||||
|
byte[] data = Encoding.UTF8.GetBytes(move);
|
||||||
|
stream.Write(data, 0, data.Length);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
bin/Debug/net8.0/client_labytint
Executable file
BIN
bin/Debug/net8.0/client_labytint
Executable file
Binary file not shown.
23
bin/Debug/net8.0/client_labytint.deps.json
Normal file
23
bin/Debug/net8.0/client_labytint.deps.json
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
{
|
||||||
|
"runtimeTarget": {
|
||||||
|
"name": ".NETCoreApp,Version=v8.0",
|
||||||
|
"signature": ""
|
||||||
|
},
|
||||||
|
"compilationOptions": {},
|
||||||
|
"targets": {
|
||||||
|
".NETCoreApp,Version=v8.0": {
|
||||||
|
"client_labytint/1.0.0": {
|
||||||
|
"runtime": {
|
||||||
|
"client_labytint.dll": {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"libraries": {
|
||||||
|
"client_labytint/1.0.0": {
|
||||||
|
"type": "project",
|
||||||
|
"serviceable": false,
|
||||||
|
"sha512": ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
bin/Debug/net8.0/client_labytint.dll
Normal file
BIN
bin/Debug/net8.0/client_labytint.dll
Normal file
Binary file not shown.
BIN
bin/Debug/net8.0/client_labytint.pdb
Normal file
BIN
bin/Debug/net8.0/client_labytint.pdb
Normal file
Binary file not shown.
12
bin/Debug/net8.0/client_labytint.runtimeconfig.json
Normal file
12
bin/Debug/net8.0/client_labytint.runtimeconfig.json
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"runtimeOptions": {
|
||||||
|
"tfm": "net8.0",
|
||||||
|
"framework": {
|
||||||
|
"name": "Microsoft.NETCore.App",
|
||||||
|
"version": "8.0.0"
|
||||||
|
},
|
||||||
|
"configProperties": {
|
||||||
|
"System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
10
client_labytint.csproj
Normal file
10
client_labytint.csproj
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<OutputType>Exe</OutputType>
|
||||||
|
<TargetFramework>net8.0</TargetFramework>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
</Project>
|
||||||
@ -0,0 +1,4 @@
|
|||||||
|
// <autogenerated />
|
||||||
|
using System;
|
||||||
|
using System.Reflection;
|
||||||
|
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v8.0", FrameworkDisplayName = ".NET 8.0")]
|
||||||
BIN
obj/Debug/net8.0/apphost
Executable file
BIN
obj/Debug/net8.0/apphost
Executable file
Binary file not shown.
22
obj/Debug/net8.0/client_labytint.AssemblyInfo.cs
Normal file
22
obj/Debug/net8.0/client_labytint.AssemblyInfo.cs
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by a tool.
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Reflection;
|
||||||
|
|
||||||
|
[assembly: System.Reflection.AssemblyCompanyAttribute("client_labytint")]
|
||||||
|
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||||
|
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||||
|
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")]
|
||||||
|
[assembly: System.Reflection.AssemblyProductAttribute("client_labytint")]
|
||||||
|
[assembly: System.Reflection.AssemblyTitleAttribute("client_labytint")]
|
||||||
|
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||||
|
|
||||||
|
// Generated by the MSBuild WriteCodeFragment class.
|
||||||
|
|
||||||
@ -0,0 +1 @@
|
|||||||
|
a0d01affce58190a9475fb1bd62fc05fe5513e79fd46bdb01b1fc56ccfda1f25
|
||||||
@ -0,0 +1,13 @@
|
|||||||
|
is_global = true
|
||||||
|
build_property.TargetFramework = net8.0
|
||||||
|
build_property.TargetPlatformMinVersion =
|
||||||
|
build_property.UsingMicrosoftNETSdkWeb =
|
||||||
|
build_property.ProjectTypeGuids =
|
||||||
|
build_property.InvariantGlobalization =
|
||||||
|
build_property.PlatformNeutralAssembly =
|
||||||
|
build_property.EnforceExtendedAnalyzerRules =
|
||||||
|
build_property._SupportedPlatformList = Linux,macOS,Windows
|
||||||
|
build_property.RootNamespace = client_labytint
|
||||||
|
build_property.ProjectDir = /home/twelve/Code/sharp/client_labytint/
|
||||||
|
build_property.EnableComHosting =
|
||||||
|
build_property.EnableGeneratedComInterfaceComImportInterop =
|
||||||
8
obj/Debug/net8.0/client_labytint.GlobalUsings.g.cs
Normal file
8
obj/Debug/net8.0/client_labytint.GlobalUsings.g.cs
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
// <auto-generated/>
|
||||||
|
global using global::System;
|
||||||
|
global using global::System.Collections.Generic;
|
||||||
|
global using global::System.IO;
|
||||||
|
global using global::System.Linq;
|
||||||
|
global using global::System.Net.Http;
|
||||||
|
global using global::System.Threading;
|
||||||
|
global using global::System.Threading.Tasks;
|
||||||
BIN
obj/Debug/net8.0/client_labytint.assets.cache
Normal file
BIN
obj/Debug/net8.0/client_labytint.assets.cache
Normal file
Binary file not shown.
@ -0,0 +1 @@
|
|||||||
|
43f20b0d702f9c6b772dca33671a14fa11825a56ac4210e3ba3e7d39f3ba2a7b
|
||||||
14
obj/Debug/net8.0/client_labytint.csproj.FileListAbsolute.txt
Normal file
14
obj/Debug/net8.0/client_labytint.csproj.FileListAbsolute.txt
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
/home/twelve/Code/sharp/client_labytint/bin/Debug/net8.0/client_labytint
|
||||||
|
/home/twelve/Code/sharp/client_labytint/bin/Debug/net8.0/client_labytint.deps.json
|
||||||
|
/home/twelve/Code/sharp/client_labytint/bin/Debug/net8.0/client_labytint.runtimeconfig.json
|
||||||
|
/home/twelve/Code/sharp/client_labytint/bin/Debug/net8.0/client_labytint.dll
|
||||||
|
/home/twelve/Code/sharp/client_labytint/bin/Debug/net8.0/client_labytint.pdb
|
||||||
|
/home/twelve/Code/sharp/client_labytint/obj/Debug/net8.0/client_labytint.GeneratedMSBuildEditorConfig.editorconfig
|
||||||
|
/home/twelve/Code/sharp/client_labytint/obj/Debug/net8.0/client_labytint.AssemblyInfoInputs.cache
|
||||||
|
/home/twelve/Code/sharp/client_labytint/obj/Debug/net8.0/client_labytint.AssemblyInfo.cs
|
||||||
|
/home/twelve/Code/sharp/client_labytint/obj/Debug/net8.0/client_labytint.csproj.CoreCompileInputs.cache
|
||||||
|
/home/twelve/Code/sharp/client_labytint/obj/Debug/net8.0/client_labytint.dll
|
||||||
|
/home/twelve/Code/sharp/client_labytint/obj/Debug/net8.0/refint/client_labytint.dll
|
||||||
|
/home/twelve/Code/sharp/client_labytint/obj/Debug/net8.0/client_labytint.pdb
|
||||||
|
/home/twelve/Code/sharp/client_labytint/obj/Debug/net8.0/client_labytint.genruntimeconfig.cache
|
||||||
|
/home/twelve/Code/sharp/client_labytint/obj/Debug/net8.0/ref/client_labytint.dll
|
||||||
BIN
obj/Debug/net8.0/client_labytint.dll
Normal file
BIN
obj/Debug/net8.0/client_labytint.dll
Normal file
Binary file not shown.
1
obj/Debug/net8.0/client_labytint.genruntimeconfig.cache
Normal file
1
obj/Debug/net8.0/client_labytint.genruntimeconfig.cache
Normal file
@ -0,0 +1 @@
|
|||||||
|
311cb557223ad8db889fd7fb7c29f285ee28e328b5aa1cd06946f54175eff293
|
||||||
BIN
obj/Debug/net8.0/client_labytint.pdb
Normal file
BIN
obj/Debug/net8.0/client_labytint.pdb
Normal file
Binary file not shown.
BIN
obj/Debug/net8.0/ref/client_labytint.dll
Normal file
BIN
obj/Debug/net8.0/ref/client_labytint.dll
Normal file
Binary file not shown.
BIN
obj/Debug/net8.0/refint/client_labytint.dll
Normal file
BIN
obj/Debug/net8.0/refint/client_labytint.dll
Normal file
Binary file not shown.
66
obj/client_labytint.csproj.nuget.dgspec.json
Normal file
66
obj/client_labytint.csproj.nuget.dgspec.json
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
{
|
||||||
|
"format": 1,
|
||||||
|
"restore": {
|
||||||
|
"/home/twelve/Code/sharp/client_labytint/client_labytint.csproj": {}
|
||||||
|
},
|
||||||
|
"projects": {
|
||||||
|
"/home/twelve/Code/sharp/client_labytint/client_labytint.csproj": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"restore": {
|
||||||
|
"projectUniqueName": "/home/twelve/Code/sharp/client_labytint/client_labytint.csproj",
|
||||||
|
"projectName": "client_labytint",
|
||||||
|
"projectPath": "/home/twelve/Code/sharp/client_labytint/client_labytint.csproj",
|
||||||
|
"packagesPath": "/home/twelve/.nuget/packages/",
|
||||||
|
"outputPath": "/home/twelve/Code/sharp/client_labytint/obj/",
|
||||||
|
"projectStyle": "PackageReference",
|
||||||
|
"configFilePaths": [
|
||||||
|
"/home/twelve/.nuget/NuGet/NuGet.Config"
|
||||||
|
],
|
||||||
|
"originalTargetFrameworks": [
|
||||||
|
"net8.0"
|
||||||
|
],
|
||||||
|
"sources": {
|
||||||
|
"https://api.nuget.org/v3/index.json": {}
|
||||||
|
},
|
||||||
|
"frameworks": {
|
||||||
|
"net8.0": {
|
||||||
|
"targetAlias": "net8.0",
|
||||||
|
"projectReferences": {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"warningProperties": {
|
||||||
|
"warnAsError": [
|
||||||
|
"NU1605"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"restoreAuditProperties": {
|
||||||
|
"enableAudit": "true",
|
||||||
|
"auditLevel": "low",
|
||||||
|
"auditMode": "direct"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"frameworks": {
|
||||||
|
"net8.0": {
|
||||||
|
"targetAlias": "net8.0",
|
||||||
|
"imports": [
|
||||||
|
"net461",
|
||||||
|
"net462",
|
||||||
|
"net47",
|
||||||
|
"net471",
|
||||||
|
"net472",
|
||||||
|
"net48",
|
||||||
|
"net481"
|
||||||
|
],
|
||||||
|
"assetTargetFallback": true,
|
||||||
|
"warn": true,
|
||||||
|
"frameworkReferences": {
|
||||||
|
"Microsoft.NETCore.App": {
|
||||||
|
"privateAssets": "all"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"runtimeIdentifierGraphPath": "/nix/store/xd9xy9mf4wmmlcdk51kzvsrnazqsajfz-dotnet-sdk-8.0.412/share/dotnet/sdk/8.0.412/PortableRuntimeIdentifierGraph.json"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
15
obj/client_labytint.csproj.nuget.g.props
Normal file
15
obj/client_labytint.csproj.nuget.g.props
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||||
|
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||||
|
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
|
||||||
|
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
|
||||||
|
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
|
||||||
|
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">/home/twelve/.nuget/packages/</NuGetPackageRoot>
|
||||||
|
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">/home/twelve/.nuget/packages/</NuGetPackageFolders>
|
||||||
|
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
|
||||||
|
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.11.1</NuGetToolVersion>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||||
|
<SourceRoot Include="/home/twelve/.nuget/packages/" />
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
||||||
2
obj/client_labytint.csproj.nuget.g.targets
Normal file
2
obj/client_labytint.csproj.nuget.g.targets
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||||
|
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" />
|
||||||
71
obj/project.assets.json
Normal file
71
obj/project.assets.json
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
{
|
||||||
|
"version": 3,
|
||||||
|
"targets": {
|
||||||
|
"net8.0": {}
|
||||||
|
},
|
||||||
|
"libraries": {},
|
||||||
|
"projectFileDependencyGroups": {
|
||||||
|
"net8.0": []
|
||||||
|
},
|
||||||
|
"packageFolders": {
|
||||||
|
"/home/twelve/.nuget/packages/": {}
|
||||||
|
},
|
||||||
|
"project": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"restore": {
|
||||||
|
"projectUniqueName": "/home/twelve/Code/sharp/client_labytint/client_labytint.csproj",
|
||||||
|
"projectName": "client_labytint",
|
||||||
|
"projectPath": "/home/twelve/Code/sharp/client_labytint/client_labytint.csproj",
|
||||||
|
"packagesPath": "/home/twelve/.nuget/packages/",
|
||||||
|
"outputPath": "/home/twelve/Code/sharp/client_labytint/obj/",
|
||||||
|
"projectStyle": "PackageReference",
|
||||||
|
"configFilePaths": [
|
||||||
|
"/home/twelve/.nuget/NuGet/NuGet.Config"
|
||||||
|
],
|
||||||
|
"originalTargetFrameworks": [
|
||||||
|
"net8.0"
|
||||||
|
],
|
||||||
|
"sources": {
|
||||||
|
"https://api.nuget.org/v3/index.json": {}
|
||||||
|
},
|
||||||
|
"frameworks": {
|
||||||
|
"net8.0": {
|
||||||
|
"targetAlias": "net8.0",
|
||||||
|
"projectReferences": {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"warningProperties": {
|
||||||
|
"warnAsError": [
|
||||||
|
"NU1605"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"restoreAuditProperties": {
|
||||||
|
"enableAudit": "true",
|
||||||
|
"auditLevel": "low",
|
||||||
|
"auditMode": "direct"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"frameworks": {
|
||||||
|
"net8.0": {
|
||||||
|
"targetAlias": "net8.0",
|
||||||
|
"imports": [
|
||||||
|
"net461",
|
||||||
|
"net462",
|
||||||
|
"net47",
|
||||||
|
"net471",
|
||||||
|
"net472",
|
||||||
|
"net48",
|
||||||
|
"net481"
|
||||||
|
],
|
||||||
|
"assetTargetFallback": true,
|
||||||
|
"warn": true,
|
||||||
|
"frameworkReferences": {
|
||||||
|
"Microsoft.NETCore.App": {
|
||||||
|
"privateAssets": "all"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"runtimeIdentifierGraphPath": "/nix/store/xd9xy9mf4wmmlcdk51kzvsrnazqsajfz-dotnet-sdk-8.0.412/share/dotnet/sdk/8.0.412/PortableRuntimeIdentifierGraph.json"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
8
obj/project.nuget.cache
Normal file
8
obj/project.nuget.cache
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"version": 2,
|
||||||
|
"dgSpecHash": "m45nL8elFuQ=",
|
||||||
|
"success": true,
|
||||||
|
"projectFilePath": "/home/twelve/Code/sharp/client_labytint/client_labytint.csproj",
|
||||||
|
"expectedPackageFiles": [],
|
||||||
|
"logs": []
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user