final GreetingPacket r = new GreetingPacket();
r.length = packet.getLength();
r.sequence = packet.getSequence();
r.protocolVersion = d.readInt(1);
r.serverVersion = d.readNullTerminatedString();
r.threadId = d.readLong(4);
r.scramble1 = d.readNullTerminatedString();
r.serverCapabilities = d.readInt(2);
r.serverCollation = d.readInt(1);
r.serverStatus = d.readInt(2);
d.skip(13); // reserved, all 0