服务端(Go): - GM 塞背包/带属性装备发放:在线角色推送 op14 增量物品行,背包实时刷新,无需回角色选择界面 - GM 改金币/改等级:去掉在线拒绝,落库后推送 op14 钱包/op37 等级状态,在线实时刷新 - 等级端点统一切换到新版 GMSetCharacterLevel(自带在线刷新) - 无限/锁死疲劳模式 + 燃烧疲劳:每房间消耗 2 点、打怪与通关经验双倍 - 燃烧疲劳开关时给所有在线角色推送系统提示(op12 mode 0) - 深渊史诗掉率:GM 全局倍率 + 城镇增益药剂窗口倍率,真实接入掉落结算 启动器(Python/JS): - 标题栏自绘、窗口 1204x717、禁止拖拽改大小、仅最小化/关闭 - GM 工具:疲劳与燃烧、深渊史诗掉率、拍卖行上架(单一定价对齐) - 拍卖行上架前端对齐服务端单一价格语义,修复 400 报错
76 lines
2.1 KiB
Go
76 lines
2.1 KiB
Go
package services
|
|
|
|
import "strings"
|
|
|
|
// ReadItemNames resolves equipment and stackable names using the same item
|
|
// relations and localized text as other archive views. Missing IDs are omitted.
|
|
func (s *FileGUIService) ReadItemNames(ids []string) (map[string]string, error) {
|
|
s.c.mu.Lock()
|
|
defer s.c.mu.Unlock()
|
|
if s.c.archive == nil {
|
|
return nil, ErrNoArchive
|
|
}
|
|
result := make(map[string]string)
|
|
if s.c.annotationEngine == nil {
|
|
return result, nil
|
|
}
|
|
seen := make(map[string]bool)
|
|
for _, raw := range ids {
|
|
id := strings.TrimSpace(raw)
|
|
if id == "" || seen[id] {
|
|
continue
|
|
}
|
|
seen[id] = true
|
|
if reference, ok := s.c.resolveAnnotationReferenceLocked("物品", id); ok {
|
|
result[id] = reference.Name
|
|
}
|
|
}
|
|
return result, nil
|
|
}
|
|
|
|
// ReadItemIcons reads only display metadata for the currently visible rewards.
|
|
func (s *FileGUIService) ReadItemIcons(ids []string) (map[string]*ImageReference, error) {
|
|
appearances, err := s.ReadItemAppearances(ids)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
result := make(map[string]*ImageReference, len(appearances))
|
|
for id, appearance := range appearances {
|
|
result[id] = appearance.Icon
|
|
}
|
|
return result, nil
|
|
}
|
|
|
|
// ItemAppearance shares the item rarity and icon metadata used by shop views.
|
|
type ItemAppearance struct {
|
|
Icon *ImageReference `json:"icon"`
|
|
Rarity int32 `json:"rarity"`
|
|
}
|
|
|
|
// ReadItemAppearances batches presentation metadata without reading item prices.
|
|
func (s *FileGUIService) ReadItemAppearances(ids []string) (map[string]*ItemAppearance, error) {
|
|
s.c.mu.Lock()
|
|
defer s.c.mu.Unlock()
|
|
if s.c.archive == nil {
|
|
return nil, ErrNoArchive
|
|
}
|
|
result := make(map[string]*ItemAppearance)
|
|
if s.c.annotationEngine == nil {
|
|
return result, nil
|
|
}
|
|
seen := make(map[string]bool)
|
|
for _, raw := range ids {
|
|
id := strings.TrimSpace(raw)
|
|
if id == "" || seen[id] {
|
|
continue
|
|
}
|
|
seen[id] = true
|
|
if reference, ok := s.c.resolveAnnotationReferenceLocked("物品", id); ok {
|
|
if metadata, err := s.c.archive.ScriptMetadata(reference.FileIndex); err == nil {
|
|
result[id] = &ItemAppearance{Icon: imageReferenceFromPVF(metadata.Icon), Rarity: metadata.RarityValue()}
|
|
}
|
|
}
|
|
}
|
|
return result, nil
|
|
}
|