Yes, please read the code
public static boolean check(L2PcInstance player)
{
boolean loggedz0r = false;
for (L2PcInstance playerz0r : L2World.getInstance().getAllPlayers())
{
String client = first(playerz0r);
String client1 = second(player);
if (client.equalsIgnoreCase(client1));
loggedz0r = true;
}
return loggedz0r;
}
Explain me what this does then talk about posiblities because when you do the check you are already in game which is dualbox in your check
can someone fix the imports for interlude ?
v 1.01
package com.l2jserver.gameserver;
import com.l2jserver.gameserver.model.L2World;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.network.clientpackets.Say2;
import com.l2jserver.gameserver.network.serverpackets.CreatureSay;
/**
* @author xAddytzu
* @version 1.01
*/
public class DualBoxProtection
{
public void checkForDualbox(L2PcInstance player)
{
int objId = player.getObjectId();
String playerIp = getIp(player);
for (L2PcInstance players : L2World.getInstance().getAllPlayers().values())
{
if (players != null && objId != players.getObjectId())
{
if (playerIp.equalsIgnoreCase(getIp(players)))
{
disconnect(players);
}
}
}
}
private String getIp(L2PcInstance player)
{
return player.getClient().getConnection().getInetAddress().getHostAddress();
}
public void disconnect(final L2PcInstance player)
{
player.sendPacket(new CreatureSay(1, Say2.HERO_VOICE, "SYSTEM", "Dualbox isn't allowed. You'll be disconnected soon!"));
ThreadPoolManager.getInstance().scheduleGeneral(new Runnable() {
public void run()
{
if (player != null && player.isOnline() > 0)
{
player.closeNetConnection(true);
}
}
}, 20000);
}
}
xAddytzu why do you even post bugged codes if you doesnt know how to code and read ? you are probly from the ones who can code but cant read it