Fixes insert (new player) for cracked players (Fixes #18)

This commit is contained in:
games647
2016-06-07 17:32:45 +02:00
parent 0b709997a4
commit ac15829dcc
12 changed files with 72 additions and 57 deletions
@@ -109,7 +109,7 @@ public class FastLoginBungee extends Plugin {
this.bungeeAuthPlugin = authPlugin;
}
public Configuration getConfiguration() {
public Configuration getConfig() {
return configuration;
}
@@ -58,7 +58,7 @@ public class PlayerConnectionListener implements Listener {
//bungeecord will do this automatically so override it on disabled option
InitialHandler initialHandler = (InitialHandler) connection;
if (!plugin.getConfiguration().getBoolean("premiumUuid")) {
if (!plugin.getConfig().getBoolean("premiumUuid")) {
try {
UUID offlineUUID = UUID.nameUUIDFromBytes(("OfflinePlayer:" + username).getBytes(Charsets.UTF_8));
@@ -72,7 +72,7 @@ public class PlayerConnectionListener implements Listener {
}
}
if (!plugin.getConfiguration().getBoolean("forwardSkin")) {
if (!plugin.getConfig().getBoolean("forwardSkin")) {
//this is null on offline mode
LoginResult loginProfile = initialHandler.getLoginProfile();
if (loginProfile != null) {
@@ -1,7 +1,7 @@
package com.github.games647.fastlogin.bungee.listener;
import com.github.games647.fastlogin.bungee.tasks.AsyncToggleMessage;
import com.github.games647.fastlogin.bungee.FastLoginBungee;
import com.github.games647.fastlogin.bungee.tasks.AsyncToggleMessage;
import com.github.games647.fastlogin.core.PlayerProfile;
import com.google.common.io.ByteArrayDataInput;
import com.google.common.io.ByteStreams;
@@ -35,8 +35,7 @@ public class AsyncPremiumCheck implements Runnable {
if (profile.getUserId() == -1) {
UUID premiumUUID = null;
if (plugin.getConfiguration().getBoolean("nameChangeCheck")
|| plugin.getConfiguration().getBoolean("autoRegister")) {
if (plugin.getConfig().getBoolean("nameChangeCheck") || plugin.getConfig().getBoolean("autoRegister")) {
premiumUUID = plugin.getCore().getMojangApiConnector().getPremiumUUID(username);
}
@@ -59,7 +58,7 @@ public class AsyncPremiumCheck implements Runnable {
private boolean checkPremiumName(String username, PendingConnection connection, PlayerProfile profile)
throws Exception {
BungeeAuthPlugin authPlugin = plugin.getBungeeAuthPlugin();
if (plugin.getConfiguration().getBoolean("autoRegister")
if (plugin.getConfig().getBoolean("autoRegister")
&& (authPlugin == null || !authPlugin.isRegistered(username))) {
plugin.getLogger().log(Level.FINER, "Player {0} uses a premium username", username);
requestPremiumLogin(connection, profile, username, false);
@@ -71,7 +70,7 @@ public class AsyncPremiumCheck implements Runnable {
private boolean checkNameChange(UUID premiumUUID, PendingConnection connection, String username) {
//user not exists in the db
if (plugin.getConfiguration().getBoolean("nameChangeCheck")) {
if (plugin.getConfig().getBoolean("nameChangeCheck")) {
PlayerProfile profile = plugin.getCore().getStorage().loadProfile(premiumUUID);
if (profile != null) {
//uuid exists in the database