From db8b745933cdd706522930afa61484ec4566b708 Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Thu, 24 Aug 2023 11:24:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/robot/core.go | 3 +- modules/robot/modulerobot_hero.go | 15 ++- modules/robot/modulerobot_mainline.go | 116 +++++++++++++++++- modules/robot/modulerobot_practice.go | 88 ++++++++++--- modules/robot/modulerobot_sys.go | 75 +++++++++++ modules/robot/modulerobot_user.go | 4 +- modules/robot/modulerobot_wtask.go | 19 +-- modules/robot/robot.go | 42 +++++-- .../{api_activate.go => api_funcactivate.go} | 0 .../{api_getlist.go => api_funcgetList.go} | 0 modules/sys/module.go | 8 +- 11 files changed, 327 insertions(+), 43 deletions(-) create mode 100644 modules/robot/modulerobot_sys.go rename modules/sys/{api_activate.go => api_funcactivate.go} (100%) rename modules/sys/{api_getlist.go => api_funcgetList.go} (100%) diff --git a/modules/robot/core.go b/modules/robot/core.go index 99b658dd1..2e86fc0eb 100644 --- a/modules/robot/core.go +++ b/modules/robot/core.go @@ -25,12 +25,13 @@ type IRobot interface { ServerId() string GetModule(module core.M_Modules) IModuleRobot SendMessage(mtype, stype string, msg proto.Message) (resp proto.Message, errdata *pb.ErrorData) + SendTaskMessage(task, comdi int32, mtype, stype string, msg proto.Message) (resp proto.Message, errdata *pb.ErrorData) DoTask(taskconf *cfg.GameWorldTaskData, condconf *cfg.GameBuriedCondiData, module core.M_Modules) (err error) } //机器人模块 type IModuleRobot interface { - Init() + Init() (err error) //接收到回应和推送消息 Receive(robot IRobot, stype string, message proto.Message) (err error) //执行流水线任务 diff --git a/modules/robot/modulerobot_hero.go b/modules/robot/modulerobot_hero.go index 138c0f438..06322cd40 100644 --- a/modules/robot/modulerobot_hero.go +++ b/modules/robot/modulerobot_hero.go @@ -15,8 +15,9 @@ type ModuleRobot_Hero struct { heros map[string]*pb.DBHero } -func (this *ModuleRobot_Hero) Init() { +func (this *ModuleRobot_Hero) Init() (err error) { this.heros = make(map[string]*pb.DBHero) + return } //接收到消息 @@ -57,7 +58,7 @@ func (this *ModuleRobot_Hero) DoTask(robot IRobot, taskconf *cfg.GameWorldTaskDa ) switch comm.TaskType(condconf.Type) { case comm.Rtype14: - if _, errdata = robot.SendMessage("hero", "drawcard", &pb.HeroDrawCardReq{DrawType: 2, DrawCount: 1, Consume: 0}); errdata != nil { + if _, errdata = robot.SendTaskMessage(taskconf.Key, condconf.Id, "hero", "drawcard", &pb.HeroDrawCardReq{DrawType: 2, DrawCount: 1, Consume: 0}); errdata != nil { err = errors.New(errdata.Message) return } @@ -88,3 +89,13 @@ func (this *ModuleRobot_Hero) getbattlehero() (bheros []string) { } return } + +//获取武官训练英雄英雄 +func (this *ModuleRobot_Hero) getpracticehero() (bheros string) { + for _, v := range this.heros { + if v.Status != pb.HeroType_HeroTypeKongFu { + return v.Id + } + } + return +} diff --git a/modules/robot/modulerobot_mainline.go b/modules/robot/modulerobot_mainline.go index 4bb66f112..bb3f7a7be 100644 --- a/modules/robot/modulerobot_mainline.go +++ b/modules/robot/modulerobot_mainline.go @@ -2,6 +2,7 @@ package robot import ( "errors" + "fmt" "go_dreamfactory/comm" "go_dreamfactory/pb" "go_dreamfactory/sys/configure" @@ -12,11 +13,26 @@ import ( //用户模块 机器人 type ModuleRobot_MainLine struct { - info *pb.DBMainline + info *pb.DBMainline + group map[int32][]*cfg.GameMainStageData } -func (this *ModuleRobot_MainLine) Init() { - +func (this *ModuleRobot_MainLine) Init() (err error) { + var ( + confs []*cfg.GameMainStageData + ok bool + ) + this.group = make(map[int32][]*cfg.GameMainStageData) + if confs, err = this.getGameMainStageDatas(); err != nil { + return + } + for _, v := range confs { + if _, ok = this.group[v.GroupId]; !ok { + this.group[v.GroupId] = make([]*cfg.GameMainStageData, 0) + } + this.group[v.GroupId] = append(this.group[v.GroupId], v) + } + return } //接收到消息 @@ -43,28 +59,116 @@ func (this *ModuleRobot_MainLine) DoPipeline(robot IRobot) (err error) { func (this *ModuleRobot_MainLine) DoTask(robot IRobot, taskconf *cfg.GameWorldTaskData, condconf *cfg.GameBuriedCondiData) (err error) { var ( errdata *pb.ErrorData + conf *cfg.GameMainStageData + ok bool ) if _, errdata = robot.SendMessage("mainline", "info", &pb.MainlineInfoReq{}); errdata != nil { err = errors.New(errdata.Message) return } - switch comm.TaskType(condconf.Type) { + case comm.Rtype61: + if _, ok = this.info.Level[condconf.Filter[0]]; ok { //已通关 + return + } + if conf, err = this.getGameMainStageData(condconf.Filter[0]); err != nil { + return + } + if conf, err = this.findlevel(conf); err != nil { //找到目标管卡 + return + } + switch conf.Episodetype { + case 1, 4, 8: + var ( + heromodule *ModuleRobot_Hero + heros []string + resp proto.Message + ) + heromodule = robot.GetModule(comm.ModuleHero).(*ModuleRobot_Hero) + heros = heromodule.getbattlehero() + if resp, errdata = robot.SendTaskMessage(taskconf.Key, condconf.Id, "mainline", "challenge", &pb.MainlineChallengeReq{Level: conf.Id, Battle: &pb.BattleFormation{ + Format: heros, + }}); errdata != nil { + err = errors.New(errdata.Message) + return + } + if _, errdata = robot.SendTaskMessage(taskconf.Key, condconf.Id, "mainline", "challengeover", &pb.MainlineChallengeOverReq{Level: conf.Id, Report: &pb.BattleReport{ + Info: resp.(*pb.MainlineChallengeResp).Info, + WinSide: 1, + }}); errdata != nil { + err = errors.New(errdata.Message) + return + } + break + case 3, 7: + if _, errdata = robot.SendTaskMessage(taskconf.Key, condconf.Id, "mainline", "levelpass", &pb.MainlineLevelPassReq{Level: conf.Id}); errdata != nil { + err = errors.New(errdata.Message) + return + } + } + default: + err = fmt.Errorf("no fund mainline id:%d type:%d", conf.Id, conf.Episodetype) } return } +func (this *ModuleRobot_MainLine) findlevel(conf *cfg.GameMainStageData) (rconf *cfg.GameMainStageData, err error) { + var ( + confs []*cfg.GameMainStageData + nconf *cfg.GameMainStageData + ok bool + ) + + //前置组判断 + for _, v := range conf.PreviousGroupId { + confs = this.group[v] + for _, nconf := range confs { + if _, ok = this.info.Level[nconf.Id]; !ok { + return this.findlevel(nconf) + } + } + } + if conf.Previoustage != 0 { + if _, ok = this.info.Level[conf.Previoustage]; !ok { + if nconf, err = this.getGameMainStageData(conf.Previoustage); err != nil { + return + } + return this.findlevel(nconf) + } + } + //没找到前置了,直接放回 + rconf = conf + return +} + // 读取主线关卡表 -func (this *ModuleRobot_MainLine) getGameMainStageData(cid int32) (conf []*cfg.GameMainStageData, err error) { +func (this *ModuleRobot_MainLine) getGameMainStageData(id int32) (conf *cfg.GameMainStageData, err error) { + var ( + v interface{} + ok bool + ) + if v, err = configure.GetConfigure(game_mainstage); err != nil { + return + } else { + if conf, ok = v.(*cfg.GameMainStage).GetDataMap()[id]; !ok { + err = comm.NewNotFoundConfErr("robot", game_mainstage, id) + return + } + } + return +} + +// 读取主线关卡表 +func (this *ModuleRobot_MainLine) getGameMainStageDatas() (confs []*cfg.GameMainStageData, err error) { var ( v interface{} ) if v, err = configure.GetConfigure(game_mainstage); err != nil { return } else { - conf = v.(*cfg.GameMainStage).GetDataList() + confs = v.(*cfg.GameMainStage).GetDataList() } return } diff --git a/modules/robot/modulerobot_practice.go b/modules/robot/modulerobot_practice.go index c12cc2ea5..6f8af61bd 100644 --- a/modules/robot/modulerobot_practice.go +++ b/modules/robot/modulerobot_practice.go @@ -2,6 +2,7 @@ package robot import ( "errors" + "fmt" "go_dreamfactory/comm" "go_dreamfactory/pb" cfg "go_dreamfactory/sys/configure/structs" @@ -14,8 +15,8 @@ type ModuleRobot_Practice struct { Info *pb.DBPracticeRoom } -func (this *ModuleRobot_Practice) Init() { - +func (this *ModuleRobot_Practice) Init() (err error) { + return } //接收到消息 @@ -25,20 +26,13 @@ func (this *ModuleRobot_Practice) Receive(robot IRobot, stype string, message pr resp := message.(*pb.PracticeInfoResp) this.Info = resp.Info break - } return } //机器人执行流 func (this *ModuleRobot_Practice) DoPipeline(robot IRobot) (err error) { - var ( - errdata *pb.ErrorData - ) - if _, errdata = robot.SendMessage("hero", "list", &pb.HeroListReq{}); errdata != nil { - err = errors.New(errdata.Message) - return - } + return } @@ -53,11 +47,77 @@ func (this *ModuleRobot_Practice) DoTask(robot IRobot, taskconf *cfg.GameWorldTa } switch comm.TaskType(condconf.Type) { case comm.Rtype149: - - if _, errdata = robot.SendMessage("practice", "practice", &pb.PracticePracticeReq{}); errdata != nil { - err = errors.New(errdata.Message) - return + for i := 1; i < 4; i++ { + if err = this.practice(taskconf.Key, condconf.Id, robot, int32(i)); err == nil { + break + } + } + case comm.Rtype152: + for i := 1; i <= int(condconf.Value); i++ { + if err = this.unlock(taskconf.Key, condconf.Id, robot, int32(i)); err != nil { + return + } } } return } + +//练功 +func (this *ModuleRobot_Practice) unlock(tid, cid int32, robot IRobot, index int32) (err error) { + var ( + sysmodule *ModuleRobot_Sys + ) + sysmodule = robot.GetModule(comm.ModuleSys).(*ModuleRobot_Sys) + switch index { + case 1: + err = sysmodule.funcactivate(tid, cid, robot, "practice_ pillar1") + break + case 2: + err = sysmodule.funcactivate(tid, cid, robot, "practice_ pillar2") + break + case 3: + err = sysmodule.funcactivate(tid, cid, robot, "practice_ pillar3") + break + default: + err = fmt.Errorf("no found pillar:%d", index) + } + return +} + +//练功 +func (this *ModuleRobot_Practice) practice(tid, cid int32, robot IRobot, index int32) (err error) { + var ( + errdata *pb.ErrorData + sysmodule *ModuleRobot_Sys + heromodule *ModuleRobot_Hero + hero string + ) + sysmodule = robot.GetModule(comm.ModuleSys).(*ModuleRobot_Sys) + switch index { + case 1: + err = sysmodule.funcactivate(tid, cid, robot, "practice_ pillar1") + break + case 2: + err = sysmodule.funcactivate(tid, cid, robot, "practice_ pillar2") + break + case 3: + err = sysmodule.funcactivate(tid, cid, robot, "practice_ pillar3") + break + default: + err = fmt.Errorf("no found pillar:%d", index) + } + if err != nil { + return + } + heromodule = robot.GetModule(comm.ModuleHero).(*ModuleRobot_Hero) + hero = heromodule.getpracticehero() + if hero == "" { + err = fmt.Errorf("no found can practice hero") + return + } + if _, errdata = robot.SendTaskMessage(tid, cid, "practice", "practice", &pb.PracticePracticeReq{Index: index, Hero: hero}); errdata != nil { + err = errors.New(errdata.Message) + return + } + return +} diff --git a/modules/robot/modulerobot_sys.go b/modules/robot/modulerobot_sys.go new file mode 100644 index 000000000..a9524d8ae --- /dev/null +++ b/modules/robot/modulerobot_sys.go @@ -0,0 +1,75 @@ +package robot + +import ( + "errors" + "go_dreamfactory/comm" + "go_dreamfactory/pb" + cfg "go_dreamfactory/sys/configure/structs" + + "google.golang.org/protobuf/proto" +) + +//用户模块 机器人 +type ModuleRobot_Sys struct { + cmd map[string]int32 +} + +func (this *ModuleRobot_Sys) Init() (err error) { + this.cmd = make(map[string]int32) + return +} + +//接收到消息 +func (this *ModuleRobot_Sys) Receive(robot IRobot, stype string, message proto.Message) (err error) { + switch stype { + case "funcgetlist": + resp := message.(*pb.SysFuncGetListResp) + this.cmd = resp.Cond + break + } + return +} + +//机器人执行流 +func (this *ModuleRobot_Sys) DoPipeline(robot IRobot) (err error) { + var ( + errdata *pb.ErrorData + ) + if _, errdata = robot.SendMessage("sys", "funcgetlist", &pb.SysFuncGetListReq{}); errdata != nil { + err = errors.New(errdata.Message) + return + } + return +} + +//做任务 +func (this *ModuleRobot_Sys) DoTask(robot IRobot, taskconf *cfg.GameWorldTaskData, condconf *cfg.GameBuriedCondiData) (err error) { + var ( + errdata *pb.ErrorData + ) + switch comm.TaskType(condconf.Type) { + case comm.Rtype14: + if _, errdata = robot.SendMessage("hero", "drawcard", &pb.HeroDrawCardReq{DrawType: 2, DrawCount: 1, Consume: 0}); errdata != nil { + err = errors.New(errdata.Message) + return + } + } + return +} + +//解锁 +func (this *ModuleRobot_Sys) funcactivate(tid, sid int32, robot IRobot, cid string) (err error) { + var ( + errdata *pb.ErrorData + ) + + if this.cmd[cid] == 2 { //已解锁 + return + } + + if _, errdata = robot.SendTaskMessage(tid, sid, "sys", "funcactivate", &pb.SysFuncActivateReq{Cid: cid}); errdata != nil { + err = errors.New(errdata.Message) + return + } + return +} diff --git a/modules/robot/modulerobot_user.go b/modules/robot/modulerobot_user.go index e147879a8..a84b7ed6b 100644 --- a/modules/robot/modulerobot_user.go +++ b/modules/robot/modulerobot_user.go @@ -14,8 +14,8 @@ type ModuleRobot_User struct { userex *pb.DBUserExpand } -func (this *ModuleRobot_User) Init() { - +func (this *ModuleRobot_User) Init() (err error) { + return } //接收到消息 diff --git a/modules/robot/modulerobot_wtask.go b/modules/robot/modulerobot_wtask.go index 54d38efea..5ecdd42cb 100644 --- a/modules/robot/modulerobot_wtask.go +++ b/modules/robot/modulerobot_wtask.go @@ -21,8 +21,9 @@ type ModuleRobot_WTask struct { change chan bool } -func (this *ModuleRobot_WTask) Init() { +func (this *ModuleRobot_WTask) Init() (err error) { this.change = make(chan bool) + return } //接收到消息 @@ -124,6 +125,10 @@ locp: module = comm.ModuleHero case comm.Rtype20001, comm.Rtype70, comm.Rtype227: module = comm.ModuleWtask + case comm.Rtype149, comm.Rtype152: + module = comm.ModulePractice + case comm.Rtype61: + module = comm.ModuleMainline default: log.Error("[Robot DoTask]", log.Field{Key: "ctype", Value: cconf.Type}, log.Field{Key: "conld", Value: cconf.Id}, log.Field{Key: "err", Value: "Not Achieved !"}) break locp @@ -133,7 +138,7 @@ locp: log.Error("[Robot DoTask]", log.Field{Key: "task", Value: tconf.Key}, log.Field{Key: "conld", Value: cconf.Id}, log.Field{Key: "err", Value: err.Error()}) break locp } - time.Sleep(time.Second) + time.Sleep(time.Second * 2) continue } else { //任务已完成直接完成 if _, errdata = robot.SendMessage("wtask", "finish", &pb.WTaskFinishReq{Tid: tconf.Key}); errdata != nil { @@ -152,7 +157,7 @@ func (this *ModuleRobot_WTask) DoTask(robot IRobot, taskconf *cfg.GameWorldTaskD ) switch comm.TaskType(condconf.Type) { case comm.Rtype20001: //完成对话 - if _, errdata = robot.SendMessage("wtask", "completecondi", &pb.WTaskCompleteCondiReq{TaskId: taskconf.Key, CondiId: condconf.Id}); errdata != nil { + if _, errdata = robot.SendTaskMessage(taskconf.Key, condconf.Id, "wtask", "completecondi", &pb.WTaskCompleteCondiReq{TaskId: taskconf.Key, CondiId: condconf.Id}); errdata != nil { err = errors.New(errdata.Message) return } @@ -165,11 +170,11 @@ func (this *ModuleRobot_WTask) DoTask(robot IRobot, taskconf *cfg.GameWorldTaskD ) heromodule = robot.GetModule(comm.ModuleHero).(*ModuleRobot_Hero) heros = heromodule.getbattlehero() - if resp, errdata = robot.SendMessage("wtask", "battlestart", &pb.WTaskBattleStartReq{BattleConfId: condconf.Filter[0], Battle: &pb.BattleFormation{Format: heros}}); errdata != nil { + if resp, errdata = robot.SendTaskMessage(taskconf.Key, condconf.Id, "wtask", "battlestart", &pb.WTaskBattleStartReq{BattleConfId: condconf.Filter[0], Battle: &pb.BattleFormation{Format: heros}}); errdata != nil { err = errors.New(errdata.Message) return } - if _, errdata = robot.SendMessage("wtask", "battlefinish", &pb.WTaskBattleFinishReq{BattleConfId: condconf.Filter[0], Report: &pb.BattleReport{ + if _, errdata = robot.SendTaskMessage(taskconf.Key, condconf.Id, "wtask", "battlefinish", &pb.WTaskBattleFinishReq{BattleConfId: condconf.Filter[0], Report: &pb.BattleReport{ Info: resp.(*pb.WTaskBattleStartResp).Info, WinSide: 1, }}); errdata != nil { @@ -185,11 +190,11 @@ func (this *ModuleRobot_WTask) DoTask(robot IRobot, taskconf *cfg.GameWorldTaskD ) heromodule = robot.GetModule(comm.ModuleHero).(*ModuleRobot_Hero) heros = heromodule.getbattlehero() - if resp, errdata = robot.SendMessage("wtask", "battlestart", &pb.WTaskBattleStartReq{BattleConfId: condconf.Filter[0], Battle: &pb.BattleFormation{Format: heros}}); errdata != nil { + if resp, errdata = robot.SendTaskMessage(taskconf.Key, condconf.Id, "wtask", "battlestart", &pb.WTaskBattleStartReq{BattleConfId: condconf.Filter[0], Battle: &pb.BattleFormation{Format: heros}}); errdata != nil { err = errors.New(errdata.Message) return } - if _, errdata = robot.SendMessage("wtask", "battlefinish", &pb.WTaskBattleFinishReq{BattleConfId: condconf.Filter[0], Report: &pb.BattleReport{ + if _, errdata = robot.SendTaskMessage(taskconf.Key, condconf.Id, "wtask", "battlefinish", &pb.WTaskBattleFinishReq{BattleConfId: condconf.Filter[0], Report: &pb.BattleReport{ Info: resp.(*pb.WTaskBattleStartResp).Info, WinSide: 2, }}); errdata != nil { diff --git a/modules/robot/robot.go b/modules/robot/robot.go index a48071cbd..a8bf3482b 100644 --- a/modules/robot/robot.go +++ b/modules/robot/robot.go @@ -44,8 +44,11 @@ func (this *Robot) Init(addr string, client IClient) (err error) { this.await = make(chan *MessageResp) this.modules = make(map[core.M_Modules]IModuleRobot) this.modules[comm.ModuleUser] = new(ModuleRobot_User) + this.modules[comm.ModuleSys] = new(ModuleRobot_Sys) this.modules[comm.ModuleHero] = new(ModuleRobot_Hero) this.modules[comm.ModuleWtask] = new(ModuleRobot_WTask) + this.modules[comm.ModulePractice] = new(ModuleRobot_Practice) + this.modules[comm.ModuleMainline] = new(ModuleRobot_MainLine) for _, v := range this.modules { v.Init() } @@ -75,12 +78,6 @@ func (this *Robot) Receive(msg *pb.UserMessage) (err error) { if msgpath == "notify.errornotify" { //错误通知 resp := message.(*pb.NotifyErrorNotifyPush) reqpath := fmt.Sprintf("%s.%s", resp.ReqMainType, resp.ReqSubType) - // if module, ok = this.modules[core.M_Modules(resp.ReqMainType)]; ok { - // if err = module.ErrReceive(this, resp.ReqSubType, resp.Code); err != nil { - // log.Error("[Robot NotifyErrorNotifyPush]", log.Field{Key: "Account", Value: this.account}, log.Field{Key: "message", Value: reqpath}, log.Field{Key: "err", Value: err.Error()}) - // return - // } - // } if reqpath == this.curreq { //收到回应 this.await <- &MessageResp{ resp: nil, @@ -112,6 +109,37 @@ func (this *Robot) WriteMsg(msg *pb.UserMessage) (err error) { //发送消息 func (this *Robot) SendMessage(mtype, stype string, msg proto.Message) (resp proto.Message, errdata *pb.ErrorData) { + var ( + messageresp *MessageResp + err error + ) + // stime := time.Now() + data, _ := anypb.New(msg) + message := &pb.UserMessage{ + MainType: mtype, + SubType: stype, + Data: data, + } + if err = this.WriteMsg(message); err != nil { + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ClientError, + Title: pb.ErrorCode_ClientError.String(), + Message: err.Error(), + } + return + } + if mtype != "gateway" { + this.curreq = fmt.Sprintf("%s.%s", mtype, stype) + messageresp = <-this.await //等待回应 + resp = messageresp.resp + errdata = messageresp.errdata + // log.Debug("[机器人 Message]", log.Field{Key: "t", Value: time.Since(stime).Milliseconds()}, log.Field{Key: "Account", Value: this.account}, log.Field{Key: "message", Value: fmt.Sprintf("%s.%s", mtype, stype)}, log.Field{Key: "resp", Value: errdata == nil}) + } + return +} + +//发送消息 +func (this *Robot) SendTaskMessage(task, comdi int32, mtype, stype string, msg proto.Message) (resp proto.Message, errdata *pb.ErrorData) { var ( messageresp *MessageResp err error @@ -136,7 +164,7 @@ func (this *Robot) SendMessage(mtype, stype string, msg proto.Message) (resp pro messageresp = <-this.await //等待回应 resp = messageresp.resp errdata = messageresp.errdata - log.Debug("[机器人 Message]", log.Field{Key: "t", Value: time.Since(stime).Milliseconds()}, log.Field{Key: "Account", Value: this.account}, log.Field{Key: "message", Value: fmt.Sprintf("%s.%s", mtype, stype)}, log.Field{Key: "resp", Value: errdata == nil}) + log.Debug("[机器人 Message]", log.Field{Key: "t", Value: time.Since(stime).Milliseconds()}, log.Field{Key: "Account", Value: this.account}, log.Field{Key: "Task", Value: fmt.Sprintf("[%d-%d]", task, comdi)}, log.Field{Key: "message", Value: fmt.Sprintf("%s.%s", mtype, stype)}, log.Field{Key: "resp", Value: errdata == nil}) } return } diff --git a/modules/sys/api_activate.go b/modules/sys/api_funcactivate.go similarity index 100% rename from modules/sys/api_activate.go rename to modules/sys/api_funcactivate.go diff --git a/modules/sys/api_getlist.go b/modules/sys/api_funcgetList.go similarity index 100% rename from modules/sys/api_getlist.go rename to modules/sys/api_funcgetList.go diff --git a/modules/sys/module.go b/modules/sys/module.go index ba6960424..b1682a2eb 100644 --- a/modules/sys/module.go +++ b/modules/sys/module.go @@ -29,6 +29,10 @@ func NewModule() core.IModule { return &ModuleSys{} } +func (this *ModuleSys) GetType() core.M_Modules { + return comm.ModuleSys +} + func (this *ModuleSys) OnInstallComp() { this.ModuleBase.OnInstallComp() this.api = this.RegisterComp(new(apiComp)).(*apiComp) @@ -72,10 +76,6 @@ func (this *ModuleSys) Start() (err error) { return } -func (this *ModuleSys) GetType() core.M_Modules { - return comm.ModuleSys -} - func (this *ModuleSys) ValidCond(uid string, conf *cfg.GameOpencondData) string { return this.modelSys.validCond(uid, conf) }