From 1269a0430e1d7cc1b774c195f2f23fdd027e5033 Mon Sep 17 00:00:00 2001 From: KingRainbow44 Date: Wed, 31 May 2023 18:18:06 -0400 Subject: [PATCH] Move more logs to `trace` --- .../auth/DefaultAuthenticators.java | 9 ++++---- .../game/ability/AbilityManager.java | 23 +++++++++---------- .../emu/grasscutter/scripts/ScriptLib.java | 6 ++--- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/main/java/emu/grasscutter/auth/DefaultAuthenticators.java b/src/main/java/emu/grasscutter/auth/DefaultAuthenticators.java index 1df155f4b..c53854471 100644 --- a/src/main/java/emu/grasscutter/auth/DefaultAuthenticators.java +++ b/src/main/java/emu/grasscutter/auth/DefaultAuthenticators.java @@ -1,8 +1,5 @@ package emu.grasscutter.auth; -import static emu.grasscutter.config.Configuration.ACCOUNT; -import static emu.grasscutter.utils.lang.Language.translate; - import at.favre.lib.crypto.bcrypt.BCrypt; import emu.grasscutter.Grasscutter; import emu.grasscutter.Grasscutter.ServerRunMode; @@ -17,13 +14,17 @@ import emu.grasscutter.utils.DispatchUtils; import emu.grasscutter.utils.FileUtils; import emu.grasscutter.utils.Utils; import io.javalin.http.ContentType; + +import javax.crypto.Cipher; import java.nio.charset.StandardCharsets; import java.security.KeyFactory; import java.security.interfaces.RSAPrivateKey; import java.security.spec.PKCS8EncodedKeySpec; import java.util.concurrent.CompletableFuture; import java.util.concurrent.TimeUnit; -import javax.crypto.Cipher; + +import static emu.grasscutter.config.Configuration.ACCOUNT; +import static emu.grasscutter.utils.lang.Language.translate; /** A class containing default authenticators. */ public final class DefaultAuthenticators { diff --git a/src/main/java/emu/grasscutter/game/ability/AbilityManager.java b/src/main/java/emu/grasscutter/game/ability/AbilityManager.java index 9e23788f3..a63e405b2 100644 --- a/src/main/java/emu/grasscutter/game/ability/AbilityManager.java +++ b/src/main/java/emu/grasscutter/game/ability/AbilityManager.java @@ -23,13 +23,14 @@ import emu.grasscutter.net.proto.AbilityScalarTypeOuterClass.AbilityScalarType; import emu.grasscutter.net.proto.AbilityScalarValueEntryOuterClass.AbilityScalarValueEntry; import emu.grasscutter.net.proto.ModifierActionOuterClass.ModifierAction; import io.netty.util.concurrent.FastThreadLocalThread; +import lombok.Getter; +import org.reflections.Reflections; + import java.util.HashMap; import java.util.concurrent.ExecutorService; import java.util.concurrent.LinkedBlockingDeque; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; -import lombok.Getter; -import org.reflections.Reflections; public final class AbilityManager extends BasePlayerManager { @@ -96,8 +97,7 @@ public final class AbilityManager extends BasePlayerManager { public void executeAction( Ability ability, AbilityModifierAction action, ByteString abilityData, GameEntity target) { - AbilityActionHandler handler = actionHandlers.get(action.type); - + var handler = actionHandlers.get(action.type); if (handler == null || ability == null) { Grasscutter.getLogger() .debug("Could not execute ability action {} at {}", action.type, ability); @@ -108,17 +108,16 @@ public final class AbilityManager extends BasePlayerManager { () -> { if (!handler.execute(ability, action, abilityData, target)) { Grasscutter.getLogger() - .debug("Execute ability action failed {} at {}", action.type, ability); + .debug("Ability execute action failed for {} at {}.", action.type, ability); } }); } public void executeMixin(Ability ability, AbilityMixinData mixinData, ByteString abilityData) { - AbilityMixinHandler handler = mixinHandlers.get(mixinData.type); - - if (handler == null || ability == null || mixinData == null) { + var handler = mixinHandlers.get(mixinData.type); + if (handler == null || ability == null) { Grasscutter.getLogger() - .error("Could not execute ability mixin {} at {}", mixinData.type, ability); + .trace("Could not execute ability mixin {} at {}", mixinData.type, ability); return; } @@ -126,7 +125,7 @@ public final class AbilityManager extends BasePlayerManager { () -> { if (!handler.execute(ability, mixinData, abilityData)) { Grasscutter.getLogger() - .error("exec ability action failed {} at {}", mixinData.type, ability); + .error("Ability execute action failed for {} at {}.", mixinData.type, ability); } }); } @@ -335,7 +334,7 @@ public final class AbilityManager extends BasePlayerManager { var instancedAbilityIndex = head.getInstancedAbilityId() - 1; if (instancedAbilityIndex >= entity.getInstancedAbilities().size()) { - Grasscutter.getLogger().error("Ability not found {}", head.getInstancedAbilityId()); + Grasscutter.getLogger().trace("Ability not found {}", head.getInstancedAbilityId()); return; } @@ -356,7 +355,7 @@ public final class AbilityManager extends BasePlayerManager { var instancedAbilityIndex = head.getInstancedAbilityId() - 1; if (instancedAbilityIndex >= entity.getInstancedAbilities().size()) { - Grasscutter.getLogger().error("Ability not found {}", head.getInstancedAbilityId()); + Grasscutter.getLogger().trace("Ability not found {}", head.getInstancedAbilityId()); return; } diff --git a/src/main/java/emu/grasscutter/scripts/ScriptLib.java b/src/main/java/emu/grasscutter/scripts/ScriptLib.java index 5860f5da9..cb9db38d0 100644 --- a/src/main/java/emu/grasscutter/scripts/ScriptLib.java +++ b/src/main/java/emu/grasscutter/scripts/ScriptLib.java @@ -459,10 +459,10 @@ public class ScriptLib { private void printLog(String source, String msg){ var currentGroup = this.currentGroup.getIfExists(); - if(currentGroup!=null) { - Grasscutter.getLogger().warn("[LUA] {} {} {}", source, currentGroup.id, msg); + if(currentGroup != null) { + Grasscutter.getLogger().trace("[LUA] {} {} {}", source, currentGroup.id, msg); } else { - Grasscutter.getLogger().warn("[LUA] {} {}", source, msg); + Grasscutter.getLogger().trace("[LUA] {} {}", source, msg); } }