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,119 @@
|
||||
// Command chcutscenes 列出「城镇区域开启过场」全表:影片、所需等级、前置任务(含任务名)。
|
||||
//
|
||||
// 数据来源全部是 PVF:
|
||||
// - etc/townmovielist.etc → (城镇, 区域) ↔ 影片标题/文件
|
||||
// - <城镇>.twn 各 area 的 [permission] → NeedLevel + NeedQuests
|
||||
// - n_quest/... → 任务名
|
||||
//
|
||||
// 用法:
|
||||
//
|
||||
// go run ./cmd/scratch/chcutscenes -pvf <Script.pvf>
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"flag"
|
||||
"fmt"
|
||||
"os"
|
||||
"sort"
|
||||
"strings"
|
||||
|
||||
dnfpvf "longheng.io/server/internal/modules/dnf/pvf"
|
||||
dnfquest "longheng.io/server/internal/modules/dnf/quest"
|
||||
dnftown "longheng.io/server/internal/modules/dnf/town"
|
||||
platformpvf "longheng.io/server/internal/platform/pvf"
|
||||
)
|
||||
|
||||
func main() {
|
||||
pvfPath := flag.String("pvf", "", "Script.pvf 路径")
|
||||
flag.Parse()
|
||||
if *pvfPath == "" {
|
||||
fmt.Fprintln(os.Stderr, "需要 -pvf")
|
||||
os.Exit(2)
|
||||
}
|
||||
archive, err := platformpvf.LoadArchive(platformpvf.Options{Path: *pvfPath})
|
||||
if err != nil {
|
||||
fmt.Fprintln(os.Stderr, "打开 PVF 失败:", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
ctx := context.Background()
|
||||
towns, err := dnftown.Load(ctx, archive, dnftown.Options{})
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "加载城镇表失败(继续,等级/任务可能缺失): %v\n", err)
|
||||
}
|
||||
movies, err := dnftown.LoadTownMovieTable(archive, dnftown.DefaultMovieListPath)
|
||||
if err != nil {
|
||||
fmt.Fprintln(os.Stderr, "加载过场表失败:", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
// 任务名:尽力加载,失败就只显示任务号。
|
||||
questNames := map[int64]string{}
|
||||
if index, buildErr := dnfpvf.Build(ctx, archive, dnfpvf.BuildOptions{Lists: []string{dnfquest.DefaultList}}); buildErr == nil {
|
||||
if catalog, loadErr := dnfquest.Load(ctx, index); loadErr == nil {
|
||||
for _, def := range catalog.Definitions() {
|
||||
if strings.TrimSpace(def.Name) != "" {
|
||||
questNames[def.ID] = def.Name
|
||||
}
|
||||
}
|
||||
} else {
|
||||
fmt.Fprintf(os.Stderr, "加载任务表失败(只显示任务号): %v\n", loadErr)
|
||||
}
|
||||
}
|
||||
|
||||
plays := movies.Plays()
|
||||
type row struct {
|
||||
play dnftown.TownMoviePlay
|
||||
area dnftown.Area
|
||||
town dnftown.Town
|
||||
found bool
|
||||
}
|
||||
rows := make([]row, 0, len(plays))
|
||||
for _, play := range plays {
|
||||
area, ok := towns.FindArea(play.TownID, play.AreaID)
|
||||
town, _ := towns.Find(play.TownID)
|
||||
rows = append(rows, row{play: play, area: area, town: town, found: ok})
|
||||
}
|
||||
// 按所需等级升序(缺等级的排最后)
|
||||
sort.SliceStable(rows, func(i, j int) bool {
|
||||
li, lj := rows[i].area.MinLevel, rows[j].area.MinLevel
|
||||
if li == 0 {
|
||||
li = 1 << 30
|
||||
}
|
||||
if lj == 0 {
|
||||
lj = 1 << 30
|
||||
}
|
||||
return li < lj
|
||||
})
|
||||
|
||||
fmt.Printf("城镇区域开启过场:共 %d 条\n\n", len(rows))
|
||||
fmt.Printf("%-4s %-4s %-6s %-14s %-34s %s\n", "Lv", "城镇", "区域", "影片标题", "影片文件", "前置任务")
|
||||
fmt.Println(strings.Repeat("-", 118))
|
||||
for _, r := range rows {
|
||||
level := "-"
|
||||
if r.area.MinLevel > 0 {
|
||||
level = fmt.Sprintf("%d", r.area.MinLevel)
|
||||
}
|
||||
title := r.play.Title
|
||||
if title == "" {
|
||||
title = "(无标题)"
|
||||
}
|
||||
quests := "-"
|
||||
if len(r.area.NeedQuests) > 0 {
|
||||
parts := make([]string, 0, len(r.area.NeedQuests))
|
||||
for _, id := range r.area.NeedQuests {
|
||||
if name, ok := questNames[id]; ok {
|
||||
parts = append(parts, fmt.Sprintf("%d(%s)", id, name))
|
||||
} else {
|
||||
parts = append(parts, fmt.Sprintf("%d", id))
|
||||
}
|
||||
}
|
||||
quests = strings.Join(parts, ", ")
|
||||
}
|
||||
fmt.Printf("%-4s %-4d %-6d %-14s %-34s %s\n",
|
||||
level, r.play.TownID, r.play.AreaID, title, r.play.FilePath, quests)
|
||||
if r.found && r.area.MapPath != "" {
|
||||
fmt.Printf(" └ 城镇「%s」 地图 %s\n", r.town.Name, r.area.MapPath)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user