This commit is contained in:
2022-12-16 00:05:46 +04:00
parent 6bda468607
commit 4d8ed1105a
83 changed files with 1872 additions and 2387 deletions
+6
View File
@@ -0,0 +1,6 @@
namespace Ragon.Server;
public interface INetworkChannel
{
void Send(byte[] data);
}
+8
View File
@@ -0,0 +1,8 @@
namespace Ragon.Server;
public interface INetworkConnection
{
public ushort Id { get; }
public INetworkChannel ReliableChannel { get; }
public INetworkChannel UnreliableChannel { get; }
}
+9
View File
@@ -0,0 +1,9 @@
namespace Ragon.Server;
public interface INetworkListener
{
void OnConnected(INetworkConnection connection);
void OnDisconnected(INetworkConnection connection);
void OnTimeout(INetworkConnection connection);
void OnData(INetworkConnection connection, byte[] data);
}
+8
View File
@@ -0,0 +1,8 @@
namespace Ragon.Server;
public interface INetworkServer
{
public void Stop();
public void Poll();
public void Start(INetworkListener listener, NetworkConfiguration configuration);
}
+9
View File
@@ -0,0 +1,9 @@
namespace Ragon.Server;
public struct NetworkConfiguration
{
public int LimitConnections { get; set; }
public int Port { get; set; }
public uint Protocol { get; set; }
public string Address { get; set; }
}
+13
View File
@@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Ragon.Protocol\Ragon.Protocol.csproj" />
</ItemGroup>
</Project>