From bbd4b54757cddcd5be3a5c2c6cd6313ef89976c5 Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Tue, 16 Jan 2024 14:09:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=8A=9F=E8=83=BD=E5=BC=80?= =?UTF-8?q?=E5=90=AF=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/dailytask/configure.go | 21 ++++- modules/dailytask/module.go | 11 ++- modules/practice/module.go | 46 +++++----- modules/sys/api_funcactivate.go | 155 ++++++++++++++++---------------- modules/sys/api_funcgetList.go | 121 +++++-------------------- modules/sys/config.go | 36 +++++++- modules/sys/model_sys.go | 38 -------- modules/sys/module.go | 86 +++++++++++++++--- modules/user/comp_configure.go | 37 -------- 9 files changed, 257 insertions(+), 294 deletions(-) diff --git a/modules/dailytask/configure.go b/modules/dailytask/configure.go index 3ccb7d290..b2c4ecaba 100644 --- a/modules/dailytask/configure.go +++ b/modules/dailytask/configure.go @@ -13,6 +13,7 @@ import ( const ( game_annulartaskall = "game_annulartaskall.json" game_annulartask_library = "game_annulartask_library.json" + game_opencond = "game_opencond.json" ) type configureComp struct { @@ -26,8 +27,8 @@ func (this *configureComp) Init(service core.IService, module core.IModule, comp err = this.MCompConfigure.Init(service, module, comp, options) this.module = module.(*Dailytask) err = this.LoadMultiConfigure(map[string]interface{}{ - game_annulartaskall: cfg.NewGameAnnulartaskAll, - game_annulartask_library: cfg.NewGameAnnulartask_Library, + game_annulartaskall: cfg.NewGameAnnulartaskAll, + game_opencond: cfg.NewGameOpencond, }) configure.RegisterConfigure(game_annulartask_library, cfg.NewGameAnnulartask_Library, this.updateconfigure) return @@ -137,3 +138,19 @@ func (this *configureComp) getAnnulartaskLibrary(ulv, group int32) (results *cfg results = canuse[index] return } + +func (this *configureComp) getOpencondCfg(id string) (conf *cfg.GameOpencondData, err error) { + var ( + v interface{} + ok bool + ) + if v, err = this.GetConfigure(game_opencond); err == nil { + err = fmt.Errorf("%T no is *cfg.GameOpencond", v) + return + } + if conf, ok = v.(*cfg.GameOpencond).GetDataMap()[id]; !ok { + err = comm.NewNotFoundConfErr(string(this.module.GetType()), game_opencond, id) + return + } + return +} diff --git a/modules/dailytask/module.go b/modules/dailytask/module.go index b796d2b83..1872497a0 100644 --- a/modules/dailytask/module.go +++ b/modules/dailytask/module.go @@ -8,6 +8,7 @@ import ( "go_dreamfactory/modules" "go_dreamfactory/pb" "go_dreamfactory/sys/configure" + cfg "go_dreamfactory/sys/configure/structs" "go_dreamfactory/sys/db" "go_dreamfactory/utils" ) @@ -61,14 +62,18 @@ func (this *Dailytask) OnInstallComp() { // 用户登录 func (this *Dailytask) EventUserLogin(session comm.IUserSession) { var ( - isopen bool + conf *cfg.GameOpencondData + err error + ok bool ) if db.IsCross() { //跨服不支持 return } - - if isopen, _ = this.ModuleSys.CheckOpenCondCfgById(session.GetUserId(), "annulartask"); !isopen { + if conf, err = this.configure.getOpencondCfg("annulartask"); err != nil { + return + } + if ok, _, _ = this.ModuleBuried.CheckCondition(session, conf.Opencondi...); !ok { return } this.refreshtask(session) diff --git a/modules/practice/module.go b/modules/practice/module.go index b9a1cff45..927b39518 100644 --- a/modules/practice/module.go +++ b/modules/practice/module.go @@ -209,30 +209,30 @@ func (this *Practice) TaskComplete(session comm.IUserSession, taskid ...int32) { } func (this *Practice) OpenCmdNotice(session comm.IUserSession, keys ...string) { - this.Debug("OpenCmdNotice", - log.Field{Key: "session", Value: session.GetUserId()}, - log.Field{Key: "key", Value: keys}, - ) - if !this.IsCross() { - for _, v := range keys { - if v == "practice_ pillar1" || v == "practice_ pillar2" || v == "practice_ pillar3" { - err := this.service.AcrossClusterRpcCall(context.Background(), this.GetCrossTag(), - comm.Service_Worker, string(comm.RPC_ModulePracticeUnLockPillar), - &pb.RPCGeneralReqA2{Param1: session.GetUserId(), Param2: v}, &pb.EmptyResp{}) - if err != nil { - this.Errorln(err) - return - } - } - } + // this.Debug("OpenCmdNotice", + // log.Field{Key: "session", Value: session.GetUserId()}, + // log.Field{Key: "key", Value: keys}, + // ) + // if !this.IsCross() { + // for _, v := range keys { + // if v == "practice_ pillar1" || v == "practice_ pillar2" || v == "practice_ pillar3" { + // err := this.service.AcrossClusterRpcCall(context.Background(), this.GetCrossTag(), + // comm.Service_Worker, string(comm.RPC_ModulePracticeUnLockPillar), + // &pb.RPCGeneralReqA2{Param1: session.GetUserId(), Param2: v}, &pb.EmptyResp{}) + // if err != nil { + // this.Errorln(err) + // return + // } + // } + // } - } else { - for _, v := range keys { - if v == "practice_ pillar1" || v == "practice_ pillar2" || v == "practice_ pillar3" { - this.RPC_ModulePracticeUnLockPillar(context.Background(), &pb.RPCGeneralReqA2{Param1: session.GetUserId(), Param2: v}, &pb.EmptyResp{}) - } - } - } + // } else { + // for _, v := range keys { + // if v == "practice_ pillar1" || v == "practice_ pillar2" || v == "practice_ pillar3" { + // this.RPC_ModulePracticeUnLockPillar(context.Background(), &pb.RPCGeneralReqA2{Param1: session.GetUserId(), Param2: v}, &pb.EmptyResp{}) + // } + // } + // } } func (this *Practice) ChallengeResults(bid, red, bule string, winSide int32) { diff --git a/modules/sys/api_funcactivate.go b/modules/sys/api_funcactivate.go index a975f79e5..b42bc2679 100644 --- a/modules/sys/api_funcactivate.go +++ b/modules/sys/api_funcactivate.go @@ -1,84 +1,87 @@ package sys -import ( - "go_dreamfactory/comm" - "go_dreamfactory/lego/core" - "go_dreamfactory/pb" -) +// import ( +// "fmt" +// "go_dreamfactory/comm" +// "go_dreamfactory/lego/core" +// "go_dreamfactory/pb" +// cfg "go_dreamfactory/sys/configure/structs" +// ) -func (this *apiComp) FuncActivateCheck(session comm.IUserSession, req *pb.SysFuncActivateReq) (errdata *pb.ErrorData) { - return -} +// func (this *apiComp) FuncActivateCheck(session comm.IUserSession, req *pb.SysFuncActivateReq) (errdata *pb.ErrorData) { +// return +// } -// cond 值 为0 表示功能未开启 1 功能开启 需要手动激活 2 功能开启并激活 -func (this *apiComp) FuncActivate(session comm.IUserSession, req *pb.SysFuncActivateReq) (errdata *pb.ErrorData) { - var ( - list *pb.DBOpenCond - err error - ) - rsp := &pb.SysFuncActivateResp{} - opencfg, err := this.module.configure.GetOpenCondCfgById(req.Cid) - if err == nil { +// // cond 值 为0 表示功能未开启 1 功能开启 需要手动激活 2 功能开启并激活 +// func (this *apiComp) FuncActivate(session comm.IUserSession, req *pb.SysFuncActivateReq) (errdata *pb.ErrorData) { +// var ( +// conf *cfg.GameOpencondData +// info *pb.DBOpenCond +// condis []*pb.ConIProgress +// ok bool +// err error +// ) +// rsp := &pb.SysFuncActivateResp{} +// if conf, err = this.module.configure.GetOpenCondCfgById(req.Cid); err != nil { +// errdata = &pb.ErrorData{ +// Code: pb.ErrorCode_ConfigNoFound, +// Title: pb.ErrorCode_ConfigNoFound.ToString(), +// Message: req.Cid, +// } +// return +// } - if list, err = this.module.modelSys.GetOpenCondList(session.GetUserId()); err != nil { - errdata = &pb.ErrorData{ - Code: pb.ErrorCode_DBError, - Title: pb.ErrorCode_DBError.ToString(), - Message: err.Error(), - } - return - } - if v, ok := list.Cond[req.Cid]; !ok || v != 1 { - errdata = &pb.ErrorData{ - Code: pb.ErrorCode_OpenCondActivate, - Title: pb.ErrorCode_OpenCondActivate.ToString(), - } - return - } - if id := this.module.modelSys.CheckValidCond(session.GetUserId(), opencfg, list); id == "" { // 条件不满足 - errdata = &pb.ErrorData{ - Code: pb.ErrorCode_OpenCondErr, - Title: pb.ErrorCode_OpenCondErr.ToString(), - Message: req.Cid, - } - return - } - } else { - errdata = &pb.ErrorData{ - Code: pb.ErrorCode_ConfigNoFound, - Title: pb.ErrorCode_ConfigNoFound.ToString(), - Message: req.Cid, - } - return - } +// if info, err = this.module.modelSys.GetOpenCondList(session.GetUserId()); err != nil { +// errdata = &pb.ErrorData{ +// Code: pb.ErrorCode_DBError, +// Title: pb.ErrorCode_DBError.ToString(), +// Message: err.Error(), +// } +// return +// } +// if v, ok := info.Cond[req.Cid]; !ok || v != 1 { +// errdata = &pb.ErrorData{ +// Code: pb.ErrorCode_OpenCondActivate, +// Title: pb.ErrorCode_OpenCondActivate.ToString(), +// } +// return +// } +// if ok, condis, _ = this.module.ModuleBuried.CheckCondition(session, conf.Opencondi...); !ok { // 条件不满足 +// errdata = &pb.ErrorData{ +// Code: pb.ErrorCode_OpenCondErr, +// Title: pb.ErrorCode_OpenCondErr.ToString(), +// Message: fmt.Sprintln(condis), +// } +// return +// } - list.Cond[req.Cid] = 2 - this.module.modelSys.ChangeOpenCondData(session.GetUserId(), map[string]interface{}{ - "cond": list.Cond, - }) - rsp.Cid = req.Cid - if err := session.SendMsg(string(this.module.GetType()), "funcactivate", rsp); err != nil { - errdata = &pb.ErrorData{ - Code: pb.ErrorCode_SystemError, - Title: pb.ErrorCode_SystemError.ToString(), - } - return - } +// info.Cond[req.Cid] = 2 +// this.module.modelSys.ChangeOpenCondData(session.GetUserId(), map[string]interface{}{ +// "cond": info.Cond, +// }) +// rsp.Cid = req.Cid +// if err := session.SendMsg(string(this.module.GetType()), "funcactivate", rsp); err != nil { +// errdata = &pb.ErrorData{ +// Code: pb.ErrorCode_SystemError, +// Title: pb.ErrorCode_SystemError.ToString(), +// Message: err.Error(), +// } +// return +// } - go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { - //手动激活通知模块 - for _, m := range opencfg.Notify { - i, err := this.service.GetModule(core.M_Modules(m)) - if err != nil { - this.module.Errorln(err) - continue - } +// go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { +// //手动激活通知模块 +// for _, m := range conf.Notify { +// i, err := this.service.GetModule(core.M_Modules(m)) +// if err != nil { +// this.module.Errorln(err) +// continue +// } +// if ic, ok := i.(comm.IOpenCmdNotice); ok { +// ic.OpenCmdNotice(session, req.Cid) +// } +// } +// }) - if ic, ok := i.(comm.IOpenCmdNotice); ok { - ic.OpenCmdNotice(session, req.Cid) - } - } - }) - - return -} +// return +// } diff --git a/modules/sys/api_funcgetList.go b/modules/sys/api_funcgetList.go index be6dfba9f..36ea472d2 100644 --- a/modules/sys/api_funcgetList.go +++ b/modules/sys/api_funcgetList.go @@ -1,103 +1,28 @@ package sys -import ( - "go_dreamfactory/comm" - "go_dreamfactory/lego/core" - "go_dreamfactory/pb" -) +// import ( +// "go_dreamfactory/comm" +// "go_dreamfactory/pb" +// ) -func (this *apiComp) FuncGetListCheck(session comm.IUserSession, req *pb.SysFuncGetListReq) (errdata *pb.ErrorData) { - return -} +// func (this *apiComp) FuncGetListCheck(session comm.IUserSession, req *pb.SysFuncGetListReq) (errdata *pb.ErrorData) { +// return +// } -func (this *apiComp) FuncGetList(session comm.IUserSession, req *pb.SysFuncGetListReq) (errdata *pb.ErrorData) { +// func (this *apiComp) FuncGetList(session comm.IUserSession, req *pb.SysFuncGetListReq) (errdata *pb.ErrorData) { - var ( - bChange bool - change []string = make([]string, 0) - list *pb.DBOpenCond - ) - rsp := &pb.SysFuncGetListResp{} - rsp.Cond = make(map[string]int32, 0) - opencfg, err := this.module.configure.getOpencondCfg() - if err != nil { - errdata = &pb.ErrorData{ - Code: pb.ErrorCode_ConfigNoFound, - Message: err.Error(), - } - return - } - if list, err = this.module.modelSys.GetOpenCondList(session.GetUserId()); err != nil { - errdata = &pb.ErrorData{ - Code: pb.ErrorCode_DBError, - Title: pb.ErrorCode_DBError.ToString(), - Message: err.Error(), - } - return - } - if len(req.Keys) == 0 { - for _, v := range opencfg.GetDataList() { - if list.Cond[v.Id] == 0 { - - id := this.module.modelSys.CheckValidCond(session.GetUserId(), v, list) - if id != "" { - if v.ActivateType { // 需要手动激活的 - list.Cond[id] = 1 //设置激活 - } else { - list.Cond[id] = 2 //自动激活 - change = append(change, id) - } - bChange = true - } - } - rsp.Cond[v.Id] = list.Cond[v.Id] - } - } else { - for _, key := range req.Keys { - if list.Cond[key] == 0 { - if conf, ok := opencfg.GetDataMap()[key]; ok { - id := this.module.modelSys.CheckValidCond(session.GetUserId(), conf, list) - if id != "" { - if conf.ActivateType { // 需要手动激活的 - list.Cond[id] = 1 //设置激活 - } else { - list.Cond[id] = 2 //自动激活 - change = append(change, id) - } - bChange = true - } - } - } - rsp.Cond[key] = list.Cond[key] - } - } - - if bChange { - this.module.modelSys.ChangeOpenCondData(session.GetUserId(), map[string]interface{}{ - "cond": list.Cond, - }) - } - session.SendMsg(string(this.module.GetType()), "funcgetlist", rsp) - - if len(change) > 0 { - go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) { - //手动激活通知模块 - for _, m := range change { - opencfg, _ := this.module.configure.GetOpenCondCfgById(m) - for _, v := range opencfg.Notify { - i, err := this.service.GetModule(core.M_Modules(v)) - if err != nil { - this.module.Errorln(err) - continue - } - if ic, ok := i.(comm.IOpenCmdNotice); ok { - ic.OpenCmdNotice(session, m) - } - } - - } - }) - - } - return -} +// var ( +// info *pb.DBOpenCond +// err error +// ) +// if info, err = this.module.modelSys.GetOpenCondList(session.GetUserId()); err != nil { +// errdata = &pb.ErrorData{ +// Code: pb.ErrorCode_DBError, +// Title: pb.ErrorCode_DBError.ToString(), +// Message: err.Error(), +// } +// return +// } +// session.SendMsg(string(this.module.GetType()), "funcgetlist", &pb.SysFuncGetListResp{Cond: info.Cond}) +// return +// } diff --git a/modules/sys/config.go b/modules/sys/config.go index 25029df6d..97328ec0e 100644 --- a/modules/sys/config.go +++ b/modules/sys/config.go @@ -5,7 +5,9 @@ import ( "go_dreamfactory/comm" "go_dreamfactory/lego/core" "go_dreamfactory/modules" + "go_dreamfactory/sys/configure" cfg "go_dreamfactory/sys/configure/structs" + "sync" ) const ( @@ -14,24 +16,50 @@ const ( type configureComp struct { modules.MCompConfigure - module *ModuleSys + module *ModuleSys + lock sync.RWMutex + condlTask map[int32][]*cfg.GameOpencondData + cmds map[string]*cfg.GameOpencondData } func (this *configureComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) { err = this.MCompConfigure.Init(service, module, comp, options) - this.LoadConfigure(gameOpencond, cfg.NewGameOpencond) + // this.LoadConfigure(gameOpencond, cfg.NewGameOpencond) + configure.RegisterConfigure(gameOpencond, cfg.NewGameOpencond, this.updateconfigure) this.module = module.(*ModuleSys) - return } +// 更新任务配置表 +func (this *configureComp) updateconfigure() { + gwt, err := this.getOpencondCfg() + if err != nil { + this.module.Error("世界任务配置表异常!") + return + } + condlTask := make(map[int32][]*cfg.GameOpencondData) + cmds := make(map[string]*cfg.GameOpencondData) + for _, v := range gwt.GetDataList() { + cmds[v.Id] = v + for _, condi := range v.Opencondi { + if _, ok := condlTask[condi]; !ok { + condlTask[condi] = make([]*cfg.GameOpencondData, 0) + } + condlTask[condi] = append(condlTask[condi], v) + } + } + this.lock.Lock() + this.condlTask = condlTask + this.cmds = cmds + this.lock.Unlock() +} + func (this *configureComp) getOpencondCfg() (data *cfg.GameOpencond, err error) { var ( v interface{} ok bool ) if v, err = this.GetConfigure(gameOpencond); err == nil { - if data, ok = v.(*cfg.GameOpencond); !ok { err = fmt.Errorf("%T no is *cfg.GameOpencond", v) return diff --git a/modules/sys/model_sys.go b/modules/sys/model_sys.go index dfda5de62..b0b9f6147 100644 --- a/modules/sys/model_sys.go +++ b/modules/sys/model_sys.go @@ -5,7 +5,6 @@ import ( "go_dreamfactory/lego/core" "go_dreamfactory/modules" "go_dreamfactory/pb" - cfg "go_dreamfactory/sys/configure/structs" "go.mongodb.org/mongo-driver/bson/primitive" "go.mongodb.org/mongo-driver/mongo" @@ -56,40 +55,3 @@ func (this *ModelSys) ChangeOpenCondData(uid string, value map[string]interface{ } return this.Change(uid, value) } - -func (this *ModelSys) CheckValidCond(uid string, condData *cfg.GameOpencondData, open *pb.DBOpenCond) string { - for _, conf := range condData.Main { - switch comm.OpencondType(conf.Key) { - case comm.OpencondTypePlatlv: //等级 - if open.Lv < conf.Param { - return "" - } - case comm.OpencondTypeMaxmapid: //关卡ID - if _, ok := open.Mline[conf.Param]; !ok { - return "" - } - case comm.OpencondTypeWorldtaskid: //世界任务ID - if _, ok := open.Wtask[conf.Param]; !ok { - return "" - } - - case comm.OpencondTypeFriend: // 好友数量 - if open.Friend < conf.Param { - return "" - } - case comm.OpencondTypePagoda: - if _, ok := open.Pagoda[conf.Param]; !ok { - return "" - } - case comm.OpencondTypeSociaty: // 查询工会等级 - if open.Sociaty < conf.Param { - return "" - } - case comm.OpencondTypeMoonLv: - if open.Moonlv < conf.Param { - return "" - } - } - } - return condData.Id -} diff --git a/modules/sys/module.go b/modules/sys/module.go index 8e96ac15d..d15b2f20b 100644 --- a/modules/sys/module.go +++ b/modules/sys/module.go @@ -4,8 +4,10 @@ import ( "go_dreamfactory/comm" "go_dreamfactory/lego/base" "go_dreamfactory/lego/core" + "go_dreamfactory/lego/sys/log" "go_dreamfactory/modules" "go_dreamfactory/pb" + cfg "go_dreamfactory/sys/configure/structs" ) var _ comm.ISys = (*ModuleSys)(nil) @@ -111,17 +113,8 @@ func (this *ModuleSys) CheckOpenCond(session comm.IUserSession, itype comm.Openc func (this *ModuleSys) CheckOpenCondCfgById(uid string, id string) (bOpen bool, errdata *pb.ErrorData) { var ( list *pb.DBOpenCond + err error ) - conf, err := this.configure.GetOpenCondCfgById(id) - if err != nil { - bOpen = false - errdata = &pb.ErrorData{ - Code: pb.ErrorCode_ConfigNoFound, - Title: pb.ErrorCode_ConfigNoFound.ToString(), - Message: err.Error(), - } - return - } if list, err = this.modelSys.GetOpenCondList(uid); err != nil { return @@ -132,9 +125,6 @@ func (this *ModuleSys) CheckOpenCondCfgById(uid string, id string) (bOpen bool, return } } - if this.modelSys.CheckValidCond(uid, conf, list) != "" { - bOpen = true - } return } @@ -181,3 +171,73 @@ func (this *ModuleSys) GMOpenAllCondition(uid string) { }) return } + +//功能开启 +func (this *ModuleSys) BuriedsNotify(session comm.IUserSession, condis []*pb.ConIProgress) { + this.Debug("收到子任务进度变化推送", log.Field{Key: "uid", Value: session.GetUserId()}, log.Field{Key: "condis", Value: condis}) + var ( + condlTask map[int32][]*cfg.GameOpencondData + condlidsMap map[int32]struct{} = make(map[int32]struct{}) + confs map[string]*cfg.GameOpencondData + condlids []int32 + condisSlice []*pb.ConIProgress + condisMap map[int32]*pb.ConIProgress + progress *pb.ConIProgress + notify []*cfg.GameOpencondData = make([]*cfg.GameOpencondData, 0) + ok bool + err error + ) + condlTask = this.configure.condlTask + for _, v := range condis { + if _, ok = condlTask[v.Conid]; ok { + for _, cmd := range condlTask[v.Conid] { + if len(cmd.Notify) > 0 { + confs[cmd.Id] = cmd + for _, condi := range cmd.Opencondi { + condlidsMap[condi] = struct{}{} + } + } + } + } + } + if len(condlidsMap) < 0 { + return + } + for k, _ := range condlidsMap { + condlids = append(condlids, k) + } + + if _, condisSlice, err = this.ModuleBuried.CheckCondition(session, condlids...); err != nil { + this.Errorln(err) + } + for _, v := range condisSlice { + condisMap[v.Conid] = v + } + + for _, conf := range confs { + ok = true + for _, v := range conf.Opencondi { + if progress, ok = condisMap[v]; !ok || progress.State == pb.BuriedItemFinishState_buried_unfinish { + ok = false + break + } + } + if ok { + notify = append(notify, conf) + } + } + if len(notify) > 0 { + for _, conf := range notify { + for _, v := range conf.Notify { + i, err := this.service.GetModule(core.M_Modules(v)) + if err != nil { + this.Errorln(err) + continue + } + if ic, ok := i.(comm.IOpenCmdNotice); ok { + ic.OpenCmdNotice(session, conf.Id) + } + } + } + } +} diff --git a/modules/user/comp_configure.go b/modules/user/comp_configure.go index 97c8fb83e..a843ccba1 100644 --- a/modules/user/comp_configure.go +++ b/modules/user/comp_configure.go @@ -13,7 +13,6 @@ import ( const ( game_signreset = "game_signreset.json" game_sign = "game_sign.json" - gameOpencond = "game_opencond.json" game_SignExtra = "game_signextra.json" game_initial = "game_initial.json" //初始化表 game_playerinfor_overview = "game_playerinfor_overview.json" //皮肤配置表 @@ -37,7 +36,6 @@ func (this *configureComp) Init(service core.IService, module core.IModule, comp this._sign = make(map[int32]*cfg.GameSignData, 0) this._signExtra = make(map[int32]*cfg.GameSignExtraData, 0) err = this.LoadConfigure(game_initial, cfg.NewGameInitial) - this.LoadConfigure(gameOpencond, cfg.NewGameOpencond) this.LoadConfigure(game_restore, cfg.NewGameRestore) configure.RegisterConfigure(game_sign, cfg.NewGameSign, this.LoadSignData) configure.RegisterConfigure(game_SignExtra, cfg.NewGameSignExtra, this.LoadSignExtraData) @@ -84,41 +82,6 @@ func (this *configureComp) LoadSignData() { return } -func (this *configureComp) GetOpenCondConf() []*cfg.GameOpencondData { - if v, err := this.GetConfigure(gameOpencond); err != nil { - return nil - } else { - data, ok := v.(*cfg.GameOpencond) - if !ok { - err = fmt.Errorf("%T no is *cfg.GameOpencond", v) - return nil - } - return data.GetDataList() - } -} - -func (this *configureComp) FindFunc(lv int32) (funcIds []string) { - if v, err := this.GetConfigure(gameOpencond); err != nil { - return nil - } else { - data, ok := v.(*cfg.GameOpencond) - if !ok { - err = fmt.Errorf("%T no is *cfg.GameOpencond", v) - this.module.Errorln(err) - return nil - } - for _, d := range data.GetDataList() { - for _, v := range d.Main { - if v.Key == 1 && v.Param == lv { - funcIds = append(funcIds, d.Id) - continue - } - } - } - } - return -} - func (this *configureComp) LoadSignExtraData() { if v, err := this.GetConfigure(game_SignExtra); err == nil { if configure, ok := v.(*cfg.GameSignExtra); ok {