Skip to content

Commit 60f1bc3

Browse files
committed
Fix for autokick users_max_human_players
1 parent 1bf12d7 commit 60f1bc3

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

out/Left4Lib.vpk

339 Bytes
Binary file not shown.

root/scripts/vscripts/left4lib_users.nut

+13-2
Original file line numberDiff line numberDiff line change
@@ -346,9 +346,9 @@ if (!("Left4Users" in getroottable()))
346346
AdminNotice("\x04" + "Griefer " + player.GetPlayerName() + " joined");
347347
else
348348
AdminNotice("\x01" + "User " + player.GetPlayerName() + " joined");
349-
350-
::Left4Users.HandleMaxHumanPlayers();
351349
}
350+
351+
::Left4Users.HandleMaxHumanPlayers();
352352
}
353353

354354
::Left4Users.AdminNotice <- function (msg)
@@ -461,6 +461,17 @@ if (!("Left4Users" in getroottable()))
461461
SendToServerConsole("kickid " + kickid + " " + Left4Lib.Settings.users_full_kick_reason);
462462
::Left4Lib.Logger.Info("Player with steam ID " + kickid + " kicked with reason: " + Left4Lib.Settings.users_full_kick_reason);
463463

464+
// Must remove the kicked player from OnlineUsers to avoid multiple kick to the same player when multiple joined events in the same frame
465+
foreach (userid, usr in OnlineUsers)
466+
{
467+
if (usr.steamid == kickid)
468+
{
469+
delete OnlineUsers[userid];
470+
::Left4Lib.Logger.Debug("Deleted from OnlineUsers");
471+
break;
472+
}
473+
}
474+
464475
return kickid;
465476
}
466477

0 commit comments

Comments
 (0)