public static IChannelMatcher Invert(IChannelMatcher matcher) => new InvertMatcher(matcher);
 public InvertMatcher(IChannelMatcher matcher)
 {
     this.matcher = matcher;
 }
 public static void SendPacket(this IChannelGroup channelGroup, PacketDefinition packet, IChannelMatcher matcher)
 => channelGroup.SendPackets(new[] { packet }, matcher);
        public static void SendPackets(this IChannelGroup channelGroup, IEnumerable <PacketDefinition> packets, IChannelMatcher matcher)
        {
            var packetDefinitions = packets as PacketDefinition[] ?? packets.ToArray();

            if (packetDefinitions.Length == 0)
            {
                return;
            }

            if (matcher == null)
            {
                channelGroup?.WriteAndFlushAsync(PacketFactory.Serialize(packetDefinitions));
            }
            else
            {
                channelGroup?.WriteAndFlushAsync(PacketFactory.Serialize(packetDefinitions), matcher);
            }
        }
Exemple #5
0
 public InvertMatcher(IChannelMatcher matcher)
 {
     _matcher = matcher;
 }
        public void SetUp()
        {
            cacheMock = new Mock <ICacheManager>();

            channelMatcher = new ChannelMatcher(cacheMock.Object);
        }
Exemple #7
0
 public static IChannelMatcher Invert(IChannelMatcher matcher) => new InvertMatcher(matcher);
Exemple #8
0
 static ChannelMatchers()
 {
     AllMatcher              = new AllChannelMatcher();
     ServerChannelMatcher    = IsInstanceOf(typeof(IServerChannel));
     NonServerChannelMatcher = IsNotInstanceOf(typeof(IServerChannel));
 }
 public static IChannelMatcher Invert(IChannelMatcher matcher)
 {
     return new InvertMatcher(matcher);
 }
Exemple #10
0
 public static Task SendPacketAsync(this IBroadcastable channelGroup, IPacket packet, IChannelMatcher matcher)
 {
     return(channelGroup.SendPacketsAsync(new[] { packet }, matcher));
 }
 public InvertMatcher(IChannelMatcher matcher)
 {
     this.matcher = matcher;
 }