Client LuaCsForBarotrauma
LidgrenConnection.cs
1 using Lidgren.Network;
2 
3 namespace Barotrauma.Networking
4 {
5  sealed class LidgrenConnection : NetworkConnection<LidgrenEndpoint>
6  {
7  public readonly NetConnection NetConnection;
8 
9  public LidgrenConnection(NetConnection netConnection) : base(new LidgrenEndpoint(netConnection.RemoteEndPoint))
10  {
11  NetConnection = netConnection;
12  }
13 
14  public override bool AddressMatches(NetworkConnection other)
15  => other is LidgrenConnection { Endpoint: LidgrenEndpoint otherEndpoint }
16  && Endpoint is LidgrenEndpoint endpoint
17  && endpoint.Address == otherEndpoint.Address;
18  }
19 }
readonly Address Address
Definition: Endpoint.cs:11
LidgrenConnection(NetConnection netConnection)
override bool AddressMatches(NetworkConnection other)
Similar to EndpointMatches but ignores port on LidgrenEndpoint