OBT/1.2.0(Spring Update)
Sync with Upstream
This commit is contained in:
+8
-10
@@ -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;
|
||||
|
||||
+1
-6
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user