Add server c#
continuous-integration/drone/push Build is failing Details

pull/1/head
Bruno DA COSTA CUNHA 2 years ago
parent ba24f02382
commit d889c466f0

@ -0,0 +1,28 @@
using System;
using System.Net;
using System.Net.Sockets;
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Welcome to LeapHit Multiplayer - Server");
StartServer();
}
static void StartServer()
{
IPEndPoint endPoint = new IPEndPoint(IPAddress.Parse("192.168.41.58"), 3131);
UdpClient server = new UdpClient(endPoint);
Console.WriteLine("Server started, waiting for clients to connect...");
while (true)
{
IPEndPoint clientEndPoint = new IPEndPoint(IPAddress.Any, 0);
byte[] data = server.Receive(ref clientEndPoint);
string dataReceived = System.Text.Encoding.ASCII.GetString(data);
Console.WriteLine("Data received from client: " + dataReceived + " from " + clientEndPoint.ToString());
}
}
}

@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>

@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.2.32526.322
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Server", "Server\Server.csproj", "{356E6AA3-C180-4309-ACCE-C6E66B4DF441}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Client", "Client\Client.csproj", "{1D3CF318-8453-4D0C-B11D-2A6B7E44AA47}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{356E6AA3-C180-4309-ACCE-C6E66B4DF441}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{356E6AA3-C180-4309-ACCE-C6E66B4DF441}.Debug|Any CPU.Build.0 = Debug|Any CPU
{356E6AA3-C180-4309-ACCE-C6E66B4DF441}.Release|Any CPU.ActiveCfg = Release|Any CPU
{356E6AA3-C180-4309-ACCE-C6E66B4DF441}.Release|Any CPU.Build.0 = Release|Any CPU
{1D3CF318-8453-4D0C-B11D-2A6B7E44AA47}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1D3CF318-8453-4D0C-B11D-2A6B7E44AA47}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1D3CF318-8453-4D0C-B11D-2A6B7E44AA47}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1D3CF318-8453-4D0C-B11D-2A6B7E44AA47}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {4BE2DC93-D511-4DA9-9C47-F286E71354BA}
EndGlobalSection
EndGlobal

Binary file not shown.

Binary file not shown.
Loading…
Cancel
Save