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,38 @@
|
||||
import { readFileSync } from "node:fs";
|
||||
import { expect, test } from "vitest";
|
||||
import { editQuest, parseQuest } from "../src/gui/quest";
|
||||
|
||||
const corpus = process.env.PVF_GUI_QUEST_CORPUS;
|
||||
|
||||
test.skipIf(!corpus)("real archive quests preserve source ranges and support integer edits", () => {
|
||||
const fixtures: { text: string }[] = JSON.parse(readFileSync(corpus!, "utf8"));
|
||||
expect(fixtures.length).toBeGreaterThan(0);
|
||||
let failed = 0, issues = 0, edited = 0;
|
||||
const errors = new Map<string, number>();
|
||||
for (const { text } of fixtures) {
|
||||
let doc: ReturnType<typeof parseQuest>;
|
||||
try {
|
||||
doc = parseQuest(text);
|
||||
} catch (cause) {
|
||||
failed++;
|
||||
const message = cause instanceof Error ? cause.message.split("\n")[0]! : String(cause);
|
||||
errors.set(message, (errors.get(message) ?? 0) + 1);
|
||||
continue;
|
||||
}
|
||||
if (doc.sections.some(s => s.issue)) issues++;
|
||||
expect(editQuest(text, [])).toBe(text);
|
||||
const field = doc.sections.find(s => !s.issue && s.tokens.length > 0 && s.tokens.every(t => t.kind === "integer"));
|
||||
if (!field) continue;
|
||||
const values = field.tokens.map(t => t.value);
|
||||
const first = field.tokens[0]!;
|
||||
const next = first.value === "0" ? "1" : "0";
|
||||
values[0] = next;
|
||||
expect(editQuest(text, [{ name: field.name, kind: "integer", values }])).toBe(
|
||||
text.slice(0, first.start) + next + text.slice(first.end),
|
||||
);
|
||||
edited++;
|
||||
}
|
||||
console.log(JSON.stringify({ quests: fixtures.length, failed, issues, edited, errors: Object.fromEntries(errors) }));
|
||||
expect(failed).toBe(Number(process.env.PVF_GUI_QUEST_EXPECTED_REJECTIONS ?? 0));
|
||||
expect(edited).toBeGreaterThan(0);
|
||||
}, 120_000);
|
||||
Reference in new issue
Block a user