Remove remaining uses of MaplePacketLittleEndianWriter

This commit is contained in:
P0nk
2021-08-22 21:03:51 +02:00
parent 8f6860d7d7
commit b3d422a6c5
7 changed files with 78 additions and 94 deletions

View File

@@ -28,12 +28,13 @@ import client.MapleClient;
import client.command.Command;
import net.MaplePacketHandler;
import net.PacketProcessor;
import net.packet.ByteBufOutPacket;
import net.packet.OutPacket;
import tools.FilePrinter;
import tools.HexTool;
import tools.data.input.ByteArrayByteStream;
import tools.data.input.GenericSeekableLittleEndianAccessor;
import tools.data.input.SeekableLittleEndianAccessor;
import tools.data.output.MaplePacketLittleEndianWriter;
import java.io.FileReader;
import java.io.IOException;
@@ -61,9 +62,9 @@ public class PeCommand extends Command {
return;
}
MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
mplew.write(HexTool.getByteArrayFromHexString(packet));
SeekableLittleEndianAccessor slea = new GenericSeekableLittleEndianAccessor(new ByteArrayByteStream(mplew.getPacket()));
OutPacket p = new ByteBufOutPacket();
p.writeBytes(HexTool.getByteArrayFromHexString(packet));
SeekableLittleEndianAccessor slea = new GenericSeekableLittleEndianAccessor(new ByteArrayByteStream(p.getBytes()));
short packetId = slea.readShort();
final MaplePacketHandler packetHandler = PacketProcessor.getProcessor(0, c.getChannel()).getHandler(packetId);
if (packetHandler != null && packetHandler.validateState(c)) {