Files
bl/logic/service/space/hot.go
昔念 ec0552b59a feat(player): 重构任务状态管理逻辑
将任务状态相关的 GetTask 和 SetTask 方法从 player 包迁移至 model.PlayerInfo 结构体中,
统一通过 c.Info 调
2025-12-08 19:16:37 +08:00

50 lines
1.0 KiB
Go

package space
// MapHotInfo 表示地图热度信息
type MapHotInfo struct {
MapID uint32 `json:"mapId"` // 地图ID
Count int32 `struc:"uint32" json:"count"` // 地图里的人数
}
var maphot = make(map[uint32]*int32, 0)
func GetMapHot() []MapHotInfo {
ret := make([]MapHotInfo, 0)
for k, v := range maphot {
ret = append(ret, MapHotInfo{
MapID: k,
Count: *v,
})
}
return ret
// result1, _, _ := requestGroup.Do("map_hot", func() (interface{}, error) {
// tt := make(map[uint32]uint32)
// for _, v := range xmlres.MapConfig.Maps {
// t1, ok := tt[uint32(v.Super)]
// if ok {
// tt[uint32(v.Super)] = uint32(int(t1) + GetSpace(uint32(v.ID)).User.Count())
// } else {
// tt[uint32(v.Super)] = uint32(GetSpace(uint32(v.ID)).User.Count())
// }
// }
// var result = make([]MapHotInfo, 0)
// for k, v := range tt {
// result = append(result, MapHotInfo{
// MapID: uint32(k),
// Count: uint32(v),
// })
// }
// return result, nil
// })
}