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


C# ByteStream.GetPosition方法代码示例

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


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

示例1: ExplorePlayerProfile

        public void ExplorePlayerProfile(StreamWriter OutputStream, ByteStream Buffer, PacketDirection Direction)
        {
            OutputStream.WriteLine("{0, -5}: Checksum = {1:X}", Buffer.GetPosition(), Buffer.ReadUInt32());
            OutputStream.WriteLine("{0, -5}: ChecksumSize = {1:X}", Buffer.GetPosition(), Buffer.ReadUInt32());
            OutputStream.WriteLine("{0, -5}: Unknown = {1:X}", Buffer.GetPosition(), Buffer.ReadUInt32());
            OutputStream.WriteLine("{0, -5}: Unknown = {1:X}", Buffer.GetPosition(), Buffer.ReadUInt32());

            OutputStream.WriteLine("");
            OutputStream.WriteLine("{0, -5}: Gender = {1}", Buffer.GetPosition(), Buffer.ReadByte());
            OutputStream.WriteLine("{0, -5}: Race = {1}", Buffer.GetPosition(), Buffer.ReadUInt32());
            OutputStream.WriteLine("{0, -5}: Class = {1}", Buffer.GetPosition(), Buffer.ReadByte());
            OutputStream.WriteLine("{0, -5}: Level = {1}", Buffer.GetPosition(), Buffer.ReadByte());
            OutputStream.WriteLine("{0, -5}: Level1 = {1}", Buffer.GetPosition(), Buffer.ReadByte());

            OutputStream.WriteLine("");
            UInt32 BindCount = Buffer.ReadUInt32();
            OutputStream.WriteLine("{0, -5}: BindCount = {1}", Buffer.GetPosition() - 4, BindCount);

            for (int i = 0; i < BindCount; ++i)
            {
                OutputStream.WriteLine("{0, -5}:   Bind: {1} Zone: {2} XYZ: {3},{4},{5} Heading: {6}",
                    Buffer.GetPosition(), i, Buffer.ReadUInt32(), Buffer.ReadSingle(), Buffer.ReadSingle(), Buffer.ReadSingle(), Buffer.ReadSingle());
            }

            OutputStream.WriteLine("");
            OutputStream.WriteLine("{0, -5}: Deity = {1}", Buffer.GetPosition(), Buffer.ReadUInt32());
            OutputStream.WriteLine("{0, -5}: Intoxication = {1}", Buffer.GetPosition(), Buffer.ReadUInt32());
            OutputStream.WriteLine("");

            //Buffer.SkipBytes(8); // Deity, intoxication

            UInt32 UnknownCount = Buffer.ReadUInt32();

            OutputStream.WriteLine("{0, -5}: Unknown Count = {1}", Buffer.GetPosition() - 4, UnknownCount);



            for (int i = 0; i < UnknownCount; ++i)
            {
                OutputStream.WriteLine("{0, -5}: Unknown : {1}, Value = {2}", Buffer.GetPosition(), i, Buffer.ReadUInt32());
                //Buffer.SkipBytes(4);
            }

            UInt32 EquipmentCount = Buffer.ReadUInt32();

            OutputStream.WriteLine("{0, -5}: EquipmentCount = {1}", Buffer.GetPosition() - 4, EquipmentCount);

            for (int i = 0; i < EquipmentCount; ++i)
            {
                OutputStream.Write("{0, -5}: Equip: {1} Values: ", Buffer.GetPosition(), i);
                for (int j = 0; j < 5; ++j)
                    OutputStream.Write("{0} ", Buffer.ReadUInt32());

                OutputStream.WriteLine("");
                //Buffer.SkipBytes(20);
            }

            UInt32 EquipmentCount2 = Buffer.ReadUInt32();

            OutputStream.WriteLine("{0, -5}: EquipmentCount2 = {1}", Buffer.GetPosition() - 4, EquipmentCount2);

            for (int i = 0; i < EquipmentCount2; ++i)
            {
                OutputStream.Write("{0, -5}: Equip2: {1} Values: ", Buffer.GetPosition(), i);
                for (int j = 0; j < 5; ++j)
                    OutputStream.Write("{0} ", Buffer.ReadUInt32());

                OutputStream.WriteLine("");
                //Buffer.SkipBytes(20);
            }



            UInt32 TintCount = Buffer.ReadUInt32();

            OutputStream.WriteLine("{0, -5}: TintCount = {1}", Buffer.GetPosition() - 4, TintCount);

            for (int i = 0; i < TintCount; ++i)
            {
                OutputStream.WriteLine("{0, -5}: TintCount : {1}, Value = {2}", Buffer.GetPosition(), i, Buffer.ReadUInt32());
                //Buffer.SkipBytes(4);
            }

            UInt32 TintCount2 = Buffer.ReadUInt32();

            OutputStream.WriteLine("{0, -5}: TintCount2 = {1}", Buffer.GetPosition() - 4, TintCount2);

            for (int i = 0; i < TintCount; ++i)
            {
                OutputStream.WriteLine("{0, -5}: TintCount2 : {1}, Value = {2}", Buffer.GetPosition(), i, Buffer.ReadUInt32());
                //Buffer.SkipBytes(4);
            }

            OutputStream.WriteLine("{0, -5}: Hair Color = {1}", Buffer.GetPosition(), Buffer.ReadByte());
            OutputStream.WriteLine("{0, -5}: Beard Color = {1}", Buffer.GetPosition(), Buffer.ReadByte());
            OutputStream.WriteLine("{0, -5}: Unknown = {1}", Buffer.GetPosition(), Buffer.ReadUInt32());
            OutputStream.WriteLine("{0, -5}: Eye1 Color = {1}", Buffer.GetPosition(), Buffer.ReadByte());
            OutputStream.WriteLine("{0, -5}: Eye2 Color = {1}", Buffer.GetPosition(), Buffer.ReadByte());
            OutputStream.WriteLine("{0, -5}: Hairstyle = {1}", Buffer.GetPosition(), Buffer.ReadByte());
            OutputStream.WriteLine("{0, -5}: Beard = {1}", Buffer.GetPosition(), Buffer.ReadByte());
//.........这里部分代码省略.........
开发者ID:Codex-NG,项目名称:Server,代码行数:101,代码来源:PatchFebruary11-2013.cs

示例2: DecodeItemPacket

        public void DecodeItemPacket(StreamWriter OutputStream, ByteStream Buffer, PacketDirection Direction)
        {
            String UnkString = Buffer.ReadString(false);
            //Buffer.SkipBytes(88);
            Buffer.SkipBytes(35);
            UInt32 RecastTimer = Buffer.ReadUInt32();
            Buffer.SkipBytes(49);
            String ItemName = Buffer.ReadString(false);
            String ItemLore = Buffer.ReadString(false);
            String ItemIDFile = Buffer.ReadString(false);
            Buffer.ReadString(false);

            UInt32 ItemID = Buffer.ReadUInt32();
            OutputStream.WriteLine("ItemName: {0}, IDFile: {1}", ItemName, ItemIDFile);
            OutputStream.WriteLine("Recast Time: {0:X}", RecastTimer);
            Buffer.SkipBytes(251);

            String CharmFile = Buffer.ReadString(false);

            OutputStream.WriteLine("CharmFile: {0}", CharmFile);

            Buffer.SkipBytes(74);   // Secondary BS

            String FileName = Buffer.ReadString(false);
            OutputStream.WriteLine("FileName: {0}", CharmFile);

            Buffer.SkipBytes(76);   // Tertiary BS

            UInt32 ClickEffect = Buffer.ReadUInt32();
            //Buffer.SkipBytes(26);   // ClickEffect Struct
            //OutputStream.WriteLine("Click Effect - effect : {0}", Buffer.ReadUInt32());
            OutputStream.WriteLine("Click Effect - level2 : {0}", Buffer.ReadByte());
            OutputStream.WriteLine("Click Effect - Type : {0}", Buffer.ReadUInt32());
            OutputStream.WriteLine("Click Effect - level : {0}", Buffer.ReadByte());
            OutputStream.WriteLine("Click Effect - Max Charges : {0}", Buffer.ReadUInt32());
            OutputStream.WriteLine("Click Effect - Cast Time : {0}", Buffer.ReadUInt32());
            OutputStream.WriteLine("Click Effect - Recast : {0}", Buffer.ReadUInt32());
            OutputStream.WriteLine("Click Effect - Recast Type: {0}", Buffer.ReadUInt32());
            OutputStream.WriteLine("Click Effect - Unk5: {0}", Buffer.ReadUInt32());
            String ClickName = Buffer.ReadString(false);
            OutputStream.WriteLine("ClickEffect = {0}, ClickName = {1}", ClickEffect, ClickName);
            Buffer.ReadUInt32();

            ClickEffect = Buffer.ReadUInt32();
            Buffer.SkipBytes(26);   // ClickEffect Struct
            ClickName = Buffer.ReadString(false);
            OutputStream.WriteLine("ClickEffect = {0}, ClickName = {1}", ClickEffect, ClickName);
            Buffer.ReadUInt32();

            ClickEffect = Buffer.ReadUInt32();
            Buffer.SkipBytes(26);   // ClickEffect Struct
            ClickName = Buffer.ReadString(false);
            OutputStream.WriteLine("ClickEffect = {0}, ClickName = {1}", ClickEffect, ClickName);
            Buffer.ReadUInt32();

            ClickEffect = Buffer.ReadUInt32();
            Buffer.SkipBytes(26);   // ClickEffect Struct
            ClickName = Buffer.ReadString(false);
            OutputStream.WriteLine("ClickEffect = {0}, ClickName = {1}", ClickEffect, ClickName);
            Buffer.ReadUInt32();

            ClickEffect = Buffer.ReadUInt32();
            Buffer.SkipBytes(26);   // ClickEffect Struct
            ClickName = Buffer.ReadString(false);
            OutputStream.WriteLine("ClickEffect = {0}, ClickName = {1}", ClickEffect, ClickName);
            Buffer.ReadUInt32();

            ClickEffect = Buffer.ReadUInt32();
            Buffer.SkipBytes(26);   // ClickEffect Struct
            ClickName = Buffer.ReadString(false);
            OutputStream.WriteLine("ClickEffect = {0}, ClickName = {1}", ClickEffect, ClickName);
            Buffer.ReadUInt32();

            //Buffer.SkipBytes(167);
            Buffer.SkipBytes(125);
            //Byte UnkByte = Buffer.ReadByte();
            //OutputStream.WriteLine("Unk byte is {0:X}", UnkByte);
            OutputStream.WriteLine("At String ? Pos is {0}", Buffer.GetPosition());
            UnkString = Buffer.ReadString(false);
            OutputStream.WriteLine("Unk String is {0}", UnkString);
            Buffer.SkipBytes(41);
            UInt32 SubItemCount = Buffer.ReadUInt32();

            OutputStream.WriteLine("Buffer Pos: {0}, SubItemCount = {1}", Buffer.GetPosition(), SubItemCount);

            for (int j = 0; j < SubItemCount; ++j)
            {
                Buffer.ReadUInt32();
                DecodeItemPacket(OutputStream, Buffer, Direction);
            }


        }
开发者ID:Codex-NG,项目名称:Server,代码行数:93,代码来源:PatchFebruary11-2013.cs

示例3: GetZoneNumber


//.........这里部分代码省略.........
            SomethingCount = Buffer.ReadUInt32();

            for (int i = 0; i < SomethingCount; ++i)
            {
                Buffer.SkipBytes(4);
            }

            SomethingCount = Buffer.ReadUInt32();

            for (int i = 0; i < SomethingCount; ++i)
            {
                Buffer.SkipBytes(4);
            }

            UInt32 SpellBookSlots = Buffer.ReadUInt32();

            for (int i = 0; i < SpellBookSlots; ++i)
            {
                Buffer.SkipBytes(4);
            }

            UInt32 SpellMemSlots = Buffer.ReadUInt32();

            for (int i = 0; i < SpellMemSlots; ++i)
            {
                Buffer.SkipBytes(4);
            }

            SomethingCount = Buffer.ReadUInt32();

            for (int i = 0; i < SomethingCount; ++i)
            {
                Buffer.SkipBytes(4);
            }

            Buffer.SkipBytes(1);

            UInt32 BuffCount = Buffer.ReadUInt32();

            for (int i = 0; i < BuffCount; ++i)
            {
                Buffer.SkipBytes(80);
            }

            UInt32 Plat = Buffer.ReadUInt32();
            UInt32 Gold = Buffer.ReadUInt32();
            UInt32 Silver = Buffer.ReadUInt32();
            UInt32 Copper = Buffer.ReadUInt32();

            Buffer.SkipBytes(16); // Money on cursor

            Buffer.SkipBytes(20);

            UInt32 AASpent = Buffer.ReadUInt32();

            Buffer.SkipBytes(30);

            UInt32 BandolierCount = Buffer.ReadUInt32();

            for (int i = 0; i < BandolierCount; ++i)
            {
                Buffer.ReadString(false);

                Buffer.ReadString(false);
                Buffer.SkipBytes(8);

                Buffer.ReadString(false);
                Buffer.SkipBytes(8);

                Buffer.ReadString(false);
                Buffer.SkipBytes(8);

                Buffer.ReadString(false);
                Buffer.SkipBytes(8);
            }

            UInt32 PotionCount = Buffer.ReadUInt32();

            for (int i = 0; i < PotionCount; ++i)
            {
                Buffer.ReadString(false);
                Buffer.SkipBytes(8);
            }

            Buffer.SkipBytes(100);

            int CurrentPosition = Buffer.GetPosition();

            String PlayerName = Buffer.ReadString(false);

            Buffer.SetPosition(CurrentPosition + 64);

            Buffer.SkipBytes(96);

            // This is what I am after ...

            UInt16 ZoneID = Buffer.ReadUInt16();

            return ZoneID;
        }
开发者ID:josheb,项目名称:emu_dc,代码行数:101,代码来源:PatchDecember10-2012.cs

示例4: ExploreZoneEntry

        public void ExploreZoneEntry(StreamWriter OutputStream, ByteStream Buffer, PacketDirection Direction)
        {
            if (Direction != PacketDirection.ServerToClient)
                return;

            string FirstName = Buffer.ReadString(false);

            OutputStream.WriteLine("Name = {0}", FirstName);

            UInt32 SpawnID = Buffer.ReadUInt32();

            OutputStream.WriteLine("SpawnID = {0}", SpawnID);

            byte Level = Buffer.ReadByte();

            OutputStream.WriteLine("Level = {0}", Level);

            Buffer.SkipBytes(4);

            byte IsNPC = Buffer.ReadByte();

            OutputStream.WriteLine("IsNPC = {0}", IsNPC);

            UInt32 Bitfield = Buffer.ReadUInt32();
            OutputStream.WriteLine("Name: {0}, Bitfield: {1}", FirstName, Convert.ToString(Bitfield, 2));

            byte OtherData = Buffer.ReadByte();

            OutputStream.WriteLine("OtherData = {0}", OtherData);

            Buffer.SkipBytes(8);

            if ((OtherData & 1) > 0)
            {
                OutputStream.WriteLine("OD:     {0}", Buffer.ReadString(false));
                OutputStream.WriteLine("OD:     {0}", Buffer.ReadString(false));
                OutputStream.WriteLine("OD:     {0}", Buffer.ReadString(false));
                Buffer.SkipBytes(53);
            }

            if ((OtherData & 4) > 0)
            {
                OutputStream.WriteLine("Aura:     {0}", Buffer.ReadString(false));
                OutputStream.WriteLine("Aura:     {0}", Buffer.ReadString(false));
                Buffer.SkipBytes(54);
            }

            byte Properties = Buffer.ReadByte();
            OutputStream.WriteLine("Properties = {0}, Offset now {1}", Properties, Buffer.GetPosition());

            UInt32 BodyType = 0;

            if(Properties > 0)
                BodyType = Buffer.ReadUInt32();

            OutputStream.WriteLine("Bodytype = {0}",  BodyType);

            if (Properties != 1)
                OutputStream.WriteLine("XXXX Properties is {0}", Properties);

            for (int i = 1; i < Properties; ++i)
                OutputStream.WriteLine("   Prop: {0}", Buffer.ReadUInt32());

            OutputStream.WriteLine("Position is now {0}", Buffer.GetPosition());

            byte HP = Buffer.ReadByte();
            byte HairColor = Buffer.ReadByte();
            byte BeardColor = Buffer.ReadByte();
            byte Eye1 = Buffer.ReadByte();
            byte Eye2 = Buffer.ReadByte();
            byte HairStyle = Buffer.ReadByte();
            byte BeardStyle = Buffer.ReadByte();
            OutputStream.WriteLine("Beardstyle is {0}", BeardStyle);

            Buffer.SkipBytes(12);   // Drakkin stuff
            byte EquipChest2 = Buffer.ReadByte();
            Buffer.SkipBytes(2);
            byte Helm = Buffer.ReadByte();

            float Size = Buffer.ReadSingle();

            byte Face = Buffer.ReadByte();

            float WalkSpeed = Buffer.ReadSingle();

            float RunSpeed = Buffer.ReadSingle();

            UInt32 Race = Buffer.ReadUInt32();

            OutputStream.WriteLine("Size: {0}, Face: {1}, Walkspeed: {2}, RunSpeed: {3}, Race: {4}", Size, Face, WalkSpeed, RunSpeed, Race);

            //Buffer.SkipBytes(18);
            Buffer.SkipBytes(5);
            UInt32 GuildID = Buffer.ReadUInt32();
            UInt32 GuildRank = Buffer.ReadUInt32();
            Buffer.SkipBytes(5);
            OutputStream.WriteLine("GuildID: {0}, Guild Rank: {1}", GuildID, GuildRank);

            Buffer.ReadString(false);

//.........这里部分代码省略.........
开发者ID:josheb,项目名称:emu_dc,代码行数:101,代码来源:PatchDecember10-2012.cs

示例5: GetSpawns


//.........这里部分代码省略.........
                    for (int ColourSlot = 0; ColourSlot < 9; ++ColourSlot)
                        NewSpawn.SlotColour[ColourSlot] = Buffer.ReadUInt32();

                    for (int i = 0; i < 9; ++i)
                    {
                        NewSpawn.Equipment[i] = Buffer.ReadUInt32();

                        UInt32 Equip3 = Buffer.ReadUInt32();

                        UInt32 Equip2 = Buffer.ReadUInt32();

                        UInt32 Equip1 = Buffer.ReadUInt32();

                        UInt32 Equip0 = Buffer.ReadUInt32();
                    }

                    if (NewSpawn.Equipment[Constants.MATERIAL_CHEST] > 0)
                    {
                        NewSpawn.EquipChest2 = (byte)NewSpawn.Equipment[Constants.MATERIAL_CHEST];

                    }

                    NewSpawn.ArmorTintRed = (byte)((NewSpawn.SlotColour[Constants.MATERIAL_CHEST] >> 16) & 0xff);

                    NewSpawn.ArmorTintGreen = (byte)((NewSpawn.SlotColour[Constants.MATERIAL_CHEST] >> 8) & 0xff);

                    NewSpawn.ArmorTintBlue = (byte)(NewSpawn.SlotColour[Constants.MATERIAL_CHEST] & 0xff);

                    if (NewSpawn.Equipment[Constants.MATERIAL_PRIMARY] > 0)
                        NewSpawn.MeleeTexture1 = NewSpawn.Equipment[Constants.MATERIAL_PRIMARY];

                    if (NewSpawn.Equipment[Constants.MATERIAL_SECONDARY] > 0)
                        NewSpawn.MeleeTexture2 = NewSpawn.Equipment[Constants.MATERIAL_SECONDARY];

                    if (UseWorn)
                        NewSpawn.Helm = (byte)NewSpawn.Equipment[Constants.MATERIAL_HEAD];
                    else
                        NewSpawn.Helm = 0;

                }
                else
                {
                    // Non playable race

                    Buffer.SkipBytes(20);

                    NewSpawn.MeleeTexture1 = Buffer.ReadUInt32();
                    Buffer.SkipBytes(16);
                    NewSpawn.MeleeTexture2 = Buffer.ReadUInt32();
                    Buffer.SkipBytes(16);
                }

                if (NewSpawn.EquipChest2 == 255)
                    NewSpawn.EquipChest2 = 0;

                if (NewSpawn.Helm == 255)
                    NewSpawn.Helm = 0;

                UInt32 Position1 = Buffer.ReadUInt32();

                UInt32 Position2 = Buffer.ReadUInt32();

                UInt32 Position3 = Buffer.ReadUInt32();

                UInt32 Position4 = Buffer.ReadUInt32();

                UInt32 Position5 = Buffer.ReadUInt32();

                NewSpawn.YPos = Utils.EQ19ToFloat((Int32)(Position1 >> 12));

                NewSpawn.ZPos = Utils.EQ19ToFloat((Int32)(Position3 >> 13) & 0x7FFFF);

                NewSpawn.XPos = Utils.EQ19ToFloat((Int32)(Position4) & 0x7FFFF);

                NewSpawn.Heading = Utils.EQ19ToFloat((Int32)(Position5) & 0x7FFFF);

                if ((OtherData & 16) > 0)
                {
                    NewSpawn.Title = Buffer.ReadString(false);
                }

                if ((OtherData & 32) > 0)
                {
                    NewSpawn.Suffix = Buffer.ReadString(false);
                }

                // unknowns
                Buffer.SkipBytes(8);

                NewSpawn.IsMercenary = Buffer.ReadByte();

                Buffer.SkipBytes(54);

                Debug.Assert(Buffer.GetPosition() == Buffer.Length(), "Length mismatch while parsing zone spawns");

                ZoneSpawns.Add(NewSpawn);
            }

            return ZoneSpawns;
        }
开发者ID:josheb,项目名称:emu_dc,代码行数:101,代码来源:PatchDecember10-2012.cs

示例6: ExploreZoneEntry

        public void ExploreZoneEntry(StreamWriter OutputStream, ByteStream Buffer, PacketDirection Direction)
        {
            if (Direction != PacketDirection.ServerToClient)
                return;

            string SpawnName = Buffer.ReadString(true);

            UInt32 SpawnID = Buffer.ReadUInt32();

            byte Level = Buffer.ReadByte();

            float UnkSize = Buffer.ReadSingle();

            byte IsNPC = Buffer.ReadByte();

            UInt32 Bitfield = Buffer.ReadUInt32();
            /*
            NewSpawn.Showname = (Bitfield >> 28) & 1;
            NewSpawn.TargetableWithHotkey = (Bitfield >> 27) & 1;
            NewSpawn.Targetable = (Bitfield >> 26) & 1;

            NewSpawn.ShowHelm = (Bitfield >> 24) & 1;
            NewSpawn.Gender = (Bitfield >> 20) & 3;

            NewSpawn.Padding5 = (Bitfield >> 4) & 1;
            NewSpawn.Padding7 = (Bitfield >> 6) & 2047;
            NewSpawn.Padding26 = (Bitfield >> 25) & 1;
            */
            Byte OtherData = Buffer.ReadByte();

            Buffer.SkipBytes(8);    // Skip 8 unknown bytes

            //NewSpawn.DestructableString1 = "";
            //NewSpawn.DestructableString2 = "";
            //NewSpawn.DestructableString3 = "";

            if ((IsNPC > 0) && ((OtherData & 3) > 0))
            {
                // Destructable Objects. Not handled yet
                //
                //SQLOut(String.Format("-- OBJECT FOUND SpawnID {0}", SpawnID.ToString("x")));

                Buffer.ReadString(false);

                Buffer.ReadString(false);

                Buffer.ReadString(false);

                Buffer.ReadUInt32();

                Buffer.ReadUInt32();

                Buffer.ReadUInt32();

                Buffer.ReadUInt32();

                Buffer.ReadUInt32();

                Buffer.ReadUInt32();

                Buffer.ReadUInt32();

                Buffer.ReadUInt32();

                Buffer.ReadUInt32();

                Buffer.ReadUInt32();

                Buffer.ReadUInt32();

                Buffer.ReadUInt32();

                Buffer.ReadUInt32();

                Buffer.ReadByte();


            }
            OutputStream.WriteLine("Size starts at offset {0}", Buffer.GetPosition());

            float Size = Buffer.ReadSingle();

            byte Face = Buffer.ReadByte();

            float WalkSpeed = Buffer.ReadSingle();

            float RunSpeed = Buffer.ReadSingle();

            UInt32 Race = Buffer.ReadUInt32();

            byte PropCount = Buffer.ReadByte();

            UInt32 BodyType = 0;

            if (PropCount >= 1)
            {
                BodyType = Buffer.ReadUInt32();

                for (int j = 1; j < PropCount; ++j)
                    Buffer.SkipBytes(4);
//.........这里部分代码省略.........
开发者ID:Codex-NG,项目名称:Server,代码行数:101,代码来源:PatchMar15-2012.cs

示例7: ExploreMercenaryPurchaseWindow

        public void ExploreMercenaryPurchaseWindow(StreamWriter OutputStream, ByteStream Buffer, PacketDirection Direction)
        {
            UInt32 TypeCount = Buffer.ReadUInt32();

            //OutputStream.WriteLine("Type Count: {0}\r\n", TypeCount);
            OutputStream.WriteLine("VARSTRUCT_ENCODE_TYPE(uint32, Buffer, {0}); // Number of Types (Journeyman and Apprentice in this case\r\n", TypeCount);
            for (int i = 0; i < TypeCount; ++i)
            {
                UInt32 TypeDBStringID = Buffer.ReadUInt32();
                //OutputStream.WriteLine("  Type {0} DBStringID {1}", i, TypeDBStringID);
                OutputStream.WriteLine("VARSTRUCT_ENCODE_TYPE(uint32, Buffer, {0}); // DBStringID for Type {1}", TypeDBStringID, i);
            }

            UInt32 Count2 = Buffer.ReadUInt32();

            //OutputStream.WriteLine("  Count 2 is {0}", Count2);
            OutputStream.WriteLine("VARSTRUCT_ENCODE_TYPE(uint32, Buffer, {0}); // Count of Sub-types that follow", Count2);

            for (int i = 0; i < Count2; ++i)
            {
                int Offset = Buffer.GetPosition();

                UInt32 Unknown1 = Buffer.ReadUInt32();
                OutputStream.WriteLine("VARSTRUCT_ENCODE_TYPE(uint32, Buffer, {0}); // Unknown", Unknown1);
                UInt32 DBStringID1 = Buffer.ReadUInt32();
                OutputStream.WriteLine("VARSTRUCT_ENCODE_TYPE(uint32, Buffer, {0}); // DBStringID of Type", DBStringID1);
                UInt32 DBStringID2 = Buffer.ReadUInt32();
                OutputStream.WriteLine("VARSTRUCT_ENCODE_TYPE(uint32, Buffer, {0}); // DBStringID of Sub-Type", DBStringID2);
                UInt32 PurchaseCost = Buffer.ReadUInt32();
                OutputStream.WriteLine("VARSTRUCT_ENCODE_TYPE(uint32, Buffer, {0}); // Purchase Cost", PurchaseCost);
                UInt32 UpkeepCost = Buffer.ReadUInt32();
                OutputStream.WriteLine("VARSTRUCT_ENCODE_TYPE(uint32, Buffer, {0}); // Upkeep Cost", UpkeepCost);
                UInt32 Unknown2 = Buffer.ReadUInt32();
                OutputStream.WriteLine("VARSTRUCT_ENCODE_TYPE(uint32, Buffer, {0}); // Unknown", Unknown2);
                UInt32 Unknown3 = Buffer.ReadUInt32();
                OutputStream.WriteLine("VARSTRUCT_ENCODE_TYPE(uint32, Buffer, {0}); // Unknown", Unknown3);
                UInt32 Unknown4 = Buffer.ReadUInt32();
                OutputStream.WriteLine("VARSTRUCT_ENCODE_TYPE(uint32, Buffer, {0}); // Unknown", Unknown4);

                byte Unknown5 = Buffer.ReadByte();
                //OutputStream.WriteLine("VARSTRUCT_ENCODE_TYPE(uint8, Buffer, {0}); // Unknown", Unknown5);

                UInt32 Unknown6 = Buffer.ReadUInt32();
                //OutputStream.WriteLine("VARSTRUCT_ENCODE_TYPE(uint32, Buffer, {0}); // Unknown", Unknown6);
                UInt32 Unknown7 = Buffer.ReadUInt32();
                //OutputStream.WriteLine("VARSTRUCT_ENCODE_TYPE(uint32, Buffer, {0}); // Unknown", Unknown7);
                UInt32 Unknown8 = Buffer.ReadUInt32();
                //OutputStream.WriteLine("VARSTRUCT_ENCODE_TYPE(uint32, Buffer, {0}); // Unknown", Unknown8);

                UInt32 StanceCount = Buffer.ReadUInt32();

                OutputStream.WriteLine("VARSTRUCT_ENCODE_TYPE(uint32, Buffer, {0}); // Number of Stances for this Merc", StanceCount);

                UInt32 Unknown10 = Buffer.ReadUInt32();
                OutputStream.WriteLine("VARSTRUCT_ENCODE_TYPE(uint32, Buffer, {0}); // Unknown", Unknown10);

                byte Unknown11 = Buffer.ReadByte();
                //OutputStream.WriteLine("VARSTRUCT_ENCODE_TYPE(uint8, Buffer, {0}); // Unknown", Unknown11);

                //OutputStream.WriteLine("   Offset: {5} Unknown1: {0} DBStrings: {1} {2} Purchase: {3} Upkeep: {4}\r\n", Unknown1, DBStringID1, DBStringID2,
                //                PurchaseCost, UpkeepCost, Offset);
                //OutputStream.WriteLine("   Unknowns: {0} {1} {2} {3} {4} {5} {6} {7} {8}\r\n",
                //                Unknown2, Unknown3, Unknown4, Unknown5, Unknown6, Unknown7, Unknown8, Unknown10, Unknown11);

                //OutputStream.WriteLine("    Stance Count: {0}", StanceCount);

                for (int j = 0; j < StanceCount; ++j)
                {
                    UInt32 StanceNum = Buffer.ReadUInt32();
                    OutputStream.WriteLine("VARSTRUCT_ENCODE_TYPE(uint32, Buffer, {0}); // Stance Number", StanceNum);
                    UInt32 StanceType = Buffer.ReadUInt32();
                    OutputStream.WriteLine("VARSTRUCT_ENCODE_TYPE(uint32, Buffer, {0}); // Stance DBStringID (1 = Passive, 2 = Balanced etc.", StanceType);

                    //OutputStream.WriteLine("     {0}: {1}", StanceNum, StanceType);
                }
                OutputStream.WriteLine("");
            }

            OutputStream.WriteLine("\r\nBuffer position at end is {0}", Buffer.GetPosition());
            OutputStream.WriteLine("");
        }
开发者ID:regneq,项目名称:projecteqemu,代码行数:81,代码来源:PatchTestSep1-2010.cs

示例8: ExploreSubItem

        void ExploreSubItem(StreamWriter OutputStream, ref ByteStream Buffer)
        {
            UInt32 StackSize = Buffer.ReadUInt32();
            Buffer.SkipBytes(4);
            UInt32 Slot = Buffer.ReadUInt32();
            UInt32 Price = Buffer.ReadUInt32();
            UInt32 MerchantSlot = Buffer.ReadUInt32();
            Buffer.SkipBytes(16);
            Buffer.SkipBytes(28);
            string Name = Buffer.ReadString(true);
            Buffer.ReadString(true);    // Lore
            Buffer.ReadString(true);    // IDFile

            OutputStream.WriteLine("Item Name: {0}", Name);

            Buffer.SkipBytes(236);      // ItemBodyStruct
            Buffer.ReadString(true);    // CharmFile
            Buffer.SkipBytes(64);       // ItemSecondaryBodyStruct
            Buffer.ReadString(true);    // Filename

            Buffer.SkipBytes(76);       // ItemTertiaryBodyStruct

            //Buffer.SkipBytes(30);       // Click Effect Struct
            UInt32 Effect = Buffer.ReadUInt32();
            byte Level2 = Buffer.ReadByte();
            UInt32 Type = Buffer.ReadUInt32();
            byte Level = Buffer.ReadByte();
            UInt32 Unknown1 = Buffer.ReadUInt32();
            UInt32 Unknown2 = Buffer.ReadUInt32();
            UInt32 Unknown3 = Buffer.ReadUInt32();
            UInt32 Unknown4 = Buffer.ReadUInt32();
            UInt32 Unknown5 = Buffer.ReadUInt32();

            OutputStream.WriteLine("Buffer pos is {0}" + Buffer.GetPosition());
            string ClickName = Buffer.ReadString(true);    // Clickname
            OutputStream.WriteLine(" Click Name: {0}", ClickName);
            //Buffer.SkipBytes(4);        // Clickunk7
            UInt32 Unknown7 = Buffer.ReadUInt32();
            OutputStream.WriteLine("    Effect: {0} Level2: {1} Type {2} Level {3}", Effect, Level2, Type, Level);
            OutputStream.WriteLine("    Unks: {0} {1} {2} {3} {4} {5}", Unknown1, Unknown2, Unknown3, Unknown4, Unknown5, Unknown7);

            Buffer.SkipBytes(30);       // Proc Effect Struct
            Buffer.ReadString(true);    // Clickname
            Buffer.SkipBytes(4);        // Unknown5

            Buffer.SkipBytes(30);       // Worn Effect Struct
            Buffer.ReadString(true);    // Wornname
            Buffer.SkipBytes(4);        // Unknown6

            //Buffer.SkipBytes(30);       // Worn Effect Struct
            Effect = Buffer.ReadUInt32();
            Level2 = Buffer.ReadByte();
            Type = Buffer.ReadUInt32();
            Level = Buffer.ReadByte();
            Unknown1 = Buffer.ReadUInt32();
            Unknown2 = Buffer.ReadUInt32();
            Unknown3 = Buffer.ReadUInt32();
            Unknown4 = Buffer.ReadUInt32();
            Unknown5 = Buffer.ReadUInt32();
            string FocusName = Buffer.ReadString(true);    // Focusname
            OutputStream.WriteLine("   Focusname is {0}", FocusName);
            UInt32 Unknown6 = Buffer.ReadUInt32();
            OutputStream.WriteLine("    Effect: {0} Level2: {1} Type {2} Level {3}", Effect, Level2, Type, Level);
            OutputStream.WriteLine("    Unks: {0} {1} {2} {3} {4} {5}", Unknown1, Unknown2, Unknown3, Unknown4, Unknown5, Unknown6);
            //Buffer.SkipBytes(4);        // Unknown6

            Buffer.SkipBytes(30);       // Scroll Effect Struct
            Buffer.ReadString(true);    // Scrollname
            Buffer.SkipBytes(4);        // Unknown6

            Buffer.SkipBytes(30);       // Bard Effect Struct
            Buffer.ReadString(true);    // Wornname
            Buffer.SkipBytes(4);        // Unknown6

            Buffer.SkipBytes(103);      // Quaternarybodystruct - 4

            UInt32 SubLengths = Buffer.ReadUInt32();

            //return;

            for (int i = 0; i < SubLengths; ++i)
            {
                Buffer.SkipBytes(4);
                ExploreSubItem(OutputStream, ref Buffer);
            }

            return;

            //Buffer.SkipBytes(236);  // Item Body Struct

            UInt32 ID = Buffer.ReadUInt32();
            byte Weight = Buffer.ReadByte();
            byte NoRent = Buffer.ReadByte();
            byte NoDrop = Buffer.ReadByte();
            byte Attune = Buffer.ReadByte();
            byte Size = Buffer.ReadByte();

            OutputStream.WriteLine("   ID: {0} Weight: {1} NoRent: {2} NoDrop: {3} Attune {4} Size {5}", ID, Weight, NoRent, NoDrop, Attune, Size);

            UInt32 Slots = Buffer.ReadUInt32();
//.........这里部分代码省略.........
开发者ID:Vaion,项目名称:Server,代码行数:101,代码来源:PatchMay12-2010.cs

示例9: ExploreSubItem


//.........这里部分代码省略.........
            UInt32 ReqLevel = Buffer.ReadUInt32();
            UInt32 RecLevel = Buffer.ReadUInt32();
            UInt32 ReqSkill = Buffer.ReadUInt32();
            UInt32 BardType = Buffer.ReadUInt32();
            Int32 BardValue = Buffer.ReadInt32();
            byte Light = Buffer.ReadByte();
            byte Delay = Buffer.ReadByte();
            byte ElemDamageAmount = Buffer.ReadByte();
            byte ElemDamageType = Buffer.ReadByte();
            byte Range = Buffer.ReadByte();
            UInt32 Damage = Buffer.ReadUInt32();
            UInt32 Color = Buffer.ReadUInt32();
            byte ItemType = Buffer.ReadByte();
            UInt32 Material = Buffer.ReadUInt32();
            Buffer.SkipBytes(4);
            UInt32 EliteMaterial = Buffer.ReadUInt32();
            float SellRate = Buffer.ReadSingle();
            Int32 CombatEffects = Buffer.ReadInt32();
            Int32 Shielding = Buffer.ReadInt32();
            Int32 StunResist = Buffer.ReadInt32();
            Int32 StrikeThrough = Buffer.ReadInt32();
            Int32 ExtraDamageSkill = Buffer.ReadInt32();
            Int32 ExtraDamageAmount = Buffer.ReadInt32();
            Int32 SpellShield = Buffer.ReadInt32();
            Int32 Avoidance = Buffer.ReadInt32();
            Int32 Accuracy = Buffer.ReadInt32();
            UInt32 CharmFileID = Buffer.ReadUInt32();
            UInt32 FactionMod1 = Buffer.ReadUInt32();
            Int32 FactionAmount1 = Buffer.ReadInt32();
            UInt32 FactionMod2 = Buffer.ReadUInt32();
            Int32 FactionAmount2 = Buffer.ReadInt32();
            UInt32 FactionMod3 = Buffer.ReadUInt32();
            Int32 FactionAmount3 = Buffer.ReadInt32();
            UInt32 FactionMod4 = Buffer.ReadUInt32();
            Int32 FactionAmount4 = Buffer.ReadInt32();

            Buffer.ReadString(true);    // Charm File

            //Buffer.SkipBytes(64);   // Item Secondary Body Struct

            UInt32 AugType = Buffer.ReadUInt32();
            UInt32 AugRestrict = Buffer.ReadUInt32();

            Buffer.SkipBytes(30);   // Augslot stuff

            UInt32 LDONPointType = Buffer.ReadUInt32();
            UInt32 LDONTheme = Buffer.ReadUInt32();
            UInt32 LDONPrice = Buffer.ReadUInt32();
            UInt32 LDONSellBackRate = Buffer.ReadUInt32();
            UInt32 LDONSold = Buffer.ReadUInt32();

            byte BagType = Buffer.ReadByte();
            byte BagSlots = Buffer.ReadByte();
            byte BagSize = Buffer.ReadByte();
            byte BagWeightReduction = Buffer.ReadByte();

            byte Book = Buffer.ReadByte();
            byte BookType = Buffer.ReadByte();

            OutputStream.WriteLine("\r\n     BagType: {0} BagSlots: {1} BagSize: {2} BagWR: {3}", BagType, BagSlots, BagSize, BagWeightReduction);



            Buffer.ReadString(true);    // Filename
            Buffer.SkipBytes(76);   // Item Tertiary Body Struct
            Buffer.SkipBytes(30);   // Click Effect Struct
            Buffer.ReadString(true);    // Clickname
            Buffer.SkipBytes(4);    // clickunk7
            Buffer.SkipBytes(30);   // Proc Effect Struct
            Buffer.ReadString(true);    // Proc Name
            Buffer.SkipBytes(4);    // unknown5
            Buffer.SkipBytes(30);   // Worn Effect Struct
            Buffer.ReadString(true);    // Worn Name
            Buffer.SkipBytes(4);    // unknown6
            Buffer.SkipBytes(30);   // Worn Effect Struct
            Buffer.ReadString(true);    // Worn Name
            Buffer.SkipBytes(4);    // unknown6
            Buffer.SkipBytes(30);   // Worn Effect Struct
            Buffer.ReadString(true);    // Worn Name
            Buffer.SkipBytes(4);    // unknown6
            Buffer.SkipBytes(30);   // Worn Effect Struct
            Buffer.ReadString(true);    // Worn Name
            Buffer.SkipBytes(4);    // unknown6
            Buffer.SkipBytes(103);   // Item Quaternary Body Struct - 4 (we want to read the SubLength field at the end)

            Buffer.SkipBytes(57);   // HoT

            OutputStream.WriteLine("    Reading sublengths from offset {0}", Buffer.GetPosition());
            UInt32 SubLengths = Buffer.ReadUInt32();



            for (int i = 0; i < SubLengths; ++i)
            {
                Buffer.SkipBytes(4);
                ExploreSubItem(OutputStream, ref Buffer);
            }

            OutputStream.WriteLine("");
        }
开发者ID:Xackery,项目名称:eqemuserver,代码行数:101,代码来源:PatchTestSep22-2010.cs


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