mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 21:26:45 +01:00
UUID cache changes
This commit is contained in:
parent
76bce7c0ef
commit
07977ac2ce
@ -168,20 +168,23 @@ public class FileUUIDHandler extends UUIDHandlerImplementation {
|
|||||||
} else {
|
} else {
|
||||||
NbtFactory.NbtCompound bukkit = (NbtFactory.NbtCompound) compound.get("bukkit");
|
NbtFactory.NbtCompound bukkit = (NbtFactory.NbtCompound) compound.get("bukkit");
|
||||||
String name = (String) bukkit.get("lastKnownName");
|
String name = (String) bukkit.get("lastKnownName");
|
||||||
long last = (long) bukkit.get("lastPlayed");
|
StringWrapper wrap = new StringWrapper(name);
|
||||||
if (Settings.UUID.OFFLINE) {
|
if (!toAdd.containsKey(wrap)) {
|
||||||
if (Settings.UUID.FORCE_LOWERCASE && !name.toLowerCase().equals(name)) {
|
long last = (long) bukkit.get("lastPlayed");
|
||||||
uuid = FileUUIDHandler.this.uuidWrapper.getUUID(name);
|
if (Settings.UUID.OFFLINE) {
|
||||||
} else {
|
if (Settings.UUID.FORCE_LOWERCASE && !name.toLowerCase().equals(name)) {
|
||||||
long most = (long) compound.get("UUIDMost");
|
uuid = FileUUIDHandler.this.uuidWrapper.getUUID(name);
|
||||||
long least = (long) compound.get("UUIDLeast");
|
} else {
|
||||||
uuid = new UUID(most, least);
|
long most = (long) compound.get("UUIDMost");
|
||||||
|
long least = (long) compound.get("UUIDLeast");
|
||||||
|
uuid = new UUID(most, least);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
if (ExpireManager.IMP != null) {
|
||||||
|
ExpireManager.IMP.storeDate(uuid, last);
|
||||||
|
}
|
||||||
|
toAdd.put(wrap, uuid);
|
||||||
}
|
}
|
||||||
if (ExpireManager.IMP != null) {
|
|
||||||
ExpireManager.IMP.storeDate(uuid, last);
|
|
||||||
}
|
|
||||||
toAdd.put(new StringWrapper(name), uuid);
|
|
||||||
}
|
}
|
||||||
} catch (Exception ignored) {
|
} catch (Exception ignored) {
|
||||||
PS.debug(C.PREFIX + "&6Invalid PlayerData: " + uuid.toString() + ".dat");
|
PS.debug(C.PREFIX + "&6Invalid PlayerData: " + uuid.toString() + ".dat");
|
||||||
@ -199,10 +202,12 @@ public class FileUUIDHandler extends UUIDHandlerImplementation {
|
|||||||
if (last != 0) {
|
if (last != 0) {
|
||||||
String name = op.getName();
|
String name = op.getName();
|
||||||
StringWrapper wrap = new StringWrapper(name);
|
StringWrapper wrap = new StringWrapper(name);
|
||||||
UUID uuid = FileUUIDHandler.this.uuidWrapper.getUUID(op);
|
if (!toAdd.containsKey(wrap)) {
|
||||||
toAdd.put(wrap, uuid);
|
UUID uuid = FileUUIDHandler.this.uuidWrapper.getUUID(op);
|
||||||
if (ExpireManager.IMP != null) {
|
toAdd.put(wrap, uuid);
|
||||||
ExpireManager.IMP.storeDate(uuid, last);
|
if (ExpireManager.IMP != null) {
|
||||||
|
ExpireManager.IMP.storeDate(uuid, last);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -370,13 +370,16 @@ public class PS {
|
|||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
UUIDHandler.add(new StringWrapper("*"), DBFunc.everyone);
|
UUIDHandler.add(new StringWrapper("*"), DBFunc.everyone);
|
||||||
for (Plot plot : getPlots()) {
|
foreachPlotRaw(new RunnableVal<Plot>() {
|
||||||
if (plot.hasOwner() && plot.temp != -1) {
|
@Override
|
||||||
if (UUIDHandler.getName(plot.owner) == null) {
|
public void run(Plot plot) {
|
||||||
UUIDHandler.implementation.unknown.add(plot.owner);
|
if (plot.hasOwner() && plot.temp != -1) {
|
||||||
|
if (UUIDHandler.getName(plot.owner) == null) {
|
||||||
|
UUIDHandler.implementation.unknown.add(plot.owner);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
startExpiryTasks();
|
startExpiryTasks();
|
||||||
startPlotMeConversion();
|
startPlotMeConversion();
|
||||||
}
|
}
|
||||||
|
@ -59,15 +59,18 @@ public class UUIDHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static HashSet<UUID> getAllUUIDS() {
|
public static HashSet<UUID> getAllUUIDS() {
|
||||||
HashSet<UUID> uuids = new HashSet<>();
|
final HashSet<UUID> uuids = new HashSet<>();
|
||||||
for (Plot plot : PS.get().getPlots()) {
|
PS.get().foreachPlotRaw(new RunnableVal<Plot>() {
|
||||||
if (plot.hasOwner()) {
|
@Override
|
||||||
uuids.add(plot.owner);
|
public void run(Plot plot) {
|
||||||
uuids.addAll(plot.getTrusted());
|
if (plot.hasOwner()) {
|
||||||
uuids.addAll(plot.getMembers());
|
uuids.add(plot.owner);
|
||||||
uuids.addAll(plot.getDenied());
|
uuids.addAll(plot.getTrusted());
|
||||||
|
uuids.addAll(plot.getMembers());
|
||||||
|
uuids.addAll(plot.getDenied());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
return uuids;
|
return uuids;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user