mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2024-12-28 20:17:55 +01:00
Include note in verbose command-exec-as response if there were no matches (#2734)
This commit is contained in:
parent
7bc422c83f
commit
e6a5cb06af
@ -99,9 +99,13 @@ public class VerboseCommand extends SingleCommand {
|
|||||||
|
|
||||||
verboseHandler.registerListener(sender, VerboseFilter.acceptAll(), true);
|
verboseHandler.registerListener(sender, VerboseFilter.acceptAll(), true);
|
||||||
executor.performCommand(command);
|
executor.performCommand(command);
|
||||||
verboseHandler.unregisterListener(sender);
|
|
||||||
|
|
||||||
Message.VERBOSE_OFF_COMMAND.send(sender);
|
VerboseListener listener = verboseHandler.unregisterListener(sender);
|
||||||
|
if (listener.getMatchedCount() == 0) {
|
||||||
|
Message.VERBOSE_OFF_COMMAND_NO_CHECKS.send(sender);
|
||||||
|
} else {
|
||||||
|
Message.VERBOSE_OFF_COMMAND.send(sender);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return CommandResult.SUCCESS;
|
return CommandResult.SUCCESS;
|
||||||
|
@ -586,6 +586,21 @@ public interface Message {
|
|||||||
.append(FULL_STOP)
|
.append(FULL_STOP)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Args0 VERBOSE_OFF_COMMAND_NO_CHECKS = () -> join(newline(),
|
||||||
|
// &bThe command execution completed, but no permission checks were made.
|
||||||
|
// &7This might be because the plugin runs commands in the background (async). You can still use verbose manually to detect checks made like this.
|
||||||
|
prefixed(translatable()
|
||||||
|
.key("luckperms.command.verbose.command.no-checks")
|
||||||
|
.color(AQUA)
|
||||||
|
.append(FULL_STOP)),
|
||||||
|
prefixed(text()
|
||||||
|
.color(GRAY)
|
||||||
|
.append(translatable("luckperms.command.verbose.command.possibly-async"))
|
||||||
|
.append(FULL_STOP)
|
||||||
|
.append(translatable("luckperms.command.verbose.command.try-again-manually"))
|
||||||
|
.append(FULL_STOP))
|
||||||
|
);
|
||||||
|
|
||||||
Args0 VERBOSE_RECORDING_ON = () -> prefixed(translatable()
|
Args0 VERBOSE_RECORDING_ON = () -> prefixed(translatable()
|
||||||
// "&bVerbose recording &aenabled &bfor checks matching &aANY&b."
|
// "&bVerbose recording &aenabled &bfor checks matching &aANY&b."
|
||||||
.key("luckperms.command.verbose.enabled-recording")
|
.key("luckperms.command.verbose.enabled-recording")
|
||||||
|
@ -47,7 +47,6 @@ import net.kyori.adventure.text.ComponentLike;
|
|||||||
import net.kyori.adventure.text.event.HoverEvent;
|
import net.kyori.adventure.text.event.HoverEvent;
|
||||||
import net.kyori.adventure.text.format.NamedTextColor;
|
import net.kyori.adventure.text.format.NamedTextColor;
|
||||||
import net.luckperms.api.query.QueryMode;
|
import net.luckperms.api.query.QueryMode;
|
||||||
import net.luckperms.api.util.Tristate;
|
|
||||||
|
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@ -323,18 +322,11 @@ public class VerboseListener {
|
|||||||
return bytebin.postContent(bytesOut.toByteArray(), AbstractHttpClient.JSON_TYPE, false).key();
|
return bytebin.postContent(bytesOut.toByteArray(), AbstractHttpClient.JSON_TYPE, false).key();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String getTristateColor(Tristate tristate) {
|
|
||||||
switch (tristate) {
|
|
||||||
case TRUE:
|
|
||||||
return "&2";
|
|
||||||
case FALSE:
|
|
||||||
return "&c";
|
|
||||||
default:
|
|
||||||
return "&7";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public Sender getNotifiedSender() {
|
public Sender getNotifiedSender() {
|
||||||
return this.notifiedSender;
|
return this.notifiedSender;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getMatchedCount() {
|
||||||
|
return this.matchedCounter.get();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -107,6 +107,9 @@ luckperms.command.verbose.enabled=Verbose logging {0} for checks matching {1}
|
|||||||
luckperms.command.verbose.command-exec=Forcing {0} to execute command {1} and reporting all checks made...
|
luckperms.command.verbose.command-exec=Forcing {0} to execute command {1} and reporting all checks made...
|
||||||
luckperms.command.verbose.off=Verbose logging {0}
|
luckperms.command.verbose.off=Verbose logging {0}
|
||||||
luckperms.command.verbose.command-exec-complete=Command execution complete
|
luckperms.command.verbose.command-exec-complete=Command execution complete
|
||||||
|
luckperms.command.verbose.command.no-checks=The command execution completed, but no permission checks were made
|
||||||
|
luckperms.command.verbose.command.possibly-async=This might be because the plugin runs commands in the background (async)
|
||||||
|
luckperms.command.verbose.command.try-again-manually=You can still use verbose manually to detect checks made like this
|
||||||
luckperms.command.verbose.enabled-recording=Verbose recording {0} for checks matching {1}
|
luckperms.command.verbose.enabled-recording=Verbose recording {0} for checks matching {1}
|
||||||
luckperms.command.verbose.uploading=Verbose logging {0}, uploading results...
|
luckperms.command.verbose.uploading=Verbose logging {0}, uploading results...
|
||||||
luckperms.command.verbose.url=Verbose results URL
|
luckperms.command.verbose.url=Verbose results URL
|
||||||
|
Loading…
Reference in New Issue
Block a user