1
0
mirror of https://github.com/Rogiel/l2jserver2 synced 2025-12-10 09:22:49 +00:00

Change-Id: If18611eb0a6296da808aead8f1da54be094db2a9

This commit is contained in:
rogiel
2011-04-29 20:17:45 -03:00
parent 43403d9a1e
commit 0662150229
48 changed files with 612 additions and 513 deletions

View File

@@ -7,16 +7,22 @@ import org.jboss.netty.channel.ServerChannel;
import org.jboss.netty.channel.socket.nio.NioServerSocketChannelFactory;
import com.google.inject.Inject;
import com.google.inject.Injector;
import com.l2jserver.game.net.Lineage2Connection;
import com.l2jserver.game.net.Lineage2PipelineFactory;
import com.l2jserver.service.configuration.ConfigurationService;
public class NettyNetworkService implements NetworkService {
private final NetworkConfiguration config;
private final Injector injector;
private ServerBootstrap server;
private ServerChannel channel;
@Inject
public NettyNetworkService(ConfigurationService configService) {
public NettyNetworkService(ConfigurationService configService,
Injector injector) {
this.config = configService.get(NetworkConfiguration.class);
this.injector = injector;
}
@Override
@@ -24,6 +30,7 @@ public class NettyNetworkService implements NetworkService {
server = new ServerBootstrap(new NioServerSocketChannelFactory(
Executors.newCachedThreadPool(),
Executors.newCachedThreadPool()));
server.setPipelineFactory(new Lineage2PipelineFactory(injector));
channel = (ServerChannel) server.bind(config.getListenAddress());
}

View File

@@ -13,7 +13,7 @@ public interface NetworkConfiguration extends Configuration {
*
* @return the listen address
*/
@ConfigurationPropertyGetter(name = "listen", defaultValue = "0.0.0.0:54")
@ConfigurationPropertyGetter(name = "listen", defaultValue = "0.0.0.0:7777")
InetSocketAddress getListenAddress();
/**

View File

@@ -1,7 +1,7 @@
package com.l2jserver.service.network;
import com.l2jserver.game.net.Lineage2Connection;
import com.l2jserver.service.Service;
public interface NetworkService extends Service {
}