feat(game): 实现扭蛋系统批量物品添加功能并优化地图逻辑 - 新增ItemAddBatch方法用于批量添加物品,支持普通道具和特殊道具的分别处理 - 优化扭蛋游戏玩法中的物品添加逻辑,使用新的批量接口提升性能 - 在扭蛋机器人命令中实现完整的物品检查和批量添加流程 refactor(map): 重构地图控制器代码结构并添加注释 - 为EnterMap、LeaveMap、GetMapPlayerList等方法添加中文注释 - 统一地图相关的命名规范,如enter
This commit is contained in:
@@ -144,6 +144,24 @@ func (s *DictInfoService) GetMax(value int64) (max uint32) {
|
||||
}
|
||||
|
||||
// 获取稀有精灵的光环显示
|
||||
// GetMaxMap 批量获取物品最大持有上限。
|
||||
func (s *DictInfoService) GetMaxMap(values ...uint32) map[uint32]uint32 {
|
||||
if len(values) == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
var ress []model.DictInfo
|
||||
cool.DBM(s.Model).WhereIn("value", values).Cache(gdb.CacheOption{
|
||||
Force: false,
|
||||
}).Scan(&ress)
|
||||
|
||||
result := make(map[uint32]uint32, len(ress))
|
||||
for _, item := range ress {
|
||||
result[gconv.Uint32(item.Value)] = uint32(item.Ordernum)
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
func (s *DictInfoService) GetShiny() []int {
|
||||
//获取精灵的排序作为精灵的数组
|
||||
m := cool.DBM(s.Model)
|
||||
|
||||
Reference in New Issue
Block a user