ddevault / Craft.Net

(Unmaintained, see TrueCraft) Minecraft server, client, and etc for .NET
MIT License
228 stars 64 forks source link

1.6.2 0x2C Bug #171

Closed Dav1dde closed 11 years ago

Dav1dde commented 11 years ago

The packet 0x2C: https://github.com/SirCmpwn/Craft.Net/blob/master/Craft.Net/Packets.cs#L1551

Is implemented incorrectly.

Burger: http://b.wiki.vg/1.6.2#packets:0x2c

I am currently using mcp to find out how it is done correctly, if I find something out, I'll correct the wiki and post an update here.

// Edit, Seems like this changed in 1.6.2... My bad, I'll let it open for now.

Dav1dde commented 11 years ago

Ok, so additionally to these Key/Value Pairs a list is sent for each value

(Key, Value, List : (short length, length*[{long msb, long lsb, double double_, byte byte_}]))
ddevault commented 11 years ago

Think you could submit a pull request?

dahquan1 commented 11 years ago
            for (int i = 0; i < count; i++)
            {
                Keys[i] = stream.ReadString();
                Values[i] = stream.ReadDouble();

                // Not really sure what it is used for
                var listLength = stream.ReadInt16(); // readShort
                if (listLength < 0)
                    throw new InvalidOperationException("Cannot specify less than zero properties.");

                for (int i2 = 0; i2 < listLength; i2++)
                {
                    stream.ReadInt64(); // readLong
                    stream.ReadInt64(); // readLong
                    stream.ReadDouble();
                    stream.ReadByte();
                }
            }

Is what I added for 1.6.2 support

ddevault commented 11 years ago

I've already dealt with that packet, in a different way.

ddevault commented 11 years ago

Fixed in 7ec102b63cc5394fc17b5ad5fed47f56e9fd25e1