mirror of
https://github.com/TuxCoding/FastLogin.git
synced 2025-07-30 10:47:33 +02:00
Delay force login command for async logins on Paper from Bungee
Related #331
This commit is contained in:
16
README.md
16
README.md
@ -11,25 +11,31 @@ So they don't need to enter passwords. This is also called auto login (auto-logi
|
|||||||
* Cauldron support
|
* Cauldron support
|
||||||
* Forge/Sponge message support
|
* Forge/Sponge message support
|
||||||
* Premium UUID support
|
* Premium UUID support
|
||||||
* Forwards Skins
|
* Forward skins
|
||||||
* Detect user name changed and will update the existing database record
|
* Detect user name changed and will update the existing database record
|
||||||
* BungeeCord support
|
* BungeeCord support
|
||||||
* Auto register new premium players
|
* Auto register new premium players
|
||||||
* Plugin: ProtocolSupport is supported and can be used as an alternative to ProtocolLib
|
* Plugin: ProtocolSupport is supported and can be used as an alternative to ProtocolLib
|
||||||
* No client modifications needed
|
* No client modifications needed
|
||||||
* Good performance by using async non blocking operations
|
* Good performance by using async operations
|
||||||
* Locale messages
|
* Locale messages
|
||||||
* Import the database from similar plugins
|
* Import the database from similar plugins
|
||||||
|
|
||||||
|
## Issues
|
||||||
|
|
||||||
|
Please use issues for bug reports, suggestions, questions and more. Please check for existing issues. Existing issues
|
||||||
|
can be upvoted by adding up vote to the original post.
|
||||||
|
|
||||||
## Development builds
|
## Development builds
|
||||||
|
|
||||||
Development builds of this project can be acquired at the provided CI (continuous integration) server. It contains the
|
Development builds of this project can be acquired at the provided CI (continuous integration) server. It contains the
|
||||||
latest changes from the Source-Code in preparation for the following release. This means they could contain new
|
latest changes from the Source-Code in preparation for the following release. This means they could contain new
|
||||||
features, bug fixes and other changes since the last release.
|
features, bug fixes and other changes since the last release.
|
||||||
|
|
||||||
Nevertheless builds are only tested using a small set of automated and a few manual tests. Therefore they **could**
|
They **could** contain new bugs and are likely to be less stable than released versions.
|
||||||
contain new bugs and are likely to be less stable than released versions.
|
|
||||||
|
|
||||||
|
Specific builds can be grabbed by clicking on the build number on the left side or by clicking on status to retrieve the
|
||||||
|
latest build.
|
||||||
https://ci.codemc.org/job/Games647/job/FastLogin/changes
|
https://ci.codemc.org/job/Games647/job/FastLogin/changes
|
||||||
|
|
||||||
***
|
***
|
||||||
@ -97,7 +103,7 @@ Put your stats id from the BungeeCord config into this file
|
|||||||
5. Download and Install FastLogin (or FastLoginBungee in newer versions) on BungeeCord AND Spigot
|
5. Download and Install FastLogin (or FastLoginBungee in newer versions) on BungeeCord AND Spigot
|
||||||
(on the servers where your login plugin is or where player should be able to execute the commands of FastLogin)
|
(on the servers where your login plugin is or where player should be able to execute the commands of FastLogin)
|
||||||
6. Check your database settings in the config of FastLogin on BungeeCord
|
6. Check your database settings in the config of FastLogin on BungeeCord
|
||||||
7. Set your proxy (BungeeCord) in offline mode by setting the value onlinemode in your config.yml to false
|
7. Set proxy and Spigot in offline mode by setting the value onlinemode in your config.yml to false
|
||||||
8. You should *always* firewall your Spigot server that it's only accessible through BungeeCord
|
8. You should *always* firewall your Spigot server that it's only accessible through BungeeCord
|
||||||
* https://www.spigotmc.org/wiki/bungeecord-installation/#post-installation
|
* https://www.spigotmc.org/wiki/bungeecord-installation/#post-installation
|
||||||
* BungeeCord doesn't support SQLite per default, so you should change the configuration to MySQL or MariaDB
|
* BungeeCord doesn't support SQLite per default, so you should change the configuration to MySQL or MariaDB
|
||||||
|
@ -9,7 +9,9 @@ import com.github.games647.fastlogin.core.shared.LoginSession;
|
|||||||
|
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
import net.md_5.bungee.api.ProxyServer;
|
||||||
import net.md_5.bungee.api.connection.PendingConnection;
|
import net.md_5.bungee.api.connection.PendingConnection;
|
||||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||||
import net.md_5.bungee.api.connection.Server;
|
import net.md_5.bungee.api.connection.Server;
|
||||||
@ -100,8 +102,11 @@ public class ConnectListener implements Listener {
|
|||||||
ProxiedPlayer player = serverConnectedEvent.getPlayer();
|
ProxiedPlayer player = serverConnectedEvent.getPlayer();
|
||||||
Server server = serverConnectedEvent.getServer();
|
Server server = serverConnectedEvent.getServer();
|
||||||
|
|
||||||
|
// 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);
|
Runnable loginTask = new ForceLoginTask(plugin.getCore(), player, server);
|
||||||
plugin.getScheduler().runAsync(loginTask);
|
ProxyServer.getInstance().getScheduler().schedule(plugin, loginTask, 500, TimeUnit.MILLISECONDS);
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
|
Reference in New Issue
Block a user