Merge branch 'dev' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev
This commit is contained in:
commit
72a3246f7e
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -48,13 +48,31 @@ func (this *ModelRank) getHuntingRankList(uid string) []*pb.DBHuntingRank {
|
||||
|
||||
func (this *ModelRank) getHuntingRankListByBossType(uid string, bossType int32) *pb.DBHuntingRank {
|
||||
ranks := make([]*pb.DBHuntingRank, 0)
|
||||
err := this.GetList(uid, &ranks)
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
for _, v := range ranks {
|
||||
if v.Bosstype == bossType {
|
||||
return v
|
||||
if db.IsCross() {
|
||||
err := this.GetList(uid, &ranks)
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
for _, v := range ranks {
|
||||
if v.Bosstype == bossType {
|
||||
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
|
||||
|
@ -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 {
|
||||
|
@ -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})
|
||||
|
@ -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
|
||||
|
@ -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{ // 挑战关卡数据不匹配
|
||||
|
@ -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
|
||||
}
|
||||
}
|
||||
|
@ -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,15 +44,35 @@ func (this *ModelRank) getVikingRankList(uid string) []*pb.DBVikingRank {
|
||||
}
|
||||
|
||||
func (this *ModelRank) getVikingRankListByBossType(uid string, bossType int32) *pb.DBVikingRank {
|
||||
ranks := make([]*pb.DBVikingRank, 0)
|
||||
err := this.GetList(uid, &ranks)
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
for _, v := range ranks {
|
||||
if v.Bosstype == bossType {
|
||||
return v
|
||||
|
||||
if db.IsCross() {
|
||||
ranks := make([]*pb.DBVikingRank, 0)
|
||||
err := this.GetList(uid, &ranks)
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
for _, v := range ranks {
|
||||
if v.Bosstype == bossType {
|
||||
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
|
||||
}
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user