public BattlenetParserAttribute(BattlenetOpcode opcode, BattlenetChannel channel, Direction direction)
 {
     Header = new BattlenetPacketHeader();
     Header.Opcode = (ushort)opcode;
     Header.Channel = channel;
     Header.Direction = direction;
 }
 public BattlenetParserAttribute(BattlenetOpcode opcode, BattlenetChannel channel, Direction direction)
 {
     Header = new BattlenetPacketHeader
     {
         Opcode = (ushort) opcode,
         Channel = channel,
         Direction = direction
     };
 }
Esempio n. 3
0
        public BattlenetPacket(Packet packet)
        {
            Stream = packet;

            Header = new BattlenetPacketHeader {
                Opcode = Read <byte>(6)
            };

            if (Read <bool>(1))
            {
                Header.Channel = (BattlenetChannel)Read <byte>(4);
            }

            Header.Direction = packet.Direction;
        }
Esempio n. 4
0
        public override bool Equals(object obj)
        {
            BattlenetPacketHeader that = obj as BattlenetPacketHeader;

            if (Opcode != that?.Opcode)
            {
                return(false);
            }
            if (Channel != that.Channel)
            {
                return(false);
            }

            return(Direction == that.Direction);
        }
        public BattlenetPacket(Packet packet)
        {
            BitStream = new BattlenetBitStream(packet);
            Stream    = packet;

            ushort opcode = BitStream.Read <byte>(0, 6);

            BattlenetChannel channel = BattlenetChannel.Authentication;

            if (ReadBoolean())
            {
                channel = (BattlenetChannel)BitStream.Read <byte>(0, 4);
            }

            Header = new BattlenetPacketHeader(opcode, channel, packet.Direction);
        }
 private BattlenetParserAttribute(ushort opcode, BattlenetChannel channel, Direction direction)
 {
     Header = new BattlenetPacketHeader
     {
         Opcode = opcode,
         Channel = channel,
         Direction = direction
     };
 }
 private BattlenetParserAttribute(ushort opcode, BattlenetChannel channel, Direction direction)
 {
     Header = new BattlenetPacketHeader(opcode, channel, direction);
 }