This commit is contained in:
wh_zcy 2023-03-30 16:20:13 +08:00
commit 2ab7af6f76
6 changed files with 13 additions and 16 deletions

View File

@ -47,7 +47,8 @@ func (this *PandaAtlas) OnInstallComp() {
func (this *PandaAtlas) CheckActivatePandaAtlasCollect(uid string, id string) { func (this *PandaAtlas) CheckActivatePandaAtlasCollect(uid string, id string) {
conf := this.configure.GetPandoAtlasConf(id) conf := this.configure.GetPandoAtlasConf(id)
if conf != nil { if conf == nil {
this.Errorf("GetPandoAtlasConf err:%d", id)
return return
} }
if this.IsCross() { if this.IsCross() {

View File

@ -4,7 +4,6 @@ import (
"go_dreamfactory/comm" "go_dreamfactory/comm"
"go_dreamfactory/lego/core" "go_dreamfactory/lego/core"
"go_dreamfactory/lego/sys/event" "go_dreamfactory/lego/sys/event"
"go_dreamfactory/lego/sys/log"
"go_dreamfactory/modules" "go_dreamfactory/modules"
"go_dreamfactory/pb" "go_dreamfactory/pb"
cfg "go_dreamfactory/sys/configure/structs" cfg "go_dreamfactory/sys/configure/structs"
@ -69,10 +68,7 @@ func (this *Equipment) OnInstallComp() {
//Event------------------------------------------------------------------------------------------------------------ //Event------------------------------------------------------------------------------------------------------------
func (this *Equipment) EventUserOffline(uid, sessionid string) { func (this *Equipment) EventUserOffline(uid, sessionid string) {
if err := this.modelEquipment.BatchDelLists(uid); err != nil { this.modelEquipment.BatchDelLists(uid)
this.Error("EventUserOffline", log.Field{Key: "uid", Value: uid}, log.Field{Key: "err", Value: err.Error()})
}
} }
//IEquipment------------------------------------------------------------------------------------------------------------------------------- //IEquipment-------------------------------------------------------------------------------------------------------------------------------

View File

@ -311,14 +311,14 @@ func (this *ModuleBase) CheckRes(session comm.IUserSession, res []*cfg.Gameatn)
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.Warnf("资源不足", 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.Warnf("道具不足", 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
} }
} }
@ -350,14 +350,14 @@ func (this *ModuleBase) ConsumeRes(session comm.IUserSession, res []*cfg.Gameatn
for k, v := range attrs { for k, v := range attrs {
if this.ModuleUser.QueryAttributeValue(session.GetUserId(), k) < -int64(v) { // -v 负负得正 if this.ModuleUser.QueryAttributeValue(session.GetUserId(), k) < -int64(v) { // -v 负负得正
code = pb.ErrorCode_ResNoEnough code = pb.ErrorCode_ResNoEnough
this.Warnf("资源不足", 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.Warnf("道具不足", 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
} }
} }

View File

@ -62,16 +62,16 @@ func (this *apiComp) Upgrade(session comm.IUserSession, req *pb.PracticeUpgradeR
} }
switch pillar.Lv { switch pillar.Lv {
case 2: case 2:
this.module.atlas.CheckActivatePandaAtlasCollect(session.GetUserId(), "1002") this.module.atlas.CheckActivatePandaAtlasCollect(session.GetUserId(), "100002")
break break
case 3: case 3:
this.module.atlas.CheckActivatePandaAtlasCollect(session.GetUserId(), "1003") this.module.atlas.CheckActivatePandaAtlasCollect(session.GetUserId(), "100003")
break break
case 4: case 4:
this.module.atlas.CheckActivatePandaAtlasCollect(session.GetUserId(), "1004") this.module.atlas.CheckActivatePandaAtlasCollect(session.GetUserId(), "100004")
break break
case 5: case 5:
this.module.atlas.CheckActivatePandaAtlasCollect(session.GetUserId(), "1005") this.module.atlas.CheckActivatePandaAtlasCollect(session.GetUserId(), "100005")
break break
} }
this.module.modelPandata.Change(session.GetUserId(), map[string]interface{}{ this.module.modelPandata.Change(session.GetUserId(), map[string]interface{}{

View File

@ -59,7 +59,7 @@ func (this *modelPandata) queryUserMartialhall(uid string) (result *pb.DBPractic
this.module.Errorln(err) this.module.Errorln(err)
return return
} }
this.module.atlas.CheckActivatePandaAtlasCollect(uid, "1002") this.module.atlas.CheckActivatePandaAtlasCollect(uid, "100001")
} }
err = nil err = nil
return return

View File

@ -142,7 +142,7 @@ func (this *Practice) AddItems(session comm.IUserSession, items map[string]int32
this.Errorln(err) this.Errorln(err)
return return
} }
this.atlas.CheckActivatePandaAtlasCollect(session.GetUserId(), "1002") this.atlas.CheckActivatePandaAtlasCollect(session.GetUserId(), "100001")
} else { } else {
id = make([]string, 0) id = make([]string, 0)
for k, _ := range items { for k, _ := range items {