diff --git a/README.md b/README.md index 9034d5ae..68c967ff 100644 --- a/README.md +++ b/README.md @@ -64,8 +64,8 @@ So they don't need to enter passwords. This is also called auto login (auto-logi #### Bukkit/Spigot/Paper -1. Download and install ProtocolLib -2. Download and install FastLogin +1. Download and install ProtocolLib/ProtocolSupport +2. Download and install FastLogin (or FastLoginBukkit for newer versions) 3. Set your server in offline mode by setting the value onlinemode in your server.properties to false #### BungeeCord/Waterfall @@ -75,7 +75,8 @@ So they don't need to enter passwords. This is also called auto login (auto-logi 3. Now there is proxy-whitelist file in the FastLogin folder Put your stats id from the BungeeCord config into this file 4. Activate ipForward in your BungeeCord config -5. Download and Install FastLogin on BungeeCord AND Spigot (on the servers where your login plugin is) +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) 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 8. You should *always* firewall your Spigot server that it's only accessible through BungeeCord diff --git a/bukkit/pom.xml b/bukkit/pom.xml index fbbfd514..2a2f48dc 100644 --- a/bukkit/pom.xml +++ b/bukkit/pom.xml @@ -94,6 +94,7 @@ + com.github.games647 fastlogin.core @@ -116,6 +117,7 @@ provided + com.github.ProtocolSupport ProtocolSupport @@ -124,6 +126,7 @@ provided + me.clip placeholderapi diff --git a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/hooks/AuthMeHook.java b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/hooks/AuthMeHook.java index ebbb8624..1daeef00 100644 --- a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/hooks/AuthMeHook.java +++ b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/hooks/AuthMeHook.java @@ -42,11 +42,11 @@ public class AuthMeHook implements AuthPlugin, Listener { @Override public boolean forceLogin(Player player) { - //skips registration and login if (AuthMeApi.getInstance().isAuthenticated(player)) { return false; } + //skips registration and login AuthMeApi.getInstance().forceLogin(player); return true; } @@ -58,7 +58,7 @@ public class AuthMeHook implements AuthPlugin, Listener { @Override public boolean forceRegister(Player player, String password) { - //this automatically registers the player too + //this automatically login the player too AuthMeApi.getInstance().forceRegister(player, password); return true; } diff --git a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/tasks/ForceLoginTask.java b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/tasks/ForceLoginTask.java index 26da908d..791f5632 100644 --- a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/tasks/ForceLoginTask.java +++ b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/tasks/ForceLoginTask.java @@ -33,13 +33,13 @@ public class ForceLoginTask extends ForceLoginManagement + ${project.groupId} fastlogin.core @@ -82,6 +83,7 @@ provided + me.vik1395 BungeeAuth diff --git a/core/pom.xml b/core/pom.xml index 8b77d2cf..5f9e4520 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -63,6 +63,7 @@ + com.github.games647 craftapi diff --git a/core/src/main/java/com/github/games647/fastlogin/core/hooks/DefaultPasswordGenerator.java b/core/src/main/java/com/github/games647/fastlogin/core/hooks/DefaultPasswordGenerator.java index 5e7326db..d442181e 100644 --- a/core/src/main/java/com/github/games647/fastlogin/core/hooks/DefaultPasswordGenerator.java +++ b/core/src/main/java/com/github/games647/fastlogin/core/hooks/DefaultPasswordGenerator.java @@ -2,9 +2,11 @@ package com.github.games647.fastlogin.core.hooks; import java.security.SecureRandom; import java.util.Random; +import java.util.stream.IntStream; public class DefaultPasswordGenerator

implements PasswordGenerator

{ + private static final int PASSWORD_LENGTH = 8; private static final char[] PASSWORD_CHARACTERS = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" .toCharArray(); @@ -13,9 +15,10 @@ public class DefaultPasswordGenerator

implements PasswordGenerator

{ @Override public String getRandomPassword(P player) { StringBuilder generatedPassword = new StringBuilder(8); - for (int i = 1; i <= 8; i++) { - generatedPassword.append(PASSWORD_CHARACTERS[random.nextInt(PASSWORD_CHARACTERS.length - 1)]); - } + IntStream.rangeClosed(1, PASSWORD_LENGTH) + .map(i -> random.nextInt(PASSWORD_CHARACTERS.length - 1)) + .mapToObj(pos -> PASSWORD_CHARACTERS[pos]) + .forEach(generatedPassword::append); return generatedPassword.toString(); }