mirror of
https://github.com/Melledy/Grasscutter.git
synced 2024-11-22 07:37:43 +00:00
Logging changes (move levels down & add toString
for some objects)
This commit is contained in:
parent
aad4529b0e
commit
67c0e82dfb
@ -1,15 +1,14 @@
|
||||
package emu.grasscutter.game;
|
||||
|
||||
import static emu.grasscutter.config.Configuration.ACCOUNT;
|
||||
import static emu.grasscutter.config.Configuration.LANGUAGE;
|
||||
|
||||
import dev.morphia.annotations.*;
|
||||
import emu.grasscutter.database.DatabaseHelper;
|
||||
import emu.grasscutter.utils.Crypto;
|
||||
import emu.grasscutter.utils.Utils;
|
||||
import emu.grasscutter.utils.*;
|
||||
import org.bson.Document;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Stream;
|
||||
import org.bson.Document;
|
||||
|
||||
import static emu.grasscutter.config.Configuration.*;
|
||||
|
||||
@Entity(value = "accounts", useDiscriminator = false)
|
||||
public class Account {
|
||||
@ -242,4 +241,10 @@ public class Account {
|
||||
this.locale = LANGUAGE;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Account ID: %s; Username: %s"
|
||||
.formatted(this.id, this.username);
|
||||
}
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ public final class ActionSetGlobalValueToOverrideMap extends AbilityActionHandle
|
||||
var abilityFormula = action.abilityFormula;
|
||||
|
||||
if (!entity.getGlobalAbilityValues().containsKey(globalValueKey)) {
|
||||
Grasscutter.getLogger().debug("Action does not contains {} global key", globalValueKey);
|
||||
Grasscutter.getLogger().trace("Action does not contains {} global key", globalValueKey);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -1545,6 +1545,12 @@ public class Player implements PlayerHook, FieldFetch {
|
||||
this.id == otherPlayer.getUid();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Player UID: %s; Nickname: %s; Account: %s"
|
||||
.formatted(this.id, this.nickname, this.account);
|
||||
}
|
||||
|
||||
public enum SceneLoadState {
|
||||
NONE(0), LOADING(1), INIT(2), LOADED(3);
|
||||
|
||||
|
@ -1,5 +1,8 @@
|
||||
package emu.grasscutter.scripts.data;
|
||||
|
||||
import lombok.ToString;
|
||||
|
||||
@ToString
|
||||
public class ScriptArgs {
|
||||
public int param1;
|
||||
public int param2;
|
||||
|
@ -4,10 +4,16 @@ import emu.grasscutter.*;
|
||||
import emu.grasscutter.game.entity.GameEntity;
|
||||
import emu.grasscutter.game.props.ElementType;
|
||||
import emu.grasscutter.scripts.*;
|
||||
import javax.script.*;
|
||||
import org.luaj.vm2.*;
|
||||
|
||||
import javax.script.*;
|
||||
import java.util.Set;
|
||||
|
||||
public class EntityController {
|
||||
private static final Set<String> SERVER_CALLED = Set.of(
|
||||
"OnBeHurt", "OnDie", "OnTimer"
|
||||
);
|
||||
|
||||
private transient CompiledScript entityController;
|
||||
private transient Bindings entityControllerBindings;
|
||||
|
||||
@ -92,7 +98,7 @@ public class EntityController {
|
||||
error);
|
||||
ret = LuaValue.valueOf(-1);
|
||||
}
|
||||
} else if (funcName != null && !funcName.equals("OnTimer")) {
|
||||
} else if (funcName != null && !SERVER_CALLED.contains(funcName)) {
|
||||
ScriptLib.logger.error(
|
||||
"[LUA] unknown func in gadget {} with {} {} {} {}",
|
||||
entity.getEntityTypeId(),
|
||||
|
Loading…
Reference in New Issue
Block a user