EnterWorld exploit fix.

Author: Tryskell
Source: https://acis.i-live.eu/index.php?topic=10070
This commit is contained in:
MobiusDev
2019-02-25 17:36:19 +00:00
parent aacfb7b6e9
commit b4d261eb20
48 changed files with 88 additions and 29 deletions

View File

@@ -75,6 +75,7 @@ public final class L2GameClient extends MMOClient<MMOConnection<L2GameClient>> i
{
CONNECTED,
AUTHED,
ENTERING,
IN_GAME
}

View File

@@ -138,6 +138,23 @@ public final class L2GamePacketHandler implements IPacketHandler<L2GameClient>,
}
break;
}
case ENTERING:
{
switch (opcode)
{
case 0x03:
{
msg = new EnterWorld();
break;
}
default:
{
printDebug(opcode, buf, state, client);
break;
}
}
break;
}
case IN_GAME:
{
switch (opcode)
@@ -150,11 +167,6 @@ public final class L2GamePacketHandler implements IPacketHandler<L2GameClient>,
// case 0x02:
// Say ... not used any more ??
// break;
case 0x03:
{
msg = new EnterWorld();
break;
}
case 0x04:
{
msg = new Action();

View File

@@ -84,7 +84,7 @@ public class CharacterSelected extends L2GameClientPacket
cha.setClient(getClient());
getClient().setActiveChar(cha);
nProtect.getInstance().sendRequest(getClient());
getClient().setState(GameClientState.IN_GAME);
getClient().setState(GameClientState.ENTERING);
sendPacket(new CharSelected(cha, getClient().getSessionId().playOkID1));
}
}

View File

@@ -71,6 +71,7 @@ import com.l2jmobius.gameserver.model.quest.Quest;
import com.l2jmobius.gameserver.model.quest.QuestState;
import com.l2jmobius.gameserver.model.zone.ZoneId;
import com.l2jmobius.gameserver.network.Disconnection;
import com.l2jmobius.gameserver.network.L2GameClient.GameClientState;
import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.network.serverpackets.ClientSetTime;
import com.l2jmobius.gameserver.network.serverpackets.CreatureSay;
@@ -125,7 +126,6 @@ public class EnterWorld extends L2GameClientPacket
protected void runImpl()
{
final L2PcInstance activeChar = getClient().getActiveChar();
if (activeChar == null)
{
LOGGER.warning("EnterWorld failed! activeChar is null...");
@@ -133,6 +133,8 @@ public class EnterWorld extends L2GameClientPacket
return;
}
getClient().setState(GameClientState.IN_GAME);
// Set lock at login
activeChar.setLocked(true);