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

111 lines
3.0 KiB
Go

// pvfimgrefs audits IMG paths and the largest frame number referenced by one
// or more runtime-PVF UI path prefixes.
package main
import (
"flag"
"fmt"
"regexp"
"sort"
"strconv"
"strings"
platformpvf "longheng.io/server/internal/platform/pvf"
)
var (
aniImage = regexp.MustCompile(`(?is)\[IMAGE\]\s+` + "`" + `([^` + "`" + `]+\.img)` + "`" + `\s+(-?\d+)`)
imgPath = regexp.MustCompile(`(?i)[A-Za-z0-9_./\\-]+\.img`)
imgIndex = regexp.MustCompile(`(?i)(?:Img|Index)="NUM:(\d+)"`)
)
type reference struct {
Path string
MaxFrame int
Documents map[string]struct{}
}
func main() {
pvfPath := flag.String("pvf", `D:/DNF/runtime/data/dnf/Script.pvf`, "Script.pvf path")
prefixes := flag.String("prefix", "ui/raid/luke/,ui/raidwindow/,worldmap/ui/luke_raid.xui", "comma-separated archive prefixes or exact paths")
flag.Parse()
archive, err := platformpvf.Open(*pvfPath)
if err != nil {
panic(err)
}
wanted := make([]string, 0)
for _, prefix := range strings.Split(*prefixes, ",") {
if prefix = normalize(prefix); prefix != "" {
wanted = append(wanted, prefix)
}
}
references := make(map[string]*reference)
for _, file := range archive.Files() {
archivePath := normalize(file.ArchivePath)
matched := false
for _, prefix := range wanted {
if strings.HasSuffix(prefix, "/") && strings.HasPrefix(archivePath, prefix) || archivePath == prefix {
matched = true
break
}
}
if !matched {
continue
}
text, err := archive.ReadText(file.ArchivePath)
if err != nil {
continue
}
for _, match := range aniImage.FindAllStringSubmatch(text, -1) {
frame, _ := strconv.Atoi(match[2])
addReference(references, match[1], frame, archivePath)
}
for _, line := range strings.Split(text, "\n") {
paths := imgPath.FindAllString(line, -1)
if len(paths) == 0 {
continue
}
indices := imgIndex.FindAllStringSubmatch(line, -1)
for _, imagePath := range paths {
if len(indices) == 0 {
addReference(references, imagePath, 0, archivePath)
continue
}
for _, index := range indices {
frame, _ := strconv.Atoi(index[1])
addReference(references, imagePath, frame, archivePath)
}
}
}
}
paths := make([]string, 0, len(references))
for imagePath := range references {
paths = append(paths, imagePath)
}
sort.Strings(paths)
for _, imagePath := range paths {
row := references[imagePath]
fmt.Printf("img=%s max_frame=%d documents=%d\n", row.Path, row.MaxFrame, len(row.Documents))
}
}
func addReference(references map[string]*reference, imagePath string, frame int, document string) {
imagePath = normalize(strings.Trim(imagePath, "`\"'"))
if imagePath == "" {
return
}
row := references[imagePath]
if row == nil {
row = &reference{Path: imagePath, MaxFrame: frame, Documents: make(map[string]struct{})}
references[imagePath] = row
}
if frame > row.MaxFrame {
row.MaxFrame = frame
}
row.Documents[document] = struct{}{}
}
func normalize(value string) string {
return strings.ToLower(strings.TrimPrefix(strings.ReplaceAll(strings.TrimSpace(value), "\\", "/"), "/"))
}