mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 13:16:45 +01:00
Always cache * uuid
This commit is contained in:
parent
a1c722aa9e
commit
237a0d8b6b
@ -6,20 +6,16 @@ import com.google.common.io.ByteSource;
|
||||
import com.intellectualcrafters.plot.PS;
|
||||
import com.intellectualcrafters.plot.config.C;
|
||||
import com.intellectualcrafters.plot.config.Settings;
|
||||
import com.intellectualcrafters.plot.database.DBFunc;
|
||||
import com.intellectualcrafters.plot.object.OfflinePlotPlayer;
|
||||
import com.intellectualcrafters.plot.object.RunnableVal;
|
||||
import com.intellectualcrafters.plot.object.StringWrapper;
|
||||
import com.intellectualcrafters.plot.util.expiry.ExpireManager;
|
||||
import com.intellectualcrafters.plot.util.StringMan;
|
||||
import com.intellectualcrafters.plot.util.TaskManager;
|
||||
import com.intellectualcrafters.plot.util.UUIDHandler;
|
||||
import com.intellectualcrafters.plot.util.UUIDHandlerImplementation;
|
||||
import com.intellectualcrafters.plot.util.expiry.ExpireManager;
|
||||
import com.intellectualcrafters.plot.uuid.UUIDWrapper;
|
||||
import com.plotsquared.bukkit.util.NbtFactory;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.World;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
@ -28,6 +24,8 @@ import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.World;
|
||||
|
||||
public class FileUUIDHandler extends UUIDHandlerImplementation {
|
||||
|
||||
@ -84,7 +82,6 @@ public class FileUUIDHandler extends UUIDHandlerImplementation {
|
||||
}
|
||||
if (Settings.UUID.NATIVE_UUID_PROVIDER) {
|
||||
HashBiMap<StringWrapper, UUID> toAdd = HashBiMap.create(new HashMap<StringWrapper, UUID>());
|
||||
toAdd.put(new StringWrapper("*"), DBFunc.everyone);
|
||||
HashSet<UUID> all = UUIDHandler.getAllUUIDS();
|
||||
PS.debug("&aFast mode UUID caching enabled!");
|
||||
File playerDataFolder = new File(container, world + File.separator + "playerdata");
|
||||
@ -128,7 +125,6 @@ public class FileUUIDHandler extends UUIDHandlerImplementation {
|
||||
}
|
||||
}
|
||||
HashBiMap<StringWrapper, UUID> toAdd = HashBiMap.create(new HashMap<StringWrapper, UUID>());
|
||||
toAdd.put(new StringWrapper("*"), DBFunc.everyone);
|
||||
HashSet<String> worlds = Sets.newHashSet(world, "world");
|
||||
HashSet<UUID> uuids = new HashSet<>();
|
||||
HashSet<String> names = new HashSet<>();
|
||||
|
@ -4,7 +4,6 @@ import com.google.common.collect.HashBiMap;
|
||||
import com.intellectualcrafters.plot.PS;
|
||||
import com.intellectualcrafters.plot.config.C;
|
||||
import com.intellectualcrafters.plot.config.Settings;
|
||||
import com.intellectualcrafters.plot.database.DBFunc;
|
||||
import com.intellectualcrafters.plot.database.SQLite;
|
||||
import com.intellectualcrafters.plot.object.RunnableVal;
|
||||
import com.intellectualcrafters.plot.object.StringWrapper;
|
||||
@ -13,11 +12,6 @@ import com.intellectualcrafters.plot.util.TaskManager;
|
||||
import com.intellectualcrafters.plot.util.UUIDHandler;
|
||||
import com.intellectualcrafters.plot.util.UUIDHandlerImplementation;
|
||||
import com.intellectualcrafters.plot.uuid.UUIDWrapper;
|
||||
import org.json.simple.JSONArray;
|
||||
import org.json.simple.JSONObject;
|
||||
import org.json.simple.parser.JSONParser;
|
||||
import org.json.simple.parser.ParseException;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.OutputStream;
|
||||
@ -31,6 +25,10 @@ import java.util.ArrayDeque;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.UUID;
|
||||
import org.json.simple.JSONArray;
|
||||
import org.json.simple.JSONObject;
|
||||
import org.json.simple.parser.JSONParser;
|
||||
import org.json.simple.parser.ParseException;
|
||||
|
||||
public class SQLUUIDHandler extends UUIDHandlerImplementation {
|
||||
|
||||
@ -84,8 +82,6 @@ public class SQLUUIDHandler extends UUIDHandlerImplementation {
|
||||
}
|
||||
}
|
||||
add(toAdd);
|
||||
add(new StringWrapper("*"), DBFunc.everyone);
|
||||
|
||||
// This should be called as long as there are some unknown plots
|
||||
final ArrayDeque<UUID> toFetch = new ArrayDeque<>();
|
||||
for (UUID u : UUIDHandler.getAllUUIDS()) {
|
||||
|
@ -29,6 +29,7 @@ import com.intellectualcrafters.plot.object.PlotManager;
|
||||
import com.intellectualcrafters.plot.object.PlotPlayer;
|
||||
import com.intellectualcrafters.plot.object.RegionWrapper;
|
||||
import com.intellectualcrafters.plot.object.RunnableVal;
|
||||
import com.intellectualcrafters.plot.object.StringWrapper;
|
||||
import com.intellectualcrafters.plot.util.AbstractTitle;
|
||||
import com.intellectualcrafters.plot.util.ChatManager;
|
||||
import com.intellectualcrafters.plot.util.ChunkManager;
|
||||
@ -206,6 +207,7 @@ public class PS {
|
||||
startUuidCatching();
|
||||
} else {
|
||||
// Start these separately
|
||||
UUIDHandler.add(new StringWrapper("*"), DBFunc.everyone);
|
||||
startExpiryTasks();
|
||||
startPlotMeConversion();
|
||||
}
|
||||
@ -364,6 +366,7 @@ public class PS {
|
||||
UUIDHandler.startCaching(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
UUIDHandler.add(new StringWrapper("*"), DBFunc.everyone);
|
||||
for (Plot plot : getPlots()) {
|
||||
if (plot.hasOwner() && plot.temp != -1) {
|
||||
if (UUIDHandler.getName(plot.owner) == null) {
|
||||
|
@ -1,15 +1,13 @@
|
||||
package com.plotsquared.sponge.uuid;
|
||||
|
||||
import com.intellectualcrafters.plot.database.DBFunc;
|
||||
import com.intellectualcrafters.plot.object.RunnableVal;
|
||||
import com.intellectualcrafters.plot.object.StringWrapper;
|
||||
import com.intellectualcrafters.plot.util.TaskManager;
|
||||
import com.intellectualcrafters.plot.util.UUIDHandlerImplementation;
|
||||
import com.intellectualcrafters.plot.uuid.UUIDWrapper;
|
||||
import com.plotsquared.sponge.SpongeMain;
|
||||
import org.spongepowered.api.profile.GameProfile;
|
||||
|
||||
import java.util.UUID;
|
||||
import org.spongepowered.api.profile.GameProfile;
|
||||
|
||||
public class SpongeUUIDHandler extends UUIDHandlerImplementation {
|
||||
|
||||
@ -26,7 +24,6 @@ public class SpongeUUIDHandler extends UUIDHandlerImplementation {
|
||||
}
|
||||
|
||||
public boolean cache(Runnable whenDone) {
|
||||
add(new StringWrapper("*"), DBFunc.everyone);
|
||||
for (GameProfile profile : SpongeMain.THIS.getServer().getGameProfileManager().getCache().getProfiles()) {
|
||||
String name = profile.getName().orElse(null);
|
||||
if (name != null) {
|
||||
|
Loading…
Reference in New Issue
Block a user