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,61 @@
|
||||
import { beforeEach, expect, it, vi } from "vitest";
|
||||
import { createPinia, setActivePinia } from "pinia";
|
||||
import { effectScope, toRef } from "vue";
|
||||
const events = vi.hoisted(() => new Map<string, () => void>());
|
||||
vi.mock("@wailsio/runtime", () => ({ Events: { On: (name: string, handler: () => void) => events.set(name, handler) } }));
|
||||
import { skillTreeCellNode, skillTreeCellSelectionKey } from "../src/gui/skillTree";
|
||||
import type { SkillTreeNode } from "../bindings/pvfine/services/models";
|
||||
import { useFileGUIStore } from "../src/stores/fileGUI";
|
||||
|
||||
beforeEach(() => { events.clear(); setActivePinia(createPinia()); });
|
||||
it("弹窗组件销毁后,重新创建的选择引用仍恢复职业、转职和SP/TP", () => {
|
||||
const first = effectScope();
|
||||
first.run(() => {
|
||||
const gui = useFileGUIStore();
|
||||
toRef(gui.skillTreeSelection, "job").value = "[swordman]";
|
||||
toRef(gui.skillTreeSelection, "branch").value = "weaponmaster";
|
||||
toRef(gui.skillTreeSelection, "kind").value = "tp";
|
||||
});
|
||||
first.stop();
|
||||
const reopened = effectScope();
|
||||
reopened.run(() => {
|
||||
expect(useFileGUIStore().skillTreeSelection).toEqual({job: "[swordman]", branch: "weaponmaster", kind: "tp"});
|
||||
});
|
||||
reopened.stop();
|
||||
});
|
||||
|
||||
it("各位置独立记忆,切换转职和重开弹窗后恢复,其他技能树不串用", () => {
|
||||
const cell = {key: "235:938", nodes: [319, 112].map(id => ({id}) as SkillTreeNode)};
|
||||
const key = skillTreeCellSelectionKey("clientonly/skilltree/swordman_sp.co", "[swordman]", "sp", "weaponmaster", cell.key);
|
||||
const second = {...cell, key: "329:938"};
|
||||
const secondKey = skillTreeCellSelectionKey("clientonly/skilltree/swordman_sp.co", "[swordman]", "sp", "weaponmaster", second.key);
|
||||
const first = effectScope();
|
||||
first.run(() => {
|
||||
const gui = useFileGUIStore();
|
||||
gui.skillTreeCellSelections[key] = 319;
|
||||
gui.skillTreeCellSelections[secondKey] = 112;
|
||||
gui.skillTreeSelection.branch = "asura";
|
||||
});
|
||||
first.stop();
|
||||
const reopened = effectScope();
|
||||
reopened.run(() => {
|
||||
const gui = useFileGUIStore();
|
||||
gui.skillTreeSelection.branch = "weaponmaster";
|
||||
// Reloading creates new node objects; restore by ID rather than reference.
|
||||
const reloaded = {...cell, nodes: cell.nodes.map(n => ({...n}))};
|
||||
expect(skillTreeCellNode(reloaded, gui.skillTreeCellSelections[key]).id).toBe(319);
|
||||
expect(skillTreeCellNode(second, gui.skillTreeCellSelections[secondKey]).id).toBe(112);
|
||||
for (const context of [
|
||||
["other.co", "[swordman]", "sp", "weaponmaster"],
|
||||
["clientonly/skilltree/swordman_sp.co", "[mage]", "sp", "weaponmaster"],
|
||||
["clientonly/skilltree/swordman_sp.co", "[swordman]", "tp", "weaponmaster"],
|
||||
["clientonly/skilltree/swordman_sp.co", "[swordman]", "sp", "asura"],
|
||||
]) {
|
||||
const otherKey = skillTreeCellSelectionKey(context[0]!, context[1]!, context[2]!, context[3]!, cell.key);
|
||||
expect(skillTreeCellNode(cell, gui.skillTreeCellSelections[otherKey]).id).toBe(112);
|
||||
}
|
||||
events.get("archive:opened")!();
|
||||
expect(skillTreeCellNode(cell, gui.skillTreeCellSelections[key]).id).toBe(112);
|
||||
});
|
||||
reopened.stop();
|
||||
});
|
||||
Reference in new issue
Block a user