副本支持动态配置
This commit is contained in:
parent
a99dfb6bc9
commit
beceeea318
@ -52,7 +52,7 @@ func (this *apiComp) AtlasActivate(session comm.IUserSession, req *pb.SmithyAtla
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
update := make(map[string]interface{}, 0)
|
update := make(map[string]interface{}, 0)
|
||||||
update["atlas"] = v
|
update["atlas"] = atlas.Atlas
|
||||||
atlas.Score += addScore
|
atlas.Score += addScore
|
||||||
update["score"] = atlas.Score
|
update["score"] = atlas.Score
|
||||||
this.module.modelAtlas.modifySmithyAtlasList(session.GetUserId(), update)
|
this.module.modelAtlas.modifySmithyAtlasList(session.GetUserId(), update)
|
||||||
|
@ -51,11 +51,15 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.VikingChalleng
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
value, ok := viking.Boss[req.BossId]
|
if req.Difficulty == 1 && viking.Boss[req.BossId] == 0 { // 当前难度第一次打
|
||||||
if !ok { // 类型校验
|
|
||||||
viking.Boss[req.BossId] = 1
|
viking.Boss[req.BossId] = 1
|
||||||
}
|
}
|
||||||
if value < req.Difficulty {
|
if value, ok := viking.Boss[req.BossId]; ok { // 类型校验
|
||||||
|
if value < req.Difficulty {
|
||||||
|
code = pb.ErrorCode_HuntingLvErr
|
||||||
|
return
|
||||||
|
}
|
||||||
|
} else {
|
||||||
code = pb.ErrorCode_HuntingLvErr
|
code = pb.ErrorCode_HuntingLvErr
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -56,11 +56,16 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.VikingChal
|
|||||||
// if code = this.module.CheckRes(session, []*cfg.Gameatn{costRes}); code != pb.ErrorCode_Success {
|
// if code = this.module.CheckRes(session, []*cfg.Gameatn{costRes}); code != pb.ErrorCode_Success {
|
||||||
// return
|
// return
|
||||||
// }
|
// }
|
||||||
value, ok := viking.Boss[req.BossId]
|
if req.Difficulty == 1 && viking.Boss[req.BossId] == 0 {
|
||||||
if !ok { // 类型校验
|
|
||||||
viking.Boss[req.BossId] = 1
|
viking.Boss[req.BossId] = 1
|
||||||
}
|
}
|
||||||
if value < req.Difficulty {
|
|
||||||
|
if value, ok := viking.Boss[req.BossId]; ok { // 类型校验
|
||||||
|
if value < req.Difficulty {
|
||||||
|
code = pb.ErrorCode_HuntingLvErr
|
||||||
|
return
|
||||||
|
}
|
||||||
|
} else {
|
||||||
code = pb.ErrorCode_HuntingLvErr
|
code = pb.ErrorCode_HuntingLvErr
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,6 @@ import (
|
|||||||
"go_dreamfactory/comm"
|
"go_dreamfactory/comm"
|
||||||
"go_dreamfactory/lego/sys/mgo"
|
"go_dreamfactory/lego/sys/mgo"
|
||||||
"go_dreamfactory/pb"
|
"go_dreamfactory/pb"
|
||||||
"strconv"
|
|
||||||
|
|
||||||
"go.mongodb.org/mongo-driver/bson/primitive"
|
"go.mongodb.org/mongo-driver/bson/primitive"
|
||||||
"google.golang.org/protobuf/proto"
|
"google.golang.org/protobuf/proto"
|
||||||
@ -33,12 +32,6 @@ func (this *apiComp) GetList(session comm.IUserSession, req *pb.VikingGetListReq
|
|||||||
Boss: make(map[int32]int32),
|
Boss: make(map[int32]int32),
|
||||||
BossTime: make(map[string]int32),
|
BossTime: make(map[string]int32),
|
||||||
}
|
}
|
||||||
_cfg := this.module.configure.GetVikingBossTypeConfigData()
|
|
||||||
for k := range _cfg {
|
|
||||||
list.Boss[k] = 1
|
|
||||||
str := strconv.Itoa(int(k)) + "_1"
|
|
||||||
list.BossTime[str] = 0
|
|
||||||
}
|
|
||||||
|
|
||||||
this.module.modelViking.Add(session.GetUserId(), list)
|
this.module.modelViking.Add(session.GetUserId(), list)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user