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


C# ByteStream.ReadSingle方法代码示例

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


在下文中一共展示了ByteStream.ReadSingle方法的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: ExploreClientUpdate

        public void ExploreClientUpdate(StreamWriter OutputStream, ByteStream Buffer, PacketDirection Direction)
        {
            UInt16 SpawnID = Buffer.ReadUInt16();
            Buffer.SkipBytes(6);
            float x = Buffer.ReadSingle();
            float y = Buffer.ReadSingle();
            Buffer.SkipBytes(12);
            float z = Buffer.ReadSingle();

            Buffer.SkipBytes(4);
            UInt32 Temp = Buffer.ReadUInt32();
            Temp = Temp & 0x3FFFFF;
            Temp = Temp >> 10;
            float heading = Utils.EQ19ToFloat((Int32)(Temp));

            OutputStream.WriteLine("Loc: {0}, {1}, {2}  Heading: {3}", x, y, z, heading);

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

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

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

 public void ExploreRequestClientZoneChange(StreamWriter OutputStream, ByteStream Buffer, PacketDirection Direction)
 {
     UInt32 ZoneID = Buffer.ReadUInt32();
     UInt32 Unknown = Buffer.ReadUInt32();
     float y = Buffer.ReadSingle();
     float x = Buffer.ReadSingle();
     float z = Buffer.ReadSingle();
     float heading = Buffer.ReadSingle();
     Buffer.SkipBytes(148);
     float uf = Buffer.ReadSingle();
     OutputStream.WriteLine("UF = {0}", uf);
 }
开发者ID:josheb,项目名称:emu_dc,代码行数:12,代码来源:PatchDecember10-2012.cs

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

示例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.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

示例8: GetZoneData

        public override NewZoneStruct GetZoneData()
        {
            NewZoneStruct NewZone = new NewZoneStruct();

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

            if (ZonePackets.Count < 1)
                return NewZone;

            // Assume there is only 1 packet and process the first one.

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

            string CharName = Buffer.ReadFixedLengthString(64, false);

            NewZone.ShortName = Buffer.ReadFixedLengthString(32, false);

            Buffer.SkipBytes(96);   // Skip Unknown

            NewZone.LongName = Buffer.ReadFixedLengthString(278, true);

            NewZone.Type = Buffer.ReadByte();

            NewZone.FogRed = Buffer.ReadBytes(4);

            NewZone.FogGreen = Buffer.ReadBytes(4);

            NewZone.FogBlue = Buffer.ReadBytes(4);

            Buffer.SkipBytes(1);   // Unknown

            for (int i = 0; i < 4; ++i)
                NewZone.FogMinClip[i] = Buffer.ReadSingle();

            for (int i = 0; i < 4; ++i)
                NewZone.FogMaxClip[i] = Buffer.ReadSingle();

            NewZone.Gravity = Buffer.ReadSingle();

            NewZone.TimeType = Buffer.ReadByte();

            Buffer.SkipBytes(49);   // Unknown

            NewZone.Sky = Buffer.ReadByte();

            Buffer.SkipBytes(13);   // Unknown

            NewZone.ZEM = Buffer.ReadSingle();

            NewZone.SafeY = Buffer.ReadSingle();

            NewZone.SafeX = Buffer.ReadSingle();

            NewZone.SafeZ = Buffer.ReadSingle();

            NewZone.MinZ = Buffer.ReadSingle();

            NewZone.MaxZ = Buffer.ReadSingle();

            NewZone.UnderWorld = Buffer.ReadSingle();

            NewZone.MinClip = Buffer.ReadSingle();

            NewZone.MaxClip = Buffer.ReadSingle();

            Buffer.SkipBytes(84);   // Unknown

            NewZone.ShortName2 = Buffer.ReadFixedLengthString(96, false);

            Buffer.SkipBytes(52);   // Unknown

            NewZone.ZoneID = Buffer.ReadUInt16();

            NewZone.InstanceID = Buffer.ReadUInt16();

            Buffer.SkipBytes(38);   // Unknown

            NewZone.FallDamage = Buffer.ReadByte();

            Buffer.SkipBytes(21);   // Unknown

            NewZone.FogDensity = Buffer.ReadSingle();

            // Everything else after this point in the packet is unknown.

            return NewZone;
        }
开发者ID:Vaion,项目名称:Server,代码行数:87,代码来源:PatchSoD.cs

示例9: ExploreSubItem


//.........这里部分代码省略.........

            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();
            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
            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)

            UInt32 SubLengths = Buffer.ReadUInt32();

            for (int i = 0; i < SubLengths; ++i)
            {
                Buffer.SkipBytes(4);
                ExploreSubItem(OutputStream, ref Buffer);
            }
        }
开发者ID:regneq,项目名称:projecteqemu,代码行数:101,代码来源:PatchTestSep1-2010.cs

示例10: GetGroundSpawns

        public override List<GroundSpawnStruct> GetGroundSpawns()
        {
            List<GroundSpawnStruct> GroundSpawns = new List<GroundSpawnStruct>();

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

            foreach (byte[] GroundSpawnPacket in GroundSpawnPackets)
            {
                GroundSpawnStruct GroundSpawn = new GroundSpawnStruct();

                ByteStream Buffer = new ByteStream(GroundSpawnPacket);

                GroundSpawn.DropID = Buffer.ReadUInt32();

                GroundSpawn.Name = Buffer.ReadString(false);

                GroundSpawn.ZoneID = Buffer.ReadUInt16();

                GroundSpawn.InstanceID = Buffer.ReadUInt16();

                Buffer.SkipBytes(8); // Two unknown uint32s

                GroundSpawn.Heading = Buffer.ReadSingle();

                Buffer.SkipBytes(12); // First float is 255 to make some groundspawns appear, second 4 bytes unknown, last is a float

                GroundSpawn.y = Buffer.ReadSingle();

                GroundSpawn.x = Buffer.ReadSingle();

                GroundSpawn.z = Buffer.ReadSingle();

                GroundSpawn.ObjectType = Buffer.ReadUInt32();

                GroundSpawns.Add(GroundSpawn);
            }
            return GroundSpawns;
        }
开发者ID:Vaion,项目名称:Server,代码行数:38,代码来源:PatchMay12-2010.cs

示例11: GetClientMovementUpdates

        public override List<PositionUpdate> GetClientMovementUpdates()
        {
            List<PositionUpdate> Updates = new List<PositionUpdate>();

            List<EQApplicationPacket> PacketList = Packets.PacketList;

            UInt32 OP_ClientUpdate = OpManager.OpCodeNameToNumber("OP_ClientUpdate");

            foreach (EQApplicationPacket UpdatePacket in PacketList)
            {
                if ((UpdatePacket.OpCode != OP_ClientUpdate) || (UpdatePacket.Direction != PacketDirection.ClientToServer))
                    continue;

                ByteStream Buffer = new ByteStream(UpdatePacket.Buffer);

                PositionUpdate PosUpdate = new PositionUpdate();

                PosUpdate.SpawnID = Buffer.ReadUInt16();
                Buffer.SkipBytes(6);
                PosUpdate.p.x = Buffer.ReadSingle();
                PosUpdate.p.y = Buffer.ReadSingle();
                Buffer.SkipBytes(12);
                PosUpdate.p.z = Buffer.ReadSingle();
                PosUpdate.p.TimeStamp = UpdatePacket.PacketTime;
                Buffer.SkipBytes(4);
                UInt32 Temp = Buffer.ReadUInt32();
                Temp = Temp & 0x3FFFFF;
                Temp = Temp >> 10;
                PosUpdate.p.heading = Utils.EQ19ToFloat((Int32)(Temp));

                Updates.Add(PosUpdate);
            }

            return Updates;
        }
开发者ID:Vaion,项目名称:Server,代码行数:35,代码来源:PatchMay12-2010.cs

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

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

示例14: ExploreRequestClientZoneChange

        public void ExploreRequestClientZoneChange(StreamWriter OutputStream, ByteStream Buffer, PacketDirection Direction)
        {
            UInt16 ZoneID = Buffer.ReadUInt16();
            UInt16 Instance = Buffer.ReadUInt16();
            float X = Buffer.ReadSingle();
            float Y = Buffer.ReadSingle();
            float Z = Buffer.ReadSingle();
            float Heading = Buffer.ReadSingle();
            UInt32 Type = Buffer.ReadUInt16();

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

示例15: ExploreSubItem


//.........这里部分代码省略.........

            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();
            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
            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)

            //UInt32 SubLengths = Buffer.ReadUInt32();

            for (int i = 0; i < SubLengths; ++i)
            {
                Buffer.SkipBytes(4);
                ExploreSubItem(OutputStream, ref Buffer);
            }
        }
开发者ID:Vaion,项目名称:Server,代码行数:101,代码来源:PatchMay12-2010.cs


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