Fixed login issues after latest eclipse corrections.
This commit is contained in:
@ -323,21 +323,39 @@ public class LoginController
|
||||
_bannedIps.putIfAbsent(address, System.currentTimeMillis() + duration);
|
||||
}
|
||||
|
||||
public boolean isBannedAddress(InetAddress address) throws UnknownHostException
|
||||
public boolean isBannedAddress(InetAddress address)
|
||||
{
|
||||
final String[] parts = address.getHostAddress().split("\\.");
|
||||
Long bi = _bannedIps.get(address);
|
||||
if (bi == null)
|
||||
{
|
||||
bi = _bannedIps.get(InetAddress.getByName(parts[0] + "." + parts[1] + "." + parts[2] + ".0"));
|
||||
try
|
||||
{
|
||||
bi = _bannedIps.get(InetAddress.getByName(parts[0] + "." + parts[1] + "." + parts[2] + ".0"));
|
||||
}
|
||||
catch (UnknownHostException e)
|
||||
{
|
||||
}
|
||||
}
|
||||
if (bi == null)
|
||||
{
|
||||
bi = _bannedIps.get(InetAddress.getByName(parts[0] + "." + parts[1] + ".0.0"));
|
||||
try
|
||||
{
|
||||
bi = _bannedIps.get(InetAddress.getByName(parts[0] + "." + parts[1] + ".0.0"));
|
||||
}
|
||||
catch (UnknownHostException e)
|
||||
{
|
||||
}
|
||||
}
|
||||
if (bi == null)
|
||||
{
|
||||
bi = _bannedIps.get(InetAddress.getByName(parts[0] + ".0.0.0"));
|
||||
try
|
||||
{
|
||||
bi = _bannedIps.get(InetAddress.getByName(parts[0] + ".0.0.0"));
|
||||
}
|
||||
catch (UnknownHostException e)
|
||||
{
|
||||
}
|
||||
}
|
||||
if (bi != null)
|
||||
{
|
||||
|
@ -16,7 +16,6 @@
|
||||
*/
|
||||
package com.l2jmobius.loginserver;
|
||||
|
||||
import java.net.UnknownHostException;
|
||||
import java.nio.channels.SocketChannel;
|
||||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
@ -60,7 +59,7 @@ public class SelectorHelper implements IMMOExecutor<L2LoginClient>, IClientFacto
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean accept(SocketChannel sc) throws UnknownHostException
|
||||
public boolean accept(SocketChannel sc)
|
||||
{
|
||||
return _ipv4filter.accept(sc) && !LoginController.getInstance().isBannedAddress(sc.socket().getInetAddress());
|
||||
}
|
||||
|
@ -16,7 +16,6 @@
|
||||
*/
|
||||
package com.l2jmobius.loginserver.network.mmocore;
|
||||
|
||||
import java.net.UnknownHostException;
|
||||
import java.nio.channels.SocketChannel;
|
||||
|
||||
/**
|
||||
@ -24,5 +23,5 @@ import java.nio.channels.SocketChannel;
|
||||
*/
|
||||
public interface IAcceptFilter
|
||||
{
|
||||
boolean accept(SocketChannel sc) throws UnknownHostException;
|
||||
boolean accept(SocketChannel sc);
|
||||
}
|
||||
|
Reference in New Issue
Block a user