Handlers read from InPacket instead of SeekableLittleEndianAccessor

This commit is contained in:
P0nk
2021-08-22 22:10:19 +02:00
parent 2232022cf1
commit da2d8abc56
182 changed files with 1223 additions and 1230 deletions

View File

@@ -25,37 +25,37 @@ import client.MapleClient;
import client.processor.npc.DueyProcessor;
import config.YamlConfig;
import net.AbstractMaplePacketHandler;
import net.packet.InPacket;
import tools.PacketCreator;
import tools.data.input.SeekableLittleEndianAccessor;
public final class DueyHandler extends AbstractMaplePacketHandler {
@Override
public final void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) {
public final void handlePacket(InPacket p, MapleClient c) {
if (!YamlConfig.config.server.USE_DUEY){
c.sendPacket(PacketCreator.enableActions());
return;
}
byte operation = slea.readByte();
byte operation = p.readByte();
if (operation == DueyProcessor.Actions.TOSERVER_RECV_ITEM.getCode()) { // on click 'O' Button, thanks inhyuk
DueyProcessor.dueySendTalk(c, false);
} else if (operation == DueyProcessor.Actions.TOSERVER_SEND_ITEM.getCode()) {
byte inventId = slea.readByte();
short itemPos = slea.readShort();
short amount = slea.readShort();
int mesos = slea.readInt();
String recipient = slea.readMapleAsciiString();
boolean quick = slea.readByte() != 0;
String message = quick ? slea.readMapleAsciiString() : null;
byte inventId = p.readByte();
short itemPos = p.readShort();
short amount = p.readShort();
int mesos = p.readInt();
String recipient = p.readString();
boolean quick = p.readByte() != 0;
String message = quick ? p.readString() : null;
DueyProcessor.dueySendItem(c, inventId, itemPos, amount, mesos, message, recipient, quick);
} else if (operation == DueyProcessor.Actions.TOSERVER_REMOVE_PACKAGE.getCode()) {
int packageid = slea.readInt();
int packageid = p.readInt();
DueyProcessor.dueyRemovePackage(c, packageid, true);
} else if (operation == DueyProcessor.Actions.TOSERVER_CLAIM_PACKAGE.getCode()) {
int packageid = slea.readInt();
int packageid = p.readInt();
DueyProcessor.dueyClaimPackage(c, packageid);
} else if (operation == DueyProcessor.Actions.TOSERVER_CLAIM_PACKAGE.getCode()) {