Skip to content

Commit

Permalink
fix windows mappings generation, fix wrong keepalive handling (Fixes #77
Browse files Browse the repository at this point in the history
)
  • Loading branch information
mdxd44 committed May 4, 2024
1 parent d82e0ca commit 3b9915d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@ static Map<String, Map<String, List<String>>> getTags(File tagDir, Map<String, S
directoryFile.eachFileRecurse(FileType.FILES, { file ->
List<String> values = new JsonSlurper().parse(file).values
Path relativePath = directoryFile.toPath().relativize(file.toPath())
String name = FilenameUtils.removeExtension(relativePath.toString()).replace(File.pathSeparator, "/")
String name = FilenameUtils.removeExtension(relativePath.toString()).replace(File.separatorChar, '/' as char)
typeTags.put("minecraft:" + name, values)
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ public LimboSessionHandlerImpl(LimboAPI plugin, LimboImpl limbo, ConnectedPlayer
if (originalHandler instanceof LimboSessionHandlerImpl sessionHandler) {
this.settings = sessionHandler.getSettings();
this.brand = sessionHandler.getBrand();
this.keepAliveKey = sessionHandler.keepAliveKey;
this.keepAlivePending = sessionHandler.keepAlivePending;
this.keepAliveSentTime = sessionHandler.keepAliveSentTime;
this.ping = sessionHandler.ping;
}
}

Expand All @@ -124,10 +128,6 @@ public void onConfig(LimboPlayer player) {
Integer serverReadTimeout = this.limbo.getReadTimeout();
this.keepAliveTask = player.getScheduledExecutor().scheduleAtFixedRate(() -> {
MinecraftConnection connection = this.player.getConnection();

// Sometimes there is a bug where player is kicked from the proxy by
// the limbo and this task is not cancelled in LimboSessionHandlerImpl#disconnected
// More info in issue #73
if (connection.isClosed()) {
this.keepAliveTask.cancel(true);
return;
Expand All @@ -146,7 +146,7 @@ public void onConfig(LimboPlayer player) {
this.keepAlivePending = true;
this.keepAliveSentTime = System.currentTimeMillis();
}
}, 250, (serverReadTimeout == null ? this.plugin.getServer().getConfiguration().getReadTimeout() : serverReadTimeout) / 2, TimeUnit.MILLISECONDS);
}, 250, (serverReadTimeout == null ? this.plugin.getServer().getConfiguration().getReadTimeout() / 2 : serverReadTimeout), TimeUnit.MILLISECONDS);
}

public void onSpawn() {
Expand Down

0 comments on commit 3b9915d

Please sign in to comment.