fix: renamed old classes and fixed packet registration issues
This commit is contained in:
@@ -4,16 +4,16 @@ public interface INetworkCommunicator
|
||||
{
|
||||
event OnPacketReceivedDelegate? OnPacketReceived;
|
||||
|
||||
void Stop();
|
||||
INetworkCommunicator Stop();
|
||||
|
||||
delegate void OnPacketReceivedDelegate(INetworkCommunicator sender, object packet, string from);
|
||||
}
|
||||
|
||||
public interface INetworkCommunicatorClient : INetworkCommunicator
|
||||
{
|
||||
void Connect(string address, int port, string? password = null);
|
||||
INetworkCommunicatorClient Connect(string address, int port, string? password = null);
|
||||
|
||||
void SendToServer(INetworkPacket packet);
|
||||
INetworkCommunicatorClient SendToServer<T>(T packet) where T : class, new();
|
||||
}
|
||||
|
||||
public interface INetworkCommunicatorServer : INetworkCommunicator
|
||||
@@ -22,7 +22,7 @@ public interface INetworkCommunicatorServer : INetworkCommunicator
|
||||
int MaxConnectionCount { get; }
|
||||
int Port { get; }
|
||||
|
||||
void Start(int port, int maxConnectionCount, string? password = null);
|
||||
INetworkCommunicatorServer Start(int port, int maxConnectionCount, string? password = null);
|
||||
|
||||
void SendToClient(string to, INetworkPacket packet);
|
||||
INetworkCommunicatorServer SendToClient<T>(string to, T packet) where T : class, new();
|
||||
}
|
||||
|
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
using Syntriax.Engine.Core;
|
||||
|
||||
namespace Syntriax.Engine.Network;
|
||||
|
Reference in New Issue
Block a user