服务端(Go): - GM 塞背包/带属性装备发放:在线角色推送 op14 增量物品行,背包实时刷新,无需回角色选择界面 - GM 改金币/改等级:去掉在线拒绝,落库后推送 op14 钱包/op37 等级状态,在线实时刷新 - 等级端点统一切换到新版 GMSetCharacterLevel(自带在线刷新) - 无限/锁死疲劳模式 + 燃烧疲劳:每房间消耗 2 点、打怪与通关经验双倍 - 燃烧疲劳开关时给所有在线角色推送系统提示(op12 mode 0) - 深渊史诗掉率:GM 全局倍率 + 城镇增益药剂窗口倍率,真实接入掉落结算 启动器(Python/JS): - 标题栏自绘、窗口 1204x717、禁止拖拽改大小、仅最小化/关闭 - GM 工具:疲劳与燃烧、深渊史诗掉率、拍卖行上架(单一定价对齐) - 拍卖行上架前端对齐服务端单一价格语义,修复 400 报错
54 lines
1.3 KiB
Go
54 lines
1.3 KiB
Go
package mail
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
"time"
|
|
|
|
dnfrepo "longheng.io/server/internal/modules/dnf/repository"
|
|
dnfrepomemory "longheng.io/server/internal/modules/dnf/repository/memory"
|
|
)
|
|
|
|
func TestOwnerClearAllRemovesEveryMailboxRow(t *testing.T) {
|
|
ctx := context.Background()
|
|
repositories := dnfrepomemory.NewMemoryGroup()
|
|
now := time.Now().UTC()
|
|
if err := repositories.Mailbox.Save(ctx, dnfrepo.MailboxRecord{
|
|
CharacterID: "88",
|
|
Mails: map[string]dnfrepo.MailRecord{
|
|
"1": {
|
|
MailID: "1",
|
|
Gold: 120,
|
|
Attachments: []dnfrepo.MailAttachment{{ItemID: 5001, Count: 1}},
|
|
CreatedAt: now,
|
|
},
|
|
"2": {
|
|
MailID: "2",
|
|
Read: true,
|
|
Claimed: true,
|
|
CreatedAt: now,
|
|
},
|
|
"3": {
|
|
MailID: "3",
|
|
Deleted: true,
|
|
CreatedAt: now,
|
|
},
|
|
},
|
|
UpdatedAt: now,
|
|
}); err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
|
|
result, err := NewOwner(repositories).ClearAll(ctx, "88")
|
|
if err != nil {
|
|
t.Fatalf("ClearAll() error = %v", err)
|
|
}
|
|
if result.Removed != 3 || result.Unread != 1 || result.Claimable != 1 || result.Gold != 120 || result.Attachments != 1 {
|
|
t.Fatalf("ClearAll() = %+v", result)
|
|
}
|
|
record, found, err := repositories.Mailbox.Load(ctx, "88")
|
|
if err != nil || !found || len(record.Mails) != 0 {
|
|
t.Fatalf("mailbox after clear found=%t error=%v record=%+v", found, err, record)
|
|
}
|
|
}
|