DNF90 服务端与启动器完整源码(含 GM 工具功能增强)
服务端(Go): - GM 塞背包/带属性装备发放:在线角色推送 op14 增量物品行,背包实时刷新,无需回角色选择界面 - GM 改金币/改等级:去掉在线拒绝,落库后推送 op14 钱包/op37 等级状态,在线实时刷新 - 等级端点统一切换到新版 GMSetCharacterLevel(自带在线刷新) - 无限/锁死疲劳模式 + 燃烧疲劳:每房间消耗 2 点、打怪与通关经验双倍 - 燃烧疲劳开关时给所有在线角色推送系统提示(op12 mode 0) - 深渊史诗掉率:GM 全局倍率 + 城镇增益药剂窗口倍率,真实接入掉落结算 启动器(Python/JS): - 标题栏自绘、窗口 1204x717、禁止拖拽改大小、仅最小化/关闭 - GM 工具:疲劳与燃烧、深渊史诗掉率、拍卖行上架(单一定价对齐) - 拍卖行上架前端对齐服务端单一价格语义,修复 400 报错
This commit is contained in:
commit
645b64fe21
4388 files changed
+1405457
No files matched your search
@@ -0,0 +1,70 @@
|
||||
// monsterinfo 按怪物代码反查 PVF 定义(名称/等级/rank/路径),用于把刷图日志里的
|
||||
// monster_id 还原成怪物名,例如判定「房间 1:0 里掉 3330 的 420 到底是不是蜘蛛怪」。
|
||||
//
|
||||
// go run ./cmd/scratch/monsterinfo -pvf <Script.pvf> -ids 420,400,600
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"flag"
|
||||
"fmt"
|
||||
"os"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"longheng.io/server/internal/modules/dnf/monster"
|
||||
dnfpvf "longheng.io/server/internal/modules/dnf/pvf"
|
||||
platformpvf "longheng.io/server/internal/platform/pvf"
|
||||
)
|
||||
|
||||
func main() {
|
||||
pvfPath := flag.String("pvf", "", "Script.pvf 路径")
|
||||
ids := flag.String("ids", "", "逗号分隔的怪物 ID")
|
||||
listPath := flag.String("list", monster.DefaultList, "怪物表路径")
|
||||
flag.Parse()
|
||||
if *pvfPath == "" || *ids == "" {
|
||||
fmt.Fprintln(os.Stderr, "-pvf and -ids are required")
|
||||
os.Exit(2)
|
||||
}
|
||||
want := make([]int64, 0, 8)
|
||||
for _, field := range strings.Split(*ids, ",") {
|
||||
field = strings.TrimSpace(field)
|
||||
if field == "" {
|
||||
continue
|
||||
}
|
||||
value, err := strconv.ParseInt(field, 10, 64)
|
||||
if err != nil {
|
||||
fmt.Fprintln(os.Stderr, "bad id:", field)
|
||||
os.Exit(2)
|
||||
}
|
||||
want = append(want, value)
|
||||
}
|
||||
|
||||
archive, err := platformpvf.Open(*pvfPath)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
index, err := dnfpvf.Build(context.Background(), archive, dnfpvf.BuildOptions{Lists: []string{*listPath}, Paths: []string{*listPath}})
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
table, err := monster.Load(context.Background(), index, monster.Options{ListPath: *listPath})
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
rows := make([]monster.Monster, 0, len(want))
|
||||
for _, id := range want {
|
||||
entry, found := table.Find(id)
|
||||
if !found {
|
||||
rows = append(rows, monster.Monster{ID: id, Name: "(未在怪物表中找到)"})
|
||||
continue
|
||||
}
|
||||
rows = append(rows, entry)
|
||||
}
|
||||
encoder := json.NewEncoder(os.Stdout)
|
||||
encoder.SetIndent("", " ")
|
||||
if err := encoder.Encode(rows); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user