OBT/1.2.0(Spring Update)

Sync with Upstream
This commit is contained in:
NotAlwaysTrue
2026-04-25 13:25:41 +08:00
committed by GitHub
parent 5207b381b7
commit 59bc21973a
421 changed files with 24090 additions and 11391 deletions
@@ -33,6 +33,13 @@ namespace Barotrauma.Networking
DualStack = GameSettings.CurrentConfig.UseDualModeSockets,
LocalAddress = serverSettings.ListenIPAddress,
};
if (NetConfig.UseLenientHandshake)
{
// More lenient timeouts for local testing, so the server would start even without perfect conditions
netPeerConfiguration.ConnectionTimeout = 60.0f;
netPeerConfiguration.ResendHandshakeInterval = 5.0f;
netPeerConfiguration.MaximumHandshakeAttempts = 20;
}
netPeerConfiguration.DisableMessageType(
NetIncomingMessageType.DebugMessage
@@ -187,16 +194,7 @@ namespace Barotrauma.Networking
{
if (netServer == null) { return; }
var skipDeny = false;
{
var result = GameMain.LuaCs.Hook.Call<bool?>("lidgren.handleConnection", inc);
if (result != null) {
if (result.Value) skipDeny = true;
else return;
}
}
if (!skipDeny && connectedClients.Count >= serverSettings.MaxPlayers)
if (connectedClients.Count >= serverSettings.MaxPlayers)
{
inc.SenderConnection.Deny(PeerDisconnectPacket.WithReason(DisconnectReason.ServerFull).ToLidgrenStringRepresentation());
return;
@@ -257,12 +257,7 @@ namespace Barotrauma.Networking
protected void UpdatePendingClient(PendingClient pendingClient)
{
var skipRemove = false;
var result = GameMain.LuaCs.Hook.Call<bool?>("handlePendingClient", pendingClient);
if (result != null) skipRemove = result.Value;
if (!skipRemove && connectedClients.Count >= serverSettings.MaxPlayers)
if (connectedClients.Count >= serverSettings.MaxPlayers)
{
RemovePendingClient(pendingClient, PeerDisconnectPacket.WithReason(DisconnectReason.ServerFull));
}