Files
hanfuit 645b64fe21 DNF90 服务端与启动器完整源码(含 GM 工具功能增强)
服务端(Go):
- GM 塞背包/带属性装备发放:在线角色推送 op14 增量物品行,背包实时刷新,无需回角色选择界面
- GM 改金币/改等级:去掉在线拒绝,落库后推送 op14 钱包/op37 等级状态,在线实时刷新
- 等级端点统一切换到新版 GMSetCharacterLevel(自带在线刷新)
- 无限/锁死疲劳模式 + 燃烧疲劳:每房间消耗 2 点、打怪与通关经验双倍
- 燃烧疲劳开关时给所有在线角色推送系统提示(op12 mode 0)
- 深渊史诗掉率:GM 全局倍率 + 城镇增益药剂窗口倍率,真实接入掉落结算

启动器(Python/JS):
- 标题栏自绘、窗口 1204x717、禁止拖拽改大小、仅最小化/关闭
- GM 工具:疲劳与燃烧、深渊史诗掉率、拍卖行上架(单一定价对齐)
- 拍卖行上架前端对齐服务端单一价格语义,修复 400 报错
2026-11-04 14:31:55 +08:00

134 lines
4.0 KiB
Go

// upgradevouchercensus 只读:统计声明 [upgrade inventory]/[upgrade cargo]/[upgrade account cargo]
// 的可叠加道具,打印 id、名称、[stackable type]、[stack limit]、[action usable place]。
//
// 现场 2026-10-03(服主报):490701690/490701691/490701692 三件扩容券"使用后没效果"。
// 要判断服务端该按什么条件认这些道具(不能只按那三个 id 硬编码),先看全库这一族长什么样。
//
// 只读。跑法:
//
// go run ./cmd/scratch/upgradevouchercensus -pvf "...\Script.pvf"
package main
import (
"context"
"flag"
"fmt"
"os"
"sort"
"strings"
dnfpvf "longheng.io/server/internal/modules/dnf/pvf"
platformpvf "longheng.io/server/internal/platform/pvf"
)
func main() {
pvfPath := flag.String("pvf", "", "Script.pvf (required)")
flag.Parse()
if *pvfPath == "" {
fmt.Fprintln(os.Stderr, "FAILED: -pvf is required")
os.Exit(2)
}
archive, err := platformpvf.Open(*pvfPath)
if err != nil {
fmt.Fprintln(os.Stderr, "FAILED: open pvf:", err)
os.Exit(1)
}
index, err := dnfpvf.Build(context.Background(), archive, dnfpvf.BuildOptions{
Lists: []string{"stackable/stackable.lst"},
Prefixes: []string{"stackable/"},
})
if err != nil {
fmt.Fprintln(os.Stderr, "FAILED: build index:", err)
os.Exit(1)
}
listEntries := index.List("stackable/stackable.lst")
if len(listEntries) == 0 {
fmt.Fprintln(os.Stderr, "FAILED: stackable.lst is empty")
os.Exit(1)
}
type row struct {
id int64
path string
name string
kind string
limit int64
places string
actions []string
rarity string
explain string
fileKind string
}
rows := make([]row, 0, 64)
counts := map[string]int{}
for _, entry := range listEntries {
text, readErr := archive.ReadText(entry.Path)
if readErr != nil {
continue
}
doc, parseErr := dnfpvf.Parse(entry.Path, text)
if parseErr != nil {
continue
}
actions := make([]string, 0, 2)
for _, value := range doc.Texts("action type") {
cleaned := strings.ToLower(strings.TrimSpace(strings.Trim(value, "`")))
for _, target := range []string{"upgrade inventory", "upgrade cargo", "upgrade account cargo"} {
if cleaned == "["+target+"]" {
actions = append(actions, target)
}
}
}
if len(actions) == 0 {
continue
}
for _, action := range actions {
counts[action]++
}
name, _ := doc.Text("name")
kind, _ := doc.Text("stackable type")
places, _ := doc.Text("action usable place")
explain, _ := doc.Text("explain")
rarity, _ := doc.Text("rarity")
limit := int64(0)
if values := doc.Ints("stack limit"); len(values) > 0 {
limit = values[0]
}
rows = append(rows, row{
id: entry.ID, path: entry.Path,
name: strings.TrimSpace(strings.Trim(name, "`")), kind: strings.TrimSpace(kind),
limit: limit, places: strings.Join(strings.Fields(places), " "),
actions: actions, rarity: strings.TrimSpace(rarity),
explain: strings.TrimSpace(strings.Trim(explain, "`")),
})
}
sort.Slice(rows, func(i, j int) bool { return rows[i].id < rows[j].id })
fmt.Printf("声明这三种 action type 的可叠加道具:%d 件\n", len(rows))
for _, action := range []string{"upgrade inventory", "upgrade cargo", "upgrade account cargo"} {
fmt.Printf(" [%s] : %d\n", action, counts[action])
}
kinds := map[string]int{}
for _, item := range rows {
kinds[item.kind]++
}
kindNames := make([]string, 0, len(kinds))
for name := range kinds {
kindNames = append(kindNames, name)
}
sort.Strings(kindNames)
fmt.Printf("\n按 [stackable type] 分布:\n")
for _, name := range kindNames {
fmt.Printf(" %-24s %d\n", name, kinds[name])
}
fmt.Printf("\n明细:\n")
for _, item := range rows {
fmt.Printf(" %-11d %-28s type=%-10s limit=%-4d actions=%v\n", item.id, item.name, item.kind, item.limit, item.actions)
if item.places != "" {
fmt.Printf(" usable=%s\n", item.places)
}
if item.explain != "" && len(item.explain) < 160 {
fmt.Printf(" explain=%s\n", item.explain)
}
}
}