update
This commit is contained in:
parent
d41fec6475
commit
a6194027a6
@ -26,32 +26,31 @@ func (this *apiComp) LatticeFinish(session comm.IUserSession, req *pb.UiGameLatt
|
||||
atno []*pb.UserAtno
|
||||
)
|
||||
list, _ := this.module.modelLattice.getLatticeList(session.GetUserId(), req.Hdid)
|
||||
if conf, err := this.module.configure.GetLatticeConsumConf(); err != nil {
|
||||
conf, err := this.module.configure.GetLatticeConsumConf()
|
||||
if err != nil {
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_ConfigNoFound,
|
||||
Title: pb.ErrorCode_ConfigNoFound.ToString(),
|
||||
Message: err.Error(),
|
||||
}
|
||||
return
|
||||
} else {
|
||||
list, _ := this.module.modelLattice.getLatticeList(session.GetUserId(), req.Hdid)
|
||||
if list.BReward {
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_ActivityRepatReward,
|
||||
Title: pb.ErrorCode_ActivityRepatReward.ToString(),
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
if errdata, atno = this.module.DispenseAtno(session, conf.Reward, true); errdata != nil {
|
||||
return
|
||||
}
|
||||
// 记录数据
|
||||
list.BReward = true
|
||||
update := make(map[string]interface{}, 0)
|
||||
update["bReward"] = list.BReward
|
||||
this.module.modelLattice.modifyLatticeListByObjId(session.GetUserId(), update) // 修改进度
|
||||
}
|
||||
if list.BReward {
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_ActivityRepatReward,
|
||||
Title: pb.ErrorCode_ActivityRepatReward.ToString(),
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
if errdata, atno = this.module.DispenseAtno(session, conf.Reward, true); errdata != nil {
|
||||
return
|
||||
}
|
||||
// 记录数据
|
||||
list.BReward = true
|
||||
update := make(map[string]interface{}, 0)
|
||||
update["bReward"] = list.BReward
|
||||
this.module.modelLattice.modifyLatticeListByObjId(session.GetUserId(), update) // 修改进度
|
||||
|
||||
session.SendMsg(string(this.module.GetType()), "latticefinish", &pb.UiGameLatticeFinishResp{
|
||||
Data: list,
|
||||
|
@ -21,29 +21,29 @@ func (this *apiComp) PuzzleReward(session comm.IUserSession, req *pb.UiGamePuzzl
|
||||
atno []*pb.UserAtno
|
||||
)
|
||||
list, _ := this.module.modelPuzzle.getPuzzleList(session.GetUserId(), req.Hdid)
|
||||
if conf, err := this.module.configure.GetPuzzleConf(req.PuzzleId); err != nil {
|
||||
conf, err := this.module.configure.GetPuzzleConf(req.PuzzleId)
|
||||
if err != nil {
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_ConfigNoFound,
|
||||
Title: pb.ErrorCode_ConfigNoFound.ToString(),
|
||||
Message: err.Error(),
|
||||
}
|
||||
return
|
||||
} else {
|
||||
list, _ := this.module.modelPuzzle.getPuzzleList(session.GetUserId(), req.Hdid)
|
||||
if _, ok := list.Gotarr[req.PuzzleId]; ok {
|
||||
return
|
||||
}
|
||||
|
||||
if errdata, atno = this.module.DispenseAtno(session, conf.Puzzleward, true); errdata != nil {
|
||||
return
|
||||
}
|
||||
// 记录数据
|
||||
list.Gotarr[req.PuzzleId] = 1
|
||||
update := make(map[string]interface{}, 0)
|
||||
update["gotarr"] = list.Gotarr
|
||||
this.module.modelPuzzle.modifyPuzzleListByObjId(session.GetUserId(), update) // 修改进度
|
||||
}
|
||||
|
||||
if _, ok := list.Gotarr[req.PuzzleId]; ok {
|
||||
return
|
||||
}
|
||||
|
||||
if errdata, atno = this.module.DispenseAtno(session, conf.Puzzleward, true); errdata != nil {
|
||||
return
|
||||
}
|
||||
// 记录数据
|
||||
list.Gotarr[req.PuzzleId] = 1
|
||||
update := make(map[string]interface{}, 0)
|
||||
update["gotarr"] = list.Gotarr
|
||||
this.module.modelPuzzle.modifyPuzzleListByObjId(session.GetUserId(), update) // 修改进度
|
||||
|
||||
session.SendMsg(string(this.module.GetType()), "puzzlereward", &pb.UiGamePuzzleRewardResp{
|
||||
Data: list,
|
||||
Atno: atno,
|
||||
|
Loading…
Reference in New Issue
Block a user