public override void Deserialize(Packet rawPacket)
        {
            var reader = new ArrayPacketReader(rawPacket.Payload);

            reader.Skip(1);
            GameServerIp = new byte[4];
            reader.Read(GameServerIp, 0, 4);
            GameServerPort = reader.ReadUShort();
            Seed           = new byte[4];
            reader.Read(Seed, 0, 4);
            payload = rawPacket.Payload;
        }
Exemple #2
0
        public override void Deserialize(Packet rawPacket)
        {
            this.rawPacket = rawPacket;

            var reader = new ArrayPacketReader(rawPacket.Payload);

            reader.Skip(1);

            var size = reader.ReadUShort();

            GumpId     = (GumpInstanceId)reader.ReadUInt();
            GumpTypeId = (GumpTypeId)reader.ReadUInt();
            X          = reader.ReadInt();
            Y          = reader.ReadInt();
            int clen = reader.ReadInt() - 4;
            int dlen = (int)reader.ReadUInt();

            byte[] data = new byte[clen];
            reader.Read(data, 0, clen);
            byte[] decData = new byte[dlen];

            Decompress(data, 0, decData, dlen);
            Commands = Encoding.UTF8.GetString(decData);

            uint linesNum = reader.ReadUInt();

            if (linesNum > 0)
            {
                clen = reader.ReadInt() - 4;
                dlen = reader.ReadInt();

                data = new byte[clen];
                reader.Read(data, 0, clen);

                decData = new byte[dlen];
                Decompress(data, 0, decData, dlen);
                TextLines = new string[linesNum];

                for (int i = 0, index = 0; i < linesNum; i++)
                {
                    int    length = (decData[index++] << 8) | decData[index++];
                    byte[] text   = new byte[length * 2];
                    Buffer.BlockCopy(decData, index, text, 0, text.Length);
                    index       += text.Length;
                    TextLines[i] = Encoding.BigEndianUnicode.GetString(text);
                }
            }
            else
            {
                TextLines = Array.Empty <string>();
            }
        }
Exemple #3
0
        public override void Deserialize(Packet rawPacket)
        {
            this.rawPacket = rawPacket;

            var reader = new ArrayPacketReader(rawPacket.Payload);

            reader.Skip(1);
            Key = new byte[4];
            reader.Read(Key, 0, 4);
            AccountName = reader.ReadString(30);
            Password    = reader.ReadString(30);
        }
Exemple #4
0
        public override void Deserialize(Packet rawPacket)
        {
            this.rawPacket = rawPacket;

            var reader = new ArrayPacketReader(rawPacket.Payload);

            reader.Skip(1);
            Seed = new byte[4];
            reader.Read(Seed, 0, 4);

            ClientVersion = new Version(reader.ReadInt(), reader.ReadInt(), reader.ReadInt(), reader.ReadInt());
        }
        public override void Deserialize(Packet rawPacket)
        {
            this.rawPacket = rawPacket;

            var reader = new ArrayPacketReader(rawPacket.Payload);

            reader.Skip(5);

            CharacterName = reader.ReadString(30);
            reader.Skip(2);  // unknown
            Flags = (ClientFlags)reader.ReadUInt();
            reader.Skip(4);  // unknown
            LoginCount = reader.ReadUInt();
            reader.Skip(16); // unknown
            SlotChosen = reader.ReadUInt();

            ClientIp = new byte[4];
            reader.Read(ClientIp, 0, 4);
        }