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": [
|
"battleScenes": [
|
||||||
"bossfight_spinymandrilla_02"
|
"bossfight_spinymandrilla_02"
|
||||||
],
|
],
|
||||||
"disableAiCamera": 1,
|
"disableAiCamera": 0,
|
||||||
"ChoseCamp": [],
|
"ChoseCamp": [],
|
||||||
"DisableCamp": [],
|
"DisableCamp": [],
|
||||||
"DefaultHero": 0,
|
"DefaultHero": 0,
|
||||||
@ -425,7 +425,7 @@
|
|||||||
"battleScenes": [
|
"battleScenes": [
|
||||||
"bossfight_spinymandrilla_02"
|
"bossfight_spinymandrilla_02"
|
||||||
],
|
],
|
||||||
"disableAiCamera": 1,
|
"disableAiCamera": 0,
|
||||||
"ChoseCamp": [],
|
"ChoseCamp": [],
|
||||||
"DisableCamp": [],
|
"DisableCamp": [],
|
||||||
"DefaultHero": 0,
|
"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 {
|
if err != nil {
|
||||||
errdata = &pb.ErrorData{
|
errdata = &pb.ErrorData{
|
||||||
Code: pb.ErrorCode_ReqParameterError,
|
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 {
|
func (this *ModelRank) getHuntingRankListByBossType(uid string, bossType int32) *pb.DBHuntingRank {
|
||||||
ranks := make([]*pb.DBHuntingRank, 0)
|
ranks := make([]*pb.DBHuntingRank, 0)
|
||||||
err := this.GetList(uid, &ranks)
|
if db.IsCross() {
|
||||||
if err != nil {
|
err := this.GetList(uid, &ranks)
|
||||||
return nil
|
if err != nil {
|
||||||
}
|
return nil
|
||||||
for _, v := range ranks {
|
}
|
||||||
if v.Bosstype == bossType {
|
for _, v := range ranks {
|
||||||
return v
|
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
|
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) {
|
func (this *Hunting) CheckUserBaseHuntingInfo(uid string) (data []*pb.DBHuntingRank) {
|
||||||
list, err := this.modelHunting.getHuntingList(uid)
|
list, err := this.modelHunting.getHuntingList(uid)
|
||||||
if err != nil {
|
if err == nil {
|
||||||
for k := range list.Boss {
|
for k := range list.Boss {
|
||||||
_d := this.modulerank.getHuntingRankListByBossType(uid, k)
|
_d := this.modulerank.getHuntingRankListByBossType(uid, k)
|
||||||
if _d != nil {
|
if _d != nil {
|
||||||
|
@ -57,7 +57,13 @@ func (this *apiComp) GetRace(session comm.IUserSession, req *pb.PagodaGetRaceReq
|
|||||||
if bChange {
|
if bChange {
|
||||||
mapData := make(map[string]interface{}, 0)
|
mapData := make(map[string]interface{}, 0)
|
||||||
mapData["race"] = list.Race
|
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})
|
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(),
|
Rtime: configure.Now().Unix(),
|
||||||
Defeat: 0,
|
Defeat: 0,
|
||||||
Endtime: 0,
|
Endtime: 0,
|
||||||
Curfloor: 1,
|
Curfloor: 0,
|
||||||
}
|
}
|
||||||
//mapData := make(map[string]interface{}, 0)
|
//mapData := make(map[string]interface{}, 0)
|
||||||
//mapData["Race"] = list.Race
|
//mapData["Race"] = list.Race
|
||||||
|
@ -77,7 +77,7 @@ func (this *apiComp) ChallengeRaceOver(session comm.IUserSession, req *pb.Pagoda
|
|||||||
Rtime: configure.Now().Unix(),
|
Rtime: configure.Now().Unix(),
|
||||||
Defeat: 0,
|
Defeat: 0,
|
||||||
Endtime: 0,
|
Endtime: 0,
|
||||||
Curfloor: 1,
|
Curfloor: 0,
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
errdata = &pb.ErrorData{ // 挑战关卡数据不匹配
|
errdata = &pb.ErrorData{ // 挑战关卡数据不匹配
|
||||||
|
@ -44,7 +44,7 @@ func (this *ModelRank) getPagodaRankListByFloorid(uid string, cid int32) *pb.DBP
|
|||||||
} else {
|
} else {
|
||||||
if conn, err := db.Cross(); err == nil {
|
if conn, err := db.Cross(); err == nil {
|
||||||
dbModel := db.NewDBModel(comm.TablePagodaRecord, 0, conn)
|
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
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,7 @@ import (
|
|||||||
"go_dreamfactory/lego/core"
|
"go_dreamfactory/lego/core"
|
||||||
"go_dreamfactory/modules"
|
"go_dreamfactory/modules"
|
||||||
"go_dreamfactory/pb"
|
"go_dreamfactory/pb"
|
||||||
|
"go_dreamfactory/sys/db"
|
||||||
|
|
||||||
"go.mongodb.org/mongo-driver/mongo"
|
"go.mongodb.org/mongo-driver/mongo"
|
||||||
"go.mongodb.org/mongo-driver/x/bsonx"
|
"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 {
|
func (this *ModelRank) getVikingRankListByBossType(uid string, bossType int32) *pb.DBVikingRank {
|
||||||
ranks := make([]*pb.DBVikingRank, 0)
|
|
||||||
err := this.GetList(uid, &ranks)
|
if db.IsCross() {
|
||||||
if err != nil {
|
ranks := make([]*pb.DBVikingRank, 0)
|
||||||
return nil
|
err := this.GetList(uid, &ranks)
|
||||||
}
|
if err != nil {
|
||||||
for _, v := range ranks {
|
return nil
|
||||||
if v.Bosstype == bossType {
|
}
|
||||||
return v
|
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
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -89,7 +89,7 @@ func (this *Viking) Start() (err error) {
|
|||||||
|
|
||||||
func (this *Viking) CheckUserBaseVikingInfo(uid string) (data []*pb.DBVikingRank) {
|
func (this *Viking) CheckUserBaseVikingInfo(uid string) (data []*pb.DBVikingRank) {
|
||||||
list, err := this.modelViking.getVikingList(uid)
|
list, err := this.modelViking.getVikingList(uid)
|
||||||
if err != nil {
|
if err == nil {
|
||||||
for k := range list.Boss {
|
for k := range list.Boss {
|
||||||
_d := this.modulerank.getVikingRankListByBossType(uid, k)
|
_d := this.modulerank.getVikingRankListByBossType(uid, k)
|
||||||
if _d != nil {
|
if _d != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user