2022-04-17 12:43:07 +00:00
|
|
|
package emu.grasscutter.server.game;
|
|
|
|
|
2022-04-27 04:21:57 +00:00
|
|
|
import emu.grasscutter.netty.KcpServerInitializer;
|
2022-04-17 12:43:07 +00:00
|
|
|
import io.jpower.kcp.netty.UkcpChannel;
|
|
|
|
import io.netty.channel.ChannelPipeline;
|
|
|
|
|
2022-04-27 04:21:57 +00:00
|
|
|
public class GameServerInitializer extends KcpServerInitializer {
|
2022-04-17 12:43:07 +00:00
|
|
|
private GameServer server;
|
|
|
|
|
|
|
|
public GameServerInitializer(GameServer server) {
|
|
|
|
this.server = server;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected void initChannel(UkcpChannel ch) throws Exception {
|
|
|
|
ChannelPipeline pipeline = ch.pipeline();
|
|
|
|
GameSession session = new GameSession(server);
|
|
|
|
pipeline.addLast(session);
|
|
|
|
}
|
|
|
|
}
|