上传代码

This commit is contained in:
liwei1dao 2023-05-30 15:07:31 +08:00
parent 543a7083a4
commit c3c266557a
2 changed files with 3 additions and 5 deletions

View File

@ -154,9 +154,7 @@ func (this *modelHoroscope) reddot(session comm.IUserSession) bool {
} }
for _, v := range horoscope.GetDataList() { for _, v := range horoscope.GetDataList() {
if lv, ok := info.Nodes[v.NodeId]; !ok && v.Lv > lv { if lv, ok := info.Nodes[v.NodeId]; !ok && v.Lv > lv {
if code = this.module.CheckRes(session, v.CostItem); code == pb.ErrorCode_Success { if code = this.module.CheckRes(session, v.CostItem); code == pb.ErrorCode_Success {
return true return true
} }

View File

@ -318,21 +318,21 @@ func (this *ModuleBase) CheckRes(session comm.IUserSession, res []*cfg.Gameatn)
case comm.ItemType: case comm.ItemType:
items[v.T] = v.N items[v.T] = v.N
default: default:
this.Errorf("not found res type") // 找不到资源类型 this.Error("not found res type", log.Field{Key: "Type", Value: v.A}) // 找不到资源类型
} }
} }
// 校验数量 // 校验数量
for k, v := range attrs { for k, v := range attrs {
if this.ModuleUser.QueryAttributeValue(session.GetUserId(), k) < int64(v) { if this.ModuleUser.QueryAttributeValue(session.GetUserId(), k) < int64(v) {
code = pb.ErrorCode_ResNoEnough code = pb.ErrorCode_ResNoEnough
this.Warn("资源不足", log.Field{Key: "uid", Value: session.GetUserId()}, log.Field{Key: "T", Value: k}, log.Field{Key: "N", Value: v}) // this.Warn("资源不足", log.Field{Key: "uid", Value: session.GetUserId()}, log.Field{Key: "T", Value: k}, log.Field{Key: "N", Value: v})
return return
} }
} }
for k, v := range items { //校验消费资源是否充足 for k, v := range items { //校验消费资源是否充足
if int32(this.ModuleItems.QueryItemAmount(session.GetUserId(), k)) < v { if int32(this.ModuleItems.QueryItemAmount(session.GetUserId(), k)) < v {
code = pb.ErrorCode_ResNoEnough code = pb.ErrorCode_ResNoEnough
this.Warn("道具不足", log.Field{Key: "uid", Value: session.GetUserId()}, log.Field{Key: "T", Value: k}, log.Field{Key: "N", Value: v}) // this.Warn("道具不足", log.Field{Key: "uid", Value: session.GetUserId()}, log.Field{Key: "T", Value: k}, log.Field{Key: "N", Value: v})
return return
} }
} }