当前位置: 首页>>代码示例>>C#>>正文


C# StreamHandler.ReadByte方法代码示例

本文整理汇总了C#中StreamHandler.ReadByte方法的典型用法代码示例。如果您正苦于以下问题:C# StreamHandler.ReadByte方法的具体用法?C# StreamHandler.ReadByte怎么用?C# StreamHandler.ReadByte使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在StreamHandler的用法示例。


在下文中一共展示了StreamHandler.ReadByte方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Read

        public override void Read(StreamHandler reader)
        {
            ContainerSlot = (InventorySlot)reader.ReadByte();
            Slot = (InventorySlot)reader.ReadByte();
            CastId = reader.ReadByte();
            SpellId = reader.ReadUInt32();
            ItemGuid = reader.ReadGuid();
            GlyphSlot = reader.ReadUInt32();
            UnkFlags = reader.ReadByte();

            TargetData.Read(reader);
        }
开发者ID:CarlosX,项目名称:Kamilla.Wow,代码行数:12,代码来源:UseItem.cs

示例2: Read

 public override void Read(StreamHandler reader)
 {
     Entity = reader.ReadGuid();
     Model = reader.ReadUInt32();
     Race = (Races)reader.ReadByte();
     Gender = (Genders)reader.ReadByte();
     Class = (Classes)reader.ReadByte();
     Skin = reader.ReadByte();
     Face = reader.ReadByte();
     Hair = reader.ReadByte();
     HairColor = reader.ReadByte();
     FaceFeatures = reader.ReadByte();
     Guild = reader.ReadGuid();
     Head = reader.ReadUInt32();
     Shoulders = reader.ReadUInt32();
     Body = reader.ReadUInt32();
     Chest = reader.ReadUInt32();
     Waist = reader.ReadUInt32();
     Legs = reader.ReadUInt32();
     Feet = reader.ReadUInt32();
     Wrists = reader.ReadUInt32();
     Hands = reader.ReadUInt32();
     Back = reader.ReadUInt32();
     Tabard = reader.ReadUInt32();
 }
开发者ID:CarlosX,项目名称:Kamilla.Wow,代码行数:25,代码来源:MirrorImageData.cs

示例3: Read

 public override void Read(StreamHandler Reader)
 {
     this.Count = Reader.ReadByte();
     this.Seed = Reader.ReadUInt32();
     this.ClientSeed = Reader.ReadBytes(16);
     this.ServerSeed = Reader.ReadBytes(16);
 }
开发者ID:CarlosX,项目名称:Kamilla.Wow,代码行数:7,代码来源:Authentication.cs

示例4: Read

        public override void Read(StreamHandler reader)
        {
            this.Guid = reader.ReadGuid();
            this.Type = (LootType)reader.ReadByte();
            this.Gold = new Money(reader.ReadUInt32());
            byte itemCount = reader.ReadByte();
            byte currencyCount = reader.ReadByte();

            for (int i = 0; i < itemCount; ++i)
            {
                Item item = reader.ReadStruct<Item>();
                Items.Add(item);
            }

            for (int i = 0; i < currencyCount; ++i)
            {
                Currency currency = reader.ReadStruct<Currency>();
                Currencies.Add(currency);
            }
        }
开发者ID:CarlosX,项目名称:Kamilla.Wow,代码行数:20,代码来源:Loot.cs

示例5: Read

        public override void Read(StreamHandler reader)
        {
            this.Roles = (GroupRoles)reader.ReadUInt32();

            reader.Skip(2); // 2 bools

            uint count = reader.ReadByte();
            Dungeons = new DungeonEntry[count];
            for (uint i = 0; i < count; ++i)
                Dungeons[i] = new DungeonEntry(reader.ReadUInt32());

            reader.Skip(4);

            this.Comment = reader.ReadCString();
        }
开发者ID:CarlosX,项目名称:Kamilla.Wow,代码行数:15,代码来源:LFG.cs

示例6: Read

        public override void Read(StreamHandler Reader)
        {
            byte[] blob = Reader.ReadBytes(256);
            Token = Reader.ReadUInt32();
            UnknownULong = Reader.ReadUInt64();
            ConnectionIndex = Reader.ReadByte();

            // hardcoded in client
            byte[] modulus1 = {
                    0x91, 0xD5, 0x9B, 0xB7, 0xD4, 0xE1, 0x83, 0xA5, 0x22, 0x2B, 0x5F, 0x38, 0xF4, 0xB8, 0x86, 0xFF, 
                    0x32, 0x84, 0x38, 0x2D, 0x99, 0x38, 0x8F, 0xBA, 0xF3, 0xC9, 0x22, 0x5D, 0x51, 0x73, 0x1E, 0x28, 
                    0x87, 0x24, 0x8F, 0xB5, 0xC9, 0xB0, 0x7C, 0x95, 0xD0, 0x6B, 0x5B, 0xF4, 0x94, 0xC5, 0x94, 0x9D, 
                    0xFA, 0x6F, 0x47, 0x3A, 0xA3, 0x86, 0xC0, 0xA8, 0x37, 0xF3, 0x9B, 0xEF, 0x2F, 0xC1, 0xFB, 0xB3, 
                    0xF4, 0x1C, 0x2B, 0x0E, 0xD3, 0x6D, 0x88, 0xBB, 0x02, 0xE0, 0x4E, 0x63, 0xFA, 0x76, 0xE3, 0x43, 
                    0xF9, 0x01, 0xFD, 0x23, 0x5E, 0x6A, 0x0B, 0x14, 0xEC, 0x5E, 0x91, 0x34, 0x0D, 0x0B, 0x4F, 0xA3, 
                    0x5A, 0x46, 0xC5, 0x5E, 0xDC, 0xB5, 0xCD, 0xC1, 0x47, 0x6B, 0x59, 0xCA, 0xFA, 0xA9, 0xBE, 0x24, 
                    0x9F, 0xF5, 0x05, 0x6B, 0xBB, 0x67, 0x8B, 0xB7, 0xE4, 0x3A, 0x43, 0x00, 0x5C, 0x1C, 0xB7, 0xCA, 
                    0x98, 0x90, 0x79, 0x77, 0x6D, 0x05, 0x4F, 0x83, 0xCC, 0xAC, 0x06, 0x2E, 0x50, 0x11, 0x87, 0x23, 
                    0xD8, 0xA6, 0xF7, 0x6F, 0x7A, 0x59, 0x87, 0xA6, 0xDE, 0x5D, 0xD8, 0xEC, 0x44, 0xBE, 0x45, 0x31, 
                    0x7F, 0x8A, 0xF0, 0x58, 0x89, 0x53, 0x74, 0xDF, 0xCC, 0xAD, 0x01, 0x24, 0xD8, 0x19, 0x65, 0x1C, 
                    0x25, 0xD3, 0xE1, 0x6B, 0x8B, 0xDA, 0xFE, 0x1D, 0xA4, 0x2C, 0x8B, 0x25, 0xED, 0x7C, 0xFF, 0x6A, 
                    0xE0, 0x63, 0xD0, 0x52, 0x20, 0x7E, 0x62, 0x49, 0xD2, 0xB3, 0x6B, 0xCC, 0x91, 0x69, 0xA5, 0x08, 
                    0x8B, 0x69, 0x65, 0xFF, 0xB9, 0xC9, 0x17, 0x02, 0x5D, 0xD8, 0x8E, 0x1A, 0x63, 0xD9, 0x2A, 0x7F, 
                    0xDB, 0xE3, 0xF8, 0x76, 0x6D, 0xEA, 0x0E, 0x36, 0x98, 0x78, 0x19, 0xC5, 0x87, 0xBA, 0x6C, 0x20, 
                    0xB6, 0x08, 0x44, 0x04, 0x4C, 0xA8, 0xD5, 0xB6, 0x9D, 0x4D, 0x00, 0x20, 0x40, 0x00, 0x90, 0x04
                };

            // hardcoded in client
            byte[] exp = { 0x01, 0x00, 0x01, 0x00 };

            BigInteger res_bn = BigInteger.ModPow(new BigInteger(blob), new BigInteger(exp), new BigInteger(modulus1));

            FixedBlob = FixBlob(res_bn.ToByteArray());

            ServerHash = new byte[0];
            Port = BitConverter.ToUInt16(FixedBlob, 21);
            IP = new IPAddress(FixedBlob.Take(4).ToArray());

            //byte[] bytes = new byte[0]
            //    .Concat(BitConverter.GetBytes(Port))
            //    .Concat(BitConverter.GetBytes(ip))
            //    .ToArray();

            //SHA1Managed sha1 = new SHA1Managed();
            ComputedHash = new byte[0]; //sha1.ComputeHash(bytes);
        }
开发者ID:SkyFire,项目名称:Kamilla.Wow,代码行数:46,代码来源:ConnectToPacket.cs

示例7: Read

        public override void Read(StreamHandler reader)
        {
            Caster = reader.ReadPackedGuid();
            SpellId = reader.ReadUInt32();
            Duration = reader.ReadInt32();

            HaveFlags = reader.ReadBoolean();
            if (HaveFlags)
            {
                TargetFlags1 = reader.ReadUInt32();
                TargetFlags2 = reader.ReadUInt32();
            }

            Unk_HaveData2 = reader.ReadBoolean();
            if (Unk_HaveData2)
            {
                Unk_Guid1 = reader.ReadPackedGuid();
                Unk_UInt3 = reader.ReadUInt32();
                Unk_Byte = reader.ReadByte();
                if (Unk_Byte == 2)
                    Unk_Guid2 = reader.ReadPackedGuid();
            }
        }
开发者ID:SkyFire,项目名称:Kamilla.Wow,代码行数:23,代码来源:ChannelStart.cs

示例8: Read

        public override void Read(StreamHandler Reader)
        {
            Caster = Reader.ReadPackedGuid();
            CastInvoker = Reader.ReadPackedGuid();
            CastId = Reader.ReadByte();
            SpellId = Reader.ReadUInt32();
            Flags = (CastFlags)Reader.ReadUInt32();
            Unk43 = Reader.ReadUInt32();
            Unk43_2 = Reader.ReadUInt32();

            TargetData.Read(Reader);

            if ((Flags & CastFlags.PredictedPower) != 0)
                PredictedPower = Reader.ReadUInt32();

            if ((Flags & CastFlags.RuneStates) != 0)
            {
                RunesBefore = (RuneStates)Reader.ReadByte();
                RunesAfter = (RuneStates)Reader.ReadByte();
                for (int i = 0; i < RuneCooldowns.Length; ++i)
                    RuneCooldowns[i] = Reader.ReadByte();
            }

            if ((Flags & CastFlags.Ammo) != 0)
            {
                ProjectileDisplayId = Reader.ReadUInt32();
                ProjectileInventoryType = (InventorySlotType)Reader.ReadUInt32();
            }

            if ((Flags & CastFlags.Unk0x04000000) != 0)
            {
                Unk0x04000000_UInt32_1 = Reader.ReadUInt32();
                Unk0x04000000_UInt32_2 = Reader.ReadUInt32();
            }
        }
开发者ID:SkyFire,项目名称:Kamilla.Wow,代码行数:35,代码来源:SpellCasting.cs

示例9: Read

        public sealed override void Read(StreamHandler reader)
        {
            var seq_b = ByteSequence;
            var seq_m = MaskSequence;
            var b_xor = ByteXorValue;

            int size = seq_m.Count(x => x >= 0);
            if (size != seq_m.Length && this.IsMaskSequenceSwapped)
                throw new InvalidOperationException("Cannot have elements in swapped MaskSequence.");
            CheckSequences(seq_b, seq_m);

            if (this.IsMaskSequenceSwapped)
            {
                var seq_m_copy = new int[seq_m.Length];
                for (int i = 0; i < seq_m.Length; )
                {
                    var t = i;
                    for (int j = t + 8 - 1; j >= t; --j, ++i)
                        seq_m_copy[j] = seq_m[i];
                }
                seq_m = seq_m_copy;
            }

            //byte[] data = new byte[size];
            //var src = new BitArray(reader.ReadBytes(size / 8));
            //var dst = new BitArray(size);

            //for (int i = 0; i < size; ++i)
            //    dst[seq_m[i]] = src[i];

            //for (int i = 0; i < seq_b.Length; ++i)
            //{
            //    var el = seq_b[i];
            //    if (el < 0)
            //        ElementRead(reader, el);
            //    else if (dst[el])
            //        data[el] = (byte)(reader.ReadByte() ^ b_xor);
            //}

            byte[] data = new byte[size];
            var dst = new BitArray(size);

            for (int i = 0; i < seq_m.Length; ++i)
            {
                var el = seq_m[i];
                if (el < 0)
                    ElementRead(reader, el);
                else
                    dst[el] = reader.UnalignedReadBit();
            }

            for (int i = 0; i < seq_b.Length; ++i)
            {
                var el = seq_b[i];
                if (el < 0)
                    ElementRead(reader, el);
                else if (dst[el])
                    data[el] = (byte)(reader.ReadByte() ^ b_xor);
            }

            PackedRead(data);
        }
开发者ID:SkyFire,项目名称:Kamilla.Wow,代码行数:62,代码来源:PackedData.cs

示例10: MovementInfo


//.........这里部分代码省略.........
                    .ReadSingle(out this.Position.X);

                if (this.HavePitch)
                    Reader.ReadSingle(out this.Pitch);

                // Fall Data
                if (this.HaveFallData)
                {
                    Reader.ReadUInt32(out this.FallTime);
                    if (this.HaveFallDirection)
                    {
                        Reader
                            .ReadSingle(out this.FallSinAngle)
                            .ReadSingle(out this.FallHorizontalSpeed)
                            .ReadSingle(out this.FallCosAngle);
                    }
                    Reader.ReadSingle(out this.FallVerticalSpeed);
                }

                Reader
                    .ReadXorByte(ref p_guid.Bytes[7])
                    .ReadSingle(out this.Speeds[4])
                    .ReadXorByte(ref p_guid.Bytes[0])
                    .ReadXorByte(ref p_guid.Bytes[5]);

                if (this.TimeStamp != 0)
                    this.TimeStamp = Reader.ReadUInt32();

                Reader
                    .ReadSingle(out this.Position.Z)
                    .ReadSingle(out this.Speeds[6])
                    .ReadXorByte(ref p_guid.Bytes[1])
                    .ReadSingle(out this.Speeds[2])
                    .ReadSingle(out this.Speeds[5])
                    .ReadSingle(out this.Speeds[3])
                    .ReadSingle(out this.Speeds[0])
                    .ReadXorByte(ref p_guid.Bytes[3])
                    .ReadXorByte(ref p_guid.Bytes[4])
                    .ReadXorByte(ref p_guid.Bytes[2])
                    .ReadXorByte(ref p_guid.Bytes[6]);

                if (this.HaveSplineElevation)
                    this.SplineElevation = Reader.ReadSingle();

                this.Position.Y = Reader.ReadSingle();

                if (haveOrientation)
                    this.Orientation = Reader.ReadSingle();

                this.Speeds[1] = Reader.ReadSingle();
            }

            if (field_1C8)
            {
                Console.WriteLine("Error: 16 floats @ 1CC detected !!!");

                Reader.ReadBytes(16 * 4); // 16 floats starting at 1CC
                var field_20C = Reader.ReadByte();
            }

            // transport time
            if (this.HaveTransportTime)
                Reader.ReadUInt32(out this.TransportTime);

            // unk2 ?
            if (field_1AC)
            {
                Console.WriteLine("Error: 3 shorts @ 1AE detected !!!");

                if (field_1B0 != 0)
                    field_1B0 = Reader.ReadUInt16();
                if (field_1B2 != 0)
                    field_1B2 = Reader.ReadUInt16();
                if (field_1AE != 0)
                    field_1AE = Reader.ReadUInt16();
            }

            // go rotation?
            if (this.HaveGameObjectRotation)
                this.GameObjectRotation = Reader.ReadUInt64().UnpackQuaternion();

            // target guid?
            if (this.HaveAttackingTarget)
            {
                fixed (byte* bytes = this.AttackingTarget.Bytes)
                {
                    Reader
                        .ReadXorByte(ref bytes[3])
                        .ReadXorByte(ref bytes[5])
                        .ReadXorByte(ref bytes[0])
                        .ReadXorByte(ref bytes[7])
                        .ReadXorByte(ref bytes[2])
                        .ReadXorByte(ref bytes[4])
                        .ReadXorByte(ref bytes[6])
                        .ReadXorByte(ref bytes[1]);
                }
            }

            this.Guid = guid;
        }
开发者ID:CarlosX,项目名称:Kamilla.Wow,代码行数:101,代码来源:MovementInfo.cs

示例11: ReadObjectCreateUpdate

        private void ReadObjectCreateUpdate(StreamHandler Reader)
        {
            var guid = Reader.ReadPackedGuid();
            var type = (ObjectTypeId)Reader.ReadByte();

            WowObject obj;

            switch (type)
            {
                case ObjectTypeId.Container:
                    obj = new WowContainer();
                    break;
                case ObjectTypeId.Corpse:
                    obj = new WowCorpse();
                    break;
                case ObjectTypeId.DynamicObject:
                    obj = new WowDynamicObject();
                    break;
                case ObjectTypeId.GameObject:
                    obj = new WowGameObject();
                    break;
                case ObjectTypeId.Item:
                    obj = new WowItem();
                    break;
                case ObjectTypeId.Object:
                default:
                    throw new Exception("Cannot instantiate an object with TypeId=" + type);
                case ObjectTypeId.Player:
                    obj = new WowPlayer();
                    break;
                case ObjectTypeId.Unit:
                    obj = new WowUnit();
                    break;
                case ObjectTypeId.AreaTrigger:
                    obj = new WowAreaTrigger();
                    break;
            }

            obj.Guid = guid;
            obj.MovementData = new MovementInfo(Reader);
            obj.SetValues(ReadValues(Reader));
            obj.ResetUpdatedFields();

            if (!m_createdObjects.ContainsKey(guid))
                m_createdObjects.Add(guid, obj);
            else
                Console.WriteLine("Error: Created object duplicate guid {0}", guid);
        }
开发者ID:CarlosX,项目名称:Kamilla.Wow,代码行数:48,代码来源:UpdateData.cs

示例12: ReadValues

        private UpdateFields ReadValues(StreamHandler Reader)
        {
            var values = new UpdateFields();

            byte blocksCount = Reader.ReadByte();
            int[] updatemask = new int[blocksCount];

            for (int i = 0; i < updatemask.Length; ++i)
                updatemask[i] = Reader.ReadInt32();

            var mask = new BitArray(updatemask);

            for (uint i = 0; i < mask.Count; ++i)
                if (mask[(int)i])
                    values[i] = Reader.ReadUInt32();

            return values;
        }
开发者ID:CarlosX,项目名称:Kamilla.Wow,代码行数:18,代码来源:UpdateData.cs

示例13: ReadByteSeq

 protected void ReadByteSeq(StreamHandler reader, ref byte b)
 {
     if (b != 0)
         b ^= reader.ReadByte();
 }
开发者ID:SkyFire,项目名称:Kamilla.Wow,代码行数:5,代码来源:RegularMovementPacket.cs

示例14: FixBlob

        private static byte[] FixBlob(byte[] blob)
        {
            var fixedBlob = new byte[260];

            using (var reader = new StreamHandler(blob))
            {
                fixedBlob[91] = reader.ReadByte();
                fixedBlob[149] = reader.ReadByte();
                fixedBlob[96] = reader.ReadByte();
                fixedBlob[44] = reader.ReadByte();
                fixedBlob[92] = reader.ReadByte();
                fixedBlob[66] = reader.ReadByte();
                fixedBlob[165] = reader.ReadByte();
                fixedBlob[111] = reader.ReadByte();
                fixedBlob[221] = reader.ReadByte();
                fixedBlob[243] = reader.ReadByte();
                fixedBlob[69] = reader.ReadByte();
                fixedBlob[7] = reader.ReadByte();
                fixedBlob[246] = reader.ReadByte();
                fixedBlob[118] = reader.ReadByte();
                fixedBlob[64] = reader.ReadByte();
                fixedBlob[131] = reader.ReadByte();
                fixedBlob[113] = reader.ReadByte();
                fixedBlob[100] = reader.ReadByte();
                fixedBlob[27] = reader.ReadByte();
                fixedBlob[40] = reader.ReadByte();
                fixedBlob[78] = reader.ReadByte();
                fixedBlob[209] = reader.ReadByte();
                fixedBlob[14] = reader.ReadByte();
                fixedBlob[203] = reader.ReadByte();
                fixedBlob[141] = reader.ReadByte();
                fixedBlob[108] = reader.ReadByte();
                fixedBlob[188] = reader.ReadByte();
                fixedBlob[195] = reader.ReadByte();
                fixedBlob[102] = reader.ReadByte();
                fixedBlob[211] = reader.ReadByte();
                fixedBlob[193] = reader.ReadByte();
                fixedBlob[89] = reader.ReadByte();
                fixedBlob[93] = reader.ReadByte();
                fixedBlob[227] = reader.ReadByte();
                fixedBlob[214] = reader.ReadByte();
                fixedBlob[256] = reader.ReadByte();
                fixedBlob[43] = reader.ReadByte();
                fixedBlob[187] = reader.ReadByte();
                fixedBlob[115] = reader.ReadByte();
                fixedBlob[245] = reader.ReadByte();
                fixedBlob[192] = reader.ReadByte();
                fixedBlob[244] = reader.ReadByte();
                fixedBlob[60] = reader.ReadByte();
                fixedBlob[207] = reader.ReadByte();
                fixedBlob[30] = reader.ReadByte();
                fixedBlob[1] = reader.ReadByte();
                fixedBlob[179] = reader.ReadByte();
                fixedBlob[56] = reader.ReadByte();
                fixedBlob[86] = reader.ReadByte();
                fixedBlob[117] = reader.ReadByte();
                fixedBlob[198] = reader.ReadByte();
                fixedBlob[189] = reader.ReadByte();
                fixedBlob[74] = reader.ReadByte();
                fixedBlob[122] = reader.ReadByte();
                fixedBlob[228] = reader.ReadByte();
                fixedBlob[45] = reader.ReadByte();
                fixedBlob[183] = reader.ReadByte();
                fixedBlob[0] = reader.ReadByte();
                fixedBlob[172] = reader.ReadByte();
                fixedBlob[136] = reader.ReadByte();
                fixedBlob[26] = reader.ReadByte();
                fixedBlob[144] = reader.ReadByte();
                fixedBlob[28] = reader.ReadByte();
                fixedBlob[171] = reader.ReadByte();
                fixedBlob[68] = reader.ReadByte();
                fixedBlob[29] = reader.ReadByte();
                fixedBlob[9] = reader.ReadByte();
                fixedBlob[114] = reader.ReadByte();
                fixedBlob[25] = reader.ReadByte();
                fixedBlob[110] = reader.ReadByte();
                fixedBlob[34] = reader.ReadByte();
                fixedBlob[186] = reader.ReadByte();
                fixedBlob[152] = reader.ReadByte();
                fixedBlob[53] = reader.ReadByte();
                fixedBlob[90] = reader.ReadByte();
                fixedBlob[200] = reader.ReadByte();
                fixedBlob[51] = reader.ReadByte();
                fixedBlob[10] = reader.ReadByte();
                fixedBlob[119] = reader.ReadByte();
                fixedBlob[168] = reader.ReadByte();
                fixedBlob[77] = reader.ReadByte();
                fixedBlob[88] = reader.ReadByte();
                fixedBlob[137] = reader.ReadByte();
                fixedBlob[103] = reader.ReadByte();
                fixedBlob[139] = reader.ReadByte();
                fixedBlob[11] = reader.ReadByte();
                fixedBlob[31] = reader.ReadByte();
                fixedBlob[12] = reader.ReadByte();
                fixedBlob[181] = reader.ReadByte();
                fixedBlob[49] = reader.ReadByte();
                fixedBlob[39] = reader.ReadByte();
                fixedBlob[215] = reader.ReadByte();
                fixedBlob[233] = reader.ReadByte();
                fixedBlob[85] = reader.ReadByte();
//.........这里部分代码省略.........
开发者ID:SkyFire,项目名称:Kamilla.Wow,代码行数:101,代码来源:ConnectToPacket.cs

示例15: ReadFromStreamHandler

        private void ReadFromStreamHandler(StreamHandler Reader, WowOpcodes opcode)
        {
            GameMasterMessage = (opcode == WowOpcodes.SMSG_GM_MESSAGECHAT);

            m_type = (ChatMessageType)Reader.ReadByte();
            if (m_type == ChatMessageType.Addon2)
                m_type = ChatMessageType.Addon;

            m_language = (Language)Reader.ReadUInt32();
            m_senderGUID = Reader.ReadGuid();
            m_unknownUInt32 = Reader.ReadUInt32();

            switch (m_type)
            {
                case ChatMessageType.MonsterSay:
                case ChatMessageType.MonsterParty:
                case ChatMessageType.MonsterYell:
                case ChatMessageType.MonsterWhisper:
                case ChatMessageType.MonsterEmote:
                case ChatMessageType.BattleNet:
                case ChatMessageType.RaidBossEmote:
                case ChatMessageType.RaidBossWhisper:
                    Reader.Skip(4);
                    m_senderName = Reader.ReadCString();
                    m_targetGUID = Reader.ReadGuid();
                    if (!m_targetGUID.IsEmpty
                        && !m_targetGUID.IsPlayer
                        && !m_targetGUID.IsPet)
                    {
                        Reader.Skip(4);
                        m_targetName = Reader.ReadCString();
                    }
                    if (m_language == Language.Addon)
                        m_addonPrefix = Reader.ReadCString();
                    Reader.Skip(4);
                    m_text = Reader.ReadCString();
                    m_flags = (ChatMessageFlags)Reader.ReadByte();
                    if (m_type == ChatMessageType.RaidBossEmote || m_type == ChatMessageType.RaidBossWhisper)
                    {
                        m_displayTime = Reader.ReadSingle();
                        m_suspendEvent = Reader.ReadBoolean();
                    }
                    break;
                case ChatMessageType.BGSystemNeutral:
                case ChatMessageType.BGSystemAlliance:
                case ChatMessageType.BGSystemHorde:
                    m_targetGUID = Reader.ReadGuid();
                    if (!m_targetGUID.IsEmpty
                        && !m_targetGUID.IsPlayer)
                    {
                        Reader.Skip(4);
                        m_targetName = Reader.ReadCString();
                    }
                    if (m_language == Language.Addon)
                        m_addonPrefix = Reader.ReadCString();
                    Reader.Skip(4);
                    m_text = Reader.ReadCString();
                    m_flags = (ChatMessageFlags)Reader.ReadByte();
                    break;
                case ChatMessageType.Achievement:
                case ChatMessageType.GuildAchievement:
                    m_targetGUID = Reader.ReadGuid();
                    if (m_language == Language.Addon)
                        m_addonPrefix = Reader.ReadCString();
                    Reader.Skip(4);
                    m_text = Reader.ReadCString();
                    m_flags = (ChatMessageFlags)Reader.ReadByte();
                    m_achievementId = Reader.ReadUInt32();
                    break;
                case ChatMessageType.WhisperForeign:
                    Reader.Skip(4);
                    m_senderName = Reader.ReadCString();
                    m_targetGUID = Reader.ReadGuid();
                    if (m_language == Language.Addon)
                        m_addonPrefix = Reader.ReadCString();
                    Reader.Skip(4);
                    m_text = Reader.ReadCString();
                    m_flags = (ChatMessageFlags)Reader.ReadByte();
                    break;
                default:
                    if (GameMasterMessage)
                    {
                        Reader.Skip(4);
                        m_senderName = Reader.ReadCString();
                    }
                    if (m_type == ChatMessageType.Channel)
                        m_channel = Reader.ReadCString();
                    m_targetGUID = Reader.ReadGuid();
                    if (m_language == Language.Addon)
                        m_addonPrefix = Reader.ReadCString();
                    Reader.Skip(4);
                    m_text = Reader.ReadCString();
                    m_flags = (ChatMessageFlags)Reader.ReadByte();
                    break;
            }
        }
开发者ID:CarlosX,项目名称:Kamilla.Wow,代码行数:96,代码来源:ServerChatMessage.cs


注:本文中的StreamHandler.ReadByte方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。