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,58 @@
|
||||
package dnfbridge
|
||||
|
||||
import (
|
||||
"encoding/hex"
|
||||
"errors"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestCurrentDungeonInfoBuildMatchesCurrentEXEReader(t *testing.T) {
|
||||
body, err := (currentDungeonInfo{
|
||||
DungeonID: 0x05040302, Difficulty: 6, EntryOption: 0x0807,
|
||||
MazeIndex: 9, BossX: 10, BossY: 11,
|
||||
HellPartyRoomX: 12, HellPartyRoomY: 13, DungeonMode: 14,
|
||||
PairGroups: [][]currentDungeonInfoPair{{{First: 17, Second: 18}}},
|
||||
HellPartyValue: 0x1413, DungeonValue: 0x1615, Value2: 23, FlagA: 24,
|
||||
PacketSeed: 0x1c1b1a19, ParamA: 29, ParamB: 30, ParamC: 31,
|
||||
TailFlag0: 32, TailFlag1: 33, TailFlag2: 34,
|
||||
OpaqueEntries: []currentDungeonInfoOpaqueEntry{{Value: 0x27262524, ParamA: 40, ParamB: 41}},
|
||||
TailMode: 42, TailValue0: 0x2c2b, TailValue1: 0x2e2d,
|
||||
}).Build()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
const wantHex = "02030405060708090a0b0c0d0e01011112131415161718191a1b1c1d1e1f202122012425262728292a2b2c2d2e"
|
||||
if got := hex.EncodeToString(body); got != wantHex {
|
||||
t.Fatalf("body=%s want=%s", got, wantHex)
|
||||
}
|
||||
}
|
||||
|
||||
func TestCurrentDungeonInfoBuildMinimumIsCurrentEXEWidth(t *testing.T) {
|
||||
body, err := (currentDungeonInfo{}).Build()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if len(body) != 36 {
|
||||
t.Fatalf("body len=%d want=36 body=%x", len(body), body)
|
||||
}
|
||||
}
|
||||
|
||||
func TestCurrentDungeonInfoBuildRejectsCountOverflow(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
packet currentDungeonInfo
|
||||
want error
|
||||
}{
|
||||
{name: "groups", packet: currentDungeonInfo{PairGroups: make([][]currentDungeonInfoPair, 256)}, want: errDungeonInfoPairGroupCount},
|
||||
{name: "pairs", packet: currentDungeonInfo{PairGroups: [][]currentDungeonInfoPair{make([]currentDungeonInfoPair, 256)}}, want: errDungeonInfoPairGroupCount},
|
||||
{name: "opaque", packet: currentDungeonInfo{OpaqueEntries: make([]currentDungeonInfoOpaqueEntry, 256)}, want: errDungeonInfoOpaqueCount},
|
||||
}
|
||||
for _, test := range tests {
|
||||
t.Run(test.name, func(t *testing.T) {
|
||||
_, err := test.packet.Build()
|
||||
if !errors.Is(err, test.want) {
|
||||
t.Fatalf("error=%v want=%v", err, test.want)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user