Fix potential issue with maps and frames.

This commit is contained in:
md_5 2012-11-19 19:34:08 +11:00
parent b4661a5c5f
commit 1999076429
4 changed files with 6 additions and 12 deletions

View File

@ -8,7 +8,7 @@ public class PacketDefinitions {
public enum OpCode {
BOOLEAN, BULK_CHUNK, BYTE, BYTE_INT, DOUBLE, FLOAT, INT, INT_3, INT_BYTE, ITEM, LONG, METADATA, OPTIONAL_MOTION, SHORT, SHORT_BYTE, SHORT_ITEM, STRING, UBYTE_BYTE
BOOLEAN, BULK_CHUNK, BYTE, BYTE_INT, DOUBLE, FLOAT, INT, INT_3, INT_BYTE, ITEM, LONG, METADATA, OPTIONAL_MOTION, SHORT, SHORT_BYTE, SHORT_ITEM, STRING, USHORT_BYTE
}
static {
@ -100,7 +100,7 @@ public class PacketDefinitions {
//
//
opCodes[0x82] = new OpCode[]{INT, SHORT, INT, STRING, STRING, STRING, STRING};
opCodes[0x83] = new OpCode[]{SHORT, SHORT, SHORT_BYTE};
opCodes[0x83] = new OpCode[]{SHORT, SHORT, USHORT_BYTE};
opCodes[0x84] = new OpCode[]{INT, SHORT, INT, BYTE, SHORT_BYTE};
//
//

View File

@ -22,7 +22,7 @@ abstract class Instruction {
static final Instruction SHORT_BYTE = new ShortHeader(BYTE);
static final Instruction SHORT_ITEM = new ShortHeader(ITEM);
static final Instruction STRING = new ShortHeader(new Jump(2));
static final Instruction UBYTE_BYTE = new UnsignedByteByte();
static final Instruction USHORT_BYTE = new UnsignedShortByte();
// Illegal forward references below this line
static final Instruction BYTE_INT = new ByteHeader(INT);

View File

@ -27,13 +27,7 @@ class MetaData extends Instruction {
STRING.read(in);
break;
case 5:
if (in.readShort() > 0) {
skip(in, 3);
short len = in.readShort();
if (len > 0 ) {
skip(in, len);
}
}
ITEM.read(in);
break;
case 6:
skip(in, 12); // int, int, int

View File

@ -3,11 +3,11 @@ package net.md_5.mendax.datainput;
import java.io.DataInput;
import java.io.IOException;
public class UnsignedByteByte extends Instruction {
public class UnsignedShortByte extends Instruction {
@Override
void read(DataInput in) throws IOException {
int size = in.readUnsignedByte();
int size = in.readUnsignedShort();
skip(in, size);
}
}