feat: 重构地图热度信息并添加地图提示功能
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful

将地图热度信息从简单的计数器改为包含提示信息的结构体
添加矿物、BOSS、宠物和掉落等提示信息的收集功能
优化地图进入和离开时的计数逻辑
This commit is contained in:
xinian
2026-03-01 10:44:31 +08:00
committed by cnb
parent 3656e43d3c
commit 9b344d3753
11 changed files with 112 additions and 34 deletions

View File

@@ -39,12 +39,13 @@ func (s *MapService) GetTimeMap() (ret []model.MapConfig) {
return
}
func (s *MapService) GetTimeTip() (ret []model.MapConfig) {
//cacheKey := strings.Join([]string{fmt.Sprintf("%d", p1), fmt.Sprintf("%d", p2)}, ":")
m := dbm_notenable(s.Model)
m.Where(`is_time_space`, 1).Scan(&ret)
// func (s *MapService) GetTimeTip() (ret []model.MapConfig) {
// //cacheKey := strings.Join([]string{fmt.Sprintf("%d", p1), fmt.Sprintf("%d", p2)}, ":")
// m := dbm_notenable(s.Model)
return
// m.Where(`is_time_space`, 1).Scan(&ret)
}
// return
// }

View File

@@ -3,6 +3,8 @@ package service
import (
"blazing/cool"
"blazing/modules/config/model"
"github.com/samber/lo"
)
type MapNodeService struct {
@@ -44,3 +46,16 @@ func (s *MapNodeService) GetDataNode(mapid, node uint32) *model.MapNode {
return pet
}
func (s *MapNodeService) GetTip(mapid uint32) []uint32 {
var pet []model.MapNode //一个特性应该是唯一的,但是我们要获取默认随机特性
dbm_enable(s.Model).Where("map_id", mapid).Scan(&pet)
var ret []uint32
for _, v := range pet {
ret = append(ret, v.TriggerID)
}
return lo.Union(ret)
}

View File

@@ -3,6 +3,8 @@ package service
import (
"blazing/cool"
"blazing/modules/config/model"
"github.com/samber/lo"
)
type MapPitService struct {
@@ -28,3 +30,16 @@ func (s *MapPitService) GetData(mapid, pos uint32) []model.MapPit {
return pet
}
func (s *MapPitService) GetDataALL(mapid uint32) []uint32 {
var pet []model.MapPit //一个特性应该是唯一的,但是我们要获取默认随机特性
dbm_enable(s.Model).Where("map_id", mapid).Scan(&pet)
var ret []uint32
for _, v := range pet {
ret = append(ret, v.RefreshID...)
}
return lo.Union(ret)
}

View File

@@ -3,6 +3,8 @@ package service
import (
"blazing/cool"
"blazing/modules/config/model"
"github.com/samber/lo"
)
type TalkConfigService struct {
@@ -25,3 +27,16 @@ func (s *TalkConfigService) GetCache(flag int) model.MineralCollectionConfig {
return config
}
func (s *TalkConfigService) GetTip(mapid uint32) []uint32 {
var item []model.TaskConfig
dbm_enable(s.Model).Where("map_id", mapid).Scan(&item)
var res []uint32
for _, v := range item {
res = append(res, v.ItemRewardIds...)
}
return lo.Union(res)
}

View File

@@ -57,3 +57,4 @@ func (s *TaskService) IsAcceptable(taskid uint32) (out *model.TaskConfig) {
return
}