羁绊优化

This commit is contained in:
meixiongfeng 2023-09-15 14:56:11 +08:00
parent 2acf600bf4
commit 448025b2ac
3 changed files with 8 additions and 34 deletions

View File

@ -323,14 +323,8 @@ type (
}
IHeroFetter interface {
ModifyHeroFetterData(uid string, obj string, data map[string]interface{}) (errdata *pb.ErrorData) // 修改羁绊信息
QueryHeroFetter(uid string) (data []*pb.DBHeroFetter) // 查询所有的羁绊信息
AddHeroFetterData(uid string, heroConfId string) (errdata *pb.ErrorData) // 创建一条羁绊信息
AddHeroFetterData(uid string, heroConfId string) (errdata *pb.ErrorData) // 创建一条羁绊信息
SendRpcAddHero(uid string, heroConfId []string, serverTag string) (err error)
// 获取 某个阵营的羁绊数据
QueryFavorabilityByRace(uid string, race int32) int32
AddHerosFetterData(uid string, heroConfIds []string) (errdata *pb.ErrorData)
}
//月子秘境

View File

@ -98,13 +98,17 @@ func (this *modelLibrary) checkReddot19109(uid string) bool {
// 有升级的情况 非常耗性能o(╯□╰)o不建议使用
func (this *modelLibrary) checkReddot19110(uid string) bool {
fetter := this.module.modelFetter.getHeroFetterList(uid)
if len(fetter) == 0 {
return false
}
list := this.getLibraryList(uid)
for _, v := range list {
if v.Fidlv > 0 {
var totalFetterLv int32 // 羁绊累计等级
for _, oid := range v.Herofetter {
if _d := this.module.modelFetter.getOneHeroFetter(uid, oid); _d != nil {
totalFetterLv += _d.Favorlv
for _, obj := range fetter {
if _, ok := v.Herofetter[obj.Id]; ok {
totalFetterLv += obj.Favorlv
}
}
for i := 1; ; i++ {

View File

@ -141,17 +141,6 @@ func (this *Library) CheckFetter(uid string, hid string) (dbLibrary []*pb.DBLibr
return
}
func (this *Library) ModifyHeroFetterData(uid string, obj string, data map[string]interface{}) (errdata *pb.ErrorData) {
err := this.modelFetter.modifyHeroFetterDataByObjId(uid, obj, data)
if err != nil {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_DBError,
Title: pb.ErrorCode_DBError.ToString(),
Message: err.Error(),
}
}
return
}
func (this *Library) GetHeroFetterList(uid string) []*pb.DBHeroFetter {
return this.modelFetter.getHeroFetterList(uid)
}
@ -194,11 +183,6 @@ func (this *Library) createHeroFetter(uid string, heroConfId string) (obj *pb.DB
return
}
func (this *Library) QueryHeroFetter(uid string) (data []*pb.DBHeroFetter) {
data = this.GetHeroFetterList(uid)
return
}
func (this *Library) QueryOneHeroFetter(uid string, cid string) *pb.DBHeroFetter {
_data := this.GetHeroFetterList(uid)
for _, v := range _data {
@ -289,14 +273,6 @@ func (this *Library) TaskFinishNotify(uid string, taskId, fetterId int32) error
return nil
}
// 获取阵营的好感度
func (this *Library) QueryFavorabilityByRace(uid string, race int32) int32 {
if rst, err := this.ModuleUser.GetUserExpand(uid); err == nil { // 统计主线进度
return rst.Race[race]
}
return 0
}
// 红点
func (this *Library) Reddot(session comm.IUserSession, rid ...comm.ReddotType) (reddot map[comm.ReddotType]*pb.ReddotItem) {
reddot = make(map[comm.ReddotType]*pb.ReddotItem)