Merge branch 'bs_2.0.6.28' of http://git.legu.cc/liwei_3d/go_dreamfactory into bs_2.0.6.28

This commit is contained in:
liwei 2023-07-17 14:42:59 +08:00
commit eeadeb379b
6 changed files with 56 additions and 19 deletions

View File

@ -204,10 +204,11 @@ func (this *ModelHero) resetJuexingProperty(hero *pb.DBHero) {
continue
}
key := awakenData.Phasebonus[0]
value, err := strconv.Atoi(awakenData.Phasebonus[1])
_, err := strconv.Atoi(awakenData.Phasebonus[0]) // 950
if err != nil {
continue
}
value, _ := strconv.Atoi(awakenData.Phasebonus[1])
switch key {
case comm.Hp:
hero.JuexProperty[comm.Hp] += int32(value)

View File

@ -48,6 +48,7 @@ func (this *ModelRank) getHuntingRankList(uid string) []*pb.DBHuntingRank {
func (this *ModelRank) getHuntingRankListByBossType(uid string, bossType int32) *pb.DBHuntingRank {
ranks := make([]*pb.DBHuntingRank, 0)
if db.IsCross() {
err := this.GetList(uid, &ranks)
if err != nil {
return nil
@ -57,6 +58,23 @@ func (this *ModelRank) getHuntingRankListByBossType(uid string, bossType int32)
return v
}
}
} else {
conn, err := db.Cross()
if err != nil {
return nil
}
model := db.NewDBModel(comm.TableHuntingRank, 0, conn)
err = model.GetList(uid, &ranks)
if err != nil {
return nil
}
for _, v := range ranks {
if v.Bosstype == bossType {
return v
}
}
}
return nil
}

View File

@ -74,7 +74,7 @@ func (this *Hunting) ModifyHuntingData(uid string, data map[string]interface{})
func (this *Hunting) CheckUserBaseHuntingInfo(uid string) (data []*pb.DBHuntingRank) {
list, err := this.modelHunting.getHuntingList(uid)
if err != nil {
if err == nil {
for k := range list.Boss {
_d := this.modulerank.getHuntingRankListByBossType(uid, k)
if _d != nil {

View File

@ -44,7 +44,7 @@ func (this *ModelRank) getPagodaRankListByFloorid(uid string, cid int32) *pb.DBP
} else {
if conn, err := db.Cross(); err == nil {
dbModel := db.NewDBModel(comm.TablePagodaRecord, 0, conn)
if err = dbModel.GetList(uid, &pagodaRank); err == nil {
if err = dbModel.GetList(uid, &pagodaRank); err != nil {
return nil
}
}

View File

@ -47,6 +47,7 @@ func (this *ModelRank) getVikingRankList(uid string) []*pb.DBVikingRank {
}
func (this *ModelRank) getVikingRankListByBossType(uid string, bossType int32) *pb.DBVikingRank {
if db.IsCross() {
ranks := make([]*pb.DBVikingRank, 0)
err := this.GetList(uid, &ranks)
if err != nil {
@ -57,6 +58,23 @@ func (this *ModelRank) getVikingRankListByBossType(uid string, bossType int32) *
return v
}
}
} else {
conn, err := db.Cross()
if err != nil {
return nil
}
model := db.NewDBModel(comm.TableVikingRank, 0, conn)
ranks := make([]*pb.DBVikingRank, 0)
err = model.GetList(uid, &ranks)
if err != nil {
return nil
}
for _, v := range ranks {
if v.Bosstype == bossType {
return v
}
}
}
return nil
}

View File

@ -77,7 +77,7 @@ func (this *Viking) Start() (err error) {
func (this *Viking) CheckUserBaseVikingInfo(uid string) (data []*pb.DBVikingRank) {
list, err := this.modelViking.getVikingList(uid)
if err != nil {
if err == nil {
for k := range list.Boss {
_d := this.modulerank.getVikingRankListByBossType(uid, k)
if _d != nil {