From 08afddcc38c182c6aee734156acad1ae1f7aa1f0 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Tue, 22 Nov 2022 17:52:51 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E8=8B=B1=E9=9B=84=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=9F=8B=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- comm/imodule.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/comm/imodule.go b/comm/imodule.go index 781ae8c24..b01751a38 100644 --- a/comm/imodule.go +++ b/comm/imodule.go @@ -74,6 +74,15 @@ type ( RechargeMoney(uid string, money int32) // 多少天没登录 NoLoginDay(uid string, day int32) + + // 拥有N个X级英雄 + CheckLvNum(uid string, lv int32) int32 + + // 激活X个英雄图鉴 + GetTujianHeroNum(uid string) int32 + //拥有觉醒至A级的B星英雄N个 Rtype123 + CheckJuexingHeroNum(uid string, juexingLv int32, star int32) int32 + //拥有共鸣至N级的英雄 Rtype124 } //玩家 From 4a7ef70fea2ceb32fccb034710246c96892de07f Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Tue, 22 Nov 2022 17:53:04 +0800 Subject: [PATCH 2/8] =?UTF-8?q?=E8=8B=B1=E9=9B=84=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=9F=8B=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- comm/const.go | 2 +- modules/hero/api_awaken.go | 2 ++ modules/hero/api_drawCard.go | 7 +++++++ modules/hero/api_strengthenUpStar.go | 2 +- modules/hero/model_hero.go | 2 ++ modules/hero/module.go | 31 ++++++++++++++++++++++++++++ 6 files changed, 44 insertions(+), 2 deletions(-) diff --git a/comm/const.go b/comm/const.go index 0de433217..999fe8fec 100644 --- a/comm/const.go +++ b/comm/const.go @@ -483,7 +483,7 @@ const ( Rtype123 TaskType = 123 //拥有共鸣至A级的B星英雄N个(打开任务时,检查B星英雄中共鸣等级大于等于A级的记入进度,达到任务条件则完成任务) Rtype124 TaskType = 124 //拥有共鸣至N级的英雄(打开任务时,检查英雄中共鸣等级最高的英雄并记入进度,达到任务条件则完成任务) Rtype125 TaskType = 125 //指定英雄共鸣至N级(打开任务时,检查指定英雄的共鸣等级并记入进度,达到任务条件则完成任务) - Rtype126 TaskType = 126 //A阵营英雄共鸣N级(从接到任务开始,A阵营的英雄共鸣每升1级进度+1) + Rtype126 TaskType = 126 //A阵营英雄共鸣N级(从接到任务开始,A阵营的英雄共鸣每升1级进度1) Rtype127 TaskType = 127 //A星英雄共鸣N级(从接到任务开始,A星的英雄共鸣每升1级进度+1) Rtype128 TaskType = 128 //竞技场积分达到N分(历史最高记录计入进度,达到N分则完成任务) Rtype129 TaskType = 129 //竞技场段位达到A段位(打开任务时,检查玩家历史最高段位,如果达到任务条件则完成任务) diff --git a/modules/hero/api_awaken.go b/modules/hero/api_awaken.go index a3eead735..8750fd3e9 100644 --- a/modules/hero/api_awaken.go +++ b/modules/hero/api_awaken.go @@ -106,9 +106,11 @@ func (this *apiComp) Awaken(session comm.IUserSession, req *pb.HeroAwakenReq) (c session.SendMsg(string(this.module.GetType()), Awaken, &pb.HeroAwakenResp{Hero: _hero}) //任务相关 this.module.ModuleRtask.SendToRtask(session, comm.Rtype34, 1, _hero.JuexingLv) + this.module.ModuleRtask.SendToRtask(session, comm.Rtype119, _hero.JuexingLv) this.module.ModuleRtask.SendToRtask(session, comm.Rtype35, _hero.JuexingLv, utils.ToInt32(_hero.HeroID)) cfg := this.module.configure.GetHeroConfig(_hero.HeroID) if cfg != nil { + this.module.ModuleRtask.SendToRtask(session, comm.Rtype121, cfg.Race, utils.ToInt32(_hero.HeroID), _hero.JuexingLv) this.module.ModuleRtask.SendToRtask(session, comm.Rtype36, 1, cfg.Color, cfg.Job, cfg.Race, _hero.JuexingLv) //xx英雄满级、共鸣、觉醒至最高状态 nextAwaken := this.module.configure.GetHeroAwakenConfig(_hero.HeroID, _hero.JuexingLv+1) diff --git a/modules/hero/api_drawCard.go b/modules/hero/api_drawCard.go index eed2c9110..c39231f49 100644 --- a/modules/hero/api_drawCard.go +++ b/modules/hero/api_drawCard.go @@ -246,9 +246,16 @@ func (this *apiComp) DrawCard(session comm.IUserSession, req *pb.HeroDrawCardReq } else { // 阵营招募 this.module.ModuleRtask.SendToRtask(session, comm.Rtype15, req.DrawCount) this.module.ModuleRtask.SendToRtask(session, comm.Rtype19, req.DrawCount) + if drawCount == 10 { + this.module.ModuleRtask.SendToRtask(session, comm.Rtype91, 1) // 阵营10连 + } } for _, star := range szStar { this.module.ModuleRtask.SendToRtask(session, comm.Rtype16, star, 1) } + if drawCount == 10 { + this.module.ModuleRtask.SendToRtask(session, comm.Rtype90, 1) + } + this.module.ModuleRtask.SendToRtask(session, comm.Rtype89, req.DrawCount) return } diff --git a/modules/hero/api_strengthenUpStar.go b/modules/hero/api_strengthenUpStar.go index cfd608092..4bf466003 100644 --- a/modules/hero/api_strengthenUpStar.go +++ b/modules/hero/api_strengthenUpStar.go @@ -178,6 +178,6 @@ func (this *apiComp) StrengthenUpStar(session comm.IUserSession, req *pb.HeroStr } else if _hero.Star == 6 { this.module.ModuleRtask.SendToRtask(session, comm.Rtype28, 1) } - + this.module.ModuleRtask.SendToRtask(session, comm.Rtype115, utils.ToInt32(_hero.HeroID), _hero.Star) return } diff --git a/modules/hero/model_hero.go b/modules/hero/model_hero.go index f1645577d..5f060896c 100644 --- a/modules/hero/model_hero.go +++ b/modules/hero/model_hero.go @@ -560,6 +560,8 @@ func (this *ModelHero) AddCardExp(session comm.IUserSession, hero *pb.DBHero, ex if curLv-preLv > 0 { // 升级了 统计任务 this.ChangeHeroProperty(session, hero) // 重新计算属性值 // 推送 + + this.moduleHero.ModuleRtask.SendToRtask(session, comm.Rtype113, utils.ToInt32(hero.HeroID), curLv-preLv) this.moduleHero.ModuleRtask.SendToRtask(session, comm.Rtype4, utils.ToInt32(hero.HeroID), hero.Lv) this.moduleHero.ModuleRtask.SendToRtask(session, comm.Rtype23, 1, hero.Star, hero.Lv) this.moduleHero.ModuleRtask.SendToRtask(session, comm.Rtype24, 1) diff --git a/modules/hero/module.go b/modules/hero/module.go index b11a28491..c98e48210 100644 --- a/modules/hero/module.go +++ b/modules/hero/module.go @@ -560,3 +560,34 @@ func (this *Hero) CheckCondition(uid string) bool { } return false } + +// 检查大于lv等级英雄的数量 +func (this *Hero) CheckLvNum(uid string, lv int32) int32 { + + tmp := make([]*pb.DBHero, 0) + for _, v := range this.modelHero.getHeroList(uid) { + if v.Lv >= lv { + tmp = append(tmp, v) + } + } + return int32(len(tmp)) +} + +func (this *Hero) GetTujianHeroNum(uid string) int32 { + if result, err1 := this.ModuleUser.GetUserExpand(uid); err1 == nil { + tujian := result.GetTujian() + return int32(len(tujian)) + } + return 0 +} + +////拥有觉醒至A级的B星英雄N个 +func (this *Hero) CheckJuexingHeroNum(uid string, juexingLv int32, star int32) int32 { + tmp := make([]*pb.DBHero, 0) + for _, v := range this.modelHero.getHeroList(uid) { + if v.JuexingLv >= juexingLv && v.Star >= star { + tmp = append(tmp, v) + } + } + return int32(len(tmp)) +} From 1add0d31dd38e13de7a58d0596ec88b0e620c0c8 Mon Sep 17 00:00:00 2001 From: wh_zcy Date: Tue, 22 Nov 2022 17:57:57 +0800 Subject: [PATCH 3/8] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/json/game_worldtask.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/json/game_worldtask.json b/bin/json/game_worldtask.json index 8e08316ae..532e09513 100644 --- a/bin/json/game_worldtask.json +++ b/bin/json/game_worldtask.json @@ -18,7 +18,7 @@ 2, 100001 ], - "completetask": 0, + "completetask": 184, "auto_accept": 0, "overtips": 1, "reword": [ @@ -48,7 +48,7 @@ "task_display": "新剧情文本10101", "npc": [ "scenes_ boundary_02", - "邦尼兔组件名", + "邦尼兔组件名入场", "150" ], "getafter_event": [ @@ -56,7 +56,7 @@ 100002 ], "completetask": 0, - "auto_accept": 1, + "auto_accept": 0, "overtips": 1, "reword": [], "day": "", From 7d893294c352862b06ceb8a208167718aa84f9e8 Mon Sep 17 00:00:00 2001 From: wh_zcy Date: Tue, 22 Nov 2022 18:45:58 +0800 Subject: [PATCH 4/8] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/json/game_worldtask.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/json/game_worldtask.json b/bin/json/game_worldtask.json index 532e09513..855229a67 100644 --- a/bin/json/game_worldtask.json +++ b/bin/json/game_worldtask.json @@ -18,7 +18,7 @@ 2, 100001 ], - "completetask": 184, + "completetask": 0, "auto_accept": 0, "overtips": 1, "reword": [ From 80919efbd924d13a116b346bbeead42d6e67480d Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Tue, 22 Nov 2022 18:50:59 +0800 Subject: [PATCH 5/8] =?UTF-8?q?=E7=BE=81=E7=BB=8A=E5=9F=8B=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- comm/imodule.go | 7 +++++++ modules/gourmet/model_gourmet.go | 1 + modules/hero/api_resonance.go | 5 ++++- modules/hero/module.go | 11 +++++++++++ modules/library/api_usegift.go | 9 +++++++++ modules/library/module.go | 32 ++++++++++++++++++++++++++++++++ 6 files changed, 64 insertions(+), 1 deletion(-) diff --git a/comm/imodule.go b/comm/imodule.go index b01751a38..41d828b1b 100644 --- a/comm/imodule.go +++ b/comm/imodule.go @@ -83,6 +83,7 @@ type ( //拥有觉醒至A级的B星英雄N个 Rtype123 CheckJuexingHeroNum(uid string, juexingLv int32, star int32) int32 //拥有共鸣至N级的英雄 Rtype124 + CheckResonaceHeroNum(uid string, resonaceLv int32) int32 } //玩家 @@ -302,4 +303,10 @@ type ( ///红点 IReddot } + ILibrary interface { + //与N个英雄好感度等级达到A + CheckRtype132(uid string, num int32, lv int32) bool + //与指定英雄好感度等级达到N + CheckRtype133(uid string, heroId string, lv int32) bool + } ) diff --git a/modules/gourmet/model_gourmet.go b/modules/gourmet/model_gourmet.go index 8c5d4ed60..0febbcdd7 100644 --- a/modules/gourmet/model_gourmet.go +++ b/modules/gourmet/model_gourmet.go @@ -149,6 +149,7 @@ func (this *modelGourmet) CalculationGourmet(uid string, gourmet *pb.DBGourmet) mapData["cookingFood"] = gourmet.CookingFood // 正在做的 this.module.ModifyGourmetData(uid, mapData) // 同步数据 + } // 技能等级提高了 重新计算订单时间(只对订单中数据有影响) diff --git a/modules/hero/api_resonance.go b/modules/hero/api_resonance.go index 0f3fd7865..1a294aa0a 100644 --- a/modules/hero/api_resonance.go +++ b/modules/hero/api_resonance.go @@ -4,6 +4,7 @@ import ( "go_dreamfactory/comm" "go_dreamfactory/pb" cfg "go_dreamfactory/sys/configure/structs" + "go_dreamfactory/utils" "google.golang.org/protobuf/proto" ) @@ -150,10 +151,12 @@ func (this *apiComp) Resonance(session comm.IUserSession, req *pb.HeroResonanceR // 任务相关 this.module.ModuleRtask.SendToRtask(session, comm.Rtype39, 1) + this.module.ModuleRtask.SendToRtask(session, comm.Rtype127, _hero.Star, utils.ToInt32(_hero.HeroID), _hero.ResonateNum) //A星英雄共鸣N级 this.module.ModuleRtask.SendToRtask(session, comm.Rtype40, 1, 1) cfg := this.module.configure.GetHeroConfig(_hero.HeroID) if cfg != nil { - this.module.ModuleRtask.SendToRtask(session, comm.Rtype36, 1, cfg.Color, cfg.Job, cfg.Race, _hero.JuexingLv) + this.module.ModuleRtask.SendToRtask(session, comm.Rtype126, cfg.Race, _hero.ResonateNum) + this.module.ModuleRtask.SendToRtask(session, comm.Rtype36, 1, cfg.Color, cfg.Job, cfg.Race, _hero.ResonateNum) //xx英雄满级、共鸣、觉醒至最高状态 nextAwaken := this.module.configure.GetHeroAwakenConfig(_hero.HeroID, _hero.JuexingLv+1) if nextAwaken == nil { // 达到满级觉醒 diff --git a/modules/hero/module.go b/modules/hero/module.go index c98e48210..9b67927b8 100644 --- a/modules/hero/module.go +++ b/modules/hero/module.go @@ -591,3 +591,14 @@ func (this *Hero) CheckJuexingHeroNum(uid string, juexingLv int32, star int32) i } return int32(len(tmp)) } + +//拥有共鸣至N级的英雄 +func (this *Hero) CheckResonaceHeroNum(uid string, resonaceLv int32) int32 { + tmp := make([]*pb.DBHero, 0) + for _, v := range this.modelHero.getHeroList(uid) { + if v.ResonateNum >= resonaceLv { + tmp = append(tmp, v) + } + } + return int32(len(tmp)) +} diff --git a/modules/library/api_usegift.go b/modules/library/api_usegift.go index e04380a6e..d7113444d 100644 --- a/modules/library/api_usegift.go +++ b/modules/library/api_usegift.go @@ -4,6 +4,7 @@ import ( "go_dreamfactory/comm" "go_dreamfactory/pb" cfg "go_dreamfactory/sys/configure/structs" + "go_dreamfactory/utils" "google.golang.org/protobuf/proto" ) @@ -22,6 +23,7 @@ func (this *apiComp) UseGift(session comm.IUserSession, req *pb.LibraryUseGiftRe totalExp int32 curStar int32 // 配置表星级 maxLv int32 // 羁绊最大等级 + upLv int32 ) code = this.UseGiftCheck(session, req) if code != pb.ErrorCode_Success { @@ -76,6 +78,7 @@ func (this *apiComp) UseGift(session comm.IUserSession, req *pb.LibraryUseGiftRe if favorConf[_heroObj.Favorlv] <= _heroObj.Favorexp { _heroObj.Favorexp -= favorConf[_heroObj.Favorlv] _heroObj.Favorlv += 1 + upLv++ } else { break } @@ -91,5 +94,11 @@ func (this *apiComp) UseGift(session comm.IUserSession, req *pb.LibraryUseGiftRe rsp.Data = _heroObj session.SendMsg(string(this.module.GetType()), LibraryUseGiftResp, rsp) + // 任务统计 + //赠送英雄礼物并增加N点好感度 + if upLv > 0 { + this.module.ModuleRtask.SendToRtask(session, comm.Rtype134, utils.ToInt32(_heroObj.Heroid), upLv) + } + return } diff --git a/modules/library/module.go b/modules/library/module.go index cebe34f65..e6b0fa62c 100644 --- a/modules/library/module.go +++ b/modules/library/module.go @@ -240,3 +240,35 @@ func (this *Library) Rpc_ModuleFetter(ctx context.Context, args *pb.RPCGeneralRe } return } + +//与N个英雄好感度等级达到A +func (this *Library) CheckRtype132(uid string, num int32, lv int32) bool { + fetter := this.GetHeroFetterList(uid) + if len(fetter) == 0 { + return false + } + for _, v := range fetter { + if v.Favorlv >= lv { + num-- + } + } + if num >= 0 { + return true + } + return false +} + +//与指定英雄好感度等级达到N +func (this *Library) CheckRtype133(uid string, heroId string, lv int32) bool { + fetter := this.GetHeroFetterList(uid) + if len(fetter) == 0 { + return false + } + for _, v := range fetter { + if v.Heroid == heroId && v.Favorlv >= lv { + return true + } + } + + return false +} From b6162658154481e28bf301ea1c93a5a24788c786 Mon Sep 17 00:00:00 2001 From: wh_zcy Date: Tue, 22 Nov 2022 19:11:53 +0800 Subject: [PATCH 6/8] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E7=9A=84=E4=BB=BB=E5=8A=A1=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/rtask/module.go | 4 ++-- modules/rtask/updateHandle.go | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/rtask/module.go b/modules/rtask/module.go index 01bfba16c..05d9ec5e0 100644 --- a/modules/rtask/module.go +++ b/modules/rtask/module.go @@ -208,7 +208,7 @@ func (this *ModuleRtask) initRtaskVerifyHandle() { comm.Rtype42, comm.Rtype43, comm.Rtype45, comm.Rtype46, comm.Rtype47, comm.Rtype48, comm.Rtype49, comm.Rtype52, comm.Rtype55, comm.Rtype56, - comm.Rtype65, comm.Rtype66, comm.Rtype67, comm.Rtype68: + comm.Rtype65, comm.Rtype66, comm.Rtype67, comm.Rtype68, comm.Rtype140: this.registerVerifyHandle(v.Id, &rtaskCondi{ cfg: typeCfg, find: this.modelRtaskRecord.lessThanParams, @@ -260,7 +260,7 @@ func (this *ModuleRtask) SendToRtask(session comm.IUserSession, rtaskType comm.T } if condiId, err = v.find(v.cfg, params...); condiId == 0 { if err != nil { - this.Warn(errors.WithMessage(err, uid).Error(),log.Fields{}) + this.Warn(errors.WithMessage(err, uid).Error(), log.Fields{}) } } else { condis = append(condis, v) diff --git a/modules/rtask/updateHandle.go b/modules/rtask/updateHandle.go index 0ffe5466e..25a69679c 100644 --- a/modules/rtask/updateHandle.go +++ b/modules/rtask/updateHandle.go @@ -3,6 +3,7 @@ package rtask import ( "go_dreamfactory/comm" + "go_dreamfactory/lego/sys/log" "go_dreamfactory/modules/task" "go_dreamfactory/pb" "go_dreamfactory/sys/configure" @@ -56,7 +57,7 @@ func (this *ModelRtaskRecord) overrideUpdate(uid string, cfg *cfg.GameRdtaskCond return } } - + log.Debug("覆盖数值更新", log.Fields{"uid": uid, "condiId": cfg.Id, "params": vals, "updated": record.Vals[cfg.Id]}) this.listenTask(uid, cfg.Id) return } @@ -97,6 +98,7 @@ func (this *ModelRtaskRecord) addUpdate(uid string, cfg *cfg.GameRdtaskCondiData } err = this.Change(uid, update) } + log.Debug("累计次数更新", log.Fields{"uid": uid, "condiId": cfg.Id, "params": vals, "updated": record.Vals[cfg.Id]}) this.listenTask(uid, cfg.Id) return From d385e9668254735b83777be8a56286ed39fa80e6 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Tue, 22 Nov 2022 19:37:17 +0800 Subject: [PATCH 7/8] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E6=80=BB=E6=97=B6?= =?UTF-8?q?=E9=95=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pb/gourmet_db.pb.go | 32 +++++++++++++++++++++----------- pb/smithy_db.pb.go | 26 ++++++++++++++++++-------- 2 files changed, 39 insertions(+), 19 deletions(-) diff --git a/pb/gourmet_db.pb.go b/pb/gourmet_db.pb.go index 4f1047216..2194acb69 100644 --- a/pb/gourmet_db.pb.go +++ b/pb/gourmet_db.pb.go @@ -162,6 +162,7 @@ type DBGourmet struct { SpecialSkill map[int32]int32 `protobuf:"bytes,7,rep,name=specialSkill,proto3" json:"specialSkill" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3" bson:"specialSkill"` //通用技能 OrderCostTime int32 `protobuf:"varint,8,opt,name=orderCostTime,proto3" json:"orderCostTime" bson:"orderCostTime"` //订单消耗的时常 Ctime int64 `protobuf:"varint,9,opt,name=ctime,proto3" json:"ctime"` // 订单创建时间 + TotalTime int32 `protobuf:"varint,10,opt,name=totalTime,proto3" json:"totalTime" bson:"totalTime"` } func (x *DBGourmet) Reset() { @@ -259,6 +260,13 @@ func (x *DBGourmet) GetCtime() int64 { return 0 } +func (x *DBGourmet) GetTotalTime() int32 { + if x != nil { + return x.TotalTime + } + return 0 +} + var File_gourmet_gourmet_db_proto protoreflect.FileDescriptor var file_gourmet_gourmet_db_proto_rawDesc = []byte{ @@ -275,7 +283,7 @@ var file_gourmet_gourmet_db_proto_rawDesc = []byte{ 0x70, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x66, 0x6f, 0x6f, 0x64, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x66, 0x6f, 0x6f, 0x64, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x6f, 0x6f, 0x6b, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x08, 0x63, 0x6f, 0x6f, 0x6b, 0x54, 0x69, 0x6d, 0x65, 0x22, 0xc4, 0x03, 0x0a, + 0x28, 0x05, 0x52, 0x08, 0x63, 0x6f, 0x6f, 0x6b, 0x54, 0x69, 0x6d, 0x65, 0x22, 0xe2, 0x03, 0x0a, 0x09, 0x44, 0x42, 0x47, 0x6f, 0x75, 0x72, 0x6d, 0x65, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x2a, 0x0a, 0x0b, @@ -296,16 +304,18 @@ var file_gourmet_gourmet_db_proto_rawDesc = []byte{ 0x6f, 0x72, 0x64, 0x65, 0x72, 0x43, 0x6f, 0x73, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x43, 0x6f, 0x73, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x05, 0x63, 0x74, 0x69, 0x6d, 0x65, 0x1a, 0x38, 0x0a, 0x0a, 0x53, 0x6b, 0x69, 0x6c, - 0x6c, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, - 0x38, 0x01, 0x1a, 0x3f, 0x0a, 0x11, 0x53, 0x70, 0x65, 0x63, 0x69, 0x61, 0x6c, 0x53, 0x6b, 0x69, - 0x6c, 0x6c, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, - 0x02, 0x38, 0x01, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, + 0x03, 0x52, 0x05, 0x63, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x6f, 0x74, 0x61, + 0x6c, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x74, 0x6f, 0x74, + 0x61, 0x6c, 0x54, 0x69, 0x6d, 0x65, 0x1a, 0x38, 0x0a, 0x0a, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x45, + 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, + 0x1a, 0x3f, 0x0a, 0x11, 0x53, 0x70, 0x65, 0x63, 0x69, 0x61, 0x6c, 0x53, 0x6b, 0x69, 0x6c, 0x6c, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, + 0x01, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( diff --git a/pb/smithy_db.pb.go b/pb/smithy_db.pb.go index 0226168ca..5e83925ae 100644 --- a/pb/smithy_db.pb.go +++ b/pb/smithy_db.pb.go @@ -163,6 +163,7 @@ type DBSmithy struct { Ctime int64 `protobuf:"varint,9,opt,name=ctime,proto3" json:"ctime"` // 订单创建时间 DeskFloor map[int32]int32 `protobuf:"bytes,10,rep,name=deskFloor,proto3" json:"deskFloor" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` //@go_tags(`bson:"deskFloor"`)台子保底 StoveFloor int32 `protobuf:"varint,11,opt,name=stoveFloor,proto3" json:"stoveFloor" bson:"stoveFloor"` //炉子保底 + TotalTime int32 `protobuf:"varint,12,opt,name=totalTime,proto3" json:"totalTime" bson:"totalTime"` } func (x *DBSmithy) Reset() { @@ -274,6 +275,13 @@ func (x *DBSmithy) GetStoveFloor() int32 { return 0 } +func (x *DBSmithy) GetTotalTime() int32 { + if x != nil { + return x.TotalTime + } + return 0 +} + var File_smithy_smithy_db_proto protoreflect.FileDescriptor var file_smithy_smithy_db_proto_rawDesc = []byte{ @@ -290,7 +298,7 @@ var file_smithy_smithy_db_proto_rawDesc = []byte{ 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x6e, 0x65, 0x65, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x6e, 0x65, 0x65, 0x64, 0x54, 0x69, 0x6d, - 0x65, 0x22, 0xe4, 0x03, 0x0a, 0x08, 0x44, 0x42, 0x53, 0x6d, 0x69, 0x74, 0x68, 0x79, 0x12, 0x0e, + 0x65, 0x22, 0x82, 0x04, 0x0a, 0x08, 0x44, 0x42, 0x53, 0x6d, 0x69, 0x74, 0x68, 0x79, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x1c, 0x0a, 0x05, 0x63, 0x6c, 0x61, 0x6e, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, @@ -313,15 +321,17 @@ var file_smithy_smithy_db_proto_rawDesc = []byte{ 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x09, 0x64, 0x65, 0x73, 0x6b, 0x46, 0x6c, 0x6f, 0x6f, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x74, 0x6f, 0x76, 0x65, 0x46, 0x6c, 0x6f, 0x6f, 0x72, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x73, 0x74, 0x6f, 0x76, 0x65, 0x46, 0x6c, 0x6f, 0x6f, 0x72, - 0x1a, 0x38, 0x0a, 0x0a, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, - 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, - 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x3c, 0x0a, 0x0e, 0x44, 0x65, - 0x73, 0x6b, 0x46, 0x6c, 0x6f, 0x6f, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, + 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x0c, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x09, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x54, 0x69, 0x6d, 0x65, 0x1a, 0x38, + 0x0a, 0x0a, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x3c, 0x0a, 0x0e, 0x44, 0x65, 0x73, 0x6b, + 0x46, 0x6c, 0x6f, 0x6f, 0x72, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( From a7f82085d305ea8e65f31a92370b7bb46453aca1 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Tue, 22 Nov 2022 20:31:00 +0800 Subject: [PATCH 8/8] =?UTF-8?q?=E8=9E=8D=E5=90=88=20=E7=BE=8E=E9=A3=9F?= =?UTF-8?q?=E9=A6=86=20=E9=93=81=E5=8C=A0=E9=93=BA=E5=9F=8B=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/gourmet/api_getlist.go | 2 ++ modules/gourmet/model_gourmet.go | 6 +++++- modules/hero/api_fusion.go | 3 +++ modules/smithy/api_getlist.go | 7 ++++--- modules/smithy/model_smithy.go | 8 +++++++- 5 files changed, 21 insertions(+), 5 deletions(-) diff --git a/modules/gourmet/api_getlist.go b/modules/gourmet/api_getlist.go index 4d61f3d9c..2205c35b8 100644 --- a/modules/gourmet/api_getlist.go +++ b/modules/gourmet/api_getlist.go @@ -29,5 +29,7 @@ func (this *apiComp) GetList(session comm.IUserSession, req *pb.GourmetGetListRe // 计算订单信息 this.module.modelGourmet.CalculationGourmet(session.GetUserId(), _gourmet) session.SendMsg(string(this.module.GetType()), GourmetGetListResp, &pb.GourmetGetListResp{Data: _gourmet}) + + this.module.ModuleRtask.SendToRtask(session, comm.Rtype136, _gourmet.TotalTime) return } diff --git a/modules/gourmet/model_gourmet.go b/modules/gourmet/model_gourmet.go index 0febbcdd7..95b2cf91d 100644 --- a/modules/gourmet/model_gourmet.go +++ b/modules/gourmet/model_gourmet.go @@ -97,6 +97,9 @@ func (this *modelGourmet) CalculationGourmet(uid string, gourmet *pb.DBGourmet) for _, order := range gourmet.Foods { _gourmetcfg := this.module.configure.GetGourmetConfigData(order.FoodType, gourmet.Skill[order.FoodType]) // 美食家配置表 if order.FoodCount > 0 { + if gourmet.CookingFood.ETime > configure.Now().Unix() { + break + } order.FoodCount-- if order.FoodCount == 0 { order.CookTime = 0 @@ -127,7 +130,8 @@ func (this *modelGourmet) CalculationGourmet(uid string, gourmet *pb.DBGourmet) gourmet.Ctime = gourmet.CookingFood.ETime mapData["ctime"] = gourmet.Ctime bRet = true - break + gourmet.TotalTime += szTime[order.FoodType] + mapData["totalTime"] = gourmet.TotalTime } } if !bRet { // 没有订单可以做 diff --git a/modules/hero/api_fusion.go b/modules/hero/api_fusion.go index 718ae94df..dea8498a0 100644 --- a/modules/hero/api_fusion.go +++ b/modules/hero/api_fusion.go @@ -3,6 +3,7 @@ package hero import ( "go_dreamfactory/comm" "go_dreamfactory/pb" + "go_dreamfactory/utils" "google.golang.org/protobuf/proto" ) @@ -80,5 +81,7 @@ func (this *apiComp) Fusion(session comm.IUserSession, req *pb.HeroFusionReq) (c code = pb.ErrorCode_HeroCreate // 创建新英雄失败 } session.SendMsg(string(this.module.GetType()), HeroFusionResp, &pb.HeroFusionResp{Heroid: conf.Hero}) + // 通过融合获得指定英雄 + this.module.ModuleRtask.SendToRtask(session, comm.Rtype139, utils.ToInt32(conf.Hero)) return } diff --git a/modules/smithy/api_getlist.go b/modules/smithy/api_getlist.go index c1f4e6a91..f95832ef1 100644 --- a/modules/smithy/api_getlist.go +++ b/modules/smithy/api_getlist.go @@ -20,14 +20,15 @@ func (this *apiComp) GetList(session comm.IUserSession, req *pb.SmithyGetListReq if code != pb.ErrorCode_Success { return // 参数校验失败直接返回 } - _gourmet, err := this.module.modelSmithy.getSmithyList(session.GetUserId()) + _smithy, err := this.module.modelSmithy.getSmithyList(session.GetUserId()) if err != nil { code = pb.ErrorCode_DBError return } // 计算订单信息 - this.module.modelSmithy.CalculationSmithy(session.GetUserId(), _gourmet) - session.SendMsg(string(this.module.GetType()), SmithyGetListResp, &pb.SmithyGetListResp{Data: _gourmet}) + this.module.modelSmithy.CalculationSmithy(session.GetUserId(), _smithy) + session.SendMsg(string(this.module.GetType()), SmithyGetListResp, &pb.SmithyGetListResp{Data: _smithy}) + this.module.ModuleRtask.SendToRtask(session, comm.Rtype137, _smithy.TotalTime) return } diff --git a/modules/smithy/model_smithy.go b/modules/smithy/model_smithy.go index 6bce20640..f0e21bad6 100644 --- a/modules/smithy/model_smithy.go +++ b/modules/smithy/model_smithy.go @@ -87,7 +87,11 @@ func (this *modelSmithy) CalculationSmithy(uid string, smithy *pb.DBSmithy) { bRet := false for _, order := range smithy.Orders { _gourmetcfg := this.module.configure.GetSmithyConfigData(order.DeskType, smithy.Skill[order.DeskType]) // 美食家配置表 + if order.Count > 0 { + if smithy.Clang.ETime > configure.Now().Unix() { + break + } order.Count-- if order.Count == 0 { order.NeedTime = 0 @@ -118,7 +122,8 @@ func (this *modelSmithy) CalculationSmithy(uid string, smithy *pb.DBSmithy) { smithy.Ctime = smithy.Clang.ETime mapData["ctime"] = smithy.Ctime bRet = true - break + smithy.TotalTime += szTime[order.DeskType] + mapData["totalTime"] = smithy.TotalTime } } if !bRet { // 没有订单可以做 @@ -147,6 +152,7 @@ func (this *modelSmithy) CalculationSmithy(uid string, smithy *pb.DBSmithy) { mapData["clang"] = smithy.Clang // 正在做的 this.module.ModifySmithyData(uid, mapData) // 同步数据 + } func (this *modelSmithy) CalculationDeskSkillLv(uid string, Smithy *pb.DBSmithy) {