fix: renamed old classes and fixed packet registration issues

This commit is contained in:
2025-05-11 11:51:25 +03:00
parent 23a0c8e893
commit 94f7d4acfd
6 changed files with 67 additions and 73 deletions

View File

@@ -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();
}

View File

@@ -1,4 +1,5 @@
using System.Collections.Generic;
using Syntriax.Engine.Core;
namespace Syntriax.Engine.Network;