From 2fd909079414f21f2bc2e1ea9265583ea693bebb Mon Sep 17 00:00:00 2001 From: wh_zcy Date: Tue, 4 Jul 2023 17:57:17 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=A3=80=E6=9F=A5=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/sociaty/config.go | 18 ++++++++++++++++++ modules/sociaty/module.go | 21 +++++++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/modules/sociaty/config.go b/modules/sociaty/config.go index 85add7e4f..77cb9551d 100644 --- a/modules/sociaty/config.go +++ b/modules/sociaty/config.go @@ -14,6 +14,7 @@ const ( gameSociatyActivity = "game_guildactivity.json" gameRdtaskCondi = "game_rdtaskcondi.json" gameSociatyBossTask = "game_guildbosstask.json" + gameburiedCond = "game_buriedcondi.json" ) type configureComp struct { @@ -29,6 +30,7 @@ func (this *configureComp) Init(service core.IService, module core.IModule, comp gameSociatyActivity: cfg.NewGameGuildActivity, gameRdtaskCondi: cfg.NewGameRdtaskCondi, gameSociatyBossTask: cfg.NewGameGuildBossTask, + gameburiedCond: cfg.NewGameBuriedCondi, }) return } @@ -148,3 +150,19 @@ func (this *configureComp) getBossTaskList() []*cfg.GameGuildBossTaskData { return data.GetDataList() } } + +func (this *configureComp) getBuriedCondCfg() (data *cfg.GameBuriedCondi, err error) { + var ( + v interface{} + ok bool + ) + if v, err = this.GetConfigure(gameburiedCond); err != nil { + return + } else { + if data, ok = v.(*cfg.GameBuriedCondi); !ok { + err = fmt.Errorf("%T is *cfg.GameWorldAll", v) + return + } + } + return +} diff --git a/modules/sociaty/module.go b/modules/sociaty/module.go index f4bd197dc..8835d65e6 100644 --- a/modules/sociaty/module.go +++ b/modules/sociaty/module.go @@ -88,11 +88,32 @@ func (this *Sociaty) Start() (err error) { return err } + if err = this.checkSociatyConf(); err != nil { + return err + } + + this.Debug("check guild conf completed") // 初始化公会BOSS赛季开始时间 this.modelSociatyBoss.initSports() return } +var errs []string + +func (this *Sociaty) checkSociatyConf() (err error) { + buriedCondConf, err := this.configure.getBuriedCondCfg() + if err != nil { + return err + } + + for _, data := range this.sociatyTaskConf.GetDataList() { + if _, ok := buriedCondConf.GetDataMap()[data.TypeId]; !ok { + errs = append(errs, fmt.Sprintf("condId:%v 可能无效,检查guild_task表字段type_id值是否存在于buried_condi", data.TypeId)) + } + } + return +} + // 会长弹劾处理 // Deprecated func (this *Sociaty) ProcessAccuse(uid, sociatyId string) { From a0c07187a29ebd8ce8cb2626a37dc5b7f8cf4bb9 Mon Sep 17 00:00:00 2001 From: liwei <2211068034@qq.com> Date: Tue, 4 Jul 2023 18:30:31 +0800 Subject: [PATCH 2/3] =?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/practice/api_practice.go | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/modules/practice/api_practice.go b/modules/practice/api_practice.go index 113d436fd..6075f4c08 100644 --- a/modules/practice/api_practice.go +++ b/modules/practice/api_practice.go @@ -137,19 +137,22 @@ func (this *apiComp) Practice(session comm.IUserSession, req *pb.PracticePractic return } room.Knapsack[req.Teacher].Usenum++ - if tconfigure.Race != heroconf.Race { + room.Knapsack[req.Teacher].Lastusetime = configure.Now().Unix() + if tconfigure.Race != 0 && tconfigure.Race != heroconf.Race { errdata = &pb.ErrorData{ Code: pb.ErrorCode_ReqParameterError, Title: pb.ErrorCode_ReqParameterError.ToString(), Message: fmt.Sprintf("the teacher race:%d and the herorace:%d is race no can use", tconfigure.Race, heroconf.Race), } + return } - if tconfigure.Job != heroconf.Job { + if tconfigure.Job != 0 && tconfigure.Job != heroconf.Job { errdata = &pb.ErrorData{ Code: pb.ErrorCode_ReqParameterError, Title: pb.ErrorCode_ReqParameterError.ToString(), Message: fmt.Sprintf("the teacher job:%d and the hero job:%d is race no can use", tconfigure.Job, heroconf.Job), } + return } if tconfigure.BanHero == hero.HeroID { //禁止使用 errdata = &pb.ErrorData{ @@ -181,7 +184,7 @@ func (this *apiComp) Practice(session comm.IUserSession, req *pb.PracticePractic } if !utils.IsToday(room.Knapsack[req.Prop].Lastusetime) { - room.Knapsack[req.Teacher].Usenum = 0 + room.Knapsack[req.Prop].Usenum = 0 } if room.Knapsack[req.Prop].Usenum >= tconfigure.Limitation { @@ -193,20 +196,22 @@ func (this *apiComp) Practice(session comm.IUserSession, req *pb.PracticePractic return } room.Knapsack[req.Prop].Usenum++ - - if pconfigure.Race != heroconf.Race { + room.Knapsack[req.Prop].Lastusetime = configure.Now().Unix() + if pconfigure.Race != 0 && pconfigure.Race != heroconf.Race { errdata = &pb.ErrorData{ Code: pb.ErrorCode_ReqParameterError, Title: pb.ErrorCode_ReqParameterError.ToString(), Message: fmt.Sprintf("the teacher race:%d and the herorace:%d is race no can use", tconfigure.Race, heroconf.Race), } + return } - if pconfigure.Job != heroconf.Job { + if pconfigure.Job != 0 && pconfigure.Job != heroconf.Job { errdata = &pb.ErrorData{ Code: pb.ErrorCode_ReqParameterError, Title: pb.ErrorCode_ReqParameterError.ToString(), Message: fmt.Sprintf("the teacher job:%d and the hero job:%d is race no can use", tconfigure.Job, heroconf.Job), } + return } extra += int32(float64(pillarconfigure.PlacementDuration) * float64(pconfigure.Duration) / float64(1000)) pillar.Prop = req.Prop From 19e083aa5780f7426a0b8cf247d2c26697b51a08 Mon Sep 17 00:00:00 2001 From: wh_zcy Date: Tue, 4 Jul 2023 18:54:27 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=88=A4=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/smithy/api_trade.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/smithy/api_trade.go b/modules/smithy/api_trade.go index fcf0474ab..dfd49c61b 100644 --- a/modules/smithy/api_trade.go +++ b/modules/smithy/api_trade.go @@ -58,7 +58,12 @@ func (this *apiComp) Sell(session comm.IUserSession, req *pb.SmithySellReq) (err rsp := &pb.SmithySellResp{ CustomerId: req.CustomerId, EquipIds: req.EquipIds, - Customers: cus.Customers, + } + + if cus != nil { + rsp.Customers = cus.Customers + } else { + rsp.Customers = []*pb.CustomerInfo{} } session.SendMsg(string(this.module.GetType()), "sell", rsp)