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,89 @@
|
||||
package storygate
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"os"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
dnfpvf "longheng.io/server/internal/modules/dnf/pvf"
|
||||
"longheng.io/server/internal/modules/dnf/quest"
|
||||
"longheng.io/server/internal/modules/dnf/town"
|
||||
"longheng.io/server/internal/modules/dnf/worldmap"
|
||||
platformpvf "longheng.io/server/internal/platform/pvf"
|
||||
)
|
||||
|
||||
const realPVFStoryGateBaseline3145Hash = "44df0b9ced5b68bce3f4b39a3b3e4630bed2d6df7aff8cf683036ede67e8974b"
|
||||
|
||||
func TestObjectiveFamilyAndFingerprintAreDeterministic(t *testing.T) {
|
||||
definition := quest.Definition{ID: 10, Type: "[clear map]", IntData: []int64{123}}
|
||||
objective := buildObjective(definition, nil)
|
||||
if objective.Family != "clear-objective" || objective.Type != "clear map" {
|
||||
t.Fatalf("objective=%+v", objective)
|
||||
}
|
||||
if checks := stateChecks(objective); len(checks) != 3 || checks[0].State != "available" || checks[1].Transition != "clear-objective" {
|
||||
t.Fatalf("state checks=%+v", checks)
|
||||
}
|
||||
entry := Entry{QuestID: 10, Objective: objective}
|
||||
first := fingerprint(entry)
|
||||
second := fingerprint(entry)
|
||||
if first == "" || first != second {
|
||||
t.Fatalf("fingerprints are not stable: %q %q", first, second)
|
||||
}
|
||||
}
|
||||
|
||||
func TestWriteReports(t *testing.T) {
|
||||
report := Report{Version: MatrixVersion, StartQuestID: 10, Character: Character{Job: 2, GrowType: 0, Level: 90}, Entries: []Entry{{Sequence: 0, QuestID: 10, QuestType: "clear map", Fingerprint: "abc"}}, Ready: true}
|
||||
var json bytes.Buffer
|
||||
if err := WriteJSON(&json, report); err != nil || !strings.Contains(json.String(), `"start_quest_id": 10`) {
|
||||
t.Fatalf("json=%q err=%v", json.String(), err)
|
||||
}
|
||||
var markdown bytes.Buffer
|
||||
if err := WriteMarkdown(&markdown, report); err != nil || !strings.Contains(markdown.String(), "Story Gate Regression Matrix") || !strings.Contains(markdown.String(), "| 0 | 10 | `clear map` |") {
|
||||
t.Fatalf("markdown=%q err=%v", markdown.String(), err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestRealPVFStoryGateMatrix(t *testing.T) {
|
||||
pvfPath := os.Getenv("DNFBRIDGE_REAL_PVF_SMOKE")
|
||||
if pvfPath == "" {
|
||||
t.Skip("set DNFBRIDGE_REAL_PVF_SMOKE to run the real story-gate matrix")
|
||||
}
|
||||
archive, err := platformpvf.LoadArchive(platformpvf.Options{Path: pvfPath})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
index, err := dnfpvf.Build(context.Background(), archive, dnfpvf.BuildOptions{Lists: []string{quest.DefaultList, worldmap.DefaultMapList, worldmap.DefaultDungeonList, worldmap.DefaultWorldMapList, town.DefaultList}})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
quests, err := quest.Load(context.Background(), index)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
maps, err := worldmap.Load(context.Background(), index, worldmap.Options{})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
towns, err := town.Load(context.Background(), archive, town.Options{})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
report, err := Build(context.Background(), quests, maps, towns, 3145, Character{Job: 2, GrowType: 0, Level: 90}, Options{MaxEntries: 2048})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if report.QuestCount == 0 || report.InventoryHash == "" {
|
||||
t.Fatalf("empty real matrix: %+v", report)
|
||||
}
|
||||
if report.Entries[0].QuestID != 3145 {
|
||||
t.Fatalf("first entry=%+v", report.Entries[0])
|
||||
}
|
||||
if len(report.Entries[0].Dungeons) == 0 || len(report.Entries[0].Gates) == 0 {
|
||||
t.Fatalf("q3145 topology evidence missing: %+v", report.Entries[0])
|
||||
}
|
||||
if report.InventoryHash != realPVFStoryGateBaseline3145Hash {
|
||||
t.Fatalf("story-gate PVF baseline drift: got %s want %s; update the reviewed baseline only with an intentional PVF change", report.InventoryHash, realPVFStoryGateBaseline3145Hash)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user