Exemple #1
1
        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);
        }
Exemple #2
1
 public SwingPacket(PacketReader reader)
     : base(0x2F, "Swing")
 {
     m_flag = reader.ReadByte();
     m_attacker = reader.ReadInt32();
     m_defender = reader.ReadInt32();
 }
Exemple #3
0
 public WeatherPacket(PacketReader reader)
     : base(0x65, "Set Weather")
 {
     m_weatherType = reader.ReadByte();
     m_effectId = reader.ReadByte();
     m_temperature = reader.ReadByte();
 }
Exemple #4
0
 public TimePacket(PacketReader reader)
     : base(0x5B, "Time")
 {
     m_hour = reader.ReadByte();
     m_minute = reader.ReadByte();
     m_second = reader.ReadByte();
 }
 public TargetCursorPacket(PacketReader reader)
     : base(0x6C, "Target Cursor")
 {
     m_commandtype = reader.ReadByte(); // 0x00 = Select Object; 0x01 = Select X, Y, Z
     m_cursorid = reader.ReadInt32();
     m_cursortype = reader.ReadByte(); // 0 - 2 = unknown; 3 = Cancel current targetting RunUO seems to always send 0.
 }
        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;
        }
        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);
            }
        }
        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();
        }
Exemple #9
0
 public ExtendedStatsInfo(PacketReader reader)
 {
     int clientFlag = reader.ReadByte(); // (0x2 for 2D client, 0x5 for KR client)
     Serial = reader.ReadInt32();
     byte unknown0 = reader.ReadByte(); // (always 0)
     byte lockFlags = reader.ReadByte();
     // Lock flags = bitflags 00SSDDII
     //     00 = up
     //     01 = down
     //     10 = locked
     // FF = update mobile status animation ( KR only )
     if (lockFlags != 0xFF) {
         int strengthLock = (lockFlags >> 4) & 0x03;
         int dexterityLock = (lockFlags >> 2) & 0x03;
         int inteligenceLock = (lockFlags) & 0x03;
         Locks = new StatLocks(strengthLock, dexterityLock, inteligenceLock);
     }
     if (clientFlag == 5) {
         Tracer.Warn("ClientFlags == 5 in GeneralInfoPacket ExtendedStats 0x19. This is not a KR client.");
         // If(Lock flags = 0xFF) //Update mobile status animation
         //  BYTE[1] Status // Unveryfied if lock flags == FF the locks will be handled here
         //  BYTE[1] unknown (0x00)
         //  BYTE[1] Animation
         //  BYTE[1] unknown (0x00)
         //  BYTE[1] Frame
         // else
         //  BYTE[1] unknown (0x00)
         //  BYTE[4] unknown (0x00000000)
         // endif
     }
 }
Exemple #10
0
 public ServerListEntry(PacketReader reader)
 {
     Index = (ushort)reader.ReadInt16();
     Name = reader.ReadString(32);
     PercentFull = reader.ReadByte();
     Timezone = reader.ReadByte();
     Address = (uint)reader.ReadInt32();
 }
 public ServerListEntry(PacketReader reader)
 {
     index = (ushort)reader.ReadInt16();
     name = reader.ReadString(30);
     percentFull = reader.ReadByte();
     timezone = reader.ReadByte();
     address = (uint)reader.ReadInt32();
 }
Exemple #12
0
        public WarModePacket(PacketReader reader)
            : base(0x72, "Request War Mode")
        {
            m_warmode = reader.ReadByte();

            reader.ReadByte(); // always 0x00
            reader.ReadByte(); // always 0x32
            reader.ReadByte(); // always 0x00
        }
 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();
 }
Exemple #14
0
 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();
 }
 public MobileAnimationPacket(PacketReader reader)
     : base(0x6E, "Mobile Animation")
 {
     m_serial = reader.ReadInt32();
     m_action = reader.ReadInt16();
     m_framecount = reader.ReadInt16();
     m_repeatcount = reader.ReadInt16();
     m_reverse = reader.ReadByte(); // 0x00=forward, 0x01=backwards
     m_repeat = reader.ReadByte(); // 0 - Don't repeat / 1 repeat
     m_delay = reader.ReadByte();
 }
 // This is called when the packet is received.
 public TargetCursorMultiPacket(PacketReader reader)
     : base(0x99, "Target Cursor For Multi")
 {
     reader.ReadByte(); // (0x01 from server, 0x00 from client)
     m_deedSerial = reader.ReadInt32();
     reader.ReadByte(); // flag byte. Harmful = 1, Beneficial = 2. Unused.
     reader.ReadBytes(11); // unknown (all 0)
     m_multiModel = reader.ReadInt16();
     m_offsetX = reader.ReadInt16();
     m_offsetY = reader.ReadInt16();
     m_offsetZ = reader.ReadInt16();
 }
 public BookHeaderNewPacket(PacketReader reader)
     : base(0xD4, "Book Header (New)")
 {
     Serial = reader.ReadInt32();
     Flag0 = reader.ReadByte();
     Flag1 = reader.ReadByte();
     Pages = reader.ReadInt16();
     TitleLength = reader.ReadInt16();
     Title = reader.ReadString();
     AuthorLength = reader.ReadInt16();
     Author = reader.ReadString();
 }
 public ContainerContentUpdatePacket(PacketReader reader)
     : base(0x25, "Add Single Item")
 {
     Serial = reader.ReadInt32();
     ItemId = reader.ReadUInt16();
     reader.ReadByte(); // unknown
     Amount = reader.ReadUInt16();
     X = reader.ReadInt16();
     Y = reader.ReadInt16();
     GridLocation = reader.ReadByte(); // always 0 in RunUO.
     ContainerSerial = (Serial)reader.ReadInt32();
     Hue = reader.ReadUInt16();
 }
 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();
 }
 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();
 }
 public ContainerContentUpdatePacket(PacketReader reader)
     : base(0x25, "Add Single Item")
 {
     m_serial = reader.ReadInt32();
     m_itemId = reader.ReadUInt16();
     reader.ReadByte(); // unknown
     m_amount = reader.ReadUInt16();
     m_x = reader.ReadInt16();
     m_y = reader.ReadInt16();
     m_gridLocation = reader.ReadByte(); // always 0 in RunUO.
     m_parentSerial = (Serial)reader.ReadInt32();
     m_hue = reader.ReadUInt16();
 }
 public MessageLocalizedAffixPacket(PacketReader reader)
     : base(0xCC, "Message Localized Affix")
 {
     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();
     flags = reader.ReadByte();
     SpeakerName = reader.ReadString(30);
     Affix = reader.ReadStringSafe();
     Arguements = reader.ReadUnicodeStringSafeReverse();
 }
 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();
 }
        public VendorBuyListPacket(PacketReader reader)
            : base(0x74, "Open Buy Window")
        {
            VendorPackSerial = reader.ReadInt32();
            int count = reader.ReadByte();
            Items = new List<VendorBuyItem>();
            for (int i = 0; i < count; i++)
            {
                int price = reader.ReadInt32();
                int descriptionLegnth = reader.ReadByte();
                string description = reader.ReadString(descriptionLegnth);

                Items.Add(new VendorBuyItem(price, description));
            }
        }
        public VendorBuyListPacket(PacketReader reader)
            : base(0x74, "Open Buy Window")
        {
            m_vendorPackSerial = reader.ReadInt32();
            m_itemCount = reader.ReadByte();
            m_prices = new int[m_itemCount];
            m_descriptions = new string[m_itemCount];

            for (int i = 0; i < m_itemCount; i++)
            {
                m_prices[i] = reader.ReadInt32();
                int descriptionLegnth = reader.ReadByte();
                m_descriptions[i] = reader.ReadString(descriptionLegnth);
            }
        }
 public AddSingleItemToContainerPacket(PacketReader reader)
     : base(0x25, "Add Single Item")
 {
     Serial = reader.ReadInt32();
     ItemId = reader.ReadUInt16();
     reader.ReadByte(); // unknown
     Amount = reader.ReadUInt16();
     X = reader.ReadInt16();
     Y = reader.ReadInt16();
     if (reader.Buffer.Length == 21)
         GridLocation = reader.ReadByte(); // always 0 in RunUO.
     else
         GridLocation = 0;
     ContainerSerial = (Serial)reader.ReadInt32();
     Hue = reader.ReadUInt16();
 }
Exemple #27
0
 public ChatPacket(PacketReader reader)
     : base(0xB3, "Chat Packet")
 {
     m_language = reader.ReadString(3);
     reader.ReadInt16(); // unknown.
     m_commandtype = reader.ReadByte();
 }
 public PartyMemberListInfo(PacketReader reader)
 {
     Count = reader.ReadByte();
     Serials = new int[Count];
     for (int i = 0; i < Count; i++) {
         Serials[i] = reader.ReadInt32();
     }
 }
 public DragEffectPacket(PacketReader reader)
     : base(0x23, "Dragging Item")
 {
     m_itemId = reader.ReadUInt16();
     reader.ReadByte(); // 0x03 bytes unknown.
     reader.ReadByte(); //
     reader.ReadByte(); //
     m_amount = reader.ReadUInt16();
     m_sourceContainer = reader.ReadInt32(); // 0xFFFFFFFF for ground
     m_sourceX = reader.ReadUInt16();
     m_sourceY = reader.ReadUInt16();
     m_sourceZ = reader.ReadByte();
     m_destContainer = reader.ReadInt32(); // 0xFFFFFFFF for ground
     m_destX = reader.ReadUInt16();
     m_destY = reader.ReadUInt16();
     m_destZ = reader.ReadByte();
 }
Exemple #30
0
 public DragEffectPacket(PacketReader reader)
     : base(0x23, "Dragging Item")
 {
     ItemId = reader.ReadUInt16();
     reader.ReadByte(); // 0x03 bytes unknown.
     reader.ReadByte(); //
     reader.ReadByte(); //
     Amount = reader.ReadUInt16();
     Source = reader.ReadInt32(); // 0x00000000 or 0xFFFFFFFF for ground
     SourceX = reader.ReadUInt16();
     SourceY = reader.ReadUInt16();
     SourceZ = reader.ReadByte();
     Destination = reader.ReadInt32(); // 0x00000000 or 0xFFFFFFFF for ground
     DestX = reader.ReadUInt16();
     DestY = reader.ReadUInt16();
     DestZ = reader.ReadByte();
 }