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,77 @@
|
||||
// pvfdump 打印 Script.pvf 里指定文件的内容(可截断、可按子串过滤行)。
|
||||
// 用来核对 NPC 列表、城镇刷怪配置等 PVF 文本,而不是靠猜。
|
||||
//
|
||||
// go run ./cmd/scratch/pvfdump -pvf <path> -file npc/npc.lst -grep boken
|
||||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
platformpvf "longheng.io/server/internal/platform/pvf"
|
||||
)
|
||||
|
||||
func main() {
|
||||
pvfPath := flag.String("pvf", `../runtime/data/dnf/Script.pvf`, "Script.pvf path")
|
||||
file := flag.String("file", "", "归档内路径")
|
||||
grep := flag.String("grep", "", "只打印包含该子串的行(大小写不敏感)")
|
||||
head := flag.Int("head", 60, "最多打印多少行(0=全部)")
|
||||
tail := flag.Int("tail", 0, "只打印最后 N 行")
|
||||
flag.Parse()
|
||||
|
||||
if strings.TrimSpace(*file) == "" {
|
||||
fmt.Fprintln(os.Stderr, "usage: pvfdump -file <archive path> [-grep s] [-head n]")
|
||||
os.Exit(2)
|
||||
}
|
||||
|
||||
archive, err := platformpvf.Open(*pvfPath)
|
||||
if err != nil {
|
||||
fmt.Fprintln(os.Stderr, "open:", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
text, err := archive.ReadText(*file)
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "read %s: %v\n", *file, err)
|
||||
os.Exit(1)
|
||||
}
|
||||
lines := strings.Split(strings.ReplaceAll(text, "\r\n", "\n"), "\n")
|
||||
fmt.Printf("file=%s lines=%d\n", *file, len(lines))
|
||||
|
||||
needle := strings.ToLower(strings.TrimSpace(*grep))
|
||||
hit := 0
|
||||
printed := 0
|
||||
for _, line := range lines {
|
||||
if needle != "" && !strings.Contains(strings.ToLower(line), needle) {
|
||||
continue
|
||||
}
|
||||
hit++
|
||||
}
|
||||
if needle != "" {
|
||||
fmt.Printf("grep=%q hits=%d\n", needle, hit)
|
||||
}
|
||||
|
||||
start := 0
|
||||
end := len(lines)
|
||||
if needle == "" {
|
||||
if *tail > 0 && *tail < len(lines) {
|
||||
start = len(lines) - *tail
|
||||
}
|
||||
if *head > 0 && end-start > *head {
|
||||
end = start + *head
|
||||
}
|
||||
}
|
||||
for i := start; i < end; i++ {
|
||||
line := lines[i]
|
||||
if needle != "" && !strings.Contains(strings.ToLower(line), needle) {
|
||||
continue
|
||||
}
|
||||
fmt.Printf("%6d| %s\n", i+1, line)
|
||||
printed++
|
||||
if *head > 0 && needle != "" && printed >= *head {
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user