mirror of
https://github.com/TuxCoding/FastLogin.git
synced 2026-01-30 01:52:17 +01:00
Compile the project with Java 7. Many hosters don't have Java 8 yet.
This commit is contained in:
@@ -7,7 +7,7 @@ import org.bukkit.entity.Player;
|
||||
|
||||
/**
|
||||
* Github: https://github.com/Xephi/AuthMeReloaded/
|
||||
* Project page: dev.bukkit.org/bukkit-plugins/authme-reloaded/
|
||||
* Project page: http://dev.bukkit.org/bukkit-plugins/authme-reloaded/
|
||||
*/
|
||||
public class AuthMeHook implements AuthPlugin {
|
||||
|
||||
|
||||
@@ -8,7 +8,8 @@ import org.bukkit.entity.Player;
|
||||
* Github: http://dev.bukkit.org/bukkit-plugins/loginsecurity/
|
||||
* Project page: https://github.com/lenis0012/LoginSecurity-2
|
||||
*
|
||||
* on join: https://github.com/lenis0012/LoginSecurity-2/blob/master/src/main/java/com/lenis0012/bukkit/ls/LoginSecurity.java#L282
|
||||
* on join:
|
||||
* https://github.com/lenis0012/LoginSecurity-2/blob/master/src/main/java/com/lenis0012/bukkit/ls/LoginSecurity.java#L282
|
||||
*/
|
||||
public class LoginSecurityHook implements AuthPlugin {
|
||||
|
||||
|
||||
@@ -32,10 +32,19 @@ public class PlayerListener implements Listener {
|
||||
//check if it's the same player as we checked before
|
||||
if (session != null && session.getUsername().equals(player.getName())
|
||||
&& session.isVerified()) {
|
||||
Bukkit.getScheduler().runTaskLater(plugin, () -> {
|
||||
if (player.isOnline()) {
|
||||
plugin.getLogger().log(Level.FINER, "Logging player {0} in", player.getName());
|
||||
authPlugin.forceLogin(player);
|
||||
// Bukkit.getScheduler().runTaskLater(plugin, () -> {
|
||||
// if (player.isOnline()) {
|
||||
// plugin.getLogger().log(Level.FINER, "Logging player {0} in", player.getName());
|
||||
// authPlugin.forceLogin(player);
|
||||
// }
|
||||
Bukkit.getScheduler().runTaskLater(plugin, new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
if (player.isOnline()) {
|
||||
plugin.getLogger().log(Level.FINE, "Logging player {0} in", player.getName());
|
||||
authPlugin.forceLogin(player);
|
||||
}
|
||||
}
|
||||
//Wait before auth plugin initializes the player
|
||||
}, 1 * 20L);
|
||||
|
||||
@@ -29,6 +29,7 @@ public class StartPacketListener extends PacketAdapter {
|
||||
|
||||
//only premium (paid account) users have a uuid from there
|
||||
private static final String UUID_LINK = "https://api.mojang.com/users/profiles/minecraft/";
|
||||
//this includes a-zA-Z1-9_
|
||||
private static final String VALID_PLAYERNAME = "^\\w{2,16}$";
|
||||
|
||||
private final ProtocolManager protocolManager;
|
||||
|
||||
Reference in New Issue
Block a user