Send login command from proxy immediately

This commit is contained in:
games647
2024-05-21 21:55:23 +02:00
parent 9a400f5ae1
commit ad815777d4
2 changed files with 1 additions and 5 deletions

View File

@ -233,9 +233,6 @@ public class ConnectListener implements Listener {
return;
}
// delay sending force command, because Paper will process the login event asynchronously
// In this case it means that the force command (plugin message) is already received and processed while
// player is still in the login phase and reported to be offline.
Runnable loginTask = new ForceLoginTask(plugin.getCore(), player, server, session);
plugin.getScheduler().runAsync(loginTask);
}

View File

@ -51,7 +51,6 @@ import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
import org.geysermc.floodgate.api.player.FloodgatePlayer;
import java.net.InetSocketAddress;
import java.time.Duration;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
@ -167,6 +166,6 @@ public class ConnectListener {
Runnable loginTask = new ForceLoginTask(plugin.getCore(), player, server, session);
// Delay at least one second, otherwise the login command can be missed
plugin.getScheduler().runAsyncDelayed(loginTask, Duration.ofSeconds(1));
plugin.getScheduler().runAsync(loginTask);
}
}