Rtype167 Rtype165

This commit is contained in:
meixiongfeng 2023-05-26 15:04:02 +08:00
parent bfc3bb8bc1
commit 57d4a3ee95
2 changed files with 11 additions and 6 deletions

View File

@ -2,6 +2,7 @@ package atlas
import (
"fmt"
"go_dreamfactory/comm"
"go_dreamfactory/lego/core"
"go_dreamfactory/lego/sys/log"
"go_dreamfactory/modules"
@ -52,11 +53,14 @@ func (this *configureComp) GetConfigure(name string) (v interface{}, err error)
}
// 获取教习数据
func (this *configureComp) GetPandoJxConf(id string) (conf *cfg.GamePandamasJxData) {
func (this *configureComp) GetPandoJxConf(id string) (conf *cfg.GamePandamasJxData, err error) {
if v, err := this.GetConfigure(pandaJx); err == nil {
if configure, ok := v.(*cfg.GamePandamasJx); ok {
return configure.Get(id)
if conf = configure.Get(id); conf == nil {
err = comm.NewNotFoundConfErr("atlas", pandaJx, id)
this.module.Errorln(err)
}
}
} else {
err = fmt.Errorf("%T no is *cfg.GamePandamasJxData", v)

View File

@ -17,6 +17,7 @@ func (this *apiComp) AtlasActivateCheck(session comm.IUserSession, req *pb.Smith
func (this *apiComp) AtlasActivate(session comm.IUserSession, req *pb.SmithyAtlasActivateReq) (code pb.ErrorCode, data *pb.ErrorData) {
var (
addScore int32 // 更新图鉴增加的积分
szTask []*comm.TaskParam
)
code = this.AtlasActivateCheck(session, req)
if code != pb.ErrorCode_Success {
@ -59,7 +60,7 @@ func (this *apiComp) AtlasActivate(session comm.IUserSession, req *pb.SmithyAtla
code = pb.ErrorCode_SmithyNoFoundAtlas
return
}
this.module.ModuleRtask.TriggerTask(session.GetUserId(), comm.GettaskParam(comm.Rtype166, 1))
szTask = append(szTask, comm.GettaskParam(comm.Rtype166, 1))
} else if conf.TypeId == 2 {
if v, ok := atlas.Collect[req.Id]; ok {
if !v.Activate { // 激活
@ -75,10 +76,10 @@ func (this *apiComp) AtlasActivate(session comm.IUserSession, req *pb.SmithyAtla
code = pb.ErrorCode_SmithyNoFoundAtlas
return
}
this.module.ModuleRtask.TriggerTask(session.GetUserId(), comm.GettaskParam(comm.Rtype165, 1))
szTask = append(szTask, comm.GettaskParam(comm.Rtype165, 1))
}
this.module.ModuleRtask.TriggerTask(session.GetUserId(), comm.GettaskParam(comm.Rtype167, atlas.Score))
szTask = append(szTask, comm.GettaskParam(comm.Rtype167, atlas.Score))
this.module.ModuleRtask.TriggerTask(session.GetUserId(), szTask...)
session.SendMsg(string(this.module.GetType()), "atlasactivate", &pb.SmithyAtlasActivateResp{Data: atlas})
return
}