代码整理
This commit is contained in:
parent
e6a56d5563
commit
f578c50043
@ -804,11 +804,11 @@ func (this *modelBattleComp) createMasterRoles(comp, wheel int, fid int32) (capt
|
|||||||
captain = int32(i)
|
captain = int32(i)
|
||||||
}
|
}
|
||||||
// if monst, err := this.module.configure.GetMonster(v.Monster); err != nil {
|
// if monst, err := this.module.configure.GetMonster(v.Monster); err != nil {
|
||||||
errdata = &pb.ErrorData{
|
// errdata = &pb.ErrorData{
|
||||||
Code: pb.ErrorCode_ConfigNoFound,
|
// Code: pb.ErrorCode_ConfigNoFound,
|
||||||
Title: pb.ErrorCode_ConfigNoFound.ToString(),
|
// Title: pb.ErrorCode_ConfigNoFound.ToString(),
|
||||||
Message: err.Error(),
|
// Message: err.Error(),
|
||||||
}
|
// }
|
||||||
// } else {
|
// } else {
|
||||||
hero := &pb.DBHero{}
|
hero := &pb.DBHero{}
|
||||||
if hero = this.module.ModuleHero.CreateMonster(fmt.Sprintf("%d", v.Heroid), v.Star, v.Lv); hero == nil {
|
if hero = this.module.ModuleHero.CreateMonster(fmt.Sprintf("%d", v.Heroid), v.Star, v.Lv); hero == nil {
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
package mline
|
package mline
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
"go_dreamfactory/comm"
|
"go_dreamfactory/comm"
|
||||||
"go_dreamfactory/pb"
|
"go_dreamfactory/pb"
|
||||||
cfg "go_dreamfactory/sys/configure/structs"
|
cfg "go_dreamfactory/sys/configure/structs"
|
||||||
@ -26,17 +25,19 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.MlineChallenge
|
|||||||
curChapter *pb.DBMline // 当前章节信息
|
curChapter *pb.DBMline // 当前章节信息
|
||||||
ps int32 // 消耗的体力
|
ps int32 // 消耗的体力
|
||||||
psAnt *cfg.Gameatn
|
psAnt *cfg.Gameatn
|
||||||
stageConf *cfg.GameMainStageData
|
stageConf *cfg.GameMainStageData // 当前章节数据
|
||||||
|
preStageConf *cfg.GameMainStageData // 上一章节数据
|
||||||
|
err error
|
||||||
)
|
)
|
||||||
|
|
||||||
if errdata = this.ChallengeCheck(session, req); errdata != nil {
|
if errdata = this.ChallengeCheck(session, req); errdata != nil {
|
||||||
return // 参数校验失败直接返回
|
return // 参数校验失败直接返回
|
||||||
}
|
}
|
||||||
if stageConf = this.module.configure.GetMainStageConf(req.StageId); stageConf == nil { // 配置文件校验
|
if stageConf, err = this.module.configure.GetMainStageConf(req.StageId); err != nil { // 配置文件校验
|
||||||
errdata = &pb.ErrorData{
|
errdata = &pb.ErrorData{
|
||||||
Code: pb.ErrorCode_MainlineNotFindChapter,
|
Code: pb.ErrorCode_MainlineNotFindChapter,
|
||||||
Title: pb.ErrorCode_MainlineNotFindChapter.ToString(),
|
Title: pb.ErrorCode_MainlineNotFindChapter.ToString(),
|
||||||
Message: fmt.Sprintf("GetMainStageConf 配置没有找到:%d", req.StageId),
|
Message: err.Error(),
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -50,13 +51,13 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.MlineChallenge
|
|||||||
}
|
}
|
||||||
if curChapter == nil { // 校验是不是新的数据
|
if curChapter == nil { // 校验是不是新的数据
|
||||||
//preStage := this.module.configure.GetMainStageConf(stageConf.Previoustage) // 新章节数据校验
|
//preStage := this.module.configure.GetMainStageConf(stageConf.Previoustage) // 新章节数据校验
|
||||||
preStageConf := this.module.configure.GetMainStageConf(stageConf.Previoustage)
|
preStageConf, err = this.module.configure.GetMainStageConf(stageConf.Previoustage)
|
||||||
if preStageConf == nil { // 配置文件校验
|
if err != nil { // 配置文件校验
|
||||||
|
|
||||||
errdata = &pb.ErrorData{
|
errdata = &pb.ErrorData{
|
||||||
Code: pb.ErrorCode_MainlineNotFindChapter,
|
Code: pb.ErrorCode_MainlineNotFindChapter,
|
||||||
Title: pb.ErrorCode_MainlineNotFindChapter.ToString(),
|
Title: pb.ErrorCode_MainlineNotFindChapter.ToString(),
|
||||||
Message: fmt.Sprintf("GetMainStageConf 配置没有找到:%d", stageConf.Previoustage),
|
Message: err.Error(),
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -32,16 +32,18 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.MlineChall
|
|||||||
rsp *pb.MlineChallengeOverResp
|
rsp *pb.MlineChallengeOverResp
|
||||||
star int32 // 评星
|
star int32 // 评星
|
||||||
tasks []*pb.BuriedParam = make([]*pb.BuriedParam, 0)
|
tasks []*pb.BuriedParam = make([]*pb.BuriedParam, 0)
|
||||||
|
err error
|
||||||
)
|
)
|
||||||
rsp = &pb.MlineChallengeOverResp{}
|
rsp = &pb.MlineChallengeOverResp{}
|
||||||
update = make(map[string]interface{})
|
update = make(map[string]interface{})
|
||||||
if errdata = this.ChallengeOverCheck(session, req); errdata != nil {
|
if errdata = this.ChallengeOverCheck(session, req); errdata != nil {
|
||||||
return // 参数校验失败直接返回
|
return // 参数校验失败直接返回
|
||||||
}
|
}
|
||||||
if stageConf = this.module.configure.GetMainStageConf(req.StageId); stageConf == nil { // 配置文件校验
|
if stageConf, err = this.module.configure.GetMainStageConf(req.StageId); err != nil { // 配置文件校验
|
||||||
errdata = &pb.ErrorData{
|
errdata = &pb.ErrorData{
|
||||||
Code: pb.ErrorCode_MainlineNotFindChapter,
|
Code: pb.ErrorCode_MainlineNotFindChapter,
|
||||||
Title: pb.ErrorCode_MainlineNotFindChapter.ToString(),
|
Title: pb.ErrorCode_MainlineNotFindChapter.ToString(),
|
||||||
|
Message: err.Error(),
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -23,15 +23,17 @@ func (this *apiComp) CleanStage(session comm.IUserSession, req *pb.MlineCleanSta
|
|||||||
curChapter *pb.DBMline // 当前章节信息
|
curChapter *pb.DBMline // 当前章节信息
|
||||||
stageConf *cfg.GameMainStageData
|
stageConf *cfg.GameMainStageData
|
||||||
rsp *pb.MlineCleanStageResp
|
rsp *pb.MlineCleanStageResp
|
||||||
|
err error
|
||||||
)
|
)
|
||||||
rsp = &pb.MlineCleanStageResp{}
|
rsp = &pb.MlineCleanStageResp{}
|
||||||
if errdata = this.CleanStageCheck(session, req); errdata != nil {
|
if errdata = this.CleanStageCheck(session, req); errdata != nil {
|
||||||
return // 参数校验失败直接返回
|
return // 参数校验失败直接返回
|
||||||
}
|
}
|
||||||
if stageConf = this.module.configure.GetMainStageConf(req.StageId); stageConf == nil { // 配置文件校验
|
if stageConf, err = this.module.configure.GetMainStageConf(req.StageId); err != nil { // 配置文件校验
|
||||||
errdata = &pb.ErrorData{
|
errdata = &pb.ErrorData{
|
||||||
Code: pb.ErrorCode_MainlineNotFindChapter,
|
Code: pb.ErrorCode_MainlineNotFindChapter,
|
||||||
Title: pb.ErrorCode_MainlineNotFindChapter.ToString(),
|
Title: pb.ErrorCode_MainlineNotFindChapter.ToString(),
|
||||||
|
Message: err.Error(),
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -8,6 +8,7 @@ import (
|
|||||||
cfg "go_dreamfactory/sys/configure/structs"
|
cfg "go_dreamfactory/sys/configure/structs"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const moduleName = "mline"
|
||||||
const (
|
const (
|
||||||
game_mainchapter = "game_mainchapter.json"
|
game_mainchapter = "game_mainchapter.json"
|
||||||
game_mainstage = "game_mainstage.json"
|
game_mainstage = "game_mainstage.json"
|
||||||
@ -62,13 +63,19 @@ func (this *configureComp) GetMainStarRewardConf(boxId int32) (data []*cfg.GameM
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *configureComp) GetMainStageConf(id int32) (data *cfg.GameMainStageData) {
|
func (this *configureComp) GetMainStageConf(id int32) (data *cfg.GameMainStageData, err error) {
|
||||||
if v, err := this.GetConfigure(game_mainstage); err == nil {
|
var (
|
||||||
|
v interface{}
|
||||||
|
)
|
||||||
|
if v, err = this.GetConfigure(game_mainstage); err == nil {
|
||||||
if configure, ok := v.(*cfg.GameMainStage); ok {
|
if configure, ok := v.(*cfg.GameMainStage); ok {
|
||||||
return configure.Get(id)
|
data = configure.Get(id)
|
||||||
|
if data != nil {
|
||||||
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.module.Errorf("GameMainStageData conf not found key :%d", id)
|
}
|
||||||
|
err = comm.NewNotFoundConfErr(moduleName, game_mainstage, id)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -86,6 +93,7 @@ func (this *configureComp) GetPreMainChapter(stageId int32) (preStageID int32) {
|
|||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *configureComp) GetFirstChapterIDByType(iType int32) (conf *cfg.GameMainChapterData, err error) {
|
func (this *configureComp) GetFirstChapterIDByType(iType int32) (conf *cfg.GameMainChapterData, err error) {
|
||||||
var (
|
var (
|
||||||
v interface{}
|
v interface{}
|
||||||
@ -99,7 +107,7 @@ func (this *configureComp) GetFirstChapterIDByType(iType int32) (conf *cfg.GameM
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
err = comm.NewNotFoundConfErr("mline", game_mainchapter, iType)
|
err = comm.NewNotFoundConfErr(moduleName, game_mainchapter, iType)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -136,7 +144,6 @@ func (this *configureComp) GetAllStageByChapterID(chapterID int32) (stage []int3
|
|||||||
if v1.Episodetype == 1 {
|
if v1.Episodetype == 1 {
|
||||||
stage = append(stage, v1.Id)
|
stage = append(stage, v1.Id)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -90,8 +90,13 @@ func (this *Mline) CheckPoint(uid string) bool {
|
|||||||
// 参数 难度 + 章节id
|
// 参数 难度 + 章节id
|
||||||
func (this *Mline) ModifyMlineDataByNanduID(session comm.IUserSession, id int32) (errdata *pb.ErrorData) {
|
func (this *Mline) ModifyMlineDataByNanduID(session comm.IUserSession, id int32) (errdata *pb.ErrorData) {
|
||||||
var del []string
|
var del []string
|
||||||
connf := this.configure.GetMainStageConf(id)
|
connf, err := this.configure.GetMainStageConf(id)
|
||||||
if connf == nil {
|
if err != nil {
|
||||||
|
errdata = &pb.ErrorData{
|
||||||
|
Code: pb.ErrorCode_ReqParameterError,
|
||||||
|
Title: pb.ErrorCode_ReqParameterError.ToString(),
|
||||||
|
Message: err.Error(),
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
list, err := this.modelMline.getMainlineList(session.GetUserId())
|
list, err := this.modelMline.getMainlineList(session.GetUserId())
|
||||||
@ -170,8 +175,8 @@ func (this *Mline) GetUserMlineData(uid string, chapterType int32) (chapterId in
|
|||||||
|
|
||||||
func (this *Mline) CheckCommpleteStage(uid string, stageId int32) (b bool) {
|
func (this *Mline) CheckCommpleteStage(uid string, stageId int32) (b bool) {
|
||||||
|
|
||||||
conf := this.configure.GetMainStageConf(stageId)
|
conf, err := this.configure.GetMainStageConf(stageId)
|
||||||
if conf == nil {
|
if err != nil {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
_szData, err := this.modelMline.getMainlineList(uid)
|
_szData, err := this.modelMline.getMainlineList(uid)
|
||||||
|
@ -11,7 +11,7 @@ func (this *apiComp) ActivateCheck(session comm.IUserSession, req *pb.PagodaActi
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
///获取主线关卡信息
|
///激活赛季塔
|
||||||
func (this *apiComp) Activate(session comm.IUserSession, req *pb.PagodaActivateReq) (errdata *pb.ErrorData) {
|
func (this *apiComp) Activate(session comm.IUserSession, req *pb.PagodaActivateReq) (errdata *pb.ErrorData) {
|
||||||
var (
|
var (
|
||||||
list *pb.DBPagoda
|
list *pb.DBPagoda
|
||||||
@ -25,8 +25,8 @@ func (this *apiComp) Activate(session comm.IUserSession, req *pb.PagodaActivateR
|
|||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
Nomalcfg := this.module.configure.GetPagodaConfigData(list.PagodaId + 1)
|
_, err = this.module.configure.GetPagodaConfigData(list.PagodaId + 1)
|
||||||
if Nomalcfg == nil && !list.Complete {
|
if err == nil && !list.Complete {
|
||||||
list.Complete = true
|
list.Complete = true
|
||||||
this.module.ModifyPagodaData(session.GetUserId(), map[string]interface{}{
|
this.module.ModifyPagodaData(session.GetUserId(), map[string]interface{}{
|
||||||
"complete": true,
|
"complete": true,
|
||||||
|
@ -27,11 +27,12 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.PagodaChalleng
|
|||||||
return // 参数校验失败直接返回
|
return // 参数校验失败直接返回
|
||||||
}
|
}
|
||||||
|
|
||||||
conf := this.module.configure.GetPagodaConfigData(req.Cid)
|
conf, err := this.module.configure.GetPagodaConfigData(req.Cid)
|
||||||
if conf == nil {
|
if conf != nil {
|
||||||
errdata = &pb.ErrorData{
|
errdata = &pb.ErrorData{
|
||||||
Code: pb.ErrorCode_PagodaNotFound,
|
Code: pb.ErrorCode_PagodaNotFound,
|
||||||
Title: pb.ErrorCode_PagodaNotFound.ToString(),
|
Title: pb.ErrorCode_PagodaNotFound.ToString(),
|
||||||
|
Message: err.Error(),
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -36,11 +36,12 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.PagodaChal
|
|||||||
return // 参数校验失败直接返回
|
return // 参数校验失败直接返回
|
||||||
}
|
}
|
||||||
|
|
||||||
conf := this.module.configure.GetPagodaConfigData(req.Cid)
|
conf, err := this.module.configure.GetPagodaConfigData(req.Cid)
|
||||||
if conf == nil {
|
if conf != nil {
|
||||||
errdata = &pb.ErrorData{
|
errdata = &pb.ErrorData{
|
||||||
Code: pb.ErrorCode_PagodaNotFound,
|
Code: pb.ErrorCode_PagodaNotFound,
|
||||||
Title: pb.ErrorCode_PagodaNotFound.ToString(),
|
Title: pb.ErrorCode_PagodaNotFound.ToString(),
|
||||||
|
Message: err.Error(),
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -23,8 +23,8 @@ func (this *apiComp) GetReward(session comm.IUserSession, req *pb.PagodaGetRewar
|
|||||||
}
|
}
|
||||||
|
|
||||||
if pagoda, err := this.module.modelPagoda.getPagodaList(session.GetUserId()); err != nil {
|
if pagoda, err := this.module.modelPagoda.getPagodaList(session.GetUserId()); err != nil {
|
||||||
_cfg := this.module.configure.GetPagodaRewardconfig(req.Id)
|
_cfg, err := this.module.configure.GetPagodaRewardconfig(req.Id)
|
||||||
if _cfg == nil {
|
if err != nil {
|
||||||
errdata = &pb.ErrorData{
|
errdata = &pb.ErrorData{
|
||||||
Code: pb.ErrorCode_ConfigNoFound,
|
Code: pb.ErrorCode_ConfigNoFound,
|
||||||
Title: pb.ErrorCode_ConfigNoFound.ToString(),
|
Title: pb.ErrorCode_ConfigNoFound.ToString(),
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package pagoda
|
package pagoda
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"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"
|
||||||
@ -9,6 +10,7 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const moduleName = "pagoda"
|
||||||
const (
|
const (
|
||||||
game_pagoda = "game_pagoda.json"
|
game_pagoda = "game_pagoda.json"
|
||||||
game_pagodaseasonreward = "game_pagodaseasonreward.json"
|
game_pagodaseasonreward = "game_pagodaseasonreward.json"
|
||||||
@ -30,13 +32,10 @@ func (this *configureComp) Init(service core.IService, module core.IModule, comp
|
|||||||
err = this.MCompConfigure.Init(service, module, comp, options)
|
err = this.MCompConfigure.Init(service, module, comp, options)
|
||||||
this.module = module.(*Pagoda)
|
this.module = module.(*Pagoda)
|
||||||
err = this.LoadMultiConfigure(map[string]interface{}{
|
err = this.LoadMultiConfigure(map[string]interface{}{
|
||||||
//game_pagoda: cfg.NewGame_pagoda,
|
|
||||||
//game_pagodaseasonreward: cfg.NewGamePagodaSeasonReward,
|
|
||||||
game_pagodataskreward: cfg.NewGamePagodaTaskReward,
|
game_pagodataskreward: cfg.NewGamePagodaTaskReward,
|
||||||
game_pagoda: cfg.NewGamePagoda,
|
game_pagoda: cfg.NewGamePagoda,
|
||||||
})
|
})
|
||||||
|
|
||||||
//configure.RegisterConfigure(game_pagoda, cfg.NewGamePagoda, this.LoadPagodaData)
|
|
||||||
this._checkType = make(map[int32][]*cfg.GamePassCheckData, 0)
|
this._checkType = make(map[int32][]*cfg.GamePassCheckData, 0)
|
||||||
configure.RegisterConfigure(game_passcheck, cfg.NewGamePassCheck, this.LoadPassCheck)
|
configure.RegisterConfigure(game_passcheck, cfg.NewGamePassCheck, this.LoadPassCheck)
|
||||||
|
|
||||||
@ -61,15 +60,19 @@ func (this *configureComp) GetConfigure(name string) (v interface{}, err error)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 爬塔奖励
|
// 爬塔奖励
|
||||||
func (this *configureComp) GetPagodaRewardconfig(id int32) (data *cfg.GamePagodaTaskRewardData) {
|
func (this *configureComp) GetPagodaRewardconfig(id int32) (data *cfg.GamePagodaTaskRewardData, err error) {
|
||||||
if v, err := this.GetConfigure(game_pagodataskreward); err == nil {
|
var (
|
||||||
|
v interface{}
|
||||||
|
)
|
||||||
|
if v, err = this.GetConfigure(game_pagodataskreward); err == nil {
|
||||||
if configure, ok := v.(*cfg.GamePagodaTaskReward); ok {
|
if configure, ok := v.(*cfg.GamePagodaTaskReward); ok {
|
||||||
return configure.Get(id)
|
data = configure.Get(id)
|
||||||
|
if data != nil {
|
||||||
|
return
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
log.Errorf("get game_pagodataskreward conf err:%v", err)
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
err = comm.NewNotFoundConfErr(moduleName, game_pagodataskreward, id)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -143,14 +146,18 @@ func (this *configureComp) LoadPassCheck() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *configureComp) GetPagodaConfigData(id int32) (data *cfg.GamePagodaData) {
|
func (this *configureComp) GetPagodaConfigData(id int32) (data *cfg.GamePagodaData, err error) {
|
||||||
var err error
|
var (
|
||||||
if v, err := this.GetConfigure(game_pagoda); err == nil {
|
v interface{}
|
||||||
|
)
|
||||||
|
if v, err = this.GetConfigure(game_pagoda); err == nil {
|
||||||
if configure, ok := v.(*cfg.GamePagoda); ok {
|
if configure, ok := v.(*cfg.GamePagoda); ok {
|
||||||
|
data = configure.Get(id)
|
||||||
return configure.Get(id)
|
if data != nil {
|
||||||
}
|
return
|
||||||
}
|
}
|
||||||
log.Errorf("get game_pagoda conf err:%v", err)
|
}
|
||||||
|
}
|
||||||
|
err = comm.NewNotFoundConfErr(moduleName, game_pagoda, id)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -50,7 +50,7 @@ func (this *ModelRank) getPagodaRankListByFloorid(uid string, cid int32) *pb.DBP
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
for _, v := range pagodaRank {
|
for _, v := range pagodaRank {
|
||||||
if conf := this.modulePagoda.configure.GetPagodaConfigData(cid); conf == nil {
|
if conf, err := this.modulePagoda.configure.GetPagodaConfigData(cid); err == nil {
|
||||||
if v.PagodaId == conf.LayerNum && v.Tab == conf.Tab {
|
if v.PagodaId == conf.LayerNum && v.Tab == conf.Tab {
|
||||||
return v
|
return v
|
||||||
}
|
}
|
||||||
|
@ -93,8 +93,8 @@ func (this *Pagoda) ModifyPagodaFloor(session comm.IUserSession, level int32) (e
|
|||||||
mapData := make(map[string]interface{}, 0)
|
mapData := make(map[string]interface{}, 0)
|
||||||
mapData["pagodaId"] = level
|
mapData["pagodaId"] = level
|
||||||
// 通关校验
|
// 通关校验
|
||||||
Nomalcfg := this.configure.GetPagodaConfigData(level + 1)
|
_, err := this.configure.GetPagodaConfigData(level + 1)
|
||||||
if Nomalcfg == nil {
|
if err == nil {
|
||||||
list.Complete = true
|
list.Complete = true
|
||||||
mapData["complete"] = true
|
mapData["complete"] = true
|
||||||
}
|
}
|
||||||
|
@ -117,13 +117,19 @@ func (this *configureComp) CheckSmithyFirstReelConfigData(etype int32, id int32)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 获取铁匠铺熟练度数据
|
// 获取铁匠铺熟练度数据
|
||||||
func (this *configureComp) GetSmithProficiencyConf(id int32) (data *cfg.GameSmithyProficiencyData) {
|
func (this *configureComp) GetSmithProficiencyConf(id int32) (data *cfg.GameSmithyProficiencyData, err error) {
|
||||||
if v, err := this.GetConfigure(game_smproficiency); err == nil {
|
var (
|
||||||
|
v interface{}
|
||||||
|
)
|
||||||
|
if v, err = this.GetConfigure(game_smproficiency); err == nil {
|
||||||
if configure, ok := v.(*cfg.GameSmithyProficiency); ok {
|
if configure, ok := v.(*cfg.GameSmithyProficiency); ok {
|
||||||
data = configure.Get(int(id))
|
data = configure.Get(int(id))
|
||||||
|
if data != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
comm.NewNotFoundConfErr(moduleName, game_smproficiency, id)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -187,12 +193,11 @@ func (this *configureComp) GetSmithyCustomerConf(id int32) (data *cfg.GameSmithy
|
|||||||
)
|
)
|
||||||
if v, err = this.GetConfigure(game_smithycustomer); err == nil {
|
if v, err = this.GetConfigure(game_smithycustomer); err == nil {
|
||||||
if configure, ok := v.(*cfg.GameSmithyCustomer); ok {
|
if configure, ok := v.(*cfg.GameSmithyCustomer); ok {
|
||||||
if data = configure.Get(id); data == nil {
|
if data = configure.Get(id); data != nil {
|
||||||
err = comm.NewNotFoundConfErr(moduleName, game_smithycustomer, id)
|
|
||||||
}
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
err = comm.NewNotFoundConfErr(moduleName, game_smithycustomer, id)
|
err = comm.NewNotFoundConfErr(moduleName, game_smithycustomer, id)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -204,12 +209,11 @@ func (this *configureComp) GetSmithyToolsData(id int32) (data *cfg.GameSmithyToo
|
|||||||
)
|
)
|
||||||
if v, err = this.GetConfigure(game_smithytools); err == nil {
|
if v, err = this.GetConfigure(game_smithytools); err == nil {
|
||||||
if configure, ok := v.(*cfg.GameSmithyTool); ok {
|
if configure, ok := v.(*cfg.GameSmithyTool); ok {
|
||||||
if data = configure.Get(int(id)); data == nil {
|
if data = configure.Get(int(id)); data != nil {
|
||||||
err = comm.NewNotFoundConfErr(moduleName, game_smithytools, id)
|
|
||||||
}
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
err = comm.NewNotFoundConfErr(moduleName, game_smithytools, id)
|
err = comm.NewNotFoundConfErr(moduleName, game_smithytools, id)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -220,12 +224,11 @@ func (this *configureComp) GetSmithyStoveConf(level int32) (data *cfg.GameSmithy
|
|||||||
)
|
)
|
||||||
if v, err = this.GetConfigure(game_smithystove); err == nil {
|
if v, err = this.GetConfigure(game_smithystove); err == nil {
|
||||||
if configure, ok := v.(*cfg.GameSmithyStoveV1); ok {
|
if configure, ok := v.(*cfg.GameSmithyStoveV1); ok {
|
||||||
if data = configure.Get(int32(level)); data == nil {
|
if data = configure.Get(int32(level)); data != nil {
|
||||||
err = comm.NewNotFoundConfErr(moduleName, game_smithystove, level)
|
|
||||||
}
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
err = comm.NewNotFoundConfErr(moduleName, game_smithystove, level)
|
err = comm.NewNotFoundConfErr(moduleName, game_smithystove, level)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -237,12 +240,11 @@ func (this *configureComp) GetSmithyAtlasConf(id string) (data *cfg.GameSmithyAt
|
|||||||
)
|
)
|
||||||
if v, err = this.GetConfigure(game_smithyatlas); err == nil {
|
if v, err = this.GetConfigure(game_smithyatlas); err == nil {
|
||||||
if configure, ok := v.(*cfg.GameSmithyAtlas); ok {
|
if configure, ok := v.(*cfg.GameSmithyAtlas); ok {
|
||||||
if data = configure.Get(id); data == nil {
|
if data = configure.Get(id); data != nil {
|
||||||
err = comm.NewNotFoundConfErr(moduleName, game_smithyatlas, id)
|
|
||||||
}
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
err = comm.NewNotFoundConfErr(moduleName, game_smithyatlas, id)
|
err = comm.NewNotFoundConfErr(moduleName, game_smithyatlas, id)
|
||||||
|
|
||||||
return
|
return
|
||||||
@ -292,12 +294,11 @@ func (this *configureComp) GetSmithyTask(taskId int32) (data *cfg.GameSmithyTask
|
|||||||
)
|
)
|
||||||
if v, err = this.GetConfigure(game_smithytask); err == nil {
|
if v, err = this.GetConfigure(game_smithytask); err == nil {
|
||||||
if configure, ok := v.(*cfg.GameSmithyTask); ok {
|
if configure, ok := v.(*cfg.GameSmithyTask); ok {
|
||||||
if data = configure.Get(taskId); data == nil {
|
if data = configure.Get(taskId); data != nil {
|
||||||
err = comm.NewNotFoundConfErr(moduleName, game_smithytask, taskId)
|
|
||||||
}
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
err = comm.NewNotFoundConfErr(moduleName, game_smithytask, taskId)
|
err = comm.NewNotFoundConfErr(moduleName, game_smithytask, taskId)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -47,10 +47,6 @@ func (this *configureComp) Init(service core.IService, module core.IModule, comp
|
|||||||
log.Errorf("get game_viking conf err:%v", err)
|
log.Errorf("get game_viking conf err:%v", err)
|
||||||
return
|
return
|
||||||
})
|
})
|
||||||
// err = this.LoadConfigure(game_challenge, cfg.NewGameVikingChallenge)
|
|
||||||
|
|
||||||
// _data := this.GetVikingBossTypeConfigData()
|
|
||||||
// log.Debugf("%v", _data)
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -105,17 +101,3 @@ func (this *configureComp) GetMaxDifficultyByBossID(bossId int32) int32 {
|
|||||||
}
|
}
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取最后一条数据
|
|
||||||
// func (this *configureComp) GetLastBuyChallenge() (data *cfg.GameVikingChallengeData) {
|
|
||||||
// if v, err := this.GetConfigure(game_challenge); err == nil {
|
|
||||||
// if configure, ok := v.(*cfg.GameVikingChallenge); ok && len(configure.GetDataList()) > 0 {
|
|
||||||
// data = configure.GetDataList()[len(configure.GetDataList())-1]
|
|
||||||
// return
|
|
||||||
// }
|
|
||||||
// } else {
|
|
||||||
// log.Errorf("get game_challenge conf err:%v", err)
|
|
||||||
// }
|
|
||||||
|
|
||||||
// return
|
|
||||||
// }
|
|
||||||
|
Loading…
Reference in New Issue
Block a user