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

@@ -27,12 +27,12 @@ import client.MapleFamilyEntitlement;
import client.MapleFamilyEntry;
import config.YamlConfig;
import net.AbstractMaplePacketHandler;
import net.packet.InPacket;
import net.server.coordinator.world.MapleInviteCoordinator;
import net.server.coordinator.world.MapleInviteCoordinator.InviteType;
import server.maps.FieldLimit;
import server.maps.MapleMap;
import tools.PacketCreator;
import tools.data.input.SeekableLittleEndianAccessor;
/**
*
@@ -41,11 +41,11 @@ import tools.data.input.SeekableLittleEndianAccessor;
*/
public final class FamilyUseHandler extends AbstractMaplePacketHandler {
@Override
public final void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) {
public final void handlePacket(InPacket p, MapleClient c) {
if(!YamlConfig.config.server.USE_FAMILY_SYSTEM) {
return;
}
MapleFamilyEntitlement type = MapleFamilyEntitlement.values()[slea.readInt()];
MapleFamilyEntitlement type = MapleFamilyEntitlement.values()[p.readInt()];
int cost = type.getRepCost();
MapleFamilyEntry entry = c.getPlayer().getFamilyEntry();
if(entry.getReputation() < cost || entry.isEntitlementUsed(type)) {
@@ -54,7 +54,7 @@ public final class FamilyUseHandler extends AbstractMaplePacketHandler {
c.sendPacket(PacketCreator.getFamilyInfo(entry));
MapleCharacter victim;
if(type == MapleFamilyEntitlement.FAMILY_REUINION || type == MapleFamilyEntitlement.SUMMON_FAMILY) {
victim = c.getChannelServer().getPlayerStorage().getCharacterByName(slea.readMapleAsciiString());
victim = c.getChannelServer().getPlayerStorage().getCharacterByName(p.readString());
if(victim != null && victim != c.getPlayer()) {
if(victim.getFamily() == c.getPlayer().getFamily()) {
MapleMap targetMap = victim.getMap();