public Registration(
     EventSource mask,
     RefEventHandler handler,
     object equalityToken,
     OrderingData?ordering,
     bool referenceEvent)
 {
     Mask           = mask;
     Handler        = handler;
     EqualityToken  = equalityToken;
     Ordering       = ordering;
     ReferenceEvent = referenceEvent;
 }
Ejemplo n.º 2
0
        bool InvokePacketEvent(RefEventHandler <PacketEventArgs> handler, GameClient client,
                               Direction direction, ushort code, ref Memory <byte> payload, bool direct)
        {
            if (handler == null)
            {
                return(true);
            }

            var args = new PacketEventArgs(client, direction, code,
                                           direct ? payload.ToArray() : payload);

            handler(this, ref args);

            if (direct)
            {
                return(true);
            }

            payload = args.Payload;

            return(!args.Silence);
        }