reputation errdata
This commit is contained in:
parent
06b5855745
commit
125f4b30f7
@ -17,7 +17,10 @@ func (this *apiComp) Getattrs(session comm.IUserSession, req *pb.ReputationTalen
|
|||||||
|
|
||||||
reputation := this.module.modelReputation.getDBReputation(uid)
|
reputation := this.module.modelReputation.getDBReputation(uid)
|
||||||
if reputation == nil {
|
if reputation == nil {
|
||||||
code = pb.ErrorCode_DataNotFound
|
errdata = &pb.ErrorData{
|
||||||
|
Code: pb.ErrorCode_DataNotFound,
|
||||||
|
Title: pb.ErrorCode_DataNotFound.ToString(),
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,7 +19,10 @@ func (this *apiComp) Reset(session comm.IUserSession, req *pb.ReputationTalentre
|
|||||||
uid := session.GetUserId()
|
uid := session.GetUserId()
|
||||||
reputation := this.module.modelReputation.getDBReputation(uid)
|
reputation := this.module.modelReputation.getDBReputation(uid)
|
||||||
if reputation == nil {
|
if reputation == nil {
|
||||||
code = pb.ErrorCode_DataNotFound
|
errdata = &pb.ErrorData{
|
||||||
|
Code: pb.ErrorCode_DataNotFound,
|
||||||
|
Title: pb.ErrorCode_DataNotFound.ToString(),
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,7 +17,10 @@ func (this *apiComp) Upgrade(session comm.IUserSession, req *pb.ReputationUpgrad
|
|||||||
|
|
||||||
reputation := this.module.modelReputation.getDBReputation(uid)
|
reputation := this.module.modelReputation.getDBReputation(uid)
|
||||||
if reputation == nil {
|
if reputation == nil {
|
||||||
code = pb.ErrorCode_DataNotFound
|
errdata = &pb.ErrorData{
|
||||||
|
Code: pb.ErrorCode_DataNotFound,
|
||||||
|
Title: pb.ErrorCode_DataNotFound.ToString(),
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -43,7 +46,6 @@ func (this *apiComp) Upgrade(session comm.IUserSession, req *pb.ReputationUpgrad
|
|||||||
errdata = &pb.ErrorData{
|
errdata = &pb.ErrorData{
|
||||||
Code: pb.ErrorCode_ConfigNoFound,
|
Code: pb.ErrorCode_ConfigNoFound,
|
||||||
Title: pb.ErrorCode_ConfigNoFound.ToString(),
|
Title: pb.ErrorCode_ConfigNoFound.ToString(),
|
||||||
Message: err.Error(),
|
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -55,7 +57,7 @@ func (this *apiComp) Upgrade(session comm.IUserSession, req *pb.ReputationUpgrad
|
|||||||
if camp != nil {
|
if camp != nil {
|
||||||
if len(camp.Nodes) == 0 {
|
if len(camp.Nodes) == 0 {
|
||||||
//消耗
|
//消耗
|
||||||
if c := this.module.ConsumeRes(session, talentCfg.IconCos, true); c == pb.ErrorCode_Success {
|
if c := this.module.ConsumeRes(session, talentCfg.IconCos, true); c == nil {
|
||||||
camp.Nodes = append(camp.Nodes, &pb.TalentNode{
|
camp.Nodes = append(camp.Nodes, &pb.TalentNode{
|
||||||
Nid: req.NodeId,
|
Nid: req.NodeId,
|
||||||
Lv: 1,
|
Lv: 1,
|
||||||
@ -67,15 +69,21 @@ func (this *apiComp) Upgrade(session comm.IUserSession, req *pb.ReputationUpgrad
|
|||||||
for _, v := range camp.Nodes {
|
for _, v := range camp.Nodes {
|
||||||
//判断是否满级
|
//判断是否满级
|
||||||
if req.NodeId == v.Nid && v.Status == 2 {
|
if req.NodeId == v.Nid && v.Status == 2 {
|
||||||
code = pb.ErrorCode_ReputationTalentFull
|
errdata = &pb.ErrorData{
|
||||||
|
Code: pb.ErrorCode_ReputationTalentFull,
|
||||||
|
Title: pb.ErrorCode_ReputationTalentFull.ToString(),
|
||||||
|
}
|
||||||
return
|
return
|
||||||
} else if req.NodeId == v.Nid {
|
} else if req.NodeId == v.Nid {
|
||||||
if !this.module.modelReputation.isReachPreNode(reputation, req.RaceType, talentCfg.PreNode, talentCfg.PreNodeLv) {
|
if !this.module.modelReputation.isReachPreNode(reputation, req.RaceType, talentCfg.PreNode, talentCfg.PreNodeLv) {
|
||||||
code = pb.ErrorCode_ReputationNoPreNodeLv
|
errdata = &pb.ErrorData{
|
||||||
|
Code: pb.ErrorCode_ReputationNoPreNodeLv,
|
||||||
|
Title: pb.ErrorCode_ReputationNoPreNodeLv.ToString(),
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
//消耗
|
//消耗
|
||||||
if c := this.module.ConsumeRes(session, talentCfg.IconCos, true); c == pb.ErrorCode_Success {
|
if c := this.module.ConsumeRes(session, talentCfg.IconCos, true); c == nil {
|
||||||
|
|
||||||
v.Lv++
|
v.Lv++
|
||||||
camp.CampAttr = this.module.modelReputation.computeAttr(camp.CampAttr, talentCfg.Attribute)
|
camp.CampAttr = this.module.modelReputation.computeAttr(camp.CampAttr, talentCfg.Attribute)
|
||||||
|
Loading…
Reference in New Issue
Block a user