mirror of
https://github.com/GeyserMC/Floodgate.git
synced 2025-12-19 14:59:20 +00:00
Limit Bungee injection tries. Explicitly define cumulus in the api pom
This commit is contained in:
@@ -24,6 +24,11 @@
|
||||
<artifactId>common</artifactId>
|
||||
<version>${geyser.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.geysermc.cumulus</groupId>
|
||||
<artifactId>cumulus</artifactId>
|
||||
<version>${cumulus.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<repositories>
|
||||
|
||||
@@ -95,12 +95,24 @@ public final class BungeeInjector extends CommonPlatformInjector {
|
||||
// we're getting called before the decoder and encoder are added.
|
||||
// we'll have to wait a while :(
|
||||
ctx.executor().execute(() -> {
|
||||
int tries = 0;
|
||||
while (ctx.channel().isOpen()) {
|
||||
if (ctx.channel().pipeline().get(MinecraftEncoder.class) != null) {
|
||||
logger.debug("found packet encoder :)");
|
||||
ctx.channel().pipeline().addFirst(new BungeeInjectorInitializer());
|
||||
return;
|
||||
}
|
||||
|
||||
// half a second should be more than enough
|
||||
if (++tries > 25) {
|
||||
logger.debug("Failed to inject " + ctx.channel().pipeline());
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
Thread.sleep(20);
|
||||
} catch (InterruptedException ignored) {
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user