2024-02-02 12:20:25 +03:00
|
|
|
using System;
|
2024-02-09 10:00:36 +03:00
|
|
|
|
2024-02-02 12:20:25 +03:00
|
|
|
using LiteNetLib;
|
2024-02-02 12:42:59 +03:00
|
|
|
using LiteNetLib.Utils;
|
2024-02-09 10:00:36 +03:00
|
|
|
|
2024-02-02 12:20:25 +03:00
|
|
|
using Syntriax.Engine.Core.Abstract;
|
|
|
|
|
2024-02-09 10:00:36 +03:00
|
|
|
namespace Syntriax.Engine.Network.Abstract;
|
2024-02-02 12:20:25 +03:00
|
|
|
|
|
|
|
public interface INetworkCommunicator
|
|
|
|
{
|
|
|
|
EventBasedNetListener Listener { get; }
|
|
|
|
NetManager Manager { get; }
|
|
|
|
|
|
|
|
void PollEvents();
|
|
|
|
void Stop();
|
2024-02-02 12:42:59 +03:00
|
|
|
|
2024-02-12 16:35:24 +03:00
|
|
|
void RegisterEntityListener(IEntity entity, Action<NetPacketReader, NetPeer> onDataReceived);
|
2024-02-02 12:42:59 +03:00
|
|
|
void UnregisterEntityListener(IEntity entity);
|
|
|
|
NetDataWriter GetEntityWriter(IEntity entity);
|
2024-02-12 16:35:24 +03:00
|
|
|
NetDataWriter GetMessageWriter(IEntity entity);
|
2024-02-02 12:20:25 +03:00
|
|
|
}
|