package l2p.gameserver.clientpackets;
import l2p.extensions.multilang.CustomMessage;
import l2p.gameserver.handler.IUserCommandHandler;
import l2p.gameserver.handler.UserCommandHandler;
import l2p.gameserver.model.L2Player;
/**
* format: cd
* Пример пакета по команде /loc:
* AA 00 00 00 00
*/
public class BypassUserCmd extends L2GameClientPacket
{
private int _command;
@Override
public void readImpl()
{
_command = readD();
}
@Override
public void runImpl()
{
L2Player activeChar = getClient().getActiveChar();
if(activeChar == null)
{
return;
}
IUserCommandHandler handler = UserCommandHandler.getInstance().getUserCommandHandler(_command);
if(handler == null)
{
activeChar.sendMessage(new CustomMessage("common.S1NotImplemented", activeChar).addString(String.valueOf(_command)));
}
else
{
handler.useUserCommand(_command, activeChar);
}
}
}