Sync with L2jServer HighFive Apr 1st 2015.

This commit is contained in:
MobiusDev
2015-04-02 04:12:06 +00:00
parent 8300183361
commit 1abccfcae0
26 changed files with 283 additions and 248 deletions

View File

@@ -18,10 +18,12 @@
*/
package com.l2jserver.loginserver;
import java.net.UnknownHostException;
import java.nio.channels.SocketChannel;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.logging.Logger;
import commons.mmocore.IAcceptFilter;
import commons.mmocore.IClientFactory;
@@ -38,6 +40,7 @@ import com.l2jserver.util.IPv4Filter;
*/
public class SelectorHelper implements IMMOExecutor<L2LoginClient>, IClientFactory<L2LoginClient>, IAcceptFilter
{
private static final Logger LOG = Logger.getLogger(LoginController.class.getName());
private final ThreadPoolExecutor _generalPacketsThreadPool;
private final IPv4Filter _ipv4filter;
@@ -64,6 +67,14 @@ public class SelectorHelper implements IMMOExecutor<L2LoginClient>, IClientFacto
@Override
public boolean accept(SocketChannel sc)
{
return _ipv4filter.accept(sc) && !LoginController.getInstance().isBannedAddress(sc.socket().getInetAddress());
try
{
return _ipv4filter.accept(sc) && !LoginController.getInstance().isBannedAddress(sc.socket().getInetAddress());
}
catch (UnknownHostException e)
{
LOG.severe(SelectorHelper.class.getSimpleName() + ": Invalid address: " + sc.socket().getInetAddress() + "; " + e.getMessage());
}
return false;
}
}