mirror of
https://github.com/TuxCoding/FastLogin.git
synced 2026-05-04 19:54:32 +02:00
Fixes insert (new player) for cracked players (Fixes #18)
This commit is contained in:
@@ -109,7 +109,7 @@ public class FastLoginBungee extends Plugin {
|
||||
this.bungeeAuthPlugin = authPlugin;
|
||||
}
|
||||
|
||||
public Configuration getConfiguration() {
|
||||
public Configuration getConfig() {
|
||||
return configuration;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -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
-1
@@ -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;
|
||||
|
||||
+3
-4
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user