Tópico: [L2JFree] Anti-Phx para l2jfree rev.2741
Ver um Único Post
Antigo 22-12-2008, 07:27 PM   #1 (permalink)
christiand
Amigo SE
 
Avatar de christiand
 
Registrado em: Nov 2008
Localização: Rio de Janeiro, RJ
Posts: 597
Agradeceu: 47
Agradecido 1,826 Vezes em 246 Posts
Achei Ruim:
Acharam ruim Vezes em Posts
Enviar mensagem via Windows Live Messenger para christiand

Inventório de christiand

Thumbs up Anti-Phx para l2jfree rev.2741

Quem tem problema com hacker enchantando armas em seu server aqui tem uma ótima solução.

Coloque um anti-phx em seu server q nunca mais vc vai ter problemas com esses engraçadinhos, sem contar q quem usar irá aparecer uma mensagem para todos ler "tried to use phx and got BANED! Peace :-h".

O q é Phx?
Phx é uma abreviação do nome de um haker q quem sabe usar coloca tudo full em um servidor l2j q naum seja protegido de alguma forma.

phx = Haplex

O código abaixo só pode ser colocado em um servidor l2jfree rev.2741, não adianta q não funciona em outro servidor e nem em outra revisão do l2jfree.


no caminho net.sf.l2j.gameserver.clientpackets edite o arquivo SendWareHouseDepositList.java
Código: [Somente Usuários Registrados Podem Visualizar os Links Desta PáginaClique aqui para se Registrar]
import net.sf.l2j.gameserver.util.IllegalPlayerAction;
import net.sf.l2j.gameserver.util.Util;

na linha mais abaixo...
Código: [Somente Usuários Registrados Podem Visualizar os Links Desta PáginaClique aqui para se Registrar]
        if (player.getActiveEnchantItem() != null)
        {
           Util.handleIllegalPlayerAction(player,"Mofo "+player.getName()+" tried to use phx and got BANED! Peace :-h", IllegalPlayerAction.PUNISH_KICKBAN);
           return;
        }

como vai ficar o arquivo java ja editado...
Código: [Somente Usuários Registrados Podem Visualizar os Links Desta PáginaClique aqui para se Registrar]
// Decompiled by DJ v3.10.10.93 Copyright 2007 Atanas Neshkov  Date: 22/12/2008 19:41:01
// Home Page: http://members.fortunecity.com/neshkov/dj.html  http://www.neshkov.com/dj.html - Check often for new version!
// Decompiler options: packimports(3) 
// Source File Name:   SendWareHouseDepositList.java

package net.sf.l2j.gameserver.clientpackets;

import java.nio.ByteBuffer;
import net.sf.l2j.Config;
import net.sf.l2j.gameserver.Shutdown;
import net.sf.l2j.gameserver.model.*;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
import net.sf.l2j.gameserver.network.L2GameClient;
import net.sf.l2j.gameserver.network.SystemMessageId;
import net.sf.l2j.gameserver.serverpackets.*;
import net.sf.l2j.gameserver.templates.L2EtcItemType;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import net.sf.l2j.gameserver.util.IllegalPlayerAction;
import net.sf.l2j.gameserver.util.Util;

// Referenced classes of package net.sf.l2j.gameserver.clientpackets:
//            L2GameClientPacket

public class SendWareHouseDepositList extends L2GameClientPacket
{

    public SendWareHouseDepositList()
    {
    }

    protected void readImpl()
    {
        _count = readD();
        if(_count < 0 || _count * 8 > _buf.remaining() || _count > Config.MAX_ITEM_IN_PACKET)
            _count = 0;
        _items = new int[_count * 2];
        for(int i = 0; i < _count; i++)
        {
            int objectId = readD();
            _items[i * 2 + 0] = objectId;
            long cnt = readD();
            if(cnt > 0x7fffffffL || cnt < 0L)
            {
                _count = 0;
                _items = null;
                return;
            }
            _items[i * 2 + 1] = (int)cnt;
        }

    }

    protected void runImpl()
    {
        L2PcInstance player = ((L2GameClient)getClient()).getActiveChar();
        if(player == null)
            return;
        ItemContainer warehouse = player.getActiveWarehouse();
        if(warehouse == null)
            return;
        net.sf.l2j.gameserver.model.actor.instance.L2FolkInstance manager = player.getLastFolkNPC();
        if(Config.SAFE_REBOOT && Config.SAFE_REBOOT_DISABLE_TRANSACTION && Shutdown.getCounterInstance() != null && Shutdown.getCounterInstance().getCountdown() <= Config.SAFE_REBOOT_TIME)
        {
            player.sendMessage("Transactions are not allowed during restart/shutdown.");
            sendPacket(new ActionFailed());
            return;
        }
        if((manager == null || !player.isInsideRadius(manager, 150, false, false)) && !player.isGM())
            return;
        if((warehouse instanceof ClanWarehouse) && Config.GM_DISABLE_TRANSACTION && player.getAccessLevel() >= Config.GM_TRANSACTION_MIN && player.getAccessLevel() <= Config.GM_TRANSACTION_MAX)
        {
            player.sendMessage("Transactions are disabled for your access level.");
            sendPacket(new ActionFailed());
            return;
        }
        if(!Config.ALT_GAME_KARMA_PLAYER_CAN_USE_WAREHOUSE && player.getKarma() > 0)
            return;
        
        if (player.getActiveEnchantItem() != null)
        {
           Util.handleIllegalPlayerAction(player,"Mofo "+player.getName()+" tried to use phx and got BANED! Peace :-h", IllegalPlayerAction.PUNISH_KICKBAN);
           return;
        }
        int fee = _count * 30;
        int currentAdena = player.getAdena();
        int slots = 0;
        for(int i = 0; i < _count; i++)
        {
            int objectId = _items[i * 2 + 0];
            int count = _items[i * 2 + 1];
            L2ItemInstance item = player.checkItemManipulation(objectId, count, "deposit");
            if(item == null)
            {
                _log.warn((new StringBuilder()).append("Error depositing a warehouse object for char ").append(player.getName()).append(" (validity check)").toString());
                _items[i * 2 + 0] = 0;
                _items[i * 2 + 1] = 0;
                continue;
            }
            if(Config.ALT_STRICT_HERO_SYSTEM && item.isHeroitem())
                continue;
            if((warehouse instanceof ClanWarehouse) && !item.isTradeable() || item.getItemType() == L2EtcItemType.QUEST)
                return;
            if(item.getItemId() == 57)
                currentAdena -= count;
            if(!item.isStackable())
            {
                slots += count;
                continue;
            }
            if(warehouse.getItemByItemId(item.getItemId()) == null)
                slots++;
        }

        if(!warehouse.validateCapacity(slots))
        {
            sendPacket(new SystemMessage(SystemMessageId.YOU_HAVE_EXCEEDED_QUANTITY_THAT_CAN_BE_INPUTTED));
            return;
        }
        if(currentAdena < fee || !player.reduceAdena("Warehouse", fee, player.getLastFolkNPC(), false))
        {
            sendPacket(new SystemMessage(SystemMessageId.YOU_NOT_ENOUGH_ADENA));
            return;
        }
        InventoryUpdate playerIU = Config.FORCE_INVENTORY_UPDATE ? null : new InventoryUpdate();
        for(int i = 0; i < _count; i++)
        {
            int objectId = _items[i * 2 + 0];
            int count = _items[i * 2 + 1];
            if(objectId == 0 && count == 0)
                continue;
            L2ItemInstance oldItem = player.getInventory().getItemByObjectId(objectId);
            if(oldItem == null)
            {
                _log.warn((new StringBuilder()).append("Error depositing a warehouse object for char ").append(player.getName()).append(" (olditem == null)").toString());
                continue;
            }
            if(Config.ALT_STRICT_HERO_SYSTEM && oldItem.isHeroitem())
                continue;
            L2ItemInstance newItem = player.getInventory().transferItem((warehouse instanceof ClanWarehouse) ? "ClanWarehouse" : "Warehouse", objectId, count, warehouse, player, player.getLastFolkNPC());
            if(newItem == null)
            {
                _log.warn((new StringBuilder()).append("Error depositing a warehouse object for char ").append(player.getName()).append(" (newitem == null)").toString());
                continue;
            }
            if(playerIU == null)
                continue;
            if(oldItem.getCount() > 0 && oldItem != newItem)
                playerIU.addModifiedItem(oldItem);
            else
                playerIU.addRemovedItem(oldItem);
        }

        if(playerIU != null)
            player.sendPacket(playerIU);
        else
            player.sendPacket(new ItemList(player, false));
        StatusUpdate su = new StatusUpdate(player.getObjectId());
        su.addAttribute(14, player.getCurrentLoad());
        player.sendPacket(su);
    }

    public String getType()
    {
        return "[C] 31 SendWareHouseDepositList";
    }

    private static final String _C__31_SENDWAREHOUSEDEPOSITLIST = "[C] 31 SendWareHouseDepositList";
    private static final Log _log = LogFactory.getLog(net/sf/l2j/gameserver/clientpackets/SendWareHouseDepositList.getName());
    private int _count;
    private int _items[];

}
Para q seja feito isso ou pegue o fonte do l2jfree rev.2741 modifique e subistitua o q vc tem ou vc terá q decompilar o arquivo l2j-gameserver-1.0.0.jar, modificar e compilar de novo.

créditos
KidZoR (pelo código)
ChristianD (pelo exemplo e explicação)

Arquivos Anexados
Tipo de Arquivo: zip SendWareHouseDepositList.zip (2.2 KB, 273 visualizações) Baixar
__________________
[Somente Usuários Registrados Podem Visualizar os Links Desta PáginaClique aqui para se Registrar] [Somente Usuários Registrados Podem Visualizar os Links Desta PáginaClique aqui para se Registrar]
[Somente Usuários Registrados Podem Visualizar os Links Desta PáginaClique aqui para se Registrar]
christiand está offline  
Os Seguintes 29 Usuários disseram Obrigado(a) para christiand por gostarem deste post :
Mostrar/Ocultar lista dos que agradeceram

Links Patrocinados
 

Search Engine Optimization by vBSEO 3.3.0