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

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

            _planes = new CustomHousePlane[_numPlanes];
            for (int i = 0; i < _numPlanes; i++)
            {
                _planes[i] = new CustomHousePlane(reader);
            }
        }
예제 #2
0
 public TimePacket(PacketReader reader)
     : base(0x5B, "Time")
 {
     _hour = reader.ReadByte();
     _minute = reader.ReadByte();
     _second = reader.ReadByte();
 }
예제 #3
0
 public UpdateHealthPacket(PacketReader reader)
     : base(0xA1, "Update Health")
 {
     _serial = reader.ReadInt32();
     _max = reader.ReadInt16();
     _current = reader.ReadInt16();
 }
예제 #4
0
 public ServerRelayPacket(PacketReader reader)
     : base(0x8C, "Server Relay")
 {
     _ipAddress = reader.ReadInt32();
     _port = reader.ReadInt16();
     _accountId = reader.ReadInt32();
 }
예제 #5
0
 public ChatPacket(PacketReader reader)
     : base(0xB3, "Chat Packet")
 {
     _language = reader.ReadString(3);
     reader.ReadInt16(); // unknown.
     _commandtype = reader.ReadByte();
 }
예제 #6
0
 public WeatherPacket(PacketReader reader)
     : base(0x65, "Set Weather")
 {
     _weatherType = reader.ReadByte();
     _effectId = reader.ReadByte();
     _temperature = reader.ReadByte();
 }
예제 #7
0
 public DeathAnimationPacket(PacketReader reader)
     : base(0xAF, "Death Animation")
 {
     PlayerSerial = reader.ReadInt32();
     CorpseSerial = reader.ReadInt32();
     reader.ReadInt32(); // unknown - all zero's.
 }
예제 #8
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));
            }

            _items = items.ToArray();
            if (NextContainerContentsIsPre6017)
                NextContainerContentsIsPre6017 = false;
        }
예제 #9
0
 public TargetCursorPacket(PacketReader reader)
     : base(0x6C, "Target Cursor")
 {
     _commandtype = reader.ReadByte(); // 0x00 = Select Object; 0x01 = Select X, Y, Z
     _cursorid = reader.ReadInt32();
     _cursortype = reader.ReadByte(); // 0 - 2 = unknown; 3 = Cancel current targetting RunUO seems to always send 0.
 }
예제 #10
0
 public UpdateStaminaPacket(PacketReader reader)
     : base(0xA3, "Update Stamina")
 {
     _serial = reader.ReadInt32();
     _max = reader.ReadInt16();
     _current = reader.ReadInt16();
 }
예제 #11
0
 public SwingPacket(PacketReader reader)
     : base(0x2F, "Swing")
 {
     _flag = reader.ReadByte();
     _attacker = reader.ReadInt32();
     _defender = reader.ReadInt32();
 }
예제 #12
0
        public ObjectPropertyListPacket(PacketReader reader)
            : base(0xD6, "Object Property List")
        {
            reader.ReadInt16(); // Always 0x0001
            _serial = reader.ReadInt32();

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

            _clilocs = new List<int>();
            _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)
            {
                _clilocs.Add(clilocId);

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

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

                _arguments.Add(args);

                clilocId = reader.ReadInt32();
            }
        }
예제 #13
0
 public MovementRejectPacket(PacketReader reader)
     : base(0x21, "Move Request Rejected")
 {
     _sequence = reader.ReadByte(); // (matches sent sequence)
     _x = reader.ReadInt16();
     _y = reader.ReadInt16();
     _direction = reader.ReadByte();
     _z = reader.ReadSByte();
 }
예제 #14
0
        public WarModePacket(PacketReader reader)
            : base(0x72, "Request War Mode")
        {
            _warmode = reader.ReadByte();

            reader.ReadByte(); // always 0x00
            reader.ReadByte(); // always 0x32
            reader.ReadByte(); // always 0x00
        }
예제 #15
0
 public WornItemPacket(PacketReader reader)
     : base(0x2E, "Worn Item")
 {
     _serial = reader.ReadInt32();
     _itemId = reader.ReadInt16();
     reader.ReadByte();
     _layer = reader.ReadByte();
     _parentSerial = reader.ReadInt32();
     _hue = reader.ReadInt16();
 }
예제 #16
0
 public PlaySoundEffectPacket(PacketReader reader)
     : base(0x54, "Play Sound Effect")
 {
     Mode = reader.ReadByte();
     SoundModel = reader.ReadInt16();
     Unknown = reader.ReadInt16();
     X = reader.ReadInt16();
     Y = reader.ReadInt16();
     Z = reader.ReadInt16();
 }
예제 #17
0
 public MobileAttributesPacket(PacketReader reader)
     : base(0x2D, "Mobile Attributes")
 {
     _serial = reader.ReadInt32();
     _maxHits = reader.ReadInt16();
     _currentHits = reader.ReadInt16();
     _maxMana = reader.ReadInt16();
     _currentMana = reader.ReadInt16();
     _maxStamina = reader.ReadInt16();
     _currentStamina = reader.ReadInt16();
 }
예제 #18
0
 public AsciiMessagePacket(PacketReader reader)
     : base(0x1C, "Ascii Message")
 {
     _serial = reader.ReadInt32();
     _graphic = reader.ReadInt16();
     _type = (MessageType)reader.ReadByte();
     _hue = reader.ReadInt16();
     _font = reader.ReadInt16();
     _name = reader.ReadString(30);
     _text = reader.ReadString();
 }
예제 #19
0
 public MobileAnimationPacket(PacketReader reader)
     : base(0x6E, "Mobile Animation")
 {
     _serial = reader.ReadInt32();
     _action = reader.ReadInt16();
     _framecount = reader.ReadInt16();
     _repeatcount = reader.ReadInt16();
     _reverse = reader.ReadByte(); // 0x00=forward, 0x01=backwards
     _repeat = reader.ReadByte(); // 0 - Don't repeat / 1 repeat
     _delay = reader.ReadByte();
 }
예제 #20
0
 public GraphicEffectExtendedPacket(int id, PacketReader reader)
     : base(id, reader)
 {
     // BYTE[2] effect # (tile ID)
     // BYTE[2] explode effect # (0 if no explosion)
     // BYTE[2] additional effect # that's only used for moving effects, 0 otherwise
     // BYTE[4] if target is item (type 2) that's itemId, 0 otherwise
     // BYTE[1] layer (of the character, e.g left hand, right hand, ... 0-4, 0xff: moving effect or target is no char)
     // BYTE[2] yet another (unknown) additional effect that's only set for moving effect, 0 otherwise
     Diagnostics.Logger.Warn("Packet 0xC7 received; support for this packet is not yet implemented.");
 }
예제 #21
0
 public SubServerPacket(PacketReader reader)
     : base(0xB3, "Chat Packet")
 {
     _x = reader.ReadInt16();
     _y = reader.ReadInt16();
     _z = reader.ReadInt16();
     reader.ReadByte();
     reader.ReadInt16();
     reader.ReadInt16();
     _mapWidth = reader.ReadInt16();
     _mapHeight = reader.ReadInt16();
 }
예제 #22
0
 public MessageLocalizedPacket(PacketReader reader)
     : base(0xC1, "Message Localized")
 {
     Serial = reader.ReadInt32(); // 0xffff for system message
     Body = reader.ReadInt16(); // (0xff for system message
     MessageType = (MessageType)reader.ReadByte(); // 6 - lower left, 7 on player
     Hue = reader.ReadUInt16();
     Font = reader.ReadInt16();
     CliLocNumber = reader.ReadInt32();
     SpeakerName = reader.ReadString(30);
     Arguements = reader.ReadUnicodeStringSafeReverse();
 }
예제 #23
0
        public CharacterListUpdatePacket(PacketReader reader)
            : base(0x86, "Character List Update")
        {
            // Documented at http://docs.polserver.com/packets/index.php?Packet=0xA8
            int characterCount = reader.ReadByte();
            _characters = new CharacterListEntry[characterCount];

            for (int i = 0; i < characterCount; i++)
            {
                _characters[i] = new CharacterListEntry(reader);
            }
        }
예제 #24
0
        public CustomHousePlane(PacketReader reader)
        {
            byte[] data = reader.ReadBytes(4);
            Index = data[0];
            int uncompressedsize = data[1] + ((data[3] & 0xF0) << 4);
            int compressedLength = data[2] + ((data[3] & 0xF) << 8);
            ItemData = new byte[uncompressedsize];
            Compression.Unpack(ItemData, ref uncompressedsize, reader.ReadBytes(compressedLength), compressedLength);

            IsFloor = ((Index & 0x20) == 0x20);
            Index &= 0x1F;
        }
예제 #25
0
 public UnicodeMessagePacket(PacketReader reader)
     : base(0xAE, "Unicode Message")
 {
     _serial = reader.ReadInt32();
     _model = reader.ReadInt16();
     _msgType = (MessageType)reader.ReadByte();
     _hue = reader.ReadInt16();
     _font = reader.ReadInt16();
     _language = reader.ReadInt32();
     _speakerName = reader.ReadString(30);
     _spokenText = reader.ReadUnicodeString((reader.Buffer.Length - 48) / 2);
 }
예제 #26
0
 // 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)
     _deedSerial = reader.ReadInt32();
     reader.ReadByte(); // flag byte. Harmful = 1, Beneficial = 2. Unused.
     reader.ReadBytes(11); // unknown (all 0)
     _multiModel = reader.ReadInt16();
     _offsetX = reader.ReadInt16();
     _offsetY = reader.ReadInt16();
     _offsetZ = reader.ReadInt16();
 }
예제 #27
0
        public LoginConfirmPacket(PacketReader reader)
            : base(0x1B, "Login Confirm")
        {
            _serial = reader.ReadInt32();

            reader.ReadInt32();//unknown..

            _body = reader.ReadInt16();
            _x = reader.ReadInt16();
            _y = reader.ReadInt16();
            _z = reader.ReadInt16();
            _direction = reader.ReadByte();
        }
 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.
     _parentSerial = (Serial)reader.ReadInt32();
     _hue = reader.ReadUInt16();
 }
예제 #29
0
        public ServerListPacket(PacketReader reader)
            : base(0xA8, "Server List")
        {
            _flags = reader.ReadByte();
            ushort count = (ushort)reader.ReadInt16();

            _servers = new ServerListEntry[count];

            for (ushort i = 0; i < count; i++)
            {
                _servers[i] = new ServerListEntry(reader); ;
            }
        }
예제 #30
0
 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();
 }