mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-07-29 16:38:37 +00:00
Remove offline players from rooms
This commit is contained in:
parent
aeeb819759
commit
fcdbd46c98
1 changed files with 10 additions and 0 deletions
|
@ -7,6 +7,7 @@ using LBPUnion.ProjectLighthouse.Logging;
|
|||
using LBPUnion.ProjectLighthouse.Types;
|
||||
using LBPUnion.ProjectLighthouse.Types.Levels;
|
||||
using LBPUnion.ProjectLighthouse.Types.Match;
|
||||
using LBPUnion.ProjectLighthouse.Types.Profiles;
|
||||
|
||||
namespace LBPUnion.ProjectLighthouse.Helpers;
|
||||
|
||||
|
@ -166,6 +167,15 @@ public class RoomHelper
|
|||
{
|
||||
lock(Rooms)
|
||||
{
|
||||
// Remove offline players from rooms
|
||||
foreach (Room room in Rooms)
|
||||
{
|
||||
foreach (User player in room.Players.Where(player => player.Status.StatusType == StatusType.Offline))
|
||||
{
|
||||
room.Players.Remove(player);
|
||||
}
|
||||
}
|
||||
|
||||
// Delete old rooms based on host
|
||||
if (host != null)
|
||||
try
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue