This commit is contained in:
@@ -28,7 +28,7 @@ type PetBaseConfig struct {
|
||||
Nature int32 `gorm:"not null;default:0;comment:'BOSS属性-性格'" json:"nature"`
|
||||
Effect []uint32 `gorm:"type:jsonb;not null;default:'[]';comment:'BOSS特性'" json:"effect"`
|
||||
Lv int32 `gorm:"not null;comment:'BOSS等级(LvHpMatchUser非0时此配置无效)'" json:"lv"`
|
||||
Color string `gorm:"comment:'BOSS颜色'" json:"color"`
|
||||
ColorID uint32 `gorm:"not null;default:0;comment:'BOSS颜色配置ID'" json:"color_id"`
|
||||
Skin int32 `gorm:"not null;default:0;comment:'BOSS皮肤ID'" json:"skin"`
|
||||
Hp int32 `gorm:"comment:'BOSS血量值(LvHpMatchUser非0时此配置无效)'" json:"hp"`
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package model
|
||||
|
||||
import (
|
||||
"blazing/cool"
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"strings"
|
||||
@@ -161,8 +162,9 @@ func bindBossScriptFunctions(vm *goja.Runtime, hookAction any) {
|
||||
})
|
||||
|
||||
_ = vm.Set("debug", func(call goja.FunctionCall) goja.Value {
|
||||
logCtx := context.Background()
|
||||
if len(call.Arguments) == 0 {
|
||||
g.Log().Debugf(ctx, "[boss-script] debug() called with no arguments")
|
||||
g.Log().Debugf(logCtx, "[boss-script] debug() called with no arguments")
|
||||
return goja.Undefined()
|
||||
}
|
||||
|
||||
@@ -176,7 +178,7 @@ func bindBossScriptFunctions(vm *goja.Runtime, hookAction any) {
|
||||
parts = append(parts, arg.String())
|
||||
}
|
||||
|
||||
g.Log().Debugf(ctx, "[boss-script] %s", strings.Join(parts, " "))
|
||||
g.Log().Debugf(logCtx, "[boss-script] %s", strings.Join(parts, " "))
|
||||
return goja.Undefined()
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user