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


C# PacketReader.ReadInt32方法代码示例

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


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

示例1: SwingPacket

 public SwingPacket(PacketReader reader)
     : base(0x2F, "Swing")
 {
     m_flag = reader.ReadByte();
     m_attacker = reader.ReadInt32();
     m_defender = reader.ReadInt32();
 }
开发者ID:FreeReign,项目名称:UltimaXNA,代码行数:7,代码来源:SwingPacket.cs

示例2: ObjectPropertyListPacket

        public ObjectPropertyListPacket(PacketReader reader)
            : base(0xD6, "Object Property List")
        {
            reader.ReadInt16(); // Always 0x0001
            m_serial = reader.ReadInt32();

            reader.ReadInt16(); // Always 0x0000
            m_hash = reader.ReadInt32();

            m_clilocs = new List<int>();
            m_arguments = new List<string>();

            // Loop of all the item/creature's properties to display in the order to display them. The name is always the first entry.
            int clilocId = reader.ReadInt32();

            while (clilocId != 0)
            {
                m_clilocs.Add(clilocId);

                int textLength = reader.ReadUInt16();
                string args = string.Empty;

                if (textLength > 0)
                {
                    args = reader.ReadUnicodeStringReverse(textLength / 2);
                }

                m_arguments.Add(args);

                clilocId = reader.ReadInt32();
            }
        }
开发者ID:gautamabudha,项目名称:UltimaXNA,代码行数:32,代码来源:ObjectPropertyListPacket.cs

示例3: DeathAnimationPacket

 public DeathAnimationPacket(PacketReader reader)
     : base(0xAF, "Death Animation")
 {
     PlayerSerial = reader.ReadInt32();
     CorpseSerial = reader.ReadInt32();
     reader.ReadInt32(); // unknown - all zero's.
 }
开发者ID:gautamabudha,项目名称:UltimaXNA,代码行数:7,代码来源:DeathAnimationPacket.cs

示例4: ObjectInfoPacket

        public ObjectInfoPacket(PacketReader reader)
            : base(0x1A, "ObjectInfoPacket")
        {
            Serial = reader.ReadInt32();
            ItemID = reader.ReadUInt16();

            Amount = (ushort)(((Serial & 0x80000000) == 0x80000000) ? reader.ReadUInt16() : 0);

            X = reader.ReadInt16();
            Y = reader.ReadInt16();
                        
            Direction = (byte)(((X & 0x8000) == 0x8000) ? reader.ReadByte() : 0);

            Z = reader.ReadSByte();

            Hue = (ushort)(((Y & 0x8000) == 0x8000) ? reader.ReadUInt16() : 0);

            Flags = (byte)(((Y & 0x4000) == 0x4000) ? reader.ReadByte() : 0);

            // sanitize values
            Serial = (int)(Serial & 0x7FFFFFFF);
            ItemID = (ushort)(ItemID & 0x7FFF);
            X = (short)(X & 0x7FFF);
            Y = (short)(Y & 0x3FFF);
        }
开发者ID:msx752,项目名称:UltimaXNA,代码行数:25,代码来源:ObjectInfoPacket.cs

示例5: UpdateHealthPacket

 public UpdateHealthPacket(PacketReader reader)
     : base(0xA1, "Update Health")
 {
     m_serial = reader.ReadInt32();
     m_max = reader.ReadInt16();
     m_current = reader.ReadInt16();
 }
开发者ID:FreeReign,项目名称:UltimaXNA,代码行数:7,代码来源:UpdateHealthPacket.cs

示例6: OpenContainerPacket

 public OpenContainerPacket(PacketReader reader)
     : base(0x24, "Open Container")
 {
     m_serial = reader.ReadInt32();
     m_gumpId = reader.ReadUInt16();
     reader.ReadUInt16();
 }
开发者ID:denizsokmen,项目名称:UltimaXNA,代码行数:7,代码来源:ContainerPacket.cs

示例7: UpdateStaminaPacket

 public UpdateStaminaPacket(PacketReader reader)
     : base(0xA3, "Update Stamina")
 {
     m_serial = reader.ReadInt32();
     m_max = reader.ReadInt16();
     m_current = reader.ReadInt16();
 }
开发者ID:FreeReign,项目名称:UltimaXNA,代码行数:7,代码来源:UpdateStaminaPacket.cs

示例8: ContainerContentPacket

        public ContainerContentPacket(PacketReader reader)
            : base(0x3C, "Container ContentPacket")
        {
            int itemCount = reader.ReadUInt16();
            List<ContentItem> items = new List<ContentItem>(itemCount);

            for (int i = 0; i < itemCount; i++)
            {
                Serial serial = reader.ReadInt32();
                int iItemID = reader.ReadUInt16();
                int iUnknown = reader.ReadByte(); // signed, itemID offset. always 0 in RunUO.
                int iAmount = reader.ReadUInt16();
                int iX = reader.ReadInt16();
                int iY = reader.ReadInt16();
                int iGridLocation = 0;
                if (!NextContainerContentsIsPre6017)
                    iGridLocation = reader.ReadByte(); // always 0 in RunUO.
                int iContainerSerial = reader.ReadInt32();
                int iHue = reader.ReadUInt16();

                items.Add(new ContentItem(serial, iItemID, iAmount, iX, iY, iGridLocation, iContainerSerial, iHue));
            }

            m_items = items.ToArray();
            if (NextContainerContentsIsPre6017)
                NextContainerContentsIsPre6017 = false;
        }
开发者ID:gautamabudha,项目名称:UltimaXNA,代码行数:27,代码来源:ContainerContentPacket.cs

示例9: CustomHousePacket

        public CustomHousePacket(PacketReader reader)
            : base(0xD8, "Custom House Packet")
        {
            byte CompressionType = reader.ReadByte();
            if (CompressionType != 3)
            {
                m_houseSerial = Serial.Null;
                return;
            }
            reader.ReadByte(); // unknown, always 0?
            m_houseSerial = reader.ReadInt32();
            m_revisionHash = reader.ReadInt32();

            // this is for compression type 3 only
            int bufferLength = reader.ReadInt16();
            int trueBufferLength = reader.ReadInt16();
            m_numPlanes = reader.ReadByte();
            // end compression type 3

            m_planes = new CustomHousePlane[m_numPlanes];
            for (int i = 0; i < m_numPlanes; i++)
            {
                m_planes[i] = new CustomHousePlane(reader);
            }
        }
开发者ID:FreeReign,项目名称:UltimaXNA,代码行数:25,代码来源:CustomHousePacket.cs

示例10: ServerRelayPacket

 public ServerRelayPacket(PacketReader reader)
     : base(0x8C, "Server Relay")
 {
     m_ipAddress = reader.ReadInt32();
     m_port = reader.ReadInt16();
     m_accountId = reader.ReadInt32();
 }
开发者ID:gautamabudha,项目名称:UltimaXNA,代码行数:7,代码来源:ServerRelayPacket.cs

示例11: ContainerContentPacket

        public ContainerContentPacket(PacketReader reader)
            : base(0x3C, "Container ContentPacket")
        {
            int itemCount = reader.ReadUInt16();
            List<ItemInContainer> items = new List<ItemInContainer>(itemCount);

            bool PacketIsPre6017 = (reader.Buffer.Length == 5 + (19 * itemCount));

            for (int i = 0; i < itemCount; i++)
            {
                Serial serial = reader.ReadInt32();
                int iItemID = reader.ReadUInt16();
                int iUnknown = reader.ReadByte(); // signed, itemID offset. always 0 in RunUO.
                int iAmount = reader.ReadUInt16();
                int iX = reader.ReadInt16();
                int iY = reader.ReadInt16();
                int iGridLocation = 0;
                if (!PacketIsPre6017)
                    iGridLocation = reader.ReadByte(); // always 0 in RunUO.
                int iContainerSerial = reader.ReadInt32();
                int iHue = reader.ReadUInt16();

                items.Add(new ItemInContainer(serial, iItemID, iAmount, iX, iY, iGridLocation, iContainerSerial, iHue));
            }

            m_items = items.ToArray();
        }
开发者ID:msx752,项目名称:UltimaXNA,代码行数:27,代码来源:ContainerContentPacket.cs

示例12: PartyRemoveMemberInfo

 public PartyRemoveMemberInfo(PacketReader reader)
 {
     Count = reader.ReadByte();
     RemovedMember = reader.ReadInt32();
     Serials = new int[Count];
     for (int i = 0; i < Count; i++) {
         Serials[i] = reader.ReadInt32();
     }
 }
开发者ID:jorsi,项目名称:UltimaXNA,代码行数:9,代码来源:PartyRemoveMemberInfo.cs

示例13: MapDiffInfo

 public MapDiffInfo(PacketReader reader)
 {
     MapCount = reader.ReadInt32();
     MapPatches = new int[MapCount];
     StaticPatches = new int[MapCount];
     for (int i = 0; i < MapCount; i++) {
         StaticPatches[i] = reader.ReadInt32();
         MapPatches[i] = reader.ReadInt32();
     }
 }
开发者ID:jorsi,项目名称:UltimaXNA,代码行数:10,代码来源:MapDiffInfo.cs

示例14: WornItemPacket

 public WornItemPacket(PacketReader reader)
     : base(0x2E, "Worn Item")
 {
     m_serial = reader.ReadInt32();
     m_itemId = reader.ReadInt16();
     reader.ReadByte();
     m_layer = reader.ReadByte();
     m_parentSerial = reader.ReadInt32();
     m_hue = reader.ReadInt16();
 }
开发者ID:FreeReign,项目名称:UltimaXNA,代码行数:10,代码来源:WornItemPacket.cs

示例15: MessageLocalizedPacket

 public MessageLocalizedPacket(PacketReader reader)
     : base(0xC1, "Message Localized")
 {
     Serial = reader.ReadInt32(); // 0xffff for system message
     Body = reader.ReadInt16(); // (0xff for system message
     MessageType = (MessageTypes)reader.ReadByte(); // 6 - lower left, 7 on player
     Hue = reader.ReadUInt16();
     Font = reader.ReadInt16();
     CliLocNumber = reader.ReadInt32();
     SpeakerName = reader.ReadString(30).Trim();
     Arguements = reader.ReadUnicodeStringSafeReverse();
 }
开发者ID:msx752,项目名称:UltimaXNA,代码行数:12,代码来源:MessageLocalizedPacket.cs


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