You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The function: NetworkPlayers.DropPlayers has a bug where player sessions are being leaked in memory over time due to silent failing.
On my fork, I solved the issue by locking a removal instance like this:
private static object lockObject = new();
public static void DropPlayers()
{
lock (lockObject) // Prevents the same action being done multiple times if the loop is very tight.
{
Players.RemoveAll(playerInfo => {
if (playerInfo.Client?.State != QClient.StateType.Dropped)
return false;
if (playerInfo.Client.TimeSinceLastPacket < Constants.ClientTimeoutSeconds)
return false;
LoggerAccessor.LogWarn($"[Quazal NetworkPlayers] - auto-dropping player: {playerInfo.Name}");
if (playerInfo.Client != null)
playerInfo.Client.PlayerInfo = null;
playerInfo.OnDropped();
return true;
});
}
}
This bug will prevent ghost players being returned as game start.
The text was updated successfully, but these errors were encountered:
The function: NetworkPlayers.DropPlayers has a bug where player sessions are being leaked in memory over time due to silent failing.
On my fork, I solved the issue by locking a removal instance like this:
private static object lockObject = new();
public static void DropPlayers()
{
lock (lockObject) // Prevents the same action being done multiple times if the loop is very tight.
{
Players.RemoveAll(playerInfo => {
if (playerInfo.Client?.State != QClient.StateType.Dropped)
return false;
if (playerInfo.Client.TimeSinceLastPacket < Constants.ClientTimeoutSeconds)
return false;
LoggerAccessor.LogWarn($"[Quazal NetworkPlayers] - auto-dropping player: {playerInfo.Name}");
if (playerInfo.Client != null)
playerInfo.Client.PlayerInfo = null;
playerInfo.OnDropped();
return true;
});
}
}
This bug will prevent ghost players being returned as game start.
The text was updated successfully, but these errors were encountered: