Client LuaCsForBarotrauma
EosP2PEndpoint.cs
1 #nullable enable
2 
3 
4 namespace Barotrauma.Networking;
5 
6 sealed class EosP2PEndpoint : P2PEndpoint
7 {
8  public EosInterface.ProductUserId ProductUserId => new EosInterface.ProductUserId((Address as EosP2PAddress)!.EosStringRepresentation);
9 
10  public EosP2PEndpoint(EosInterface.ProductUserId puid) : this(new EosP2PAddress(puid.Value)) { }
11 
12  public EosP2PEndpoint(EosP2PAddress address) : base(address) { }
13 
14  public override string StringRepresentation => (Address as EosP2PAddress)!.StringRepresentation;
15 
16  public override LocalizedString ServerTypeString { get; } = TextManager.Get("PlayerHostedServer");
17 
18  public override int GetHashCode()
19  => (Address as EosP2PAddress)!.GetHashCode();
20 
21  public override bool Equals(object? obj)
22  => obj is EosP2PEndpoint otherEndpoint
23  && ProductUserId == otherEndpoint.ProductUserId;
24 
25  public new static Option<EosP2PEndpoint> Parse(string endpointStr)
26  => EosP2PAddress.Parse(endpointStr).Select(eosAddress => new EosP2PEndpoint(eosAddress));
27 
28  public const string SocketName = "Barotrauma.EosP2PSocket";
29 
31  => new EosP2PConnection(this);
32 }
override bool Equals(object? obj)
override P2PConnection MakeConnectionFromEndpoint()
override int GetHashCode()
const string SocketName
EosInterface.ProductUserId ProductUserId
EosP2PEndpoint(EosInterface.ProductUserId puid)
override string StringRepresentation
EosP2PEndpoint(EosP2PAddress address)
static new Option< EosP2PEndpoint > Parse(string endpointStr)
override LocalizedString ServerTypeString