Client LuaCsForBarotrauma
PipeConnection.cs
1 #nullable enable
2 using System;
3 
4 namespace Barotrauma.Networking
5 {
6  sealed class PipeEndpoint : Endpoint
7  {
8  public override string StringRepresentation => "PIPE";
9 
10  public override LocalizedString ServerTypeString => throw new InvalidOperationException();
11 
12  public PipeEndpoint() : base(new PipeAddress()) { }
13 
14  public override bool Equals(object? obj)
15  => obj is PipeEndpoint;
16 
17  public override int GetHashCode() => 1;
18 
19  public static bool operator ==(PipeEndpoint a, PipeEndpoint b)
20  => true;
21 
22  public static bool operator !=(PipeEndpoint a, PipeEndpoint b)
23  => !(a == b);
24  }
25 
26  sealed class PipeConnection : NetworkConnection<PipeEndpoint>
27  {
28  public PipeConnection(Option<AccountId> accountId) : base(new PipeEndpoint())
29  {
30  SetAccountInfo(new AccountInfo(accountId));
31  }
32 
33  public override bool AddressMatches(NetworkConnection other)
34  => other is PipeConnection;
35  }
36 }
37 
override bool AddressMatches(NetworkConnection other)
Similar to EndpointMatches but ignores port on LidgrenEndpoint
PipeConnection(Option< AccountId > accountId)
static bool operator==(PipeEndpoint a, PipeEndpoint b)
static bool operator!=(PipeEndpoint a, PipeEndpoint b)
override LocalizedString ServerTypeString
override bool Equals(object? obj)