feat: added LiteNetLib networking integration
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
using LiteNetLib;
|
||||
|
||||
namespace Syntriax.Engine.Systems.Network;
|
||||
|
||||
public record class LiteNetLibClientConnection(NetPeer NetPeer) : IConnection
|
||||
{
|
||||
public string Id { get; } = NetPeer.Id.ToString();
|
||||
|
||||
public float Ping => NetPeer.Ping * .001f;
|
||||
public float RoundTrip => NetPeer.RoundTripTime * .001f;
|
||||
|
||||
public int PingMs => NetPeer.Ping;
|
||||
public int RoundTripMs => NetPeer.RoundTripTime;
|
||||
|
||||
public override string ToString() => $"Connection({Id})";
|
||||
}
|
Reference in New Issue
Block a user