Package l2p.gameserver.clientpackets

Source Code of l2p.gameserver.clientpackets.BypassUserCmd

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);
    }
  }
}
TOP

Related Classes of l2p.gameserver.clientpackets.BypassUserCmd

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.