Jump to content

[Share]Dual-Box (Anti)


Recommended Posts

So, if I understood correctly, you create a java file named "custom" in model.

 

I get these errors though:

 

 

    public class ProtectionNetwork

 

It says "The public type ProtectionNetwork must be defined in its own file." And it gives me the option to rename the file to "ProtectionNetwork".



Then I get another error here:

 

player.getClient().getConnection().getSocketChannel().socket().getInetAddress().getHostAddress();

 

It says "The method GetSocketChannel() is undefined for the type MMOConnection<L2GameServerClient>" and suggests "Add cast to method receiver."

 

Sorry for bumping.

Edited by Tristis
Link to comment
Share on other sites

No, you dont.. You create ProtectionNetwork.java file inside the location (../gameserver/model/)

 

 

player.getClient().getConnection().getInetAddress().getHostAddress();
Link to comment
Share on other sites

And this:

 

+        if (ProtectionDualBox.check(activeChar))
+            ProtectionDualBox.disc(activeChar);

 

Should be changed to this:

 

+        if (ProtectionNetwork.check(activeChar))
+                ProtectionNetwork.disc(activeChar);

 

Right?

Link to comment
Share on other sites

  • 5 years later...
On 11/2/2014 at 7:54 PM, Tristis said:

And this:

 

+        if (ProtectionDualBox.check(activeChar))
+            ProtectionDualBox.disc(activeChar);

 

Should be changed to this:

 

+        if (ProtectionNetwork.check(activeChar))
+                ProtectionNetwork.disc(activeChar);

 

Right?

i build ok but when i login alway all disconnected from server even 1st charecter also got disconnect

my code...

 

/*
 * Copyright (C) 2004-2020 L2J Server
 * 
 * This file is part of L2J Server.
 * 
 * L2J Server is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * L2J Server is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */
/**
 * @author User
 *
 */
package com.l2jserver.gameserver.model;

import com.l2jserver.gameserver.ThreadPoolManager;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.network.clientpackets.Say2;
import com.l2jserver.gameserver.network.serverpackets.CreatureSay;

/**
 * @author xAddytzu
 */
public class ProtectionNetwork
{
    public static void disc(final L2PcInstance player)
    {
        player.sendPacket(new CreatureSay(1, Say2.HERO_VOICE, "SYSTEM", "You cannot play with dualbox."));
        ThreadPoolManager.getInstance().scheduleGeneral(() -> player.closeNetConnection(false), 20000);
    }
    
    public static boolean check(L2PcInstance player)
    {
        boolean loggedz0r = false;
        for (L2PcInstance playerz0r : L2World.getInstance().getPlayers())
        {
            String client = first(playerz0r);
            String client1 = second(player);
            if (client.equalsIgnoreCase(client1))
            {
                loggedz0r = true;
            }
        }
        return loggedz0r;
    }
    
    private static String first(L2PcInstance player)
    {
        return second(player).toString();
    }
    
    private static String second(L2PcInstance player)
    {
        try
        {
            player.getClient().getConnection().getInetAddress().getHostAddress();
        }
        catch (Throwable t)
        {
        }
        return null;
    }
}

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now



  • Posts

    • I am selling the essence project which includes versions 388 and 439 that have been running for over 2 years or (447 as custom PVP like Pride). I have a test server for you to test them out. If you are really interested in it then contact my seller at discord: kiwi7106. Price: 4000 Euro P/s: This is a project that I have spent a lot of money and time developing, so if you are not interested in it, please get out of this topic, thank you. P/s 2: If you find the price too expensive, it's best to skip this article and find another project and don't comment negatively on my topic, thank you.
    • Someone ask me for this, it should work on any client that has Kamael race, preview:     Installation - there are two ways to install depending on how you want to use it:   Method 1: If you want to completely replace the original, do:   Copy all lines from your armorgrp to Notepad++, press Ctrl+H, check the "match whole word" option and replace:   kamael.Mkamael_m000_w_ad00   by:   AvengersKamaelWings.Avengers_MKamael_m001_w_ad00   Then replace:   MKamael.Mkamael_m000_t00_w   by:   AvengersKamaelWings.MKamael_m001_t00_w   Now repeat the same process with the female, replace:   kamael.Fkamael_m000_w_ad00   by:   AvengersKamaelWings.Avengers_FKamael_m001_w_ad00   Then replace:   FKamael.Fkamael_m000_t00_w   by:   AvengersKamaelWings.FKamael_m001_t00_w   You're done, paste everything back into File Edit and save!   Method 2: If you only want to replace in specific sets, execute the above process only on the armorgrp of those sets.   Repack by: AvengersTeamBr Password: LadrãoDeFrango      
    • 用于解密、加密和编辑 .u 文件的工具。
    • It's always awesome when you find someone who not only delivers great quality but also does it way ahead of schedule. Makes you feel like you hit the jackpot, right? I'm new around here, just stumbled upon this forum, and seeing posts like yours really gives me hope that there are some real pros hanging out in this community.
  • Topics

×
×
  • Create New...