Handlers read from InPacket instead of SeekableLittleEndianAccessor
This commit is contained in:
@@ -63,8 +63,6 @@ import server.maps.FieldLimit;
|
||||
import server.maps.MapleMap;
|
||||
import server.maps.MapleMiniDungeonInfo;
|
||||
import tools.*;
|
||||
import tools.data.input.ByteArrayByteStream;
|
||||
import tools.data.input.GenericSeekableLittleEndianAccessor;
|
||||
|
||||
import javax.script.ScriptEngine;
|
||||
import java.io.IOException;
|
||||
@@ -199,15 +197,11 @@ public class MapleClient extends ChannelInboundHandlerAdapter {
|
||||
}
|
||||
|
||||
if (handler != null && handler.validateState(this)) {
|
||||
// TODO: pass InPacket directly to handler once all handlers have been ported,
|
||||
// this is just a temporary workaround
|
||||
final byte[] content = packet.getBytes();
|
||||
GenericSeekableLittleEndianAccessor accessor = new GenericSeekableLittleEndianAccessor(new ByteArrayByteStream(content));
|
||||
try {
|
||||
MapleLogger.logRecv(this, opcode, content);
|
||||
handler.handlePacket(accessor, this);
|
||||
MapleLogger.logRecv(this, opcode, packet.getBytes());
|
||||
handler.handlePacket(packet, this);
|
||||
} catch (final Throwable t) {
|
||||
FilePrinter.printError(FilePrinter.PACKET_HANDLER + handler.getClass().getName() + ".txt", t, "Error for " + (getPlayer() == null ? "" : "player ; " + getPlayer() + " on map ; " + getPlayer().getMapId() + " - ") + "account ; " + getAccountName() + "\r\n" + accessor);
|
||||
FilePrinter.printError(FilePrinter.PACKET_HANDLER + handler.getClass().getName() + ".txt", t, "Error for " + (getPlayer() == null ? "" : "player ; " + getPlayer() + " on map ; " + getPlayer().getMapId() + " - ") + "account ; " + getAccountName() + "\r\n" + packet);
|
||||
//client.sendPacket(PacketCreator.enableActions());//bugs sometimes
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user