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

110 lines
3.4 KiB
Go

package main
import (
"fmt"
"sort"
"longheng.io/server/internal/modules/dnf/worldmap"
)
// runQ4 统计 dungeon maze 的 [destroy object] clear 条件与被动对象摆放的关联。
// 参照 2026-07-31 空房结算修复的形状:地图恰好摆放 count 个该对象。
func runQ4(table *worldmap.Table, usages map[int64][]mapUsage, dungeonNames map[int64]string, objRefs map[int64]string) map[string]any {
mapsByID := map[int64]worldmap.Map{}
for _, m := range table.Maps() {
if _, ok := mapsByID[m.ID]; !ok {
mapsByID[m.ID] = m
}
}
var conditions []q4Condition
statusCount := map[string]int{}
totalConditions := 0
for _, d := range table.Dungeons() {
// 该 dungeon 下所有地图(任意 usage 来源)
dungeonMaps := map[int64]bool{}
for mapID, list := range usages {
for _, u := range list {
if u.DungeonID == d.ID {
dungeonMaps[mapID] = true
}
}
}
for _, maze := range d.Mazes {
for _, cond := range maze.ClearConditions {
if normSymbol(cond.Type) != "destroy object" {
continue
}
totalConditions++
entry := q4Condition{
DungeonID: d.ID, DungeonName: dungeonNames[d.ID], MazeIndex: maze.Index,
TargetID: cond.TargetID, Count: cond.Count, ObjRef: objRefs[cond.TargetID],
}
matchMaps := 0
placementTotal := 0
for mapID := range dungeonMaps {
m := mapsByID[mapID]
passive, special := 0, 0
for _, o := range m.PassiveObjects {
if o.ObjectID == cond.TargetID {
passive++
}
}
for _, o := range m.SpecialPassiveObjects {
if o.ObjectID == cond.TargetID {
special++
}
}
if passive+special == 0 {
continue
}
placementTotal += passive + special
entry.Placements = append(entry.Placements,
fmt.Sprintf("map=%d passive=%d special=%d", mapID, passive, special))
if int64(passive+special) == cond.Count {
matchMaps++
}
}
sort.Strings(entry.Placements)
switch {
case len(entry.Placements) == 0:
entry.Status = "no_placement_in_dungeon_maps"
case matchMaps > 0:
entry.Status = "count_match"
default:
entry.Status = "count_mismatch"
}
statusCount[entry.Status]++
conditions = append(conditions, entry)
}
}
}
sort.Slice(conditions, func(i, j int) bool {
if conditions[i].DungeonID != conditions[j].DungeonID {
return conditions[i].DungeonID < conditions[j].DungeonID
}
if conditions[i].MazeIndex != conditions[j].MazeIndex {
return conditions[i].MazeIndex < conditions[j].MazeIndex
}
return conditions[i].TargetID < conditions[j].TargetID
})
var lines []string
lines = append(lines, "dungeon_id\tdungeon_name\tmaze_index\ttarget_id\tcount\tstatus\tplacements\tobj_ref")
for _, c := range conditions {
lines = append(lines, fmt.Sprintf("%d\t%s\t%d\t%d\t%d\t%s\t%s\t%s",
c.DungeonID, c.DungeonName, c.MazeIndex, c.TargetID, c.Count, c.Status,
joinOr(c.Placements, "; "), c.ObjRef))
}
writeLines("q4_destroy_object_conditions.tsv", lines)
fmt.Printf("[Q4] destroy_object_conditions=%d status=%v\n", totalConditions, statusCount)
return map[string]any{
"total_conditions": totalConditions,
"status_census": statusCount,
"conditions": conditions,
"full_list_file": "out/q4_destroy_object_conditions.tsv",
"status_semantics": "count_match = 该 dungeon 至少一张地图摆放数量与 clear count 相等; no_placement = dungeon 地图中找不到该对象摆放",
}
}