Use separate thread to send packets, even in sync mode (fixes #674)

This commit is contained in:
Jonas Herzig
2022-02-27 12:59:19 +01:00
parent 7e9a1e7c13
commit 0b8a2a107c
3 changed files with 137 additions and 54 deletions

View File

@@ -137,13 +137,13 @@ public class QuickReplaySender extends ChannelHandlerAdapter implements ReplaySe
LOGGER.info("Initialized quick replay sender in " + (System.currentTimeMillis() - start) + "ms");
} catch (Throwable e) {
LOGGER.error("Initializing quick replay sender:", e);
mod.getCore().runLater(() -> {
mod.getCore().runLaterWithoutLock(() -> {
mod.getCore().printWarningToChat("Error initializing quick replay sender: %s", e.getLocalizedMessage());
promise.setException(e);
});
return;
}
mod.getCore().runLater(() -> promise.set(null));
mod.getCore().runLaterWithoutLock(() -> promise.set(null));
}).start();
return promise;
}