diff --git a/Netick/Editor/Netick.Unity.Editor.dll b/Netick/Editor/Netick.Unity.Editor.dll index 1bcb38f..ed8b372 100644 Binary files a/Netick/Editor/Netick.Unity.Editor.dll and b/Netick/Editor/Netick.Unity.Editor.dll differ diff --git a/Netick/Editor/Netick.Unity.Pro.Editor.dll b/Netick/Editor/Netick.Unity.Pro.Editor.dll index bb85012..4a30e43 100644 Binary files a/Netick/Editor/Netick.Unity.Pro.Editor.dll and b/Netick/Editor/Netick.Unity.Pro.Editor.dll differ diff --git a/Netick/Editor/Unity.Netick.CodeGen.dll b/Netick/Editor/Unity.Netick.CodeGen.dll index 9978982..8789d15 100644 Binary files a/Netick/Editor/Unity.Netick.CodeGen.dll and b/Netick/Editor/Unity.Netick.CodeGen.dll differ diff --git a/Netick/Runtime/Netick.Unity.Pro.dll b/Netick/Runtime/Netick.Unity.Pro.dll index f1bd2d5..4142969 100644 Binary files a/Netick/Runtime/Netick.Unity.Pro.dll and b/Netick/Runtime/Netick.Unity.Pro.dll differ diff --git a/Netick/Runtime/Netick.Unity.dll b/Netick/Runtime/Netick.Unity.dll index 813fea3..1820260 100644 Binary files a/Netick/Runtime/Netick.Unity.dll and b/Netick/Runtime/Netick.Unity.dll differ diff --git a/Netick/Runtime/Netick.dll b/Netick/Runtime/Netick.dll index e29c000..6bcb940 100644 Binary files a/Netick/Runtime/Netick.dll and b/Netick/Runtime/Netick.dll differ diff --git a/Transport/LiteNetLib Transport/LiteNetLibTransport.cs b/Transport/LiteNetLib Transport/LiteNetLibTransport.cs index 05d6ff5..a27b716 100644 --- a/Transport/LiteNetLib Transport/LiteNetLibTransport.cs +++ b/Transport/LiteNetLib Transport/LiteNetLibTransport.cs @@ -100,7 +100,7 @@ namespace Netick.Transport void INetEventListener.OnConnectionRequest(ConnectionRequest request) { - if (_clients.Count >= Engine.Config.MaxPlayers) + if (_freeClients.Count == 0) { request.Reject(); return; @@ -118,6 +118,11 @@ namespace Netick.Transport void INetEventListener.OnPeerConnected(NetPeer peer) { + if (_freeClients.Count == 0) + { + peer.Disconnect(); + return; + } var connection = _freeClients.Dequeue(); connection.LNLPeer = peer; _clients. Add(peer, connection); diff --git a/package.json b/package.json index ef85c1a..29eeae7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "com.karrar.netick", - "version": "0.14.60", + "version": "0.14.61", "displayName": "Netick", "description": "A networking solution for Unity", "unity": "2021.3",