Unstable 1.8.4.0

This commit is contained in:
Markus Isberg
2025-03-12 12:56:27 +00:00
parent a4c3e868e4
commit a4a3427e4e
627 changed files with 29860 additions and 10018 deletions
@@ -5,4 +5,6 @@ namespace Barotrauma.Networking;
sealed class EosP2PConnection : P2PConnection<EosP2PEndpoint>
{
public EosP2PConnection(EosP2PEndpoint endpoint) : base(endpoint) { }
public override bool AddressMatches(NetworkConnection other)
=> Endpoint == other.Endpoint;
}
@@ -10,5 +10,10 @@ namespace Barotrauma.Networking
{
NetConnection = netConnection;
}
public override bool AddressMatches(NetworkConnection other)
=> other is LidgrenConnection { Endpoint: LidgrenEndpoint otherEndpoint }
&& Endpoint is LidgrenEndpoint endpoint
&& endpoint.Address == otherEndpoint.Address;
}
}
@@ -38,6 +38,11 @@ namespace Barotrauma.Networking
public bool EndpointMatches(Endpoint endPoint)
=> Endpoint == endPoint;
/// <summary>
/// Similar to EndpointMatches but ignores port on LidgrenEndpoint
/// </summary>
public abstract bool AddressMatches(NetworkConnection other);
public NetworkConnectionStatus Status = NetworkConnectionStatus.Disconnected;
public void SetAccountInfo(AccountInfo newInfo)
@@ -29,6 +29,9 @@ namespace Barotrauma.Networking
{
SetAccountInfo(new AccountInfo(accountId));
}
public override bool AddressMatches(NetworkConnection other)
=> other is PipeConnection;
}
}
@@ -3,7 +3,10 @@
sealed class SteamP2PConnection : P2PConnection<SteamP2PEndpoint>
{
public SteamP2PConnection(SteamId steamId) : this(new SteamP2PEndpoint(steamId)) { }
public SteamP2PConnection(SteamP2PEndpoint endpoint) : base(endpoint) { }
public override bool AddressMatches(NetworkConnection other)
=> Endpoint == other.Endpoint;
}
}