refactor: moved client and server interfaces into their files

This commit is contained in:
Syntriax 2025-08-31 23:09:02 +03:00
parent 8e314f3269
commit 6d159330a1
4 changed files with 22 additions and 19 deletions

@ -0,0 +1 @@
Subproject commit 62048d7abe5b233570d59c7d8043c21a4def2cb6

View File

@ -16,22 +16,3 @@ public interface INetworkCommunicator
INetworkCommunicator SubscribeToPackets<T>(Event<IConnection, T>.EventHandler callback); INetworkCommunicator SubscribeToPackets<T>(Event<IConnection, T>.EventHandler callback);
INetworkCommunicator UnsubscribeFromPackets<T>(Event<IConnection, T>.EventHandler callback); INetworkCommunicator UnsubscribeFromPackets<T>(Event<IConnection, T>.EventHandler callback);
} }
public interface INetworkCommunicatorClient : INetworkCommunicator
{
INetworkCommunicatorClient Connect(string address, int port, string? password = null);
INetworkCommunicatorClient SendToServer<T>(T packet, PacketDelivery packetDelivery = PacketDelivery.ReliableInOrder) where T : class, new();
}
public interface INetworkCommunicatorServer : INetworkCommunicator
{
string Password { get; }
int MaxConnectionCount { get; }
int Port { get; }
INetworkCommunicatorServer Start(int port, int maxConnectionCount, string? password = null);
INetworkCommunicatorServer SendToClient<T>(IConnection connection, T packet, PacketDelivery packetDelivery = PacketDelivery.ReliableInOrder) where T : class, new();
INetworkCommunicatorServer SendToAll<T>(T packet, PacketDelivery packetDelivery = PacketDelivery.ReliableInOrder) where T : class, new();
}

View File

@ -0,0 +1,8 @@
namespace Engine.Systems.Network;
public interface INetworkCommunicatorClient : INetworkCommunicator
{
INetworkCommunicatorClient Connect(string address, int port, string? password = null);
INetworkCommunicatorClient SendToServer<T>(T packet, PacketDelivery packetDelivery = PacketDelivery.ReliableInOrder) where T : class, new();
}

View File

@ -0,0 +1,13 @@
namespace Engine.Systems.Network;
public interface INetworkCommunicatorServer : INetworkCommunicator
{
string Password { get; }
int MaxConnectionCount { get; }
int Port { get; }
INetworkCommunicatorServer Start(int port, int maxConnectionCount, string? password = null);
INetworkCommunicatorServer SendToClient<T>(IConnection connection, T packet, PacketDelivery packetDelivery = PacketDelivery.ReliableInOrder) where T : class, new();
INetworkCommunicatorServer SendToAll<T>(T packet, PacketDelivery packetDelivery = PacketDelivery.ReliableInOrder) where T : class, new();
}