Client LuaCsForBarotrauma
SteamP2PEndpoint.cs
1 #nullable enable
2 
3 namespace Barotrauma.Networking
4 {
6  {
7  public SteamId SteamId => (Address as SteamP2PAddress)!.SteamId;
8 
9  public override string StringRepresentation => SteamId.StringRepresentation;
10 
11  public override LocalizedString ServerTypeString { get; } = TextManager.Get("PlayerHostedServer");
12 
13  public SteamP2PEndpoint(SteamId steamId) : base(new SteamP2PAddress(steamId)) { }
14 
15  public override int GetHashCode()
16  => SteamId.GetHashCode();
17 
18  public override bool Equals(object? obj)
19  => obj is SteamP2PEndpoint otherEndpoint
20  && this.SteamId == otherEndpoint.SteamId;
21 
22  public new static Option<SteamP2PEndpoint> Parse(string endpointStr)
23  => SteamId.Parse(endpointStr).Select(steamId => new SteamP2PEndpoint(steamId));
24 
26  => new SteamP2PConnection(this);
27  }
28 }
static new Option< SteamP2PEndpoint > Parse(string endpointStr)
override LocalizedString ServerTypeString
override bool Equals(object? obj)
override P2PConnection MakeConnectionFromEndpoint()