Add tests for CashShopSurpriseHandler

This commit is contained in:
P0nk
2024-06-16 13:40:06 +02:00
parent c7b2d218ef
commit 6ab1af99da
11 changed files with 162 additions and 9 deletions

View File

@@ -82,6 +82,11 @@ public class ByteBufInPacket implements InPacket {
return byteBuf.readerIndex();
}
@Override
public boolean equals(Object o) {
return o instanceof ByteBufInPacket other && byteBuf.equals(other.byteBuf);
}
@Override
public String toString() {
final int readerIndex = byteBuf.readerIndex();

View File

@@ -91,4 +91,9 @@ public class ByteBufOutPacket implements OutPacket {
public void skip(int numberOfBytes) {
writeBytes(new byte[numberOfBytes]);
}
@Override
public boolean equals(Object o) {
return o instanceof ByteBufOutPacket other && byteBuf.equals(other.byteBuf);
}
}

View File

@@ -6480,14 +6480,15 @@ public class PacketCreator {
return p;
}
public static Packet onCashGachaponOpenSuccess(int accountid, long sn, int remainingBoxes, Item item, int itemid, int nSelectedItemCount, boolean bJackpot) {
public static Packet onCashGachaponOpenSuccess(int accountid, long boxCashId, int remainingBoxes, Item reward,
int rewardItemId, int rewardQuantity, boolean bJackpot) {
OutPacket p = OutPacket.create(SendOpcode.CASHSHOP_CASH_ITEM_GACHAPON_RESULT);
p.writeByte(0xE5); // subopcode thanks to Ubaware
p.writeLong(sn);// sn of the box used
p.writeLong(boxCashId);
p.writeInt(remainingBoxes);
addCashItemInformation(p, item, accountid);
p.writeInt(itemid);// the itemid of the liSN?
p.writeByte(nSelectedItemCount);// the total count now? o.O
addCashItemInformation(p, reward, accountid);
p.writeInt(rewardItemId);
p.writeByte(rewardQuantity); // nSelectedItemCount
p.writeBool(bJackpot);// "CashGachaponJackpot"
return p;
}