Fix empty packets not being processed and added opcode 121 for 317 revision as a spam packet. it is something to do with resetting entities in a region and is not neded.

This commit is contained in:
thispixel
2014-06-27 22:42:58 +01:00
parent 2d598853d0
commit ed4e341400
2 changed files with 8 additions and 3 deletions
@@ -1,6 +1,7 @@
package org.apollo.net.codec.game;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import io.netty.channel.ChannelHandlerContext;
import java.io.IOException;
@@ -117,9 +118,12 @@ public final class GamePacketDecoder extends StatefulFrameDecoder<GameDecoderSta
switch (type) {
case FIXED:
length = metaData.getLength();
if (length != 0) {
setState(GameDecoderState.GAME_PAYLOAD);
}
if (length == 0) {
setState(GameDecoderState.GAME_OPCODE);
out.add(new GamePacket(opcode, type, Unpooled.EMPTY_BUFFER));
} else {
setState(GameDecoderState.GAME_PAYLOAD);
}
break;
case VARIABLE_BYTE:
setState(GameDecoderState.GAME_LENGTH);
@@ -138,6 +138,7 @@ public final class Release317 extends Release {
register(189, spamEventDecoder);
register(210, spamEventDecoder);
register(226, spamEventDecoder);
register(121, spamEventDecoder);
register(155, new FirstNpcActionEventDecoder());
register(17, new SecondNpcActionEventDecoder());