All packet creating methods now create Packet instead of byte[]

This commit got way too big...
- Remove deprecated methods for sending packets
- Favor OutPacket & Packet over MaplePacketLittleEndianWriter, LittleEndianWriter, and byte array
- Split up some packet creating methods into separate classes
This commit is contained in:
P0nk
2021-08-21 01:36:51 +02:00
parent b5cd6887ae
commit 8f6860d7d7
231 changed files with 6403 additions and 6927 deletions

View File

@@ -188,7 +188,7 @@ public final class CouponCodeHandler extends AbstractMaplePacketHandler {
Pair<Integer, List<Pair<Integer, Pair<Integer, Integer>>>> codeRes = getNXCodeResult(c.getPlayer(), code.toUpperCase());
int type = codeRes.getLeft();
if (type < 0) {
c.announce(PacketCreator.showCashShopMessage((byte) parseCouponResult(type)));
c.sendPacket(PacketCreator.showCashShopMessage((byte) parseCouponResult(type)));
} else {
List<Item> cashItems = new LinkedList<>();
List<Pair<Integer, Integer>> items = new LinkedList<>();
@@ -260,9 +260,9 @@ public final class CouponCodeHandler extends AbstractMaplePacketHandler {
}
}
if (nxCredit != 0 || nxPrepaid != 0) { //coupon packet can only show maple points (afaik)
c.announce(PacketCreator.showBoughtQuestItem(0));
c.sendPacket(PacketCreator.showBoughtQuestItem(0));
} else {
c.announce(PacketCreator.showCouponRedeemedItems(c.getAccID(), maplePoints, mesos, cashItems, items));
c.sendPacket(PacketCreator.showCouponRedeemedItems(c.getAccID(), maplePoints, mesos, cashItems, items));
}
c.enableCSActions();
}