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


C# ByteStream.ReadByte方法代码示例

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


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

示例1: GetDoors

        override public List<Door> GetDoors()
        {
            List<Door> DoorList = new List<Door>();

            List<byte[]> SpawnDoorPacket = GetPacketsOfType("OP_SpawnDoor", PacketDirection.ServerToClient);

            if ((SpawnDoorPacket.Count == 0) || (SpawnDoorPacket[0].Length == 0))
                return DoorList;

            int DoorCount = SpawnDoorPacket[0].Length / 100;

            ByteStream Buffer = new ByteStream(SpawnDoorPacket[0]);

            for (int d = 0; d < DoorCount; ++d)
            {
                string DoorName = Buffer.ReadFixedLengthString(32, false);

                float YPos = Buffer.ReadSingle();

                float XPos = Buffer.ReadSingle();

                float ZPos = Buffer.ReadSingle();

                float Heading = Buffer.ReadSingle();

                UInt32 Incline = Buffer.ReadUInt32();

                Int32 Size = Buffer.ReadInt32();

                Buffer.SkipBytes(4); // Skip Unknown

                Byte DoorID = Buffer.ReadByte();

                Byte OpenType = Buffer.ReadByte();

                Byte StateAtSpawn = Buffer.ReadByte();

                Byte InvertState = Buffer.ReadByte();

                Int32 DoorParam = Buffer.ReadInt32();

                // Skip past the trailing unknowns in the door struct, moving to the next door in the packet.

                Buffer.SkipBytes(32);

                string DestZone = "NONE";

                Door NewDoor = new Door(DoorName, YPos, XPos, ZPos, Heading, Incline, Size, DoorID, OpenType, StateAtSpawn, InvertState,
                                        DoorParam, DestZone, 0, 0, 0, 0);

                DoorList.Add(NewDoor);

            }
            return DoorList;
        }
开发者ID:Codex-NG,项目名称:Server,代码行数:55,代码来源:PatchMarch13-2013.cs

示例2: DecodeItemPacket

        public override Item DecodeItemPacket(byte[] PacketBuffer)
        {
            ByteStream Buffer = new ByteStream(PacketBuffer);

            Item NewItem = new Item();

            Buffer.SetPosition(30);
            NewItem.MerchantSlot = Buffer.ReadByte();            // 13
            NewItem.Price = Buffer.ReadUInt32();                 // 14
            Buffer.SkipBytes(5);
            NewItem.Quantity = Buffer.ReadInt32();               // 23
            Buffer.SetPosition(97);
            NewItem.Name = Buffer.ReadString(true);
            NewItem.Lore = Buffer.ReadString(true);
            NewItem.IDFile = Buffer.ReadString(true);
            Buffer.SkipBytes(1);
            NewItem.ID = Buffer.ReadUInt32();

            return NewItem;
        }
开发者ID:Vaion,项目名称:Server,代码行数:20,代码来源:PatchFeb8-2011.cs

示例3: ExploreTaskDescription

        public void ExploreTaskDescription(StreamWriter OutputStream, ByteStream Buffer, PacketDirection Direction)
        {
            UInt32 Seq = Buffer.ReadUInt32();
            UInt32 TaskID = Buffer.ReadUInt32();
            UInt32 Unk1 = Buffer.ReadUInt32();
            UInt32 Unk2 = Buffer.ReadUInt32();
            byte Unk3 = Buffer.ReadByte();

            OutputStream.WriteLine("Seq: {0}, TaskID: {1}, Unk1: {2:X}, Unk2: {3:X}, Unk3: {4:X}", Seq, TaskID, Unk1, Unk2, Unk3);

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

            UInt32 Duration = Buffer.ReadUInt32();
            UInt32 Unk4 = Buffer.ReadUInt32();
            UInt32 StartTime = Buffer.ReadUInt32();

            String Desc = Buffer.ReadString(false);

            OutputStream.WriteLine("Duration: {0}, Unk4: {1:X}, StartTime: {2:X}", Duration, Unk4, StartTime);

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

            UInt32 RewardCount = Buffer.ReadUInt32();
            UInt32 Unk5 = Buffer.ReadUInt32();
            UInt32 Unk6 = Buffer.ReadUInt32();
            UInt16 Unk7 = Buffer.ReadUInt16();

            OutputStream.WriteLine("RewardCount: {0}, Unk5: {1:X}, Unk6: {2:X}, Unk7: {3:X}", Duration, Unk5, Unk6, Unk7);

            string MyString = "";

            byte b;

            while ((b = Buffer.ReadByte()) != 0)
            {
                if (b == 0x12)
                    continue;

                MyString += Convert.ToChar(b);
            }

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

            UInt32 Unk8 = Buffer.ReadUInt32();
            byte Unk9 = Buffer.ReadByte();

            OutputStream.WriteLine("Unk8: {0:X}, Unk9: {1:X}", Unk8, Unk9);
        }
开发者ID:josheb,项目名称:emu_dc,代码行数:49,代码来源:PatchDecember10-2012.cs

示例4: ExploreOpenNewTasksWindow

        public void ExploreOpenNewTasksWindow(StreamWriter OutputStream, ByteStream Buffer, PacketDirection Direction)
        {
            UInt32 NumTasks = Buffer.ReadUInt32();
            UInt32 Unknown = Buffer.ReadUInt32();
            UInt32 TaskGiver = Buffer.ReadUInt32();

            OutputStream.WriteLine("Number of Tasks: {0}, Given by: {1}", NumTasks, TaskGiver);

            for (int i = 0; i < NumTasks; ++i)
            {
                UInt32 TaskID = Buffer.ReadUInt32();
                float Unk1 = Buffer.ReadSingle();
                UInt32 TimeLimit = Buffer.ReadUInt32();
                UInt32 Unk2 = Buffer.ReadUInt32();

                string Title = Buffer.ReadString(false);
                string Description = Buffer.ReadString(false);
                string UnkString = Buffer.ReadString(false);

                OutputStream.WriteLine("TaskID: {0}, Title: {1}", TaskID, Title);

                UInt32 ActivityCount = Buffer.ReadUInt32();
                OutputStream.WriteLine("Unknown: {0}", ActivityCount);

                OutputStream.WriteLine("");
                for (int j = 0; j < ActivityCount; ++j)
                {
                    OutputStream.WriteLine("Activity {0}", i);
                    OutputStream.WriteLine("");
                    OutputStream.WriteLine("    Unknown: {0}", Buffer.ReadUInt32());
                    OutputStream.WriteLine("    Unknown: {0}", Buffer.ReadUInt32());
                    OutputStream.WriteLine("    Unknown: {0}", Buffer.ReadUInt32());

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

                    UInt32 StringLength = Buffer.ReadUInt32();
                    OutputStream.WriteLine("    StringLength: {0}", StringLength);

                    string MyString = "";

                    for (int k = 0; k < StringLength; ++k)
                        MyString += Convert.ToChar(Buffer.ReadByte());

                    OutputStream.WriteLine("    Weird String: {0}", MyString);

                    OutputStream.WriteLine("    Unknown: {0}", Buffer.ReadUInt32());
                    OutputStream.WriteLine("    Unknown: {0}", Buffer.ReadUInt32());

                    OutputStream.WriteLine("    String: {0}", Buffer.ReadString(false));
                    OutputStream.WriteLine("    Unknown 2 bytes: {0}", Buffer.ReadUInt16());

                    //if (i == 3)
                    //{
                    //    OutputStream.WriteLine("Offset is now: {0}", Buffer.GetPosition());
                    //    return;
                    //}
                    OutputStream.WriteLine("    String: {0}", Buffer.ReadString(false));
                    OutputStream.WriteLine("    String: {0}", Buffer.ReadString(false));
                    OutputStream.WriteLine("    String: {0}", Buffer.ReadString(false));
                }
                OutputStream.WriteLine("");
                //OutputStream.WriteLine("Offset is now: {0}", Buffer.GetPosition());

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

示例5: GetSpawns

        public override List<ZoneEntryStruct> GetSpawns()
        {
            List<ZoneEntryStruct> ZoneSpawns = new List<ZoneEntryStruct>();

            List<byte[]> SpawnPackets = GetPacketsOfType("OP_ZoneEntry", PacketDirection.ServerToClient);

            foreach (byte[] SpawnPacket in SpawnPackets)
            {
                ZoneEntryStruct NewSpawn = new ZoneEntryStruct();

                ByteStream Buffer = new ByteStream(SpawnPacket);

                NewSpawn.SpawnName = Buffer.ReadString(true);

                NewSpawn.SpawnName = Utils.MakeCleanName(NewSpawn.SpawnName);

                NewSpawn.SpawnID = Buffer.ReadUInt32();

                NewSpawn.Level = Buffer.ReadByte();

                float UnkSize = Buffer.ReadSingle();

                NewSpawn.IsNPC = Buffer.ReadByte();

                UInt32 Bitfield = Buffer.ReadUInt32();

                NewSpawn.Gender = (Bitfield  & 3);

                Byte OtherData = Buffer.ReadByte();

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

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

                if ((NewSpawn.IsNPC > 0) && ((OtherData & 1) > 0))
                {
                    // Destructable Objects
                    NewSpawn.DestructableString1 = Buffer.ReadString(false);
                    NewSpawn.DestructableString2 = Buffer.ReadString(false);
                    NewSpawn.DestructableString3 = Buffer.ReadString(false);
                    Buffer.SkipBytes(53);
                }

                if ((OtherData & 4) > 0)
                {
                    // Auras
                    Buffer.ReadString(false);
                    Buffer.ReadString(false);
                    Buffer.SkipBytes(54);
                }

                NewSpawn.PropCount = Buffer.ReadByte();

                if (NewSpawn.PropCount > 0)
                    NewSpawn.BodyType = Buffer.ReadUInt32();
                else
                    NewSpawn.BodyType = 0;

                for (int j = 1; j < NewSpawn.PropCount; ++j)
                        Buffer.SkipBytes(4);

                Buffer.SkipBytes(1);   // Skip HP %
                NewSpawn.HairColor = Buffer.ReadByte();
                NewSpawn.BeardColor = Buffer.ReadByte();
                NewSpawn.EyeColor1 = Buffer.ReadByte();
                NewSpawn.EyeColor2 = Buffer.ReadByte();
                NewSpawn.HairStyle = Buffer.ReadByte();
                NewSpawn.Beard = Buffer.ReadByte();

                NewSpawn.DrakkinHeritage = Buffer.ReadUInt32();
                NewSpawn.DrakkinTattoo = Buffer.ReadUInt32();
                NewSpawn.DrakkinDetails = Buffer.ReadUInt32();

                NewSpawn.EquipChest2 = Buffer.ReadByte();

                bool UseWorn = (NewSpawn.EquipChest2 == 255);

                Buffer.SkipBytes(2);    // 2 Unknown bytes;

                NewSpawn.Helm = Buffer.ReadByte();

                NewSpawn.Size = Buffer.ReadSingle();

                NewSpawn.Face = Buffer.ReadByte();

                NewSpawn.WalkSpeed = Buffer.ReadSingle();

                NewSpawn.RunSpeed = Buffer.ReadSingle();

                NewSpawn.Race = Buffer.ReadUInt32();

                Buffer.SkipBytes(1);   // Skip Holding

                NewSpawn.Deity = Buffer.ReadUInt32();

                Buffer.SkipBytes(8);    // Skip GuildID and GuildRank

                NewSpawn.Class = Buffer.ReadByte();
//.........这里部分代码省略.........
开发者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: GetSpawns

        public override List<ZoneEntryStruct> GetSpawns()
        {
            List<ZoneEntryStruct> ZoneSpawns = new List<ZoneEntryStruct>();

            List<byte[]> SpawnPackets = GetPacketsOfType("OP_ZoneEntry", PacketDirection.ServerToClient);

            foreach (byte[] SpawnPacket in SpawnPackets)
            {
                ZoneEntryStruct NewSpawn = new ZoneEntryStruct();

                ByteStream Buffer = new ByteStream(SpawnPacket);

                NewSpawn.SpawnName = Buffer.ReadString(true);

                NewSpawn.SpawnName = Utils.MakeCleanName(NewSpawn.SpawnName);

                NewSpawn.SpawnID = Buffer.ReadUInt32();

                NewSpawn.Level = Buffer.ReadByte();

                float UnkSize = Buffer.ReadSingle();

                NewSpawn.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;

                Byte OtherData = Buffer.ReadByte();

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

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

                if ((OtherData & 1) > 0)
                {
                    //SQLOut(String.Format("-- OBJECT FOUND SpawnID {0}", SpawnID.ToString("x")));
                    //Console.WriteLine("Otherdata is {0} Skipping Stuff.", OtherData.ToString("x"));
                    NewSpawn.DestructableString1 = Buffer.ReadString(false);

                    NewSpawn.DestructableString2 = Buffer.ReadString(false);

                    NewSpawn.DestructableString3 = Buffer.ReadString(false);

                    NewSpawn.DestructableUnk1 = Buffer.ReadUInt32();

                    NewSpawn.DestructableUnk2 = Buffer.ReadUInt32();

                    NewSpawn.DestructableID1 = Buffer.ReadUInt32();

                    NewSpawn.DestructableID2 = Buffer.ReadUInt32();

                    NewSpawn.DestructableID3 = Buffer.ReadUInt32();

                    NewSpawn.DestructableID4 = Buffer.ReadUInt32();

                    NewSpawn.DestructableUnk3 = Buffer.ReadUInt32();

                    NewSpawn.DestructableUnk4 = Buffer.ReadUInt32();

                    NewSpawn.DestructableUnk5 = Buffer.ReadUInt32();

                    NewSpawn.DestructableUnk6 = Buffer.ReadUInt32();

                    NewSpawn.DestructableUnk7 = Buffer.ReadUInt32();

                    NewSpawn.DestructableUnk8 = Buffer.ReadUInt32();

                    NewSpawn.DestructableUnk9 = Buffer.ReadUInt32();

                    NewSpawn.DestructableByte = Buffer.ReadByte();

                    //SQLOut(String.Format("-- DES: {0,8:x} {1,8:x} {2,8:d} {3,8:d} {4,8:d} {5,8:d} {6,8:x} {7,8:x} {8,8:x} {9,8:x} {10,8:x} {11,8:x} {12,8:x} {13,2:x} {14} {15} {16}",
                    //          DestructableUnk1, DestructableUnk2, DestructableID1, DestructableID2, DestructableID3, DestructableID4,
                    //          DestructableUnk3, DestructableUnk4, DestructableUnk5, DestructableUnk6, DestructableUnk7, DestructableUnk8,
                    //          DestructableUnk9, DestructableByte, DestructableString1, DestructableString2, DestructableString3));
                }

                NewSpawn.Size = Buffer.ReadSingle();

                NewSpawn.Face = Buffer.ReadByte();

                NewSpawn.WalkSpeed = Buffer.ReadSingle();

                NewSpawn.RunSpeed = Buffer.ReadSingle();

                NewSpawn.Race = Buffer.ReadUInt32();

                NewSpawn.PropCount = Buffer.ReadByte();

                NewSpawn.BodyType = 0;

                if (NewSpawn.PropCount >= 1)
//.........这里部分代码省略.........
开发者ID:Vaion,项目名称:Server,代码行数:101,代码来源:PatchSoD.cs

示例8: 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

示例9: ExploreZonePlayerToBind

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

            float X = Buffer.ReadSingle();
            float Y = Buffer.ReadSingle();
            float Z = Buffer.ReadSingle();
            float Heading = Buffer.ReadSingle();
            string ZoneName = Buffer.ReadString(false);

            byte Unknown021 = Buffer.ReadByte();
            UInt32 Unknown022 = Buffer.ReadUInt32();
            UInt32 Unknown023 = Buffer.ReadUInt32();
            UInt32 Unknown024 = Buffer.ReadUInt32();

            OutputStream.WriteLine("ZoneID: {0} Loc: ({1}, {2}, {3}) ZoneName: {4}", ZoneID, X, Y, Z, ZoneName);
            OutputStream.WriteLine("Unknowns: {0} {1} {2} {3}", Unknown021, Unknown022, Unknown023, Unknown024);

            OutputStream.WriteLine("");
        }
开发者ID:Vaion,项目名称:Server,代码行数:20,代码来源:PatchMay12-2010.cs

示例10: ExploreRespawnWindow

        public void ExploreRespawnWindow(StreamWriter OutputStream, ByteStream Buffer, PacketDirection Direction)
        {
            if (Direction == PacketDirection.ServerToClient)
            {
                UInt32 Unknown000 = Buffer.ReadUInt32();
                UInt32 TimeRemaining = Buffer.ReadUInt32();
                UInt32 Unknown008 = Buffer.ReadUInt32();
                UInt32 NumBinds = Buffer.ReadUInt32();

                OutputStream.WriteLine("Unknown000: {0} Time: {1} Unknown008: {2} Num Binds: {3}\r\n", Unknown000, TimeRemaining, Unknown008, NumBinds);

                for (int i = 0; i < NumBinds; ++i)
                {
                    UInt32 BindNumber = Buffer.ReadUInt32();
                    UInt32 ZoneID = Buffer.ReadUInt32();
                    float X = Buffer.ReadSingle();
                    float Y = Buffer.ReadSingle();
                    float Z = Buffer.ReadSingle();
                    float Heading = Buffer.ReadSingle();
                    string ZoneName = Buffer.ReadString(false);
                    byte Valid = Buffer.ReadByte();

                    OutputStream.WriteLine("Bind Number: {0} Zone ID: {1} Zone Name: {2} Valid: {3}", BindNumber, ZoneID, ZoneName, Valid);
                }
            }

            OutputStream.WriteLine("");
        }
开发者ID:Vaion,项目名称:Server,代码行数:28,代码来源:PatchMay12-2010.cs

示例11: ExplorePlayerProfile

        public void ExplorePlayerProfile(StreamWriter OutputStream, ByteStream Buffer, PacketDirection Direction)
        {
            Buffer.SetPosition(12);

            UInt32 PlayerClass = Buffer.ReadUInt32();

            Buffer.SetPosition(56);

            byte PlayerLevel = Buffer.ReadByte();

            Buffer.SetPosition(18100);

            OutputStream.WriteLine("Name: {0} Class: {1} Level: {2}\r\n", Buffer.ReadString(false), PlayerClass, PlayerLevel);
        }
开发者ID:Vaion,项目名称:Server,代码行数:14,代码来源:PatchMay12-2010.cs

示例12: ExploreAnimation

        public void ExploreAnimation(StreamWriter OutputStream, ByteStream Buffer, PacketDirection Direction)
        {
            UInt16 SpawnID = Buffer.ReadUInt16();
            byte Action = Buffer.ReadByte();
            byte Value = Buffer.ReadByte();

            string SpawnName = FindExplorerSpawn(SpawnID);

            OutputStream.WriteLine("Spawn {0} {1} Action: {2} Value: {3}", SpawnID, SpawnName, Action, Value);

            OutputStream.WriteLine("");
        }
开发者ID:Vaion,项目名称:Server,代码行数:12,代码来源:PatchMay12-2010.cs

示例13: 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

示例14: 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

示例15: ExploreSubItem

        void ExploreSubItem(StreamWriter OutputStream, ref ByteStream Buffer)
        {
            Buffer.SkipBytes(8);

            byte Area = Buffer.ReadByte();
            UInt16 MainSlot = Buffer.ReadUInt16();
            Int16 SubSlot = Buffer.ReadInt16();
            Buffer.SkipBytes(54);
            string Name = Buffer.ReadString(true);

            if (SubSlot >= 0)
                OutputStream.Write("  ");

            string AreaName = "Unknown";

            switch (Area)
            {
                case 0:
                    AreaName = "Personal Inventory";
                    break;
                case 1:
                    AreaName = "Bank";
                    break;
                case 2:
                    AreaName = "Shared Bank";
                    break;
                case 6:
                    AreaName = "Personal Tribute";
                    break;
                case 7:
                    AreaName = "Guild Tribute";
                    break;
                case 8:
                    AreaName = "Merchant";
                    break;
            }

            OutputStream.WriteLine("Area: {0} {1} Main Slot {2,2} Sub Slot {3,3} Name {4}", Area, AreaName.PadRight(20), MainSlot, SubSlot, Name);

            Buffer.ReadString(true);    // Lore
            Buffer.ReadString(true);    // IDFile

            //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();
            UInt32 Price = Buffer.ReadUInt32();
            UInt32 Icon = Buffer.ReadUInt32();
            Buffer.SkipBytes(2);
            UInt32 BenefitFlags = Buffer.ReadUInt32();
            byte Tradeskills = Buffer.ReadByte();

            OutputStream.WriteLine("   Slots: {0} Price: {1} Icon: {2} BenefitFlags {3} Tradeskills: {4}", Slots, Price, Icon, BenefitFlags, Tradeskills);

            byte CR = Buffer.ReadByte();
            byte DR = Buffer.ReadByte();
            byte PR = Buffer.ReadByte();
            byte MR = Buffer.ReadByte();
            byte FR = Buffer.ReadByte();
            byte SVC = Buffer.ReadByte();

            OutputStream.WriteLine("   CR: {0} DR: {1} PR: {2} MR: {3} FR: {4} SVC: {5}", CR, DR, PR, MR, FR, SVC);

            byte AStr = Buffer.ReadByte();
            byte ASta = Buffer.ReadByte();
            byte AAgi = Buffer.ReadByte();
            byte ADex = Buffer.ReadByte();
            byte ACha = Buffer.ReadByte();
            byte AInt = Buffer.ReadByte();
            byte AWis = Buffer.ReadByte();

            OutputStream.WriteLine("   AStr: {0} ASta: {1} AAgi: {2} ADex: {3} ACha: {4} AInt: {5} AWis: {6}", AStr, ASta, AAgi, ADex, ACha, AInt, AWis);

            Int32 HP = Buffer.ReadInt32();
            Int32 Mana = Buffer.ReadInt32();
            UInt32 Endurance = Buffer.ReadUInt32();
            Int32 AC = Buffer.ReadInt32();
            Int32 Regen = Buffer.ReadInt32();
            Int32 ManaRegen = Buffer.ReadInt32();
            Int32 EndRegen = Buffer.ReadInt32();
            UInt32 Classes = Buffer.ReadUInt32();
            UInt32 Races = Buffer.ReadUInt32();
            UInt32 Deity = Buffer.ReadUInt32();
            Int32 SkillModValue = Buffer.ReadInt32();
            Buffer.SkipBytes(4);
            UInt32 SkillModType = Buffer.ReadUInt32();
            UInt32 BaneDamageRace = Buffer.ReadUInt32();
            UInt32 BaneDamageBody = Buffer.ReadUInt32();
            UInt32 BaneDamageRaceAmount = Buffer.ReadUInt32();
            Int32 BaneDamageAmount = Buffer.ReadInt32();
            byte Magic = Buffer.ReadByte();
            Int32 CastTime = Buffer.ReadInt32();
//.........这里部分代码省略.........
开发者ID:regneq,项目名称:projecteqemu,代码行数:101,代码来源:PatchTestSep1-2010.cs


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