优化
This commit is contained in:
parent
9dcaf0e2a8
commit
2005ba62d8
@ -26,39 +26,39 @@ func (this *apiComp) LatticeReward(session comm.IUserSession, req *pb.UiGameLatt
|
||||
atno []*pb.UserAtno
|
||||
)
|
||||
list, _ := this.module.modelLattice.getLatticeList(session.GetUserId(), req.Hdid)
|
||||
if conf, err := this.module.configure.GetLatticeConf(req.Id); err != nil {
|
||||
conf, err := this.module.configure.GetLatticeConf(req.Id)
|
||||
if err != nil {
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_ConfigNoFound,
|
||||
Title: pb.ErrorCode_ConfigNoFound.ToString(),
|
||||
Message: err.Error(),
|
||||
}
|
||||
return
|
||||
} else {
|
||||
if len(conf.Openward) == 0 {
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_ReqParameterError,
|
||||
Title: pb.ErrorCode_ReqParameterError.ToString(),
|
||||
}
|
||||
return
|
||||
}
|
||||
list, _ := this.module.modelLattice.getLatticeList(session.GetUserId(), req.Hdid)
|
||||
if _, ok := list.Gotarr[req.Id]; ok {
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_ActivityRepatReward,
|
||||
Title: pb.ErrorCode_ActivityRepatReward.ToString(),
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
if errdata, atno = this.module.DispenseAtno(session, conf.Chestsward, true); errdata != nil {
|
||||
return
|
||||
}
|
||||
// 记录数据
|
||||
list.Gotarr[req.Id] = 1
|
||||
update := make(map[string]interface{}, 0)
|
||||
update["gotarr"] = list.Gotarr
|
||||
this.module.modelLattice.modifyLatticeListByObjId(session.GetUserId(), update) // 修改进度
|
||||
}
|
||||
if len(conf.Openward) == 0 {
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_ReqParameterError,
|
||||
Title: pb.ErrorCode_ReqParameterError.ToString(),
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
if _, ok := list.Gotarr[req.Id]; ok {
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_ActivityRepatReward,
|
||||
Title: pb.ErrorCode_ActivityRepatReward.ToString(),
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
if errdata, atno = this.module.DispenseAtno(session, conf.Chestsward, true); errdata != nil {
|
||||
return
|
||||
}
|
||||
// 记录数据
|
||||
list.Gotarr[req.Id] = 1
|
||||
update := make(map[string]interface{}, 0)
|
||||
update["gotarr"] = list.Gotarr
|
||||
this.module.modelLattice.modifyLatticeListByObjId(session.GetUserId(), update) // 修改进度
|
||||
|
||||
session.SendMsg(string(this.module.GetType()), "latticereward", &pb.UiGameLatticeRewardResp{
|
||||
Data: list,
|
||||
|
Loading…
Reference in New Issue
Block a user