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

123 lines
3.4 KiB
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// pvfdigestscene900 把 etc/storydigest/digest.etc 每个段的 [scene] 列表
// 改为只含 **900**(blackBoardScene.ani 占位动画,零时长、真实存在的内容段)。
//
// 目标:不播放"剧情回顾",但**保持播放序列结构完整**,让后面的 [ending] 章节
// 过场影片照常播放。
//
// 为什么不用别的做法(实测结论):
// - [scene] 指向"回顾段"(N) → 回顾会播;
// - 清空回顾段内容、[scene] 仍指 N → 序列中断,过场也不播;
// - [scene] 指向"影片段"(900+N) → 序列异常,画面不出(started=1 但无画面);
// - [scene] 指向 900(零时长占位) → 占位一步几乎无感,随后播 [ending] 过场。
//
// 只改 [scene] 列表的整数;段号、[level]、[ending] 全部不动。
package main
import (
"encoding/binary"
"flag"
"fmt"
"os"
"path/filepath"
platformpvf "longheng.io/server/internal/platform/pvf"
)
const (
refScene = uint32(0x025138C6) // "[scene]"
refEnding = uint32(0x025138D6) // "[ending]"
refLevel = uint32(0x003566E2) // "[level]"
)
func u32(b []byte) uint32 { return binary.LittleEndian.Uint32(b) }
func tok5(typ byte, ref uint32) []byte {
b := make([]byte, 5)
b[0] = typ
binary.LittleEndian.PutUint32(b[1:], ref)
return b
}
func main() {
input := flag.String("pvf", "", "input PVF")
dir := flag.String("dir", "", "raw patch dir")
dry := flag.Bool("dry-run", false, "只检查")
sceneNum := flag.Uint("scene", 900, "填给 [scene] 的段号")
flag.Parse()
archive, err := platformpvf.Open(*input)
if err != nil {
panic(err)
}
raw, err := archive.ReadRaw("etc/storydigest/digest.etc")
if err != nil {
panic(err)
}
toks := len(raw) / 5
isSec := func(i int, ref uint32) bool {
return i < toks && raw[i*5] == 3 && u32(raw[i*5+1:i*5+5]) == ref
}
segIndex := 0
var out []byte
i := 0
for i < toks {
if isSec(i, refLevel) {
segIndex++
out = append(out, raw[i*5:(i+2)*5+5]...)
i += 3
continue
}
if isSec(i, refScene) {
out = append(out, raw[i*5:i*5+5]...)
i++
for i < toks && raw[i*5] == 0 {
i++
}
out = append(out, tok5(0, uint32(*sceneNum))...)
continue
}
out = append(out, raw[i*5:i*5+5]...)
i++
}
fmt.Printf("处理 %d 个段,[scene] 全部设为 %d,新大小 %d 字节\n", segIndex, *sceneNum, len(out))
// 校验 ending 不变
origEnd, newEnd := []uint32{}, []uint32{}
for k := 0; k+1 < toks; k++ {
if isSec(k, refEnding) {
origEnd = append(origEnd, u32(raw[(k+1)*5+1:(k+1)*5+5]))
}
}
nt := len(out) / 5
for k := 0; k+1 < nt; k++ {
if out[k*5] == 3 && u32(out[k*5+1:k*5+5]) == refEnding {
newEnd = append(newEnd, u32(out[(k+1)*5+1:(k+1)*5+5]))
}
}
if len(origEnd) != len(newEnd) {
panic("ending 数量不一致")
}
for k := range origEnd {
if origEnd[k] != newEnd[k] {
panic(fmt.Sprintf("第 %d 个 ending 变了", k+1))
}
}
fmt.Println("[ending] 全部保持原值 ✅")
for k := range newEnd {
if k < 14 {
fmt.Printf(" 段%-3d [scene] %d [ending] %d\n", k+1, *sceneNum, newEnd[k])
}
}
if *dry {
fmt.Println("dry-run,未写文件")
return
}
full := filepath.Join(*dir, "etc", "storydigest", "digest.etc")
if err := os.MkdirAll(filepath.Dir(full), 0o755); err != nil {
panic(err)
}
if err := os.WriteFile(full, out, 0o644); err != nil {
panic(err)
}
fmt.Println("已写出", full, len(out), "字节")
}