Try to prevent possible door exploits.
This commit is contained in:
@ -20,6 +20,7 @@ import java.nio.BufferUnderflowException;
|
||||
|
||||
import com.l2jmobius.Config;
|
||||
import com.l2jmobius.gameserver.ai.CtrlIntention;
|
||||
import com.l2jmobius.gameserver.data.xml.impl.DoorData;
|
||||
import com.l2jmobius.gameserver.model.Location;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.events.EventDispatcher;
|
||||
@ -85,6 +86,13 @@ public class MoveBackwardToLocation extends L2GameClientPacket
|
||||
return;
|
||||
}
|
||||
|
||||
// Mobius: Check for possible door logout and move over exploit. Also checked at ValidatePosition.
|
||||
if (DoorData.getInstance().checkIfDoorsBetween(activeChar.getX(), activeChar.getY(), activeChar.getZ(), _targetX, _targetY, _targetZ, activeChar.getInstanceId(), false))
|
||||
{
|
||||
activeChar.stopMove(activeChar.getLastServerPosition());
|
||||
return;
|
||||
}
|
||||
|
||||
// Correcting targetZ from floor level to head level (?)
|
||||
// Client is giving floor level as targetZ but that floor level doesn't
|
||||
// match our current geodata and teleport coords as good as head level!
|
||||
|
@ -17,6 +17,7 @@
|
||||
package com.l2jmobius.gameserver.network.clientpackets;
|
||||
|
||||
import com.l2jmobius.Config;
|
||||
import com.l2jmobius.gameserver.data.xml.impl.DoorData;
|
||||
import com.l2jmobius.gameserver.model.L2World;
|
||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jmobius.gameserver.model.zone.ZoneId;
|
||||
@ -199,6 +200,11 @@ public class ValidatePosition extends L2GameClientPacket
|
||||
activeChar.setClientY(_y);
|
||||
activeChar.setClientZ(_z);
|
||||
activeChar.setClientHeading(_heading); // No real need to validate heading.
|
||||
activeChar.setLastServerPosition(realX, realY, realZ);
|
||||
|
||||
// Mobius: Check for possible door logout and move over exploit. Also checked at MoveBackwardToLocation.
|
||||
if (!DoorData.getInstance().checkIfDoorsBetween(realX, realY, realZ, _x, _y, _z, activeChar.getInstanceId(), false))
|
||||
{
|
||||
activeChar.setLastServerPosition(realX, realY, realZ);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user