refactor: moved client and server interfaces into their files
This commit is contained in:
1
Engine.Serializers/YamlDotNet
Submodule
1
Engine.Serializers/YamlDotNet
Submodule
Submodule Engine.Serializers/YamlDotNet added at 62048d7abe
@@ -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();
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -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();
|
||||||
|
}
|
||||||
@@ -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();
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user