服务端(Go): - GM 塞背包/带属性装备发放:在线角色推送 op14 增量物品行,背包实时刷新,无需回角色选择界面 - GM 改金币/改等级:去掉在线拒绝,落库后推送 op14 钱包/op37 等级状态,在线实时刷新 - 等级端点统一切换到新版 GMSetCharacterLevel(自带在线刷新) - 无限/锁死疲劳模式 + 燃烧疲劳:每房间消耗 2 点、打怪与通关经验双倍 - 燃烧疲劳开关时给所有在线角色推送系统提示(op12 mode 0) - 深渊史诗掉率:GM 全局倍率 + 城镇增益药剂窗口倍率,真实接入掉落结算 启动器(Python/JS): - 标题栏自绘、窗口 1204x717、禁止拖拽改大小、仅最小化/关闭 - GM 工具:疲劳与燃烧、深渊史诗掉率、拍卖行上架(单一定价对齐) - 拍卖行上架前端对齐服务端单一价格语义,修复 400 报错
91 lines
2.9 KiB
Go
91 lines
2.9 KiB
Go
// Command cooltimescan lists every stackable whose PVF declares
|
|
// [cooltime maintenance] (the field that makes the cooldown server-maintained),
|
|
// with its [cool time] and [cooltime group]. Temporary scratch tool.
|
|
package main
|
|
|
|
import (
|
|
"context"
|
|
"flag"
|
|
"fmt"
|
|
"log"
|
|
"math"
|
|
"regexp"
|
|
"sort"
|
|
"strings"
|
|
|
|
"longheng.io/server/internal/modules/dnf/pvf"
|
|
platformpvf "longheng.io/server/internal/platform/pvf"
|
|
)
|
|
|
|
const stackableList = "stackable/stackable.lst"
|
|
|
|
func main() {
|
|
pvfPath := flag.String("pvf", "", "Script.pvf path")
|
|
flag.Parse()
|
|
archive, err := platformpvf.Open(*pvfPath)
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
pathToID := map[string]int64{}
|
|
if text, err := archive.ReadText(stackableList); err == nil {
|
|
if doc, err := pvf.Parse(stackableList, text); err == nil {
|
|
for _, entry := range pvf.ParseList(doc) {
|
|
clean := strings.ToLower(strings.TrimSpace(entry.Path))
|
|
clean = strings.ReplaceAll(clean, "\\", "/")
|
|
clean = strings.Trim(clean, "`")
|
|
if entry.ID <= 0 || entry.ID > math.MaxUint32 || clean == "" {
|
|
continue
|
|
}
|
|
pathToID["stackable/"+clean] = entry.ID
|
|
}
|
|
}
|
|
}
|
|
namePattern := regexp.MustCompile("(?m)^\\s*\\[name\\]\\s+`([^`]*)`")
|
|
coolTimePattern := regexp.MustCompile(`(?m)^\s*\[cool time\]\s+(\d+)`)
|
|
groupPattern := regexp.MustCompile(`(?m)^\s*\[cooltime group\]\s+(\d+)`)
|
|
maintenancePattern := regexp.MustCompile(`(?m)^\s*\[cooltime maintenance\]\s*([^\r\n]*)`)
|
|
boosterPattern := regexp.MustCompile(`(?m)^\s*\[booster info\]`)
|
|
|
|
type row struct {
|
|
id, coolTime, group int64
|
|
maintenance, name string
|
|
booster bool
|
|
path string
|
|
}
|
|
rows := make([]row, 0, 64)
|
|
archive.RangePaths(func(path string) bool {
|
|
lower := strings.ToLower(path)
|
|
if !strings.HasSuffix(lower, ".stk") {
|
|
return true
|
|
}
|
|
text, err := archive.ReadText(path)
|
|
if err != nil || !maintenancePattern.MatchString(text) {
|
|
return true
|
|
}
|
|
entry := row{path: path}
|
|
if match := maintenancePattern.FindStringSubmatch(text); len(match) == 2 {
|
|
entry.maintenance = strings.TrimSpace(match[1])
|
|
}
|
|
if match := coolTimePattern.FindStringSubmatch(text); len(match) == 2 {
|
|
fmt.Sscanf(match[1], "%d", &entry.coolTime)
|
|
}
|
|
if match := groupPattern.FindStringSubmatch(text); len(match) == 2 {
|
|
fmt.Sscanf(match[1], "%d", &entry.group)
|
|
}
|
|
if match := namePattern.FindStringSubmatch(text); len(match) == 2 {
|
|
entry.name = match[1]
|
|
}
|
|
entry.booster = boosterPattern.MatchString(text)
|
|
entry.id = pathToID[lower]
|
|
rows = append(rows, entry)
|
|
return true
|
|
})
|
|
sort.Slice(rows, func(i, j int) bool { return rows[i].coolTime > rows[j].coolTime })
|
|
fmt.Printf("documents with [cooltime maintenance] = %d (stackable.lst entries=%d)\n", len(rows), len(pathToID))
|
|
for _, entry := range rows {
|
|
fmt.Printf("item=%-12d group=%-4d cooltime_ms=%-12d booster=%-5t maintenance=%q name=%q path=%s\n",
|
|
entry.id, entry.group, entry.coolTime, entry.booster, entry.maintenance, entry.name, entry.path)
|
|
}
|
|
_ = context.Background()
|
|
}
|