當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。