mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-03-13 08:09:59 +08:00
* Fix unable to save game data occasionally * No self-kicking * Game data synchronization * finally * prevent duplicated saving * reverse changing * keep the previous code * Update GameServerInitializer.java * Update GameSession.java * remove sanity check because of try block * a session needs can be created without a pipeline.
23 lines
586 B
Java
23 lines
586 B
Java
package emu.grasscutter.server.game;
|
|
|
|
import emu.grasscutter.netty.KcpServerInitializer;
|
|
import io.jpower.kcp.netty.UkcpChannel;
|
|
import io.netty.channel.ChannelPipeline;
|
|
|
|
public class GameServerInitializer extends KcpServerInitializer {
|
|
private GameServer server;
|
|
|
|
public GameServerInitializer(GameServer server) {
|
|
this.server = server;
|
|
}
|
|
|
|
@Override
|
|
protected void initChannel(UkcpChannel ch) throws Exception {
|
|
ChannelPipeline pipeline=null;
|
|
if(ch!=null){
|
|
pipeline = ch.pipeline();
|
|
}
|
|
new GameSession(server,pipeline);
|
|
}
|
|
}
|