Booo we don't like UUIDS! (We need to keep 1.7.X compatibility!)

- Removed the useless OtherAccounts class!
This commit is contained in:
Gabriele C 2016-03-03 21:42:50 +01:00
parent b0d230be60
commit c4684fd5f1
5 changed files with 1 additions and 104 deletions

View File

@ -58,7 +58,7 @@ McStats: http://mcstats.org/plugin/AuthMe
#####"The best authentication plugin for the Bukkit/Spigot API!"
<p>Prevent username stealing on your server! Fully compatible with UUIDs and Craftbukkit/Spigot 1.8.X!<br>
<p>Prevent username stealing on your server!<br>
Use it to secure your Offline mode server or to increase your Online mode server's protection!</p>
<p>AuthMeReloaded disallows players who aren't authenticated to do actions like placing blocks, moving,<br>

View File

@ -46,7 +46,6 @@ import fr.xephi.authme.process.ProcessService;
import fr.xephi.authme.security.PasswordSecurity;
import fr.xephi.authme.security.crypts.SHA256;
import fr.xephi.authme.settings.NewSetting;
import fr.xephi.authme.settings.OtherAccounts;
import fr.xephi.authme.settings.Settings;
import fr.xephi.authme.settings.SettingsMigrationService;
import fr.xephi.authme.settings.Spawn;
@ -121,7 +120,6 @@ public class AuthMe extends JavaPlugin {
public NewAPI api;
public SendMailSSL mail;
public DataManager dataManager;
public OtherAccounts otherAccounts;
public Location essentialsSpawn;
/*
* Plugin Hooks
@ -258,9 +256,6 @@ public class AuthMe extends JavaPlugin {
permsMan = initializePermissionsManager();
commandHandler = initializeCommandHandler(permsMan, messages, passwordSecurity, newSettings);
// Setup otherAccounts file
this.otherAccounts = OtherAccounts.getInstance();
// Set up Metrics
MetricsStarter.setupMetrics(plugin, newSettings);

View File

@ -185,7 +185,6 @@ public class AsynchronousLogin {
// makes player isLoggedin via API
PlayerCache.getInstance().addPlayer(auth);
database.setLogged(name);
plugin.otherAccounts.addPlayer(player.getUniqueId());
// As the scheduling executes the Task most likely after the current
// task, we schedule it in the end

View File

@ -157,7 +157,6 @@ public class AsyncRegister {
plugin.getManagement().performLogin(player, "dontneed", true);
}
plugin.otherAccounts.addPlayer(player.getUniqueId());
ProcessSyncPasswordRegister sync = new ProcessSyncPasswordRegister(player, plugin, settings);
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, sync);

View File

@ -1,96 +0,0 @@
package fr.xephi.authme.settings;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
/**
* @author Xephi59
* @version $Revision: 1.0 $
*/
public class OtherAccounts extends CustomConfiguration {
private static OtherAccounts others = null;
public OtherAccounts() {
super(new File("." + File.separator + "plugins" + File.separator + "AuthMe" + File.separator + "otheraccounts.yml"));
others = this;
load();
save();
}
/**
* Method getInstance.
*
* @return OtherAccounts
*/
public static OtherAccounts getInstance() {
if (others == null) {
others = new OtherAccounts();
}
return others;
}
/**
* Method clear.
*
* @param uuid UUID
*/
public void clear(UUID uuid) {
set(uuid.toString(), new ArrayList<String>());
save();
}
/**
* Method addPlayer.
*
* @param uuid UUID
*/
public void addPlayer(UUID uuid) {
try {
Player player = Bukkit.getPlayer(uuid);
if (player == null)
return;
if (!this.getStringList(uuid.toString()).contains(player.getName())) {
this.getStringList(uuid.toString()).add(player.getName());
save();
}
} catch (NoSuchMethodError | Exception e) {
//ignore
}
}
/**
* Method removePlayer.
*
* @param uuid UUID
*/
public void removePlayer(UUID uuid) {
try {
Player player = Bukkit.getPlayer(uuid);
if (player == null)
return;
if (this.getStringList(uuid.toString()).contains(player.getName())) {
this.getStringList(uuid.toString()).remove(player.getName());
save();
}
} catch (NoSuchMethodError | Exception e) {
//ignore
}
}
/**
* Method getAllPlayersByUUID.
*
* @param uuid UUID
*
* @return StringList
*/
public List<String> getAllPlayersByUUID(UUID uuid) {
return this.getStringList(uuid.toString());
}
}