initial cs-lua merge work
This commit is contained in:
+9
-9
@@ -182,21 +182,21 @@ namespace Barotrauma.Networking
|
||||
{
|
||||
if (netServer == null) { return; }
|
||||
|
||||
var result = new LuaResult(GameMain.Lua.hook.Call("lidgren.handleConnection", inc));
|
||||
if (!result.IsNull())
|
||||
if (result.Bool())
|
||||
goto ignore;
|
||||
else
|
||||
return;
|
||||
var skipDeny = false;
|
||||
{
|
||||
var result = new LuaResult(GameMain.LuaCs.hook.Call("lidgren.handleConnection", inc));
|
||||
if (!result.IsNull()) {
|
||||
if (result.Bool()) skipDeny = true;
|
||||
else return;
|
||||
}
|
||||
}
|
||||
|
||||
if (connectedClients.Count >= serverSettings.MaxPlayers)
|
||||
if (!skipDeny && connectedClients.Count >= serverSettings.MaxPlayers)
|
||||
{
|
||||
inc.SenderConnection.Deny(DisconnectReason.ServerFull.ToString());
|
||||
return;
|
||||
}
|
||||
|
||||
ignore:
|
||||
|
||||
if (serverSettings.BanList.IsBanned(inc.SenderConnection.RemoteEndPoint.Address, 0, 0, out string banReason))
|
||||
{
|
||||
//IP banned: deny immediately
|
||||
|
||||
+1
-1
@@ -206,7 +206,7 @@ namespace Barotrauma.Networking
|
||||
|
||||
protected void UpdatePendingClient(PendingClient pendingClient)
|
||||
{
|
||||
var result = new LuaResult(GameMain.Lua.hook.Call("handlePendingClient", pendingClient));
|
||||
var result = new LuaResult(GameMain.LuaCs.hook.Call("handlePendingClient", pendingClient));
|
||||
|
||||
if (result.Bool())
|
||||
goto ignore;
|
||||
|
||||
Reference in New Issue
Block a user