forked from SteamWar/SteamWar
Refactor V2 Auth
This commit is contained in:
@@ -42,6 +42,7 @@ import de.steamwar.velocitycore.network.NetworkSender;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
@@ -53,6 +54,8 @@ public class ChatListener extends BasicListener {
|
||||
|
||||
private static final List<String> rankedModes = ArenaMode.getAllModes().stream().filter(ArenaMode::isRanked).map(ArenaMode::getSchemTypeOrInternalName).toList();
|
||||
|
||||
private static final Set<String> noLogCommands = Set.of("webpw", "webpassword");
|
||||
|
||||
@Subscribe(order = PostOrder.FIRST)
|
||||
public void fixCommands(CommandExecuteEvent e) {
|
||||
String command = e.getCommand();
|
||||
@@ -73,7 +76,8 @@ public class ChatListener extends BasicListener {
|
||||
public void logCommands(CommandExecuteEvent e) {
|
||||
String command = e.getCommand();
|
||||
int space = command.indexOf(' ');
|
||||
if(VelocityCore.getProxy().getCommandManager().hasCommand(space != -1 ? command.substring(0, space) : command)) {
|
||||
String cmd = space != -1 ? command.substring(0, space) : command;
|
||||
if(VelocityCore.getProxy().getCommandManager().hasCommand(cmd)) {
|
||||
CommandSource source = e.getCommandSource();
|
||||
String name;
|
||||
if(source instanceof Player player)
|
||||
@@ -83,6 +87,10 @@ public class ChatListener extends BasicListener {
|
||||
else
|
||||
name = source.toString();
|
||||
|
||||
if (noLogCommands.contains(cmd)) {
|
||||
return;
|
||||
}
|
||||
|
||||
cmdLogger.log(Level.INFO, "%s -> executed command /%s".formatted(name, command));
|
||||
} else if (e.getCommandSource() instanceof Player player) {
|
||||
// System.out.println("spoofChatInput " + e);
|
||||
|
||||
Reference in New Issue
Block a user