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

@@ -52,7 +52,7 @@ public class FamilySeparateHandler extends AbstractMaplePacketHandler {
int cost = 2500 * levelDiff;
cost += levelDiff * levelDiff;
if(c.getPlayer().getMeso() < cost) {
c.announce(PacketCreator.sendFamilyMessage(isSenior ? 81 : 80, cost));
c.sendPacket(PacketCreator.sendFamilyMessage(isSenior ? 81 : 80, cost));
return;
}
c.getPlayer().gainMeso(-cost);
@@ -61,9 +61,9 @@ public class FamilySeparateHandler extends AbstractMaplePacketHandler {
if(senior.getSenior() != null) senior.getSenior().gainReputation(-(repCost/2), false);
forkOn.announceToSenior(PacketCreator.serverNotice(5, forkOn.getName() + " has left the family."), true);
forkOn.fork();
c.announce(PacketCreator.getFamilyInfo(forkOn)); //pedigree info will be requested from the client if the window is open
c.sendPacket(PacketCreator.getFamilyInfo(forkOn)); //pedigree info will be requested from the client if the window is open
forkOn.updateSeniorFamilyInfo(true);
c.announce(PacketCreator.sendFamilyMessage(1, 0));
c.sendPacket(PacketCreator.sendFamilyMessage(1, 0));
}