服务端(Go): - GM 塞背包/带属性装备发放:在线角色推送 op14 增量物品行,背包实时刷新,无需回角色选择界面 - GM 改金币/改等级:去掉在线拒绝,落库后推送 op14 钱包/op37 等级状态,在线实时刷新 - 等级端点统一切换到新版 GMSetCharacterLevel(自带在线刷新) - 无限/锁死疲劳模式 + 燃烧疲劳:每房间消耗 2 点、打怪与通关经验双倍 - 燃烧疲劳开关时给所有在线角色推送系统提示(op12 mode 0) - 深渊史诗掉率:GM 全局倍率 + 城镇增益药剂窗口倍率,真实接入掉落结算 启动器(Python/JS): - 标题栏自绘、窗口 1204x717、禁止拖拽改大小、仅最小化/关闭 - GM 工具:疲劳与燃烧、深渊史诗掉率、拍卖行上架(单一定价对齐) - 拍卖行上架前端对齐服务端单一价格语义,修复 400 报错
85 lines
1.9 KiB
Go
85 lines
1.9 KiB
Go
package dnfbridge
|
|
|
|
import (
|
|
"context"
|
|
"os"
|
|
"testing"
|
|
|
|
dnfhonor "longheng.io/server/internal/modules/dnf/honor"
|
|
dnfrepo "longheng.io/server/internal/modules/dnf/repository"
|
|
dnfrepomemory "longheng.io/server/internal/modules/dnf/repository/memory"
|
|
)
|
|
|
|
func TestCurrentAccountHonorProgressUsesPersistedOrdinaryHonorOnly(t *testing.T) {
|
|
tables, err := dnfhonor.LoadTables(honorServiceTestSource{dnfhonor.TablePath: honorServiceTestDocument()})
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
repositories := dnfrepomemory.NewMemoryGroup()
|
|
if err := repositories.Account.Save(context.Background(), dnfrepo.AccountRecord{
|
|
AccountID: "dnf:1",
|
|
HonorExp: 15,
|
|
}); err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
service := &Service{
|
|
options: options{accountID: "dnf:1"},
|
|
honorTable: tables,
|
|
repositoryProvider: func() (dnfrepo.Group, bool) {
|
|
return repositories, true
|
|
},
|
|
}
|
|
progress, err := service.currentAccountHonorProgress(context.Background())
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
if progress.TotalExperience != 15 || progress.Level != 2 || progress.CurrentLevelExperience != 5 || progress.Grade != 1 {
|
|
t.Fatalf("honor progress = %+v", progress)
|
|
}
|
|
}
|
|
|
|
type honorServiceTestSource map[string]string
|
|
|
|
func (source honorServiceTestSource) ReadText(path string) (string, error) {
|
|
text, found := source[path]
|
|
if !found {
|
|
return "", os.ErrNotExist
|
|
}
|
|
return text, nil
|
|
}
|
|
|
|
func honorServiceTestDocument() string {
|
|
return `[grade]
|
|
1 ` + "`effect/one.ani` `medal.img` 0 `icon.img` 0" + ` 1 0 2 10
|
|
[/grade]
|
|
[grade]
|
|
2 ` + "`effect/two.ani` `medal.img` 2 `icon.img` 1" + ` 3 20
|
|
[/grade]
|
|
[maxexp on maxlevel]
|
|
29
|
|
[expert info]
|
|
[grade info]
|
|
0 ` + "`challenger`" + `
|
|
[min lv]
|
|
0
|
|
[max lv]
|
|
0
|
|
[/grade info]
|
|
[grade info]
|
|
1 ` + "`veteran`" + `
|
|
[medal img]
|
|
` + "`expert-medal.img`" + ` 2
|
|
[icon img]
|
|
` + "`expert-icon.img`" + ` 3
|
|
[min lv]
|
|
1
|
|
[max lv]
|
|
-1
|
|
[/grade info]
|
|
[/expert info]
|
|
[honor expert exp table]
|
|
1 ` + "`100`" + ` 2 ` + "`204`" + ` 3 ` + "`9999999999`" + `
|
|
[/honor expert exp table]
|
|
`
|
|
}
|