Add config option for kcp interval

This commit is contained in:
Melledy
2023-10-18 04:41:51 -07:00
parent a1b1f040e0
commit fcc24c0cca
2 changed files with 3 additions and 2 deletions

View File

@@ -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);

View File

@@ -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);