mirror of
https://github.com/Melledy/LunarCore.git
synced 2025-12-14 14:24:37 +01:00
Add config option for kcp interval
This commit is contained in:
@@ -74,6 +74,7 @@ public class Config {
|
||||
public String id = "lunar_rail_test";
|
||||
public String name = "Test";
|
||||
public String description = "Test Server";
|
||||
public int kcpInterval = 40;
|
||||
|
||||
public GameServerConfig(int port) {
|
||||
super(port);
|
||||
|
||||
@@ -76,7 +76,7 @@ public class GameServer extends KcpServer {
|
||||
public void start() {
|
||||
// Setup config and init server
|
||||
ChannelConfig channelConfig = new ChannelConfig();
|
||||
channelConfig.nodelay(true, 50, 2, true);
|
||||
channelConfig.nodelay(true, this.getServerConfig().getKcpInterval(), 2, true);
|
||||
channelConfig.setMtu(1400);
|
||||
channelConfig.setSndwnd(256);
|
||||
channelConfig.setRcvwnd(256);
|
||||
|
||||
Reference in New Issue
Block a user