diff --git a/CHANGELOG.md b/CHANGELOG.md index b5eb9bfe..944490a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +######1.3 + +* Add support for AuthMe 3.X + +######1.2.1 + +* Fix premium status change notification message on BungeeCord + ######1.2 * Fix race condition in BungeeCord diff --git a/README.md b/README.md index 5ae5c56f..76095035 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![Build Status](https://travis-ci.org/games647/FastLogin.svg?branch=master)](https://travis-ci.org/games647/FastLogin) [![Donate Button](https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=8ZBULMAPN7MZC) -Checks if a minecraft player has a paid account (premium). If so, they can skip offline authentication (auth plugins). +Checks if a Minecraft player has a paid account (premium). If so, they can skip offline authentication (auth plugins). So they don't need to enter passwords. This is also called auto login (auto-login). ###Features: @@ -37,11 +37,11 @@ So they don't need to enter passwords. This is also called auto login (auto-logi * Tested Bukkit/[Spigot](https://www.spigotmc.org) 1.9 (could also work with other versions) * Java 7+ * Run Spigot and/or BungeeCord/Waterfall in offline mode (see server.properties or config.yml) -* An auth plugin. Supported Plugins +* An auth plugin. Supported plugins ####Bukkit/Spigot/PaperSpigot -* [AuthMe](http://dev.bukkit.org/bukkit-plugins/authme-reloaded/) +* [AuthMe (both 5.X and 3.X)](http://dev.bukkit.org/bukkit-plugins/authme-reloaded/) * [xAuth](http://dev.bukkit.org/bukkit-plugins/xauth/) * [AdvancedLogin (Paid)](https://www.spigotmc.org/resources/advancedlogin.10510/) * [CrazyLogin](http://dev.bukkit.org/bukkit-plugins/crazylogin/) @@ -65,6 +65,7 @@ https://www.spigotmc.org/resources/fastlogin.14153/history 1. Download and install ProtocolLib 2. Download and install FastLogin +3. Set your server in offline mode by setting the value onlinemode in your server.properties to false ####BungeeCord/Waterfall @@ -75,13 +76,15 @@ 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 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. (BungeeCord doesn't support SQLite per default, so you should change the configuration to MySQL or MariaDB) *** ###FAQ ####Index -1. [How does minecraft logins work?](#how-does-minecraft-logins-work) +1. [How does Minecraft logins work?](#how-does-minecraft-logins-work) 2. [How does this plugin work?](#how-does-this-plugin-work) 3. [Why does the plugin require offline mode?](#why-does-the-plugin-require-offline-mode) 4. [Can cracked player join with premium usernames?](#can-cracked-player-join-with-premium-usernames) diff --git a/bukkit/pom.xml b/bukkit/pom.xml index 85fad53b..dee14a2d 100644 --- a/bukkit/pom.xml +++ b/bukkit/pom.xml @@ -5,7 +5,7 @@ com.github.games647 fastlogin - 1.2.1 + 1.3 ../pom.xml 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 f1c9e240..e35db909 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 @@ -1,5 +1,8 @@ package com.github.games647.fastlogin.bukkit.hooks; +import com.avaje.ebeaninternal.api.ClassUtil; + +import fr.xephi.authme.api.API; import fr.xephi.authme.api.NewAPI; import org.bukkit.entity.Player; @@ -13,10 +16,21 @@ import org.bukkit.entity.Player; */ public class AuthMeHook implements BukkitAuthPlugin { + private final boolean isNewAPIAvailable; + + public AuthMeHook() { + this.isNewAPIAvailable = ClassUtil.isPresent("fr.​xephi.​authme.​api.NewAPI"); + } + @Override public boolean forceLogin(Player player) { //skips registration and login - NewAPI.getInstance().forceLogin(player); + if (isNewAPIAvailable) { + NewAPI.getInstance().forceLogin(player); + } else { + API.forceLogin(player); + } + //commented because the operation above is performed async -> race conditions // return NewAPI.getInstance().isAuthenticated(player); return true; @@ -24,12 +38,21 @@ public class AuthMeHook implements BukkitAuthPlugin { @Override public boolean isRegistered(String playerName) throws Exception { - return NewAPI.getInstance().isRegistered(playerName); + if (isNewAPIAvailable) { + return NewAPI.getInstance().isRegistered(playerName); + } else { + return API.isRegistered(playerName); + } } @Override public boolean forceRegister(Player player, String password) { - NewAPI.getInstance().forceRegister(player, password); + if (isNewAPIAvailable) { + NewAPI.getInstance().forceRegister(player, password); + } else { + API.registerPlayer(player.getName(), password); + } + return true; } } diff --git a/bungee/pom.xml b/bungee/pom.xml index 920e919a..ba4f058c 100644 --- a/bungee/pom.xml +++ b/bungee/pom.xml @@ -5,7 +5,7 @@ com.github.games647 fastlogin - 1.2.1 + 1.3 ../pom.xml diff --git a/pom.xml b/pom.xml index 590de0d2..079a33c2 100644 --- a/pom.xml +++ b/pom.xml @@ -8,7 +8,7 @@ pom FastLogin - 1.2.1 + 1.3 2015 https://www.spigotmc.org/resources/fastlogin.14153/ @@ -96,7 +96,7 @@ org.slf4j slf4j-jdk14 - 1.7.20 + 1.7.21 diff --git a/universal/pom.xml b/universal/pom.xml index 822f7118..ed4695e6 100644 --- a/universal/pom.xml +++ b/universal/pom.xml @@ -5,7 +5,7 @@ com.github.games647 fastlogin - 1.2.1 + 1.3 ../pom.xml