This commit is contained in:
liwei 2023-07-13 10:02:13 +08:00
commit 72a3246f7e
10 changed files with 69 additions and 24 deletions

View File

@ -387,7 +387,7 @@
"battleScenes": [
"bossfight_spinymandrilla_02"
],
"disableAiCamera": 1,
"disableAiCamera": 0,
"ChoseCamp": [],
"DisableCamp": [],
"DefaultHero": 0,
@ -425,7 +425,7 @@
"battleScenes": [
"bossfight_spinymandrilla_02"
],
"disableAiCamera": 1,
"disableAiCamera": 0,
"ChoseCamp": [],
"DisableCamp": [],
"DefaultHero": 0,

View File

@ -52,7 +52,7 @@ func (this *apiComp) DrawCard(session comm.IUserSession, req *pb.HeroDrawCardReq
}
// 准备数据
/////////////////////////////////////
drawConf, err = this.module.configure.GetHeroDrawConfigByType(req.DrawType) // 获取新的抽卡配置
drawConf, err = this.module.configure.GetHeroDrawConfigByType(req.DrawType + comm.DrawCardType0) // 获取新的抽卡配置
if err != nil {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_ReqParameterError,

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

@ -57,7 +57,13 @@ func (this *apiComp) GetRace(session comm.IUserSession, req *pb.PagodaGetRaceReq
if bChange {
mapData := make(map[string]interface{}, 0)
mapData["race"] = list.Race
errdata = this.module.ModifyPagodaData(session.GetUserId(), mapData)
if err = this.module.modelRacePagoda.ModifyPagodaRaceDataByObjId(session.GetUserId(), mapData); err != nil {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_DBError,
Title: pb.ErrorCode_DBError.ToString(),
Message: err.Error(),
}
}
}
session.SendMsg(string(this.module.GetType()), PagodaGetRaceResp, &pb.PagodaGetRaceResp{Race: list.Race})

View File

@ -74,7 +74,7 @@ func (this *apiComp) ChallengeRace(session comm.IUserSession, req *pb.PagodaChal
Rtime: configure.Now().Unix(),
Defeat: 0,
Endtime: 0,
Curfloor: 1,
Curfloor: 0,
}
//mapData := make(map[string]interface{}, 0)
//mapData["Race"] = list.Race

View File

@ -77,7 +77,7 @@ func (this *apiComp) ChallengeRaceOver(session comm.IUserSession, req *pb.Pagoda
Rtime: configure.Now().Unix(),
Defeat: 0,
Endtime: 0,
Curfloor: 1,
Curfloor: 0,
}
} else {
errdata = &pb.ErrorData{ // 挑战关卡数据不匹配

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

@ -5,6 +5,7 @@ import (
"go_dreamfactory/lego/core"
"go_dreamfactory/modules"
"go_dreamfactory/pb"
"go_dreamfactory/sys/db"
"go.mongodb.org/mongo-driver/mongo"
"go.mongodb.org/mongo-driver/x/bsonx"
@ -43,6 +44,8 @@ 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 {
@ -53,5 +56,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

@ -89,7 +89,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 {