feat(map): 实现地图热度统计功能并优化数据类型

This commit is contained in:
1
2025-08-16 03:18:48 +00:00
parent a02de8a4b4
commit 92c2d95764
3 changed files with 32 additions and 4 deletions

View File

@@ -4,15 +4,24 @@ import (
"blazing/common/data/entity"
"blazing/common/socket/errorcode"
"blazing/logic/service/maphot"
"blazing/logic/service/space"
)
func (h Controller) MapHot(data *maphot.InInfo, c *entity.Player) (result *maphot.OutInfo, err errorcode.ErrorCode) {
result = &maphot.OutInfo{
HotInfos: make([]maphot.MapHotInfo, 0),
}
return
ttt := space.GetMapHot()
for k, v := range ttt {
result.HotInfos = append(result.HotInfos, maphot.MapHotInfo{
MapID: uint32(k),
Count: uint32(space.GetPlanet(uint32(v)).Len()),
})
}
return
}