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,85 @@
|
||||
// pvfcollectboxdate 把 PVF 字符串池里收集箱的 **[base expiration date]** 改成未来日期,
|
||||
// 使服务端 collectbox.SnapshotBonus 不再判定为「已过期」。
|
||||
//
|
||||
// 背景:
|
||||
//
|
||||
// internal/modules/dnf/collectbox/owner.go 的 SnapshotBonus:
|
||||
// expiration := state.Expiration[boxIndex] // Insert 不写它,只有 Extend(延期券) 写
|
||||
// if expiration.IsZero() {
|
||||
// expiration, _ = parseExpiration(definition.BaseExpirationDate) // ← 回退到 base
|
||||
// }
|
||||
// if !expiration.IsZero() && !now.Before(expiration) { return Bonus{} } // 过期 → 不加属性
|
||||
//
|
||||
// 而 localization/collectbox/collectboxinfo.etc 里各箱的 base 日期都已是过去:
|
||||
// Index1 SAO 2014-12-30
|
||||
// Index2 生肖之灵 2015-09-01
|
||||
// Index3 三国志 2017-01-05
|
||||
// Index4 猎龙者 2017-12-31
|
||||
// Index5 兽人守护神 2018-12-31
|
||||
//
|
||||
// 做法:在 PVF 原始字节里**等长替换**这些日期字符串(都是 19 字节),
|
||||
// 因此不会移动任何偏移、不破坏封包结构。
|
||||
package main
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/binary"
|
||||
"flag"
|
||||
"fmt"
|
||||
"os"
|
||||
)
|
||||
|
||||
// 旧 base 日期 → 新 base 日期(长度必须一致)
|
||||
var replacements = []struct{ old, new string }{
|
||||
{"2014-12-30 06:00:00", "2099-12-30 06:00:00"},
|
||||
{"2015-09-01 06:00:00", "2099-09-01 06:00:00"},
|
||||
{"2017-01-05 06:00:00", "2099-01-05 06:00:00"},
|
||||
{"2017-12-31 06:00:00", "2099-12-31 06:00:00"},
|
||||
{"2018-12-31 06:00:00", "2099-12-31 06:00:00"},
|
||||
}
|
||||
|
||||
func main() {
|
||||
input := flag.String("pvf", "", "input PVF")
|
||||
out := flag.String("out", "", "output PVF")
|
||||
dry := flag.Bool("dry-run", false, "只统计,不写")
|
||||
flag.Parse()
|
||||
if *input == "" {
|
||||
panic("-pvf is required")
|
||||
}
|
||||
data, err := os.ReadFile(*input)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
fmt.Printf("输入 %s %d 字节\n", *input, len(data))
|
||||
|
||||
total := 0
|
||||
for _, r := range replacements {
|
||||
if len(r.old) != len(r.new) {
|
||||
panic("替换长度不一致: " + r.old)
|
||||
}
|
||||
n := bytes.Count(data, []byte(r.old))
|
||||
if n == 0 {
|
||||
fmt.Printf(" %s → %s 未找到\n", r.old, r.new)
|
||||
continue
|
||||
}
|
||||
data = bytes.ReplaceAll(data, []byte(r.old), []byte(r.new))
|
||||
total += n
|
||||
fmt.Printf(" %s → %s %d 处\n", r.old, r.new, n)
|
||||
}
|
||||
fmt.Printf("共替换 %d 处\n", total)
|
||||
if total == 0 {
|
||||
panic("没有任何替换 —— 日期可能已被改过")
|
||||
}
|
||||
if *dry {
|
||||
fmt.Println("dry-run,未写文件")
|
||||
return
|
||||
}
|
||||
if *out == "" {
|
||||
panic("-out is required")
|
||||
}
|
||||
if err := os.WriteFile(*out, data, 0o644); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
fmt.Printf("已写出 %s %d 字节\n", *out, len(data))
|
||||
_ = binary.LittleEndian
|
||||
}
|
||||
Reference in new issue
Block a user