Archiviert
1
0

Add Softreload cancel

Dieser Commit ist enthalten in:
Chaoscaot 2023-04-06 17:11:17 +02:00
Ursprung 81dbcc691a
Commit edb108b7b3
2 geänderte Dateien mit 8 neuen und 2 gelöschten Zeilen

Datei anzeigen

@ -67,19 +67,23 @@ public class SchematicSearch {
public static void abortAll() {
synchronized (searchQueue) {
searchQueue.stream().map(schematicSearch -> schematicSearch.player).collect(Collectors.toSet()).forEach(player -> {
Message.send("SCHEMATIC_SEARCH_REMOVED_FROM_QUEUE_SOFTRELOAD", player);
});
searchQueue.clear();
}
if(currentSearch != null) {
Message.send("SCHEMATIC_SEARCH_CANCELED_SOFTRELOAD", currentSearch.player);
currentSearch.end();
}
}
private static List<String> constructArguments(SteamwarUser user, File pattern) {
return Arrays.asList(searchBinary, "-T", "1", "-s", "-u", String.valueOf(user.getId()), "-o", "json:std", "-m", "50", pattern.getAbsolutePath());
return Arrays.asList(searchBinary, "-T", "2", "-s", "-u", String.valueOf(user.getId()), "-o", "json:std", "-m", "50", pattern.getAbsolutePath());
}
public static boolean removeFromQueue(ProxiedPlayer player) {
boolean removed = false;
boolean removed;
synchronized (searchQueue) {
removed = searchQueue.removeIf(search -> search.player.equals(player));
}

Datei anzeigen

@ -690,4 +690,6 @@ SCHEMATIC_SEARCH_RESULT=§7{0}: §e{1}§7% §8(§e{2}§7,§e{3},§e{4}§8)
SCHEMATIC_SEARCH_RESULT_HOVER=§7Click to get more info about {0}.
SCHEMATIC_SEARCH_NOT_SUPPORTED=§cThis schematic is not supported by the schematic search.
SCHEMATIC_SEARCH_REMOVED_FROM_QUEUE=§cYour search has been removed from the queue because you switched servers.
SCHEMATIC_SEARCH_REMOVED_FROM_QUEUE_SOFTRELOAD=§cYour search has been removed from the queue because of an update.
SCHEMATIC_SEARCH_CANCELED_SOFTRELOAD=§cYour search has been canceled because of an update.
SCHEMATIC_SEARCH_TOO_MANY_RESULTS=§cToo many results found. Please be more specific.