feat(map): 实现地图热度统计功能并优化数据类型
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user