mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-06-25 02:04:44 +02:00
Add option to disable legacy cache, also add an option to return "Unknown" when a request cannot be fulfilled (old behaviour)
This should fix issues where lowercase offline mode UUIDs don't have access to their old cache.
This commit is contained in:
@ -248,6 +248,10 @@ public class Settings extends Config {
|
||||
public static long NON_BLOCKING_TIMEOUT = 3000L;
|
||||
@Comment("Timeout (in milliseconds) for blocking UUID requests (events)")
|
||||
public static long BLOCKING_TIMEOUT = 10L;
|
||||
@Comment("Whether or not PlotSquared should read from the legacy database")
|
||||
public static boolean LEGACY_DATABASE_SUPPORT = true;
|
||||
@Comment("Whether or not PlotSquared should return Unknown if it fails to fulfill a request")
|
||||
public static boolean UNKNOWN_AS_DEFAULT = true;
|
||||
}
|
||||
|
||||
|
||||
|
@ -324,7 +324,14 @@ public class UUIDPipeline {
|
||||
PlotSquared.log("Failed to find all usernames");
|
||||
}
|
||||
|
||||
throw new ServiceError("End of pipeline");
|
||||
if (Settings.UUID.UNKNOWN_AS_DEFAULT) {
|
||||
for (final UUID uuid : remainingRequests) {
|
||||
mappings.add(new UUIDMapping(uuid, Captions.UNKNOWN.getTranslated()));
|
||||
}
|
||||
return mappings;
|
||||
} else {
|
||||
throw new ServiceError("End of pipeline");
|
||||
}
|
||||
}, this.executor);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user