feat(user-talk): 优化聊天功能中的物品奖励逻辑
重构 Talk 方法中物品奖励的获取方式,使用新的配置服务以支持多物品 ID 奖励机制。 移除了对 github.com/gogf/gf/v2/util/grand 包的依赖,改为通过服务获取实际物品数量。 同时更新了相关模型定义: - 修改 MineralCollectionConfig 中 ItemID 为数组形式以支持多个物品配置 - 调整 ItemGift 模型字段
This commit is contained in:
@@ -46,15 +46,10 @@ func (s *TalkService) Cheak(mapid uint32, flag int) (int, bool) {
|
||||
return int(talks.Count), true
|
||||
}
|
||||
|
||||
//maps := service.DictInfoServiceS.DataRemark("mapid")
|
||||
if len(config.TalkConfigServiceS.GetCache(flag)) == 0 {
|
||||
return 0, false
|
||||
}
|
||||
|
||||
if uint32(mapid) != config.TalkConfigServiceS.GetCache(flag)[0].MapID {
|
||||
if uint32(mapid) != config.NewTalkConfigService().GetCache(flag).MapID {
|
||||
return 0, false //没在地图
|
||||
}
|
||||
if talks.Count >= config.TalkConfigServiceS.GetCache(flag)[0].DailyCollectCount {
|
||||
if talks.Count >= config.NewTalkConfigService().GetCache(flag).DailyCollectCount {
|
||||
return 0, false
|
||||
}
|
||||
return int(talks.Count), true //int(config.MaxDailyCnt - talks.Count)
|
||||
|
||||
Reference in New Issue
Block a user