server-master/srcs/WingsAPI.Game/Networking/Broadcasting/OnlyPlayersBroadcast.cs
2026-02-10 18:21:30 +01:00

12 lines
No EOL
403 B
C#

using System.Collections.Generic;
namespace WingsEmu.Game.Networking.Broadcasting;
public class OnlyPlayersBroadcast : IBroadcastRule
{
private readonly HashSet<long> _players;
public OnlyPlayersBroadcast(params long[] ids) => _players = new HashSet<long>(ids);
public bool Match(IClientSession session) => session.PlayerEntity != null && _players.Contains(session.PlayerEntity.Id);
}