Rtype167 Rtype165
This commit is contained in:
parent
bfc3bb8bc1
commit
57d4a3ee95
@ -2,6 +2,7 @@ package atlas
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"go_dreamfactory/comm"
|
||||||
"go_dreamfactory/lego/core"
|
"go_dreamfactory/lego/core"
|
||||||
"go_dreamfactory/lego/sys/log"
|
"go_dreamfactory/lego/sys/log"
|
||||||
"go_dreamfactory/modules"
|
"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 v, err := this.GetConfigure(pandaJx); err == nil {
|
||||||
if configure, ok := v.(*cfg.GamePandamasJx); ok {
|
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 {
|
} else {
|
||||||
err = fmt.Errorf("%T no is *cfg.GamePandamasJxData", v)
|
err = fmt.Errorf("%T no is *cfg.GamePandamasJxData", v)
|
||||||
|
@ -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) {
|
func (this *apiComp) AtlasActivate(session comm.IUserSession, req *pb.SmithyAtlasActivateReq) (code pb.ErrorCode, data *pb.ErrorData) {
|
||||||
var (
|
var (
|
||||||
addScore int32 // 更新图鉴增加的积分
|
addScore int32 // 更新图鉴增加的积分
|
||||||
|
szTask []*comm.TaskParam
|
||||||
)
|
)
|
||||||
code = this.AtlasActivateCheck(session, req)
|
code = this.AtlasActivateCheck(session, req)
|
||||||
if code != pb.ErrorCode_Success {
|
if code != pb.ErrorCode_Success {
|
||||||
@ -59,7 +60,7 @@ func (this *apiComp) AtlasActivate(session comm.IUserSession, req *pb.SmithyAtla
|
|||||||
code = pb.ErrorCode_SmithyNoFoundAtlas
|
code = pb.ErrorCode_SmithyNoFoundAtlas
|
||||||
return
|
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 {
|
} else if conf.TypeId == 2 {
|
||||||
if v, ok := atlas.Collect[req.Id]; ok {
|
if v, ok := atlas.Collect[req.Id]; ok {
|
||||||
if !v.Activate { // 激活
|
if !v.Activate { // 激活
|
||||||
@ -75,10 +76,10 @@ func (this *apiComp) AtlasActivate(session comm.IUserSession, req *pb.SmithyAtla
|
|||||||
code = pb.ErrorCode_SmithyNoFoundAtlas
|
code = pb.ErrorCode_SmithyNoFoundAtlas
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
szTask = append(szTask, comm.GettaskParam(comm.Rtype165, 1))
|
||||||
this.module.ModuleRtask.TriggerTask(session.GetUserId(), 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})
|
session.SendMsg(string(this.module.GetType()), "atlasactivate", &pb.SmithyAtlasActivateResp{Data: atlas})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user