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

@@ -24,20 +24,20 @@ import client.MapleFamily;
import client.MapleFamilyEntry;
import config.YamlConfig;
import net.AbstractMaplePacketHandler;
import net.packet.InPacket;
import tools.PacketCreator;
import tools.data.input.SeekableLittleEndianAccessor;
public class FamilySeparateHandler extends AbstractMaplePacketHandler {
@Override
public void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) {
public void handlePacket(InPacket p, MapleClient c) {
if(!YamlConfig.config.server.USE_FAMILY_SYSTEM) return;
MapleFamily oldFamily = c.getPlayer().getFamily();
if(oldFamily == null) return;
MapleFamilyEntry forkOn = null;
boolean isSenior;
if(slea.available() > 0) { //packet 0x95 doesn't send id, since there is only one senior
forkOn = c.getPlayer().getFamily().getEntryByID(slea.readInt());
if(p.available() > 0) { //packet 0x95 doesn't send id, since there is only one senior
forkOn = c.getPlayer().getFamily().getEntryByID(p.readInt());
if(!c.getPlayer().getFamilyEntry().isJunior(forkOn)) return; //packet editing?
isSenior = true;
} else {