From 9a30a0b29981f66e5306828d2fd4ce79c0cff9ab Mon Sep 17 00:00:00 2001 From: games647 Date: Wed, 23 Mar 2016 10:15:48 +0100 Subject: [PATCH] Added forwardSkin config option --- CHANGELOG.md | 5 +++++ README.md | 1 + .../bukkit/listener/BukkitJoinListener.java | 2 +- .../listener/ProtcolSupportListener.java | 11 +++++++---- bukkit/src/main/resources/config.yml | 18 +++++++++++++++++- 5 files changed, 31 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e82de12a..36450aef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ ######0.7 +* Added a forwardSkin config option +* Added premium UUID support +* Removes the need of an Bukkit auth plugin if you use a bungeecord one +* Optimize performance and thread-safety +* Added BungeeAuth support * Added /premium [player] command with optional player parameter * Fixed BungeeCord support * Changed config option autologin to autoregister to clarify the usage diff --git a/README.md b/README.md index d6d5b02a..2be78654 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,7 @@ So they don't need to enter passwords. This is also called auto login (auto-logi * Support various of auth plugins * Cauldron support * Forge/Sponge message support +* Premium UUID support * BungeeCord support * Auto register new premium players * Plugin: ProtocolSupport is supported and can be used as an alternative to ProtocolLib diff --git a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/BukkitJoinListener.java b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/BukkitJoinListener.java index b22010fb..0b461c8e 100644 --- a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/BukkitJoinListener.java +++ b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/BukkitJoinListener.java @@ -37,7 +37,7 @@ public class BukkitJoinListener implements Listener { //removing the session because we now use it final PlayerSession session = plugin.getSessions().get(player.getAddress().toString()); - if (session != null) { + if (session != null && plugin.getConfig().getBoolean("forwardSkin")) { WrappedGameProfile gameProfile = WrappedGameProfile.fromPlayer(player); WrappedSignedProperty skin = session.getSkin(); if (skin != null) { diff --git a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/ProtcolSupportListener.java b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/ProtcolSupportListener.java index d5c08774..69bcf7da 100644 --- a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/ProtcolSupportListener.java +++ b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/ProtcolSupportListener.java @@ -44,10 +44,13 @@ public class ProtcolSupportListener implements Listener { @EventHandler(ignoreCancelled = true) public void onPropertiesResolve(PlayerPropertiesResolveEvent propertiesResolveEvent) { - InetSocketAddress address = propertiesResolveEvent.getAddress(); - PlayerSession session = plugin.getSessions().get(address.toString()); - if (session != null) { - session.setVerified(true); + //skin was resolved -> premium player + if (propertiesResolveEvent.hasProperty("textures")) { + InetSocketAddress address = propertiesResolveEvent.getAddress(); + PlayerSession session = plugin.getSessions().get(address.toString()); + if (session != null) { + session.setVerified(true); + } } } diff --git a/bukkit/src/main/resources/config.yml b/bukkit/src/main/resources/config.yml index 37149722..a0772908 100644 --- a/bukkit/src/main/resources/config.yml +++ b/bukkit/src/main/resources/config.yml @@ -1,4 +1,7 @@ # FastLogin config +# Project site: https://www.spigotmc.org/resources/fastlogin.14153 +# Source code: https://github.com/games647/FastLogin +# # You can access the newest config here: # https://github.com/games647/FastLogin/blob/master/bukkit/src/main/resources/config.yml @@ -35,4 +38,17 @@ autoRegister: false # Moreover you may want to convert the offline UUID to a premium UUID. This will ensure that the player # will have the same inventory, permissions, ... if they switched to premium authentification from offline/cracked # authentification. -premiumUuid: false \ No newline at end of file +premiumUuid: false + +# If your players have a premium account and a skin associated to their account, this plugin +# can download the data and set it to the online player. +# +# Keep in mind that this will only works if the player: +# * is the owner of the premium account +# * the serverconnection is established through a premium connection (paid account authentification) +# * has a skin +# +# This means this plugin doesn't need to create a new connection to the Mojang servers, because +# the skin data is included in the Auth-Verification-Response sent by Mojang. If you want to use for other +# players like cracked player, you have to use other plugins. +forwardSkin: true \ No newline at end of file