查询章节ID接口

This commit is contained in:
meixiongfeng 2022-08-22 17:33:35 +08:00
parent 49f034323d
commit 141113f7cf
4 changed files with 16 additions and 23 deletions

View File

@ -93,6 +93,8 @@ type (
ModifyMainlineData(uid string, objId string, data interface{}) (code pb.ErrorCode)
// 检查能不能挑战该关卡
CheckChallengeChapter(storyObjId string, uid string, zhangjieID int32) (code pb.ErrorCode)
/// 查询章节ID
GetUsermainLineData(uid string) (mainlineId int32)
}
//任务
ITask interface {

View File

@ -132,7 +132,7 @@ func (this *apiComp) DrawCard(session comm.IUserSession, req *pb.HeroDrawCardReq
for {
sz := make([]int32, 0)
if cfgDraw.CampPoolStar3 != 0 {
sz = append(sz, cfgDraw.CampPoolStar3) // 3 4 5 权重
sz = append(sz, cfgDraw.CampPoolStar3) // 3 4 5 权重
}
if cfgDraw.CampPoolStar4 != 0 {
sz = append(sz, cfgDraw.CampPoolStar4)

View File

@ -528,28 +528,6 @@ func (this *ModelHero) RemoveUserHeroInfo(session comm.IUserSession) (err error)
return
}
// 保底抽卡 (参数 卡池id, 返回抽到卡配置id)
func (this *ModelHero) FloorDrawCard(Cardpool int32) (cardId string) {
// _bd, err := this.moduleHero.configure.GetHeroDrawConfig(Cardpool)
// if err == nil && len(_bd) != 0 {
// var _totalW int64 // 总权重
// var _tmpW int64 // 临时权重
// for _, v := range _bd {
// _totalW += int64(v.Weight)
// }
// // 随机权重
// n, _ := rand.Int(rand.Reader, big.NewInt(_totalW))
// for _, v := range _bd {
// _tmpW += int64(v.Weight)
// if n.Int64() < _tmpW { // 种族保底卡池命中
// cardId = v.Id
// break
// }
// }
// }
return
}
func (this *ModelHero) CheckPool(drawCount int32, config *cfg.GameGlobalData) (pools string) {
if config.BasePool1.S <= drawCount && config.BasePool1.E >= drawCount {
return config.BasePool1.P

View File

@ -5,6 +5,7 @@ import (
"go_dreamfactory/lego/core"
"go_dreamfactory/modules"
"go_dreamfactory/pb"
"sort"
)
type Mainline struct {
@ -110,3 +111,15 @@ func (this *Mainline) CheckChallengeChapter(storyObjId string, uid string, zhang
}
return
}
func (this *Mainline) GetUsermainLineData(uid string) (mainlineId int32) {
_szData, err := this.modelMainline.getMainlineList(uid)
if err == nil {
sort.SliceStable(_szData, func(i, j int) bool { // 排序
return _szData[i].ChapterId > _szData[j].ChapterId
})
}
return
}