Merge branch 'dev' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev
This commit is contained in:
commit
2ab7af6f76
@ -47,7 +47,8 @@ func (this *PandaAtlas) OnInstallComp() {
|
||||
|
||||
func (this *PandaAtlas) CheckActivatePandaAtlasCollect(uid string, id string) {
|
||||
conf := this.configure.GetPandoAtlasConf(id)
|
||||
if conf != nil {
|
||||
if conf == nil {
|
||||
this.Errorf("GetPandoAtlasConf err:%d", id)
|
||||
return
|
||||
}
|
||||
if this.IsCross() {
|
||||
|
@ -4,7 +4,6 @@ import (
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/lego/core"
|
||||
"go_dreamfactory/lego/sys/event"
|
||||
"go_dreamfactory/lego/sys/log"
|
||||
"go_dreamfactory/modules"
|
||||
"go_dreamfactory/pb"
|
||||
cfg "go_dreamfactory/sys/configure/structs"
|
||||
@ -69,10 +68,7 @@ func (this *Equipment) OnInstallComp() {
|
||||
|
||||
//Event------------------------------------------------------------------------------------------------------------
|
||||
func (this *Equipment) EventUserOffline(uid, sessionid string) {
|
||||
if err := this.modelEquipment.BatchDelLists(uid); err != nil {
|
||||
this.Error("EventUserOffline", log.Field{Key: "uid", Value: uid}, log.Field{Key: "err", Value: err.Error()})
|
||||
}
|
||||
|
||||
this.modelEquipment.BatchDelLists(uid)
|
||||
}
|
||||
|
||||
//IEquipment-------------------------------------------------------------------------------------------------------------------------------
|
||||
|
@ -311,14 +311,14 @@ func (this *ModuleBase) CheckRes(session comm.IUserSession, res []*cfg.Gameatn)
|
||||
for k, v := range attrs {
|
||||
if this.ModuleUser.QueryAttributeValue(session.GetUserId(), k) < int64(v) {
|
||||
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
|
||||
}
|
||||
}
|
||||
for k, v := range items { //校验消费资源是否充足
|
||||
if int32(this.ModuleItems.QueryItemAmount(session.GetUserId(), k)) < v {
|
||||
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
|
||||
}
|
||||
}
|
||||
@ -350,14 +350,14 @@ func (this *ModuleBase) ConsumeRes(session comm.IUserSession, res []*cfg.Gameatn
|
||||
for k, v := range attrs {
|
||||
if this.ModuleUser.QueryAttributeValue(session.GetUserId(), k) < -int64(v) { // -v 负负得正
|
||||
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
|
||||
}
|
||||
}
|
||||
for k, v := range items {
|
||||
if int32(this.ModuleItems.QueryItemAmount(session.GetUserId(), k)) < -v {
|
||||
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
|
||||
}
|
||||
}
|
||||
|
@ -62,16 +62,16 @@ func (this *apiComp) Upgrade(session comm.IUserSession, req *pb.PracticeUpgradeR
|
||||
}
|
||||
switch pillar.Lv {
|
||||
case 2:
|
||||
this.module.atlas.CheckActivatePandaAtlasCollect(session.GetUserId(), "1002")
|
||||
this.module.atlas.CheckActivatePandaAtlasCollect(session.GetUserId(), "100002")
|
||||
break
|
||||
case 3:
|
||||
this.module.atlas.CheckActivatePandaAtlasCollect(session.GetUserId(), "1003")
|
||||
this.module.atlas.CheckActivatePandaAtlasCollect(session.GetUserId(), "100003")
|
||||
break
|
||||
case 4:
|
||||
this.module.atlas.CheckActivatePandaAtlasCollect(session.GetUserId(), "1004")
|
||||
this.module.atlas.CheckActivatePandaAtlasCollect(session.GetUserId(), "100004")
|
||||
break
|
||||
case 5:
|
||||
this.module.atlas.CheckActivatePandaAtlasCollect(session.GetUserId(), "1005")
|
||||
this.module.atlas.CheckActivatePandaAtlasCollect(session.GetUserId(), "100005")
|
||||
break
|
||||
}
|
||||
this.module.modelPandata.Change(session.GetUserId(), map[string]interface{}{
|
||||
|
@ -59,7 +59,7 @@ func (this *modelPandata) queryUserMartialhall(uid string) (result *pb.DBPractic
|
||||
this.module.Errorln(err)
|
||||
return
|
||||
}
|
||||
this.module.atlas.CheckActivatePandaAtlasCollect(uid, "1002")
|
||||
this.module.atlas.CheckActivatePandaAtlasCollect(uid, "100001")
|
||||
}
|
||||
err = nil
|
||||
return
|
||||
|
@ -142,7 +142,7 @@ func (this *Practice) AddItems(session comm.IUserSession, items map[string]int32
|
||||
this.Errorln(err)
|
||||
return
|
||||
}
|
||||
this.atlas.CheckActivatePandaAtlasCollect(session.GetUserId(), "1002")
|
||||
this.atlas.CheckActivatePandaAtlasCollect(session.GetUserId(), "100001")
|
||||
} else {
|
||||
id = make([]string, 0)
|
||||
for k, _ := range items {
|
||||
|
Loading…
Reference in New Issue
Block a user