服务端(Go): - GM 塞背包/带属性装备发放:在线角色推送 op14 增量物品行,背包实时刷新,无需回角色选择界面 - GM 改金币/改等级:去掉在线拒绝,落库后推送 op14 钱包/op37 等级状态,在线实时刷新 - 等级端点统一切换到新版 GMSetCharacterLevel(自带在线刷新) - 无限/锁死疲劳模式 + 燃烧疲劳:每房间消耗 2 点、打怪与通关经验双倍 - 燃烧疲劳开关时给所有在线角色推送系统提示(op12 mode 0) - 深渊史诗掉率:GM 全局倍率 + 城镇增益药剂窗口倍率,真实接入掉落结算 启动器(Python/JS): - 标题栏自绘、窗口 1204x717、禁止拖拽改大小、仅最小化/关闭 - GM 工具:疲劳与燃烧、深渊史诗掉率、拍卖行上架(单一定价对齐) - 拍卖行上架前端对齐服务端单一价格语义,修复 400 报错
40 lines
1.6 KiB
Go
40 lines
1.6 KiB
Go
package dnfbridge
|
||
|
||
import (
|
||
"encoding/binary"
|
||
"math"
|
||
"testing"
|
||
|
||
dnfrepo "longheng.io/server/internal/modules/dnf/repository"
|
||
)
|
||
|
||
// 心意通/戒指券在用掉"最后一个"之后,槽位已经从背包里删掉了。
|
||
// 这时必须发**清空行**(itemID=0xffffffff、count=0),否则客户端会继续显示那个
|
||
// 已经不存在的道具,再点就报错(2026-10-04 真机现场)。
|
||
func TestCurrentWeddingConsumedSlotUpdateClearsExhaustedSlot(t *testing.T) {
|
||
const slot int32 = 42
|
||
|
||
cleared := currentWeddingConsumedSlotUpdate(slot, dnfrepo.ItemStack{}, false)
|
||
if got := binary.LittleEndian.Uint32(cleared.data[2:6]); got != math.MaxUint32 {
|
||
t.Fatalf("清空行的 itemID=%#x,应为 0xffffffff", got)
|
||
}
|
||
if got := binary.LittleEndian.Uint32(cleared.data[6:10]); got != 0 {
|
||
t.Fatalf("清空行的 count=%d,应为 0", got)
|
||
}
|
||
|
||
// 还有剩余时照常回真实的那一行。
|
||
remaining := currentWeddingConsumedSlotUpdate(slot, dnfrepo.ItemStack{ItemID: 10002901, Count: 3}, true)
|
||
if got := binary.LittleEndian.Uint32(remaining.data[2:6]); got != 10002901 {
|
||
t.Fatalf("剩余行的 itemID=%d,应为 10002901", got)
|
||
}
|
||
if got := binary.LittleEndian.Uint32(remaining.data[6:10]); got != 3 {
|
||
t.Fatalf("剩余行的 count=%d,应为 3", got)
|
||
}
|
||
|
||
// 计数归零但键还留着(不该发生)同样按清空处理,避免残留幻影行。
|
||
zeroed := currentWeddingConsumedSlotUpdate(slot, dnfrepo.ItemStack{ItemID: 10002901, Count: 0}, true)
|
||
if got := binary.LittleEndian.Uint32(zeroed.data[2:6]); got != math.MaxUint32 {
|
||
t.Fatalf("计数归零的行 itemID=%#x,应为 0xffffffff", got)
|
||
}
|
||
}
|