More eclipse login issue changes.
This commit is contained in:
parent
5f8301af70
commit
bba9f4be4f
@ -611,16 +611,17 @@ public final class GameServerTable implements IGameXmlReader
|
|||||||
* @param addr the addr
|
* @param addr the addr
|
||||||
* @return the server address
|
* @return the server address
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("unlikely-arg-type")
|
||||||
public String getServerAddress(InetAddress addr)
|
public String getServerAddress(InetAddress addr)
|
||||||
{
|
{
|
||||||
for (GameServerAddress a : _addrs)
|
for (GameServerAddress a : _addrs)
|
||||||
{
|
{
|
||||||
if (a.getAddress().equals(addr.getAddress()))
|
if (a.equals(addr))
|
||||||
{
|
{
|
||||||
return a.getServerAddress();
|
return a.getServerAddress();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null; // should not happens
|
return null; // should not happen
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -323,39 +323,21 @@ public class LoginController
|
|||||||
_bannedIps.putIfAbsent(address, System.currentTimeMillis() + duration);
|
_bannedIps.putIfAbsent(address, System.currentTimeMillis() + duration);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isBannedAddress(InetAddress address)
|
public boolean isBannedAddress(InetAddress address) throws UnknownHostException
|
||||||
{
|
{
|
||||||
final String[] parts = address.getHostAddress().split("\\.");
|
final String[] parts = address.getHostAddress().split("\\.");
|
||||||
Long bi = _bannedIps.get(address);
|
Long bi = _bannedIps.get(address);
|
||||||
if (bi == null)
|
if (bi == null)
|
||||||
{
|
{
|
||||||
try
|
bi = _bannedIps.get(InetAddress.getByName(parts[0] + "." + parts[1] + "." + parts[2] + ".0"));
|
||||||
{
|
|
||||||
bi = _bannedIps.get(InetAddress.getByName(parts[0] + "." + parts[1] + "." + parts[2] + ".0"));
|
|
||||||
}
|
|
||||||
catch (UnknownHostException e)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (bi == null)
|
if (bi == null)
|
||||||
{
|
{
|
||||||
try
|
bi = _bannedIps.get(InetAddress.getByName(parts[0] + "." + parts[1] + ".0.0"));
|
||||||
{
|
|
||||||
bi = _bannedIps.get(InetAddress.getByName(parts[0] + "." + parts[1] + ".0.0"));
|
|
||||||
}
|
|
||||||
catch (UnknownHostException e)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (bi == null)
|
if (bi == null)
|
||||||
{
|
{
|
||||||
try
|
bi = _bannedIps.get(InetAddress.getByName(parts[0] + ".0.0.0"));
|
||||||
{
|
|
||||||
bi = _bannedIps.get(InetAddress.getByName(parts[0] + ".0.0.0"));
|
|
||||||
}
|
|
||||||
catch (UnknownHostException e)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (bi != null)
|
if (bi != null)
|
||||||
{
|
{
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.l2jmobius.loginserver;
|
package com.l2jmobius.loginserver;
|
||||||
|
|
||||||
|
import java.net.UnknownHostException;
|
||||||
import java.nio.channels.SocketChannel;
|
import java.nio.channels.SocketChannel;
|
||||||
import java.util.concurrent.LinkedBlockingQueue;
|
import java.util.concurrent.LinkedBlockingQueue;
|
||||||
import java.util.concurrent.ThreadPoolExecutor;
|
import java.util.concurrent.ThreadPoolExecutor;
|
||||||
@ -59,7 +60,7 @@ public class SelectorHelper implements IMMOExecutor<L2LoginClient>, IClientFacto
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean accept(SocketChannel sc)
|
public boolean accept(SocketChannel sc) throws UnknownHostException
|
||||||
{
|
{
|
||||||
return _ipv4filter.accept(sc) && !LoginController.getInstance().isBannedAddress(sc.socket().getInetAddress());
|
return _ipv4filter.accept(sc) && !LoginController.getInstance().isBannedAddress(sc.socket().getInetAddress());
|
||||||
}
|
}
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.l2jmobius.loginserver.network.mmocore;
|
package com.l2jmobius.loginserver.network.mmocore;
|
||||||
|
|
||||||
|
import java.net.UnknownHostException;
|
||||||
import java.nio.channels.SocketChannel;
|
import java.nio.channels.SocketChannel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -23,5 +24,5 @@ import java.nio.channels.SocketChannel;
|
|||||||
*/
|
*/
|
||||||
public interface IAcceptFilter
|
public interface IAcceptFilter
|
||||||
{
|
{
|
||||||
boolean accept(SocketChannel sc);
|
boolean accept(SocketChannel sc) throws UnknownHostException;
|
||||||
}
|
}
|
||||||
|
@ -611,16 +611,17 @@ public final class GameServerTable implements IGameXmlReader
|
|||||||
* @param addr the addr
|
* @param addr the addr
|
||||||
* @return the server address
|
* @return the server address
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("unlikely-arg-type")
|
||||||
public String getServerAddress(InetAddress addr)
|
public String getServerAddress(InetAddress addr)
|
||||||
{
|
{
|
||||||
for (GameServerAddress a : _addrs)
|
for (GameServerAddress a : _addrs)
|
||||||
{
|
{
|
||||||
if (a.getAddress().equals(addr.getAddress()))
|
if (a.equals(addr))
|
||||||
{
|
{
|
||||||
return a.getServerAddress();
|
return a.getServerAddress();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null; // should not happens
|
return null; // should not happen
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -323,39 +323,21 @@ public class LoginController
|
|||||||
_bannedIps.putIfAbsent(address, System.currentTimeMillis() + duration);
|
_bannedIps.putIfAbsent(address, System.currentTimeMillis() + duration);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isBannedAddress(InetAddress address)
|
public boolean isBannedAddress(InetAddress address) throws UnknownHostException
|
||||||
{
|
{
|
||||||
final String[] parts = address.getHostAddress().split("\\.");
|
final String[] parts = address.getHostAddress().split("\\.");
|
||||||
Long bi = _bannedIps.get(address);
|
Long bi = _bannedIps.get(address);
|
||||||
if (bi == null)
|
if (bi == null)
|
||||||
{
|
{
|
||||||
try
|
bi = _bannedIps.get(InetAddress.getByName(parts[0] + "." + parts[1] + "." + parts[2] + ".0"));
|
||||||
{
|
|
||||||
bi = _bannedIps.get(InetAddress.getByName(parts[0] + "." + parts[1] + "." + parts[2] + ".0"));
|
|
||||||
}
|
|
||||||
catch (UnknownHostException e)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (bi == null)
|
if (bi == null)
|
||||||
{
|
{
|
||||||
try
|
bi = _bannedIps.get(InetAddress.getByName(parts[0] + "." + parts[1] + ".0.0"));
|
||||||
{
|
|
||||||
bi = _bannedIps.get(InetAddress.getByName(parts[0] + "." + parts[1] + ".0.0"));
|
|
||||||
}
|
|
||||||
catch (UnknownHostException e)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (bi == null)
|
if (bi == null)
|
||||||
{
|
{
|
||||||
try
|
bi = _bannedIps.get(InetAddress.getByName(parts[0] + ".0.0.0"));
|
||||||
{
|
|
||||||
bi = _bannedIps.get(InetAddress.getByName(parts[0] + ".0.0.0"));
|
|
||||||
}
|
|
||||||
catch (UnknownHostException e)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (bi != null)
|
if (bi != null)
|
||||||
{
|
{
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.l2jmobius.loginserver;
|
package com.l2jmobius.loginserver;
|
||||||
|
|
||||||
|
import java.net.UnknownHostException;
|
||||||
import java.nio.channels.SocketChannel;
|
import java.nio.channels.SocketChannel;
|
||||||
import java.util.concurrent.LinkedBlockingQueue;
|
import java.util.concurrent.LinkedBlockingQueue;
|
||||||
import java.util.concurrent.ThreadPoolExecutor;
|
import java.util.concurrent.ThreadPoolExecutor;
|
||||||
@ -59,7 +60,7 @@ public class SelectorHelper implements IMMOExecutor<L2LoginClient>, IClientFacto
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean accept(SocketChannel sc)
|
public boolean accept(SocketChannel sc) throws UnknownHostException
|
||||||
{
|
{
|
||||||
return _ipv4filter.accept(sc) && !LoginController.getInstance().isBannedAddress(sc.socket().getInetAddress());
|
return _ipv4filter.accept(sc) && !LoginController.getInstance().isBannedAddress(sc.socket().getInetAddress());
|
||||||
}
|
}
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.l2jmobius.loginserver.network.mmocore;
|
package com.l2jmobius.loginserver.network.mmocore;
|
||||||
|
|
||||||
|
import java.net.UnknownHostException;
|
||||||
import java.nio.channels.SocketChannel;
|
import java.nio.channels.SocketChannel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -23,5 +24,5 @@ import java.nio.channels.SocketChannel;
|
|||||||
*/
|
*/
|
||||||
public interface IAcceptFilter
|
public interface IAcceptFilter
|
||||||
{
|
{
|
||||||
boolean accept(SocketChannel sc);
|
boolean accept(SocketChannel sc) throws UnknownHostException;
|
||||||
}
|
}
|
||||||
|
@ -611,16 +611,17 @@ public final class GameServerTable implements IGameXmlReader
|
|||||||
* @param addr the addr
|
* @param addr the addr
|
||||||
* @return the server address
|
* @return the server address
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("unlikely-arg-type")
|
||||||
public String getServerAddress(InetAddress addr)
|
public String getServerAddress(InetAddress addr)
|
||||||
{
|
{
|
||||||
for (GameServerAddress a : _addrs)
|
for (GameServerAddress a : _addrs)
|
||||||
{
|
{
|
||||||
if (a.getAddress().equals(addr.getAddress()))
|
if (a.equals(addr))
|
||||||
{
|
{
|
||||||
return a.getServerAddress();
|
return a.getServerAddress();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null; // should not happens
|
return null; // should not happen
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -323,39 +323,21 @@ public class LoginController
|
|||||||
_bannedIps.putIfAbsent(address, System.currentTimeMillis() + duration);
|
_bannedIps.putIfAbsent(address, System.currentTimeMillis() + duration);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isBannedAddress(InetAddress address)
|
public boolean isBannedAddress(InetAddress address) throws UnknownHostException
|
||||||
{
|
{
|
||||||
final String[] parts = address.getHostAddress().split("\\.");
|
final String[] parts = address.getHostAddress().split("\\.");
|
||||||
Long bi = _bannedIps.get(address);
|
Long bi = _bannedIps.get(address);
|
||||||
if (bi == null)
|
if (bi == null)
|
||||||
{
|
{
|
||||||
try
|
bi = _bannedIps.get(InetAddress.getByName(parts[0] + "." + parts[1] + "." + parts[2] + ".0"));
|
||||||
{
|
|
||||||
bi = _bannedIps.get(InetAddress.getByName(parts[0] + "." + parts[1] + "." + parts[2] + ".0"));
|
|
||||||
}
|
|
||||||
catch (UnknownHostException e)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (bi == null)
|
if (bi == null)
|
||||||
{
|
{
|
||||||
try
|
bi = _bannedIps.get(InetAddress.getByName(parts[0] + "." + parts[1] + ".0.0"));
|
||||||
{
|
|
||||||
bi = _bannedIps.get(InetAddress.getByName(parts[0] + "." + parts[1] + ".0.0"));
|
|
||||||
}
|
|
||||||
catch (UnknownHostException e)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (bi == null)
|
if (bi == null)
|
||||||
{
|
{
|
||||||
try
|
bi = _bannedIps.get(InetAddress.getByName(parts[0] + ".0.0.0"));
|
||||||
{
|
|
||||||
bi = _bannedIps.get(InetAddress.getByName(parts[0] + ".0.0.0"));
|
|
||||||
}
|
|
||||||
catch (UnknownHostException e)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (bi != null)
|
if (bi != null)
|
||||||
{
|
{
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.l2jmobius.loginserver;
|
package com.l2jmobius.loginserver;
|
||||||
|
|
||||||
|
import java.net.UnknownHostException;
|
||||||
import java.nio.channels.SocketChannel;
|
import java.nio.channels.SocketChannel;
|
||||||
import java.util.concurrent.LinkedBlockingQueue;
|
import java.util.concurrent.LinkedBlockingQueue;
|
||||||
import java.util.concurrent.ThreadPoolExecutor;
|
import java.util.concurrent.ThreadPoolExecutor;
|
||||||
@ -59,7 +60,7 @@ public class SelectorHelper implements IMMOExecutor<L2LoginClient>, IClientFacto
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean accept(SocketChannel sc)
|
public boolean accept(SocketChannel sc) throws UnknownHostException
|
||||||
{
|
{
|
||||||
return _ipv4filter.accept(sc) && !LoginController.getInstance().isBannedAddress(sc.socket().getInetAddress());
|
return _ipv4filter.accept(sc) && !LoginController.getInstance().isBannedAddress(sc.socket().getInetAddress());
|
||||||
}
|
}
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.l2jmobius.loginserver.network.mmocore;
|
package com.l2jmobius.loginserver.network.mmocore;
|
||||||
|
|
||||||
|
import java.net.UnknownHostException;
|
||||||
import java.nio.channels.SocketChannel;
|
import java.nio.channels.SocketChannel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -23,5 +24,5 @@ import java.nio.channels.SocketChannel;
|
|||||||
*/
|
*/
|
||||||
public interface IAcceptFilter
|
public interface IAcceptFilter
|
||||||
{
|
{
|
||||||
boolean accept(SocketChannel sc);
|
boolean accept(SocketChannel sc) throws UnknownHostException;
|
||||||
}
|
}
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.l2jmobius.commons.mmocore;
|
package com.l2jmobius.commons.mmocore;
|
||||||
|
|
||||||
|
import java.net.UnknownHostException;
|
||||||
import java.nio.channels.SocketChannel;
|
import java.nio.channels.SocketChannel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -23,5 +24,5 @@ import java.nio.channels.SocketChannel;
|
|||||||
*/
|
*/
|
||||||
public interface IAcceptFilter
|
public interface IAcceptFilter
|
||||||
{
|
{
|
||||||
boolean accept(SocketChannel sc);
|
boolean accept(SocketChannel sc) throws UnknownHostException;
|
||||||
}
|
}
|
||||||
|
@ -599,16 +599,17 @@ public final class GameServerTable implements IXmlReader
|
|||||||
* @param addr the addr
|
* @param addr the addr
|
||||||
* @return the server address
|
* @return the server address
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("unlikely-arg-type")
|
||||||
public String getServerAddress(InetAddress addr)
|
public String getServerAddress(InetAddress addr)
|
||||||
{
|
{
|
||||||
for (GameServerAddress a : _addrs)
|
for (GameServerAddress a : _addrs)
|
||||||
{
|
{
|
||||||
if (a.getAddress().equals(addr.getAddress()))
|
if (a.equals(addr))
|
||||||
{
|
{
|
||||||
return a.getServerAddress();
|
return a.getServerAddress();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null; // should not happens
|
return null; // should not happen
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -321,39 +321,21 @@ public class LoginController
|
|||||||
_bannedIps.putIfAbsent(address, System.currentTimeMillis() + duration);
|
_bannedIps.putIfAbsent(address, System.currentTimeMillis() + duration);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isBannedAddress(InetAddress address)
|
public boolean isBannedAddress(InetAddress address) throws UnknownHostException
|
||||||
{
|
{
|
||||||
final String[] parts = address.getHostAddress().split("\\.");
|
final String[] parts = address.getHostAddress().split("\\.");
|
||||||
Long bi = _bannedIps.get(address);
|
Long bi = _bannedIps.get(address);
|
||||||
if (bi == null)
|
if (bi == null)
|
||||||
{
|
{
|
||||||
try
|
bi = _bannedIps.get(InetAddress.getByName(parts[0] + "." + parts[1] + "." + parts[2] + ".0"));
|
||||||
{
|
|
||||||
bi = _bannedIps.get(InetAddress.getByName(parts[0] + "." + parts[1] + "." + parts[2] + ".0"));
|
|
||||||
}
|
|
||||||
catch (UnknownHostException e)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (bi == null)
|
if (bi == null)
|
||||||
{
|
{
|
||||||
try
|
bi = _bannedIps.get(InetAddress.getByName(parts[0] + "." + parts[1] + ".0.0"));
|
||||||
{
|
|
||||||
bi = _bannedIps.get(InetAddress.getByName(parts[0] + "." + parts[1] + ".0.0"));
|
|
||||||
}
|
|
||||||
catch (UnknownHostException e)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (bi == null)
|
if (bi == null)
|
||||||
{
|
{
|
||||||
try
|
bi = _bannedIps.get(InetAddress.getByName(parts[0] + ".0.0.0"));
|
||||||
{
|
|
||||||
bi = _bannedIps.get(InetAddress.getByName(parts[0] + ".0.0.0"));
|
|
||||||
}
|
|
||||||
catch (UnknownHostException e)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (bi != null)
|
if (bi != null)
|
||||||
{
|
{
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.l2jmobius.loginserver;
|
package com.l2jmobius.loginserver;
|
||||||
|
|
||||||
|
import java.net.UnknownHostException;
|
||||||
import java.nio.channels.SocketChannel;
|
import java.nio.channels.SocketChannel;
|
||||||
import java.util.concurrent.LinkedBlockingQueue;
|
import java.util.concurrent.LinkedBlockingQueue;
|
||||||
import java.util.concurrent.ThreadPoolExecutor;
|
import java.util.concurrent.ThreadPoolExecutor;
|
||||||
@ -59,7 +60,7 @@ public class SelectorHelper implements IMMOExecutor<L2LoginClient>, IClientFacto
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean accept(SocketChannel sc)
|
public boolean accept(SocketChannel sc) throws UnknownHostException
|
||||||
{
|
{
|
||||||
return _ipv4filter.accept(sc) && !LoginController.getInstance().isBannedAddress(sc.socket().getInetAddress());
|
return _ipv4filter.accept(sc) && !LoginController.getInstance().isBannedAddress(sc.socket().getInetAddress());
|
||||||
}
|
}
|
||||||
|
@ -611,16 +611,17 @@ public final class GameServerTable implements IGameXmlReader
|
|||||||
* @param addr the addr
|
* @param addr the addr
|
||||||
* @return the server address
|
* @return the server address
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("unlikely-arg-type")
|
||||||
public String getServerAddress(InetAddress addr)
|
public String getServerAddress(InetAddress addr)
|
||||||
{
|
{
|
||||||
for (GameServerAddress a : _addrs)
|
for (GameServerAddress a : _addrs)
|
||||||
{
|
{
|
||||||
if (a.getAddress().equals(addr.getAddress()))
|
if (a.equals(addr))
|
||||||
{
|
{
|
||||||
return a.getServerAddress();
|
return a.getServerAddress();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null; // should not happens
|
return null; // should not happen
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -323,39 +323,21 @@ public class LoginController
|
|||||||
_bannedIps.putIfAbsent(address, System.currentTimeMillis() + duration);
|
_bannedIps.putIfAbsent(address, System.currentTimeMillis() + duration);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isBannedAddress(InetAddress address)
|
public boolean isBannedAddress(InetAddress address) throws UnknownHostException
|
||||||
{
|
{
|
||||||
final String[] parts = address.getHostAddress().split("\\.");
|
final String[] parts = address.getHostAddress().split("\\.");
|
||||||
Long bi = _bannedIps.get(address);
|
Long bi = _bannedIps.get(address);
|
||||||
if (bi == null)
|
if (bi == null)
|
||||||
{
|
{
|
||||||
try
|
bi = _bannedIps.get(InetAddress.getByName(parts[0] + "." + parts[1] + "." + parts[2] + ".0"));
|
||||||
{
|
|
||||||
bi = _bannedIps.get(InetAddress.getByName(parts[0] + "." + parts[1] + "." + parts[2] + ".0"));
|
|
||||||
}
|
|
||||||
catch (UnknownHostException e)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (bi == null)
|
if (bi == null)
|
||||||
{
|
{
|
||||||
try
|
bi = _bannedIps.get(InetAddress.getByName(parts[0] + "." + parts[1] + ".0.0"));
|
||||||
{
|
|
||||||
bi = _bannedIps.get(InetAddress.getByName(parts[0] + "." + parts[1] + ".0.0"));
|
|
||||||
}
|
|
||||||
catch (UnknownHostException e)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (bi == null)
|
if (bi == null)
|
||||||
{
|
{
|
||||||
try
|
bi = _bannedIps.get(InetAddress.getByName(parts[0] + ".0.0.0"));
|
||||||
{
|
|
||||||
bi = _bannedIps.get(InetAddress.getByName(parts[0] + ".0.0.0"));
|
|
||||||
}
|
|
||||||
catch (UnknownHostException e)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (bi != null)
|
if (bi != null)
|
||||||
{
|
{
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.l2jmobius.loginserver;
|
package com.l2jmobius.loginserver;
|
||||||
|
|
||||||
|
import java.net.UnknownHostException;
|
||||||
import java.nio.channels.SocketChannel;
|
import java.nio.channels.SocketChannel;
|
||||||
import java.util.concurrent.LinkedBlockingQueue;
|
import java.util.concurrent.LinkedBlockingQueue;
|
||||||
import java.util.concurrent.ThreadPoolExecutor;
|
import java.util.concurrent.ThreadPoolExecutor;
|
||||||
@ -59,7 +60,7 @@ public class SelectorHelper implements IMMOExecutor<L2LoginClient>, IClientFacto
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean accept(SocketChannel sc)
|
public boolean accept(SocketChannel sc) throws UnknownHostException
|
||||||
{
|
{
|
||||||
return _ipv4filter.accept(sc) && !LoginController.getInstance().isBannedAddress(sc.socket().getInetAddress());
|
return _ipv4filter.accept(sc) && !LoginController.getInstance().isBannedAddress(sc.socket().getInetAddress());
|
||||||
}
|
}
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.l2jmobius.loginserver.network.mmocore;
|
package com.l2jmobius.loginserver.network.mmocore;
|
||||||
|
|
||||||
|
import java.net.UnknownHostException;
|
||||||
import java.nio.channels.SocketChannel;
|
import java.nio.channels.SocketChannel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -23,5 +24,5 @@ import java.nio.channels.SocketChannel;
|
|||||||
*/
|
*/
|
||||||
public interface IAcceptFilter
|
public interface IAcceptFilter
|
||||||
{
|
{
|
||||||
boolean accept(SocketChannel sc);
|
boolean accept(SocketChannel sc) throws UnknownHostException;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user