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


C# PacketReader.ReadSByte方法代码示例

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


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

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

示例2: MovementRejectPacket

 public MovementRejectPacket(PacketReader reader)
     : base(0x21, "Move Request Rejected")
 {
     m_sequence = reader.ReadByte(); // (matches sent sequence)
     m_x = reader.ReadInt16();
     m_y = reader.ReadInt16();
     m_direction = reader.ReadByte();
     m_z = reader.ReadSByte();
 }
开发者ID:FreeReign,项目名称:UltimaXNA,代码行数:9,代码来源:MovementRejectPacket.cs

示例3: MobileMovingPacket

 public MobileMovingPacket(PacketReader reader)
     : base(0x77, "Mobile Moving")
 {
     this.serial = reader.ReadInt32();
     this.bodyid = reader.ReadUInt16();
     this.x = reader.ReadInt16();
     this.y = reader.ReadInt16();
     this.z = reader.ReadSByte();
     this.direction = reader.ReadByte();
     this.hue = reader.ReadUInt16();
     this.Flags = new MobileFlags(reader.ReadByte());
     this.notoriety = reader.ReadByte();
 }
开发者ID:FreeReign,项目名称:UltimaXNA,代码行数:13,代码来源:MobileMovingPacket.cs

示例4: MobileMovingPacket

 public MobileMovingPacket(PacketReader reader)
     : base(0x77, "Mobile Moving")
 {
     serial = reader.ReadInt32();
     bodyid = reader.ReadUInt16();
     x = reader.ReadInt16();
     y = reader.ReadInt16();
     z = reader.ReadSByte();
     direction = reader.ReadByte();
     hue = reader.ReadUInt16();
     Flags = new MobileFlags((MobileFlag)reader.ReadByte());
     notoriety = reader.ReadByte();
 }
开发者ID:gautamabudha,项目名称:UltimaXNA,代码行数:13,代码来源:MobileMovingPacket.cs

示例5: MobileUpdatePacket

 public MobileUpdatePacket(PacketReader reader)
     : base(0x20, "Mobile Update")
 {
     m_serial = reader.ReadInt32();
     m_body = reader.ReadInt16();
     reader.ReadByte(); // Always 0
     m_hue = reader.ReadUInt16(); // Skin hue
     m_flags = new MobileFlags((MobileFlag)reader.ReadByte());
     m_x = reader.ReadInt16();
     m_y = reader.ReadInt16();
     reader.ReadInt16(); // Always 0
     m_direction = reader.ReadByte();
     m_z = reader.ReadSByte();
 }
开发者ID:gautamabudha,项目名称:UltimaXNA,代码行数:14,代码来源:MobileUpdatePacket.cs

示例6: WorldItemPacket

        public WorldItemPacket(PacketReader reader)
            : base(0x1A, "ObjectInfo")
        {
            Serial serial = reader.ReadInt32();
            ushort itemId = reader.ReadUInt16();

            m_amount = 0;

            if ((serial & 0x80000000) == 0x80000000)
            {
                m_amount = reader.ReadInt16();
            }

            // Doesn't exist this thing in the packet
            /*byte iIncrement = 0;
            if ((iItemID & 0x8000) == 0x8000)
            {
                iIncrement = reader.ReadByte();
                iObjectSerial += iIncrement;
            }*/

            ushort x = reader.ReadUInt16();
            ushort y = reader.ReadUInt16();

            m_direction = 0;

            if ((x & 0x8000) == 0x8000)
                m_direction = reader.ReadByte();

            m_z = reader.ReadSByte();
            m_hue = 0;

            if ((y & 0x8000) == 0x8000)
                m_hue = reader.ReadUInt16();

            m_flags = 0;

            if ((y & 0x4000) == 0x4000)
                m_flags = reader.ReadByte();

            m_serial = (int)(serial &= 0x7FFFFFFF);
            m_itemid = (short)(itemId &= 0x7FFF);
            m_x = (short)(x &= 0x7FFF);
            m_y = (short)(y &= 0x3FFF);
        }
开发者ID:FreeReign,项目名称:UltimaXNA,代码行数:45,代码来源:ObjectInfoPacket.cs

示例7: MobileIncomingPacket

        public MobileIncomingPacket(PacketReader reader)
            : base(0x78, "Mobile Incoming")
        {
            // Mobile
            m_serial = reader.ReadInt32();
            m_body = reader.ReadInt16();
            m_x = reader.ReadInt16();
            m_y = reader.ReadInt16();
            m_z = reader.ReadSByte();
            m_direction = reader.ReadByte();
            m_hue = reader.ReadUInt16();
            Flags = new MobileFlags((MobileFlag)reader.ReadByte());
            m_notoriety = reader.ReadByte();

            // Read equipment - nine bytes ea.
            List<EquipmentEntry> items = new List<EquipmentEntry>();

            Serial serial = reader.ReadInt32();
            if (!serial.IsValid)
            {
                reader.ReadByte(); //zero terminated
                m_equipment = new EquipmentEntry[0];
            }
            else
            {
                while (serial.IsValid)
                {
                    ushort gumpId = reader.ReadUInt16();
                    byte layer = reader.ReadByte();
                    ushort hue = 0;

                    if ((gumpId & 0x8000) == 0x8000)
                    {
                        gumpId = (ushort)((int)gumpId - 0x8000);
                        hue = reader.ReadUInt16();
                    }

                    items.Add(new EquipmentEntry(serial, gumpId, layer, hue));
                    // read the next serial and begin the loop again. break at 0x00000000
                    serial = reader.ReadInt32();
                }
                m_equipment = items.ToArray();
            }
        }
开发者ID:gautamabudha,项目名称:UltimaXNA,代码行数:44,代码来源:MobileIncomingPacket.cs

示例8: ObjectInfoPacketNew

        public ObjectInfoPacketNew(PacketReader reader)
            : base(0xF3, "ObjectInfoPacketNew")
        {
            reader.ReadInt16();
            Type = reader.ReadByte();
            Serial = reader.ReadInt32();
            ItemID = reader.ReadUInt16();

            Direction = (byte)reader.ReadByte();
            Amount = reader.ReadUInt16();
            Amount = reader.ReadUInt16();
            X = reader.ReadInt16();
            Y = reader.ReadInt16();
            Z = reader.ReadSByte();
            Layer = reader.ReadByte();
            Hue = reader.ReadUInt16();
            Flags = reader.ReadByte();

            reader.ReadUInt16();
        }
开发者ID:denizsokmen,项目名称:UltimaXNA,代码行数:20,代码来源:ObjectInfoPacketNew.cs

示例9: WorldItemPacket

        public WorldItemPacket(PacketReader reader)
            : base(0x1A, "ObjectInfo")
        {
            Serial serial = reader.ReadInt32();
            ushort itemId = reader.ReadUInt16();

            m_amount = 0;

            if ((serial & 0x80000000) == 0x80000000)
            {
                m_amount = reader.ReadInt16();
            }

            ushort x = reader.ReadUInt16();
            ushort y = reader.ReadUInt16();

            m_direction = 0;

            if ((x & 0x8000) == 0x8000)
                m_direction = reader.ReadByte();

            m_z = reader.ReadSByte();
            m_hue = 0;

            if ((y & 0x8000) == 0x8000)
                m_hue = reader.ReadUInt16();

            m_flags = 0;

            if ((y & 0x4000) == 0x4000)
                m_flags = reader.ReadByte();

            m_serial = (int)(serial &= 0x7FFFFFFF);
            m_itemid = (short)(itemId &= 0x7FFF);
            m_x = (short)(x &= 0x7FFF);
            m_y = (short)(y &= 0x3FFF);
        }
开发者ID:gautamabudha,项目名称:UltimaXNA,代码行数:37,代码来源:ObjectInfoPacket.cs


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