From 21e6225520011c83d4d8c8078551fda0e1137d5f Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Thu, 21 Jul 2022 19:13:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B1=9E=E6=80=A7=E6=8E=A8=E9=80=81=E5=90=88?= =?UTF-8?q?=E5=B9=B6,=E5=A2=9E=E5=8A=A0=E4=B8=80=E4=BA=9B=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/json/game_mainlinechapter.json | 420 +++++++++++++------------- modules/hero/api_awaken.go | 8 +- modules/hero/api_resonance.go | 12 +- modules/hero/api_resonanceReset.go | 7 +- modules/hero/api_resonanceSelect.go | 3 +- modules/hero/api_strengthenUpSkill.go | 5 +- modules/hero/api_strengthenUpStar.go | 26 +- modules/hero/api_strengthenUplv.go | 5 +- modules/hero/model_hero.go | 7 +- modules/hero/module.go | 12 +- modules/mainline/api.go | 8 +- modules/mainline/api_challenge.go | 46 ++- modules/mainline/api_getReward.go | 29 ++ modules/user/api_login.go | 2 +- pb/errorcode.pb.go | 37 ++- pb/mainline_msg.pb.go | 50 +-- pb/proto/errorcode.proto | 2 + pb/proto/mainline/mainline_msg.proto | 2 +- 18 files changed, 371 insertions(+), 310 deletions(-) diff --git a/bin/json/game_mainlinechapter.json b/bin/json/game_mainlinechapter.json index b3fbf4b73..90a1a4392 100644 --- a/bin/json/game_mainlinechapter.json +++ b/bin/json/game_mainlinechapter.json @@ -21,9 +21,9 @@ ], "award": [ { - "a": "attr", - "t": "gold", - "n": 10000 + "a": "item", + "t": "1", + "n": 1 }, { "a": "attr", @@ -64,9 +64,9 @@ ], "award": [ { - "a": "attr", - "t": "gold", - "n": 10000 + "a": "item", + "t": "1", + "n": 1 }, { "a": "attr", @@ -112,9 +112,9 @@ ], "award": [ { - "a": "attr", - "t": "gold", - "n": 10000 + "a": "item", + "t": "1", + "n": 1 }, { "a": "attr", @@ -165,9 +165,9 @@ ], "award": [ { - "a": "attr", - "t": "gold", - "n": 10000 + "a": "item", + "t": "1", + "n": 1 }, { "a": "attr", @@ -223,9 +223,9 @@ ], "award": [ { - "a": "attr", - "t": "gold", - "n": 10000 + "a": "item", + "t": "1", + "n": 1 }, { "a": "attr", @@ -286,9 +286,9 @@ ], "award": [ { - "a": "attr", - "t": "gold", - "n": 10000 + "a": "item", + "t": "1", + "n": 1 }, { "a": "attr", @@ -349,9 +349,9 @@ ], "award": [ { - "a": "attr", - "t": "gold", - "n": 10000 + "a": "item", + "t": "1", + "n": 1 }, { "a": "attr", @@ -412,9 +412,9 @@ ], "award": [ { - "a": "attr", - "t": "gold", - "n": 10000 + "a": "item", + "t": "1", + "n": 1 }, { "a": "attr", @@ -475,9 +475,9 @@ ], "award": [ { - "a": "attr", - "t": "gold", - "n": 10000 + "a": "item", + "t": "1", + "n": 1 }, { "a": "attr", @@ -538,9 +538,9 @@ ], "award": [ { - "a": "attr", - "t": "gold", - "n": 10000 + "a": "item", + "t": "1", + "n": 1 }, { "a": "attr", @@ -601,9 +601,9 @@ ], "award": [ { - "a": "attr", - "t": "gold", - "n": 10000 + "a": "item", + "t": "1", + "n": 1 }, { "a": "attr", @@ -664,9 +664,9 @@ ], "award": [ { - "a": "attr", - "t": "gold", - "n": 10000 + "a": "item", + "t": "1", + "n": 1 }, { "a": "attr", @@ -727,9 +727,9 @@ ], "award": [ { - "a": "attr", - "t": "gold", - "n": 10000 + "a": "item", + "t": "1", + "n": 1 }, { "a": "attr", @@ -790,9 +790,9 @@ ], "award": [ { - "a": "attr", - "t": "gold", - "n": 10000 + "a": "item", + "t": "1", + "n": 1 }, { "a": "attr", @@ -853,9 +853,9 @@ ], "award": [ { - "a": "attr", - "t": "gold", - "n": 10000 + "a": "item", + "t": "1", + "n": 1 }, { "a": "attr", @@ -916,9 +916,9 @@ ], "award": [ { - "a": "attr", - "t": "gold", - "n": 10000 + "a": "item", + "t": "1", + "n": 1 }, { "a": "attr", @@ -979,9 +979,9 @@ ], "award": [ { - "a": "attr", - "t": "gold", - "n": 10000 + "a": "item", + "t": "1", + "n": 1 }, { "a": "attr", @@ -1042,9 +1042,9 @@ ], "award": [ { - "a": "attr", - "t": "gold", - "n": 10000 + "a": "item", + "t": "1", + "n": 1 }, { "a": "attr", @@ -1105,9 +1105,9 @@ ], "award": [ { - "a": "attr", - "t": "gold", - "n": 10000 + "a": "item", + "t": "1", + "n": 1 }, { "a": "attr", @@ -1168,9 +1168,9 @@ ], "award": [ { - "a": "attr", - "t": "gold", - "n": 10000 + "a": "item", + "t": "1", + "n": 1 }, { "a": "attr", @@ -1231,9 +1231,9 @@ ], "award": [ { - "a": "attr", - "t": "gold", - "n": 10000 + "a": "item", + "t": "1", + "n": 1 }, { "a": "attr", @@ -1294,9 +1294,9 @@ ], "award": [ { - "a": "attr", - "t": "gold", - "n": 10000 + "a": "item", + "t": "1", + "n": 1 }, { "a": "attr", @@ -1357,9 +1357,9 @@ ], "award": [ { - "a": "attr", - "t": "gold", - "n": 10000 + "a": "item", + "t": "1", + "n": 1 }, { "a": "attr", @@ -1420,9 +1420,9 @@ ], "award": [ { - "a": "attr", - "t": "gold", - "n": 10000 + "a": "item", + "t": "1", + "n": 1 }, { "a": "attr", @@ -1483,9 +1483,9 @@ ], "award": [ { - "a": "attr", - "t": "gold", - "n": 10000 + "a": "item", + "t": "1", + "n": 1 }, { "a": "attr", @@ -1546,9 +1546,9 @@ ], "award": [ { - "a": "attr", - "t": "gold", - "n": 10000 + "a": "item", + "t": "1", + "n": 1 }, { "a": "attr", @@ -1609,9 +1609,9 @@ ], "award": [ { - "a": "attr", - "t": "gold", - "n": 10000 + "a": "item", + "t": "1", + "n": 1 }, { "a": "attr", @@ -1672,9 +1672,9 @@ ], "award": [ { - "a": "attr", - "t": "gold", - "n": 10000 + "a": "item", + "t": "1", + "n": 1 }, { "a": "attr", @@ -1735,9 +1735,9 @@ ], "award": [ { - "a": "attr", - "t": "gold", - "n": 10000 + "a": "item", + "t": "1", + "n": 1 }, { "a": "attr", @@ -1798,9 +1798,9 @@ ], "award": [ { - "a": "attr", - "t": "gold", - "n": 10000 + "a": "item", + "t": "1", + "n": 1 }, { "a": "attr", @@ -1861,9 +1861,9 @@ ], "award": [ { - "a": "attr", - "t": "gold", - "n": 10000 + "a": "item", + "t": "1", + "n": 1 }, { "a": "attr", @@ -1924,9 +1924,9 @@ ], "award": [ { - "a": "attr", - "t": "gold", - "n": 10000 + "a": "item", + "t": "1", + "n": 1 }, { "a": "attr", @@ -1987,9 +1987,9 @@ ], "award": [ { - "a": "attr", - "t": "gold", - "n": 10000 + "a": "item", + "t": "1", + "n": 1 }, { "a": "attr", @@ -2050,9 +2050,9 @@ ], "award": [ { - "a": "attr", - "t": "gold", - "n": 10000 + "a": "item", + "t": "1", + "n": 1 }, { "a": "attr", @@ -2113,9 +2113,9 @@ ], "award": [ { - "a": "attr", - "t": "gold", - "n": 10000 + "a": "item", + "t": "1", + "n": 1 }, { "a": "attr", @@ -2176,9 +2176,9 @@ ], "award": [ { - "a": "attr", - "t": "gold", - "n": 10000 + "a": "item", + "t": "1", + "n": 1 }, { "a": "attr", @@ -2239,9 +2239,9 @@ ], "award": [ { - "a": "attr", - "t": "gold", - "n": 10000 + "a": "item", + "t": "1", + "n": 1 }, { "a": "attr", @@ -2302,9 +2302,9 @@ ], "award": [ { - "a": "attr", - "t": "gold", - "n": 10000 + "a": "item", + "t": "1", + "n": 1 }, { "a": "attr", @@ -2365,9 +2365,9 @@ ], "award": [ { - "a": "attr", - "t": "gold", - "n": 10000 + "a": "item", + "t": "1", + "n": 1 }, { "a": "attr", @@ -2428,9 +2428,9 @@ ], "award": [ { - "a": "attr", - "t": "gold", - "n": 10000 + "a": "item", + "t": "1", + "n": 1 }, { "a": "attr", @@ -2491,9 +2491,9 @@ ], "award": [ { - "a": "attr", - "t": "gold", - "n": 10000 + "a": "item", + "t": "1", + "n": 1 }, { "a": "attr", @@ -2554,9 +2554,9 @@ ], "award": [ { - "a": "attr", - "t": "gold", - "n": 10000 + "a": "item", + "t": "1", + "n": 1 }, { "a": "attr", @@ -2617,9 +2617,9 @@ ], "award": [ { - "a": "attr", - "t": "gold", - "n": 10000 + "a": "item", + "t": "1", + "n": 1 }, { "a": "attr", @@ -2680,9 +2680,9 @@ ], "award": [ { - "a": "attr", - "t": "gold", - "n": 10000 + "a": "item", + "t": "1", + "n": 1 }, { "a": "attr", @@ -2743,9 +2743,9 @@ ], "award": [ { - "a": "attr", - "t": "gold", - "n": 10000 + "a": "item", + "t": "1", + "n": 1 }, { "a": "attr", @@ -2806,9 +2806,9 @@ ], "award": [ { - "a": "attr", - "t": "gold", - "n": 10000 + "a": "item", + "t": "1", + "n": 1 }, { "a": "attr", @@ -2869,9 +2869,9 @@ ], "award": [ { - "a": "attr", - "t": "gold", - "n": 10000 + "a": "item", + "t": "1", + "n": 1 }, { "a": "attr", @@ -2932,9 +2932,9 @@ ], "award": [ { - "a": "attr", - "t": "gold", - "n": 10000 + "a": "item", + "t": "1", + "n": 1 }, { "a": "attr", @@ -2995,9 +2995,9 @@ ], "award": [ { - "a": "attr", - "t": "gold", - "n": 10000 + "a": "item", + "t": "1", + "n": 1 }, { "a": "attr", @@ -3058,9 +3058,9 @@ ], "award": [ { - "a": "attr", - "t": "gold", - "n": 10000 + "a": "item", + "t": "1", + "n": 1 }, { "a": "attr", @@ -3121,9 +3121,9 @@ ], "award": [ { - "a": "attr", - "t": "gold", - "n": 10000 + "a": "item", + "t": "1", + "n": 1 }, { "a": "attr", @@ -3184,9 +3184,9 @@ ], "award": [ { - "a": "attr", - "t": "gold", - "n": 10000 + "a": "item", + "t": "1", + "n": 1 }, { "a": "attr", @@ -3247,9 +3247,9 @@ ], "award": [ { - "a": "attr", - "t": "gold", - "n": 10000 + "a": "item", + "t": "1", + "n": 1 }, { "a": "attr", @@ -3310,9 +3310,9 @@ ], "award": [ { - "a": "attr", - "t": "gold", - "n": 10000 + "a": "item", + "t": "1", + "n": 1 }, { "a": "attr", @@ -3373,9 +3373,9 @@ ], "award": [ { - "a": "attr", - "t": "gold", - "n": 10000 + "a": "item", + "t": "1", + "n": 1 }, { "a": "attr", @@ -3436,9 +3436,9 @@ ], "award": [ { - "a": "attr", - "t": "gold", - "n": 10000 + "a": "item", + "t": "1", + "n": 1 }, { "a": "attr", @@ -3499,9 +3499,9 @@ ], "award": [ { - "a": "attr", - "t": "gold", - "n": 10000 + "a": "item", + "t": "1", + "n": 1 }, { "a": "attr", @@ -3562,9 +3562,9 @@ ], "award": [ { - "a": "attr", - "t": "gold", - "n": 10000 + "a": "item", + "t": "1", + "n": 1 }, { "a": "attr", @@ -3625,9 +3625,9 @@ ], "award": [ { - "a": "attr", - "t": "gold", - "n": 10000 + "a": "item", + "t": "1", + "n": 1 }, { "a": "attr", @@ -3688,9 +3688,9 @@ ], "award": [ { - "a": "attr", - "t": "gold", - "n": 10000 + "a": "item", + "t": "1", + "n": 1 }, { "a": "attr", @@ -3751,9 +3751,9 @@ ], "award": [ { - "a": "attr", - "t": "gold", - "n": 10000 + "a": "item", + "t": "1", + "n": 1 }, { "a": "attr", @@ -3814,9 +3814,9 @@ ], "award": [ { - "a": "attr", - "t": "gold", - "n": 10000 + "a": "item", + "t": "1", + "n": 1 }, { "a": "attr", @@ -3877,9 +3877,9 @@ ], "award": [ { - "a": "attr", - "t": "gold", - "n": 10000 + "a": "item", + "t": "1", + "n": 1 }, { "a": "attr", @@ -3940,9 +3940,9 @@ ], "award": [ { - "a": "attr", - "t": "gold", - "n": 10000 + "a": "item", + "t": "1", + "n": 1 }, { "a": "attr", @@ -4003,9 +4003,9 @@ ], "award": [ { - "a": "attr", - "t": "gold", - "n": 10000 + "a": "item", + "t": "1", + "n": 1 }, { "a": "attr", @@ -4066,9 +4066,9 @@ ], "award": [ { - "a": "attr", - "t": "gold", - "n": 10000 + "a": "item", + "t": "1", + "n": 1 }, { "a": "attr", @@ -4129,9 +4129,9 @@ ], "award": [ { - "a": "attr", - "t": "gold", - "n": 10000 + "a": "item", + "t": "1", + "n": 1 }, { "a": "attr", @@ -4192,9 +4192,9 @@ ], "award": [ { - "a": "attr", - "t": "gold", - "n": 10000 + "a": "item", + "t": "1", + "n": 1 }, { "a": "attr", @@ -4255,9 +4255,9 @@ ], "award": [ { - "a": "attr", - "t": "gold", - "n": 10000 + "a": "item", + "t": "1", + "n": 1 }, { "a": "attr", @@ -4318,9 +4318,9 @@ ], "award": [ { - "a": "attr", - "t": "gold", - "n": 10000 + "a": "item", + "t": "1", + "n": 1 }, { "a": "attr", diff --git a/modules/hero/api_awaken.go b/modules/hero/api_awaken.go index 141706344..96357ad74 100644 --- a/modules/hero/api_awaken.go +++ b/modules/hero/api_awaken.go @@ -88,9 +88,9 @@ func (this *apiComp) Awaken(session comm.IUserSession, req *pb.HeroAwakenReq) (c property[awakenData.Phasebonus[0]] += int32(value) } this.module.modelHero.mergeMainProperty(session.GetUserId(), _hero.Id, property) - + _hero.JuexingLv += 1 _heroMap := map[string]interface{}{ - "juexingLv": _hero.JuexingLv + 1, + "juexingLv": _hero.JuexingLv, "isOverlying": false, } // 保存数据 @@ -102,10 +102,12 @@ func (this *apiComp) Awaken(session comm.IUserSession, req *pb.HeroAwakenReq) (c } } - err1 = this.module.modelHero.PushHeroProperty(session, _hero.Id) // 推送属性变化 + m, err1 := this.module.modelHero.PushHeroProperty(session, _hero.Id) // 推送属性变化 if err1 != nil { this.module.Errorf("PushHeroProperty err!") } + _hero.Property = m + session.SendMsg(string(this.module.GetType()), "change", &pb.HeroChangePush{List: []*pb.DBHero{_hero}}) session.SendMsg(string(this.module.GetType()), Awaken, &pb.HeroAwakenResp{Hero: _hero}) return } diff --git a/modules/hero/api_resonance.go b/modules/hero/api_resonance.go index e47a0d605..9e396b8d5 100644 --- a/modules/hero/api_resonance.go +++ b/modules/hero/api_resonance.go @@ -101,10 +101,11 @@ func (this *apiComp) Resonance(session comm.IUserSession, req *pb.HeroResonanceR if code != pb.ErrorCode_Success { return } - + _hero.ResonateNum += 1 + _hero.DistributionResonate += resonConfig.Energy _heroMap := map[string]interface{}{ - "resonateNum": _hero.ResonateNum + 1, - "distributionResonate": _hero.DistributionResonate + resonConfig.Energy, + "resonateNum": _hero.ResonateNum, + "distributionResonate": _hero.DistributionResonate, "isOverlying": false, } err1 = this.module.modelHero.modifyHeroData(session.GetUserId(), req.HeroObjID, _heroMap) // 修改英雄信息 @@ -127,11 +128,12 @@ func (this *apiComp) Resonance(session comm.IUserSession, req *pb.HeroResonanceR } } - err1 = this.module.modelHero.PushHeroProperty(session, _hero.Id) // 推送属性变化 + m, err1 := this.module.modelHero.PushHeroProperty(session, _hero.Id) // 推送属性变化 if err1 != nil { this.module.Errorf("PushHeroProperty err!") } - + _hero.Property = m + changeHero = append(changeHero, _hero) session.SendMsg(string(this.module.GetType()), "change", &pb.HeroChangePush{List: changeHero}) session.SendMsg(string(this.module.GetType()), Resonance, &pb.HeroResonanceResp{Hero: _hero}) return diff --git a/modules/hero/api_resonanceReset.go b/modules/hero/api_resonanceReset.go index 3cd2aec31..007da2c57 100644 --- a/modules/hero/api_resonanceReset.go +++ b/modules/hero/api_resonanceReset.go @@ -68,8 +68,9 @@ func (this *apiComp) ResonanceReset(session comm.IUserSession, req *pb.HeroReson for k := range _hero.Energy { // 清除玩家选择的共鸣属性 delete(_hero.Energy, k) } + _hero.ResonateNum *= resonConfig.Energy _heroMap := map[string]interface{}{ - "DistributionResonate": _hero.ResonateNum * resonConfig.Energy, + "DistributionResonate": _hero.ResonateNum, "Energy": _hero.Energy, "isOverlying": false, } @@ -80,10 +81,12 @@ func (this *apiComp) ResonanceReset(session comm.IUserSession, req *pb.HeroReson code = pb.ErrorCode_DBError return } - err1 = this.module.modelHero.PushHeroProperty(session, _hero.Id) // 推送属性变化 + m, err1 := this.module.modelHero.PushHeroProperty(session, _hero.Id) // 推送属性变化 if err1 != nil { this.module.Errorf("PushHeroProperty err!") } + _hero.Property = m + session.SendMsg(string(this.module.GetType()), "change", &pb.HeroChangePush{List: []*pb.DBHero{_hero}}) session.SendMsg(string(this.module.GetType()), ResonanceReset, &pb.HeroResonanceResetResp{Hero: _hero, Energy: _hero.ResonateNum}) return } diff --git a/modules/hero/api_resonanceSelect.go b/modules/hero/api_resonanceSelect.go index 78c2ef4a1..1dd14a1e0 100644 --- a/modules/hero/api_resonanceSelect.go +++ b/modules/hero/api_resonanceSelect.go @@ -67,10 +67,11 @@ func (this *apiComp) ResonanceUseEnergy(session comm.IUserSession, req *pb.HeroR } this.module.modelHero.mergeMainProperty(session.GetUserId(), _hero.Id, property) - err1 = this.module.modelHero.PushHeroProperty(session, _hero.Id) // 推送属性变化 + m, err1 := this.module.modelHero.PushHeroProperty(session, _hero.Id) // 推送属性变化 if err1 != nil { this.module.Errorf("PushHeroProperty err!") } + _hero.Property = m session.SendMsg(string(this.module.GetType()), ResonanceUseEnergy, &pb.HeroResonanceUseEnergyResp{Hero: _hero}) return } diff --git a/modules/hero/api_strengthenUpSkill.go b/modules/hero/api_strengthenUpSkill.go index 11f6322d3..d0c18e532 100644 --- a/modules/hero/api_strengthenUpSkill.go +++ b/modules/hero/api_strengthenUpSkill.go @@ -131,11 +131,12 @@ func (this *apiComp) StrengthenUpSkill(session comm.IUserSession, req *pb.HeroSt return } session.SendMsg(string(this.module.GetType()), "change", &pb.HeroChangePush{List: []*pb.DBHero{delcard}}) - err1 = this.module.modelHero.PushHeroProperty(session, _hero.Id) // 推送属性变化 + m, err1 := this.module.modelHero.PushHeroProperty(session, _hero.Id) // 推送属性变化 if err1 != nil { this.module.Errorf("PushHeroProperty err!") } - + _hero.Property = m + session.SendMsg(string(this.module.GetType()), "change", &pb.HeroChangePush{List: []*pb.DBHero{_hero}}) session.SendMsg(string(this.module.GetType()), StrengthenUpSkill, &pb.HeroStrengthenUpSkillResp{Hero: _hero}) return } diff --git a/modules/hero/api_strengthenUpStar.go b/modules/hero/api_strengthenUpStar.go index 20f337158..3052b0c2c 100644 --- a/modules/hero/api_strengthenUpStar.go +++ b/modules/hero/api_strengthenUpStar.go @@ -4,7 +4,6 @@ import ( "go_dreamfactory/comm" "go_dreamfactory/pb" cfg "go_dreamfactory/sys/configure/structs" - "math" "google.golang.org/protobuf/proto" ) @@ -153,39 +152,26 @@ func (this *apiComp) StrengthenUpStar(session comm.IUserSession, req *pb.HeroStr } chanegCard = append(chanegCard, _delcard) } - + _hero.Star += 1 _heroMap := map[string]interface{}{ - "star": _hero.Star + 1, + "star": _hero.Star, "isOverlying": false, } // 触发星级任务 - this.module.ModuleTask.SendToTask(session.GetUserId(), comm.TaskTypeGetHero, &pb.TaskParam{First: _hero.Star + 1}) + this.module.ModuleTask.SendToTask(session.GetUserId(), comm.TaskTypeGetHero, &pb.TaskParam{First: _hero.Star}) // 保存数据 err1 = this.module.modelHero.modifyHeroData(session.GetUserId(), _hero.Id, _heroMap) if err1 != nil { code = pb.ErrorCode_DBError this.module.Errorf("update hero skill failed:%v", err1) } - // 计算属性 - data1 := make(map[string]int32, 0) - newConfig := this.module.configure.GetHeroStar(_hero.Star - 1) - if newConfig == nil { - - code = pb.ErrorCode_ConfigurationException - return - } - - data1[comm.Hp] = int32(math.Floor((1.0 + float64(newConfig.StarupHp)) * float64(_hero.Property[comm.Hp]) / 100)) - data1[comm.Atk] = int32(math.Floor((1.0 + float64(newConfig.StarupAtk)) * float64(_hero.Property[comm.Atk]) / 100)) - data1[comm.Def] = int32(math.Floor((1.0 + float64(newConfig.StarupDef)) * float64(_hero.Property[comm.Def]) / 100)) - data1[comm.Speed] = int32(math.Floor((1.0 + float64(newConfig.StarupSpeed)) * float64(_hero.Property[comm.Speed]) / 100)) - this.module.modelHero.mergeMainProperty(session.GetUserId(), _hero.Id, data1) - - err1 = this.module.modelHero.PushHeroProperty(session, _hero.Id) // 推送属性变化 + m, err1 := this.module.modelHero.PushHeroProperty(session, _hero.Id) // 推送属性变化 if err1 != nil { code = pb.ErrorCode_Unknown this.module.Errorf("PushHeroProperty err!") } + _hero.Property = m // 更新属性变化 + chanegCard = append(chanegCard, _hero) session.SendMsg(string(this.module.GetType()), "change", &pb.HeroChangePush{List: chanegCard}) session.SendMsg(string(this.module.GetType()), StrengthenUpStar, &pb.HeroStrengthenUpStarResp{Hero: _hero}) return diff --git a/modules/hero/api_strengthenUplv.go b/modules/hero/api_strengthenUplv.go index 3f6a52376..4d9aff09f 100644 --- a/modules/hero/api_strengthenUplv.go +++ b/modules/hero/api_strengthenUplv.go @@ -170,13 +170,14 @@ func (this *apiComp) StrengthenUplv(session comm.IUserSession, req *pb.HeroStren _costHero = append(_costHero, costHero) } session.SendMsg(string(this.module.GetType()), "change", &pb.HeroChangePush{List: _costHero}) - err1 := this.module.modelHero.PushHeroProperty(session, _hero.Id) // 推送属性变化 + m, err1 := this.module.modelHero.PushHeroProperty(session, _hero.Id) // 推送属性变化 if err1 != nil { this.module.Errorf("PushHeroProperty err!") } _hero.Lv = curLv _hero.Exp = curExp - + _hero.Property = m + session.SendMsg(string(this.module.GetType()), "change", &pb.HeroChangePush{List: []*pb.DBHero{_hero}}) session.SendMsg(string(this.module.GetType()), StrengthenUplv, &pb.HeroStrengthenUplvResp{Hero: _hero}) return } diff --git a/modules/hero/model_hero.go b/modules/hero/model_hero.go index e78e56a9a..3bbea36a4 100644 --- a/modules/hero/model_hero.go +++ b/modules/hero/model_hero.go @@ -402,8 +402,8 @@ func (this *ModelHero) PropertyCompute(uid, heroId string) map[string]int32 { } //推送用户指定英雄属性 -func (this *ModelHero) PushHeroProperty(session comm.IUserSession, heroId string) (err error) { - m := this.PropertyCompute(session.GetUserId(), heroId) +func (this *ModelHero) PushHeroProperty(session comm.IUserSession, heroId string) (m map[string]int32, err error) { + m = this.PropertyCompute(session.GetUserId(), heroId) update := map[string]interface{}{ "property": m, } @@ -412,7 +412,8 @@ func (this *ModelHero) PushHeroProperty(session comm.IUserSession, heroId string this.moduleHero.Errorf("PushHeroProperty err:%v", err) return } - return session.SendMsg("hero", "property", &pb.HeroPropertyPush{Property: m}) + + return //session.SendMsg("hero", "property", &pb.HeroPropertyPush{Property: m}) } func (this *ModelHero) cleanData(uid string) { userList := this.moduleHero.GetHeroList(uid) diff --git a/modules/hero/module.go b/modules/hero/module.go index f7e553599..36daa9eda 100644 --- a/modules/hero/module.go +++ b/modules/hero/module.go @@ -63,24 +63,24 @@ func (this *Hero) UpdateEquipment(session comm.IUserSession, hero *pb.DBHero, eq code = pb.ErrorCode_HeroNoExist return } - + list := make([]*pb.DBHero, 0) if newHero, err := this.modelHero.setEquipment(hero); err != nil { code = pb.ErrorCode_HeroEquipUpdate return } else { - list := make([]*pb.DBHero, 0) + if newHero != nil { list = append(list, newHero) } - - list = append(list, hero) - session.SendMsg("hero", "change", &pb.HeroChangePush{List: list}) } - err1 := this.modelHero.PushHeroProperty(session, hero.Id) // 推送属性变化 + m, err1 := this.modelHero.PushHeroProperty(session, hero.Id) // 推送属性变化 if err1 != nil { code = pb.ErrorCode_Unknown this.Errorf("PushHeroProperty err!") } + hero.Property = m + list = append(list, hero) + session.SendMsg("hero", "change", &pb.HeroChangePush{List: list}) this.modelHero.setEquipProperty(hero, equip) return } diff --git a/modules/mainline/api.go b/modules/mainline/api.go index 7a417b6f5..8f5de9706 100644 --- a/modules/mainline/api.go +++ b/modules/mainline/api.go @@ -6,10 +6,10 @@ import ( ) const ( - MainlineGetListResp = "getlist" - MainlineChallengeResp = "challenge" - MainlineGetRewardResp = "getreward" - PushNewChapterPush = "newchapter" + MainlineGetListResp = "getlist" + MainlineChallengeResp = "challenge" + MainlineGetRewardResp = "getreward" + MainlineNewChapterPush = "newchapter" ) type apiComp struct { diff --git a/modules/mainline/api_challenge.go b/modules/mainline/api_challenge.go index 1207244d4..16574aa23 100644 --- a/modules/mainline/api_challenge.go +++ b/modules/mainline/api_challenge.go @@ -4,6 +4,8 @@ import ( "go_dreamfactory/comm" "go_dreamfactory/pb" + cfg "go_dreamfactory/sys/configure/structs" + "go.mongodb.org/mongo-driver/bson/primitive" "google.golang.org/protobuf/proto" ) @@ -23,7 +25,9 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.MainlineChalle curChapter *pb.DBMainline // 当前章节信息 bBranch bool // 当前挑战关卡是不是分支 bCheck bool + res []*cfg.Game_atn // 小章节奖励 ) + res = make([]*cfg.Game_atn, 0) bBranch = false code = this.ChallengeCheck(session, req) if code != pb.ErrorCode_Success { @@ -62,6 +66,12 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.MainlineChalle } if con.Route == 1 { if con.Previoustage != curChapter.MainlineId { // 前置关卡校验 + // 分支关卡也校验一下 + for _, v := range curChapter.BranchID { + if v == con.Previoustage { + break + } + } code = pb.ErrorCode_MainlinePreNotFound } } else if con.Route == 2 { //分支 @@ -72,6 +82,7 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.MainlineChalle // return //} } + res = append(res, con.Award...) } // TODO 调用战斗逻辑 @@ -91,21 +102,34 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.MainlineChalle code = pb.ErrorCode_DBError return } - // 如果本章节打完 则创建新的章节 - if chaptConfig.Episode[len(chaptConfig.Episode)-1] == int32(req.MainlineId) { - _data := &pb.DBMainline{} - _data.Id = primitive.NewObjectID().Hex() - _data.ChapterId = curChapter.ChapterId + 1 - _mData := make(map[string]interface{}, 0) - _data.Uid = session.GetUserId() - _mData[_data.Id] = _data + newChaptConfig := this.module.configure.GetMainlineChapter(int32(curChapter.ChapterId + 1)) // 查下一章节 + if newChaptConfig != nil { + if len(newChaptConfig.Episode) <= 0 { + return + } + mainLineID := newChaptConfig.Episode[0] + // 如果本章节打完 则创建新的章节 + if chaptConfig.Episode[len(chaptConfig.Episode)-1] == int32(req.MainlineId) { + _data := &pb.DBMainline{} + _data.Id = primitive.NewObjectID().Hex() + _data.ChapterId = curChapter.ChapterId + 1 + _data.MainlineId = mainLineID + _mData := make(map[string]interface{}, 0) + _data.Uid = session.GetUserId() + _mData[_data.Id] = _data - this.module.modelMainline.addNewChapter(session.GetUserId(), _mData) - // 推送新的章节 - session.SendMsg(string(this.module.GetType()), PushNewChapterPush, &pb.PushNewChapterPush{Data: _data}) + this.module.modelMainline.addNewChapter(session.GetUserId(), _mData) + // 推送新的章节 + session.SendMsg(string(this.module.GetType()), MainlineNewChapterPush, &pb.MainlineNewChapterPush{Data: _data}) + } } + // 发奖 (奖励数据还没配置,后续补充) + code = this.module.DispenseRes(session, res, true) + if code != pb.ErrorCode_Success { + return + } session.SendMsg(string(this.module.GetType()), MainlineChallengeResp, &pb.MainlineChallengeResp{Data: curChapter}) return } diff --git a/modules/mainline/api_getReward.go b/modules/mainline/api_getReward.go index 9e9519adb..add27a6b5 100644 --- a/modules/mainline/api_getReward.go +++ b/modules/mainline/api_getReward.go @@ -29,6 +29,35 @@ func (this *apiComp) GetReward(session comm.IUserSession, req *pb.MainlineGetRew code = pb.ErrorCode_DBError return } + if _obj.AwaredID >= 0 { + code = pb.ErrorCode_MainlineRepeatReward // 重复领奖 + return + } + // 校验是不是通关了 + chaptConfig := this.module.configure.GetMainlineChapter(int32(_obj.ChapterId)) // 根据配置文件找 + if chaptConfig == nil { + code = pb.ErrorCode_ConfigNoFound + return + } + if chaptConfig.Episode[len(chaptConfig.Episode)-1] != _obj.MainlineId { + code = pb.ErrorCode_MainlineCompleteReward // 通关才能领奖 + return + } + _obj.AwaredID = 1 + update := map[string]interface{}{ + "awaredID": _obj.AwaredID, + } + // 发奖 + code = this.module.DispenseRes(session, chaptConfig.Award, true) + if code != pb.ErrorCode_Success { + return + } + err := this.module.modelMainline.modifyMainlineData(session.GetUserId(), _obj.Id, update) + if err != nil { + code = pb.ErrorCode_DBError + return + } + rsp.Data = _obj session.SendMsg(string(this.module.GetType()), MainlineGetRewardResp, rsp) return diff --git a/modules/user/api_login.go b/modules/user/api_login.go index d4f551560..9fa33fa8b 100644 --- a/modules/user/api_login.go +++ b/modules/user/api_login.go @@ -120,7 +120,7 @@ func (this *apiComp) Login(session comm.IUserSession, req *pb.UserLoginReq) (cod ObjId: primitive.NewObjectID().Hex(), Uid: user.Uid, Title: "系统邮件", - Contex: "恭喜获得专属礼包一份", + Contex: "恭喜获得登录专属礼包一份", CreateTime: uint64(time.Now().Unix()), DueTime: uint64(time.Now().Unix()) + 30*24*3600, // 30天需要走配置文件 Check: false, diff --git a/pb/errorcode.pb.go b/pb/errorcode.pb.go index 56ae3a961..53ca95384 100644 --- a/pb/errorcode.pb.go +++ b/pb/errorcode.pb.go @@ -102,6 +102,8 @@ const ( ErrorCode_MainlineIDFailed ErrorCode = 1501 // 关卡ID 错误 ErrorCode_MainlineNotFound ErrorCode = 1502 // 主线关卡不存在 ErrorCode_MainlinePreNotFound ErrorCode = 1503 // 前置关卡不匹配 + ErrorCode_MainlineRepeatReward ErrorCode = 1504 // 重复领奖 + ErrorCode_MainlineCompleteReward ErrorCode = 1505 // 通关才能领奖 // task ErrorCode_TaskInit ErrorCode = 1600 //初始化失败 ErrorCode_TaskReset ErrorCode = 1601 //重置任务失败 @@ -190,6 +192,8 @@ var ( 1501: "MainlineIDFailed", 1502: "MainlineNotFound", 1503: "MainlinePreNotFound", + 1504: "MainlineRepeatReward", + 1505: "MainlineCompleteReward", 1600: "TaskInit", 1601: "TaskReset", 1602: "TaskHandle", @@ -274,6 +278,8 @@ var ( "MainlineIDFailed": 1501, "MainlineNotFound": 1502, "MainlinePreNotFound": 1503, + "MainlineRepeatReward": 1504, + "MainlineCompleteReward": 1505, "TaskInit": 1600, "TaskReset": 1601, "TaskHandle": 1602, @@ -317,7 +323,7 @@ var File_errorcode_proto protoreflect.FileDescriptor var file_errorcode_proto_rawDesc = []byte{ 0x0a, 0x0f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x63, 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x2a, 0xb1, 0x0d, 0x0a, 0x09, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, + 0x6f, 0x2a, 0xe9, 0x0d, 0x0a, 0x09, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x4e, 0x6f, 0x46, 0x69, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x10, 0x0a, 0x12, 0x1b, 0x0a, 0x17, 0x4e, 0x6f, 0x46, 0x69, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, @@ -413,19 +419,22 @@ var file_errorcode_proto_rawDesc = []byte{ 0x10, 0xdd, 0x0b, 0x12, 0x15, 0x0a, 0x10, 0x4d, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x4e, 0x6f, 0x74, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x10, 0xde, 0x0b, 0x12, 0x18, 0x0a, 0x13, 0x4d, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x50, 0x72, 0x65, 0x4e, 0x6f, 0x74, 0x46, 0x6f, 0x75, 0x6e, - 0x64, 0x10, 0xdf, 0x0b, 0x12, 0x0d, 0x0a, 0x08, 0x54, 0x61, 0x73, 0x6b, 0x49, 0x6e, 0x69, 0x74, - 0x10, 0xc0, 0x0c, 0x12, 0x0e, 0x0a, 0x09, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x73, 0x65, 0x74, - 0x10, 0xc1, 0x0c, 0x12, 0x0f, 0x0a, 0x0a, 0x54, 0x61, 0x73, 0x6b, 0x48, 0x61, 0x6e, 0x64, 0x6c, - 0x65, 0x10, 0xc2, 0x0c, 0x12, 0x11, 0x0a, 0x0c, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x63, 0x65, - 0x69, 0x76, 0x65, 0x64, 0x10, 0xc3, 0x0c, 0x12, 0x13, 0x0a, 0x0e, 0x54, 0x61, 0x73, 0x6b, 0x41, - 0x63, 0x74, 0x69, 0x76, 0x65, 0x49, 0x6e, 0x69, 0x74, 0x10, 0xc4, 0x0c, 0x12, 0x16, 0x0a, 0x11, - 0x54, 0x61, 0x73, 0x6b, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x4e, 0x6f, 0x66, 0x6f, 0x75, 0x6e, - 0x64, 0x10, 0xc5, 0x0c, 0x12, 0x17, 0x0a, 0x12, 0x54, 0x61, 0x73, 0x6b, 0x41, 0x63, 0x74, 0x69, - 0x76, 0x65, 0x4e, 0x6f, 0x65, 0x6e, 0x6f, 0x75, 0x67, 0x68, 0x10, 0xc6, 0x0c, 0x12, 0x13, 0x0a, - 0x0e, 0x54, 0x61, 0x73, 0x6b, 0x4e, 0x6f, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x10, - 0xc7, 0x0c, 0x12, 0x11, 0x0a, 0x0c, 0x54, 0x61, 0x73, 0x6b, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, - 0x65, 0x64, 0x10, 0xc8, 0x0c, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x64, 0x10, 0xdf, 0x0b, 0x12, 0x19, 0x0a, 0x14, 0x4d, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, + 0x52, 0x65, 0x70, 0x65, 0x61, 0x74, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x10, 0xe0, 0x0b, 0x12, + 0x1b, 0x0a, 0x16, 0x4d, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x43, 0x6f, 0x6d, 0x70, 0x6c, + 0x65, 0x74, 0x65, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x10, 0xe1, 0x0b, 0x12, 0x0d, 0x0a, 0x08, + 0x54, 0x61, 0x73, 0x6b, 0x49, 0x6e, 0x69, 0x74, 0x10, 0xc0, 0x0c, 0x12, 0x0e, 0x0a, 0x09, 0x54, + 0x61, 0x73, 0x6b, 0x52, 0x65, 0x73, 0x65, 0x74, 0x10, 0xc1, 0x0c, 0x12, 0x0f, 0x0a, 0x0a, 0x54, + 0x61, 0x73, 0x6b, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x10, 0xc2, 0x0c, 0x12, 0x11, 0x0a, 0x0c, + 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x10, 0xc3, 0x0c, 0x12, + 0x13, 0x0a, 0x0e, 0x54, 0x61, 0x73, 0x6b, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x49, 0x6e, 0x69, + 0x74, 0x10, 0xc4, 0x0c, 0x12, 0x16, 0x0a, 0x11, 0x54, 0x61, 0x73, 0x6b, 0x41, 0x63, 0x74, 0x69, + 0x76, 0x65, 0x4e, 0x6f, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x10, 0xc5, 0x0c, 0x12, 0x17, 0x0a, 0x12, + 0x54, 0x61, 0x73, 0x6b, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x4e, 0x6f, 0x65, 0x6e, 0x6f, 0x75, + 0x67, 0x68, 0x10, 0xc6, 0x0c, 0x12, 0x13, 0x0a, 0x0e, 0x54, 0x61, 0x73, 0x6b, 0x4e, 0x6f, 0x46, + 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x10, 0xc7, 0x0c, 0x12, 0x11, 0x0a, 0x0c, 0x54, 0x61, + 0x73, 0x6b, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x10, 0xc8, 0x0c, 0x42, 0x06, 0x5a, + 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/pb/mainline_msg.pb.go b/pb/mainline_msg.pb.go index c6632a429..730239213 100644 --- a/pb/mainline_msg.pb.go +++ b/pb/mainline_msg.pb.go @@ -306,7 +306,7 @@ func (x *MainlineChallengeResp) GetData() *DBMainline { } // 推送新章节 -type PushNewChapterPush struct { +type MainlineNewChapterPush struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -314,8 +314,8 @@ type PushNewChapterPush struct { Data *DBMainline `protobuf:"bytes,1,opt,name=data,proto3" json:"data"` } -func (x *PushNewChapterPush) Reset() { - *x = PushNewChapterPush{} +func (x *MainlineNewChapterPush) Reset() { + *x = MainlineNewChapterPush{} if protoimpl.UnsafeEnabled { mi := &file_mainline_mainline_msg_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -323,13 +323,13 @@ func (x *PushNewChapterPush) Reset() { } } -func (x *PushNewChapterPush) String() string { +func (x *MainlineNewChapterPush) String() string { return protoimpl.X.MessageStringOf(x) } -func (*PushNewChapterPush) ProtoMessage() {} +func (*MainlineNewChapterPush) ProtoMessage() {} -func (x *PushNewChapterPush) ProtoReflect() protoreflect.Message { +func (x *MainlineNewChapterPush) ProtoReflect() protoreflect.Message { mi := &file_mainline_mainline_msg_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -341,12 +341,12 @@ func (x *PushNewChapterPush) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use PushNewChapterPush.ProtoReflect.Descriptor instead. -func (*PushNewChapterPush) Descriptor() ([]byte, []int) { +// Deprecated: Use MainlineNewChapterPush.ProtoReflect.Descriptor instead. +func (*MainlineNewChapterPush) Descriptor() ([]byte, []int) { return file_mainline_mainline_msg_proto_rawDescGZIP(), []int{6} } -func (x *PushNewChapterPush) GetData() *DBMainline { +func (x *MainlineNewChapterPush) GetData() *DBMainline { if x != nil { return x.Data } @@ -380,12 +380,12 @@ var file_mainline_mainline_msg_proto_rawDesc = []byte{ 0x64, 0x22, 0x38, 0x0a, 0x15, 0x4d, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x43, 0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1f, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x44, 0x42, 0x4d, 0x61, 0x69, - 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x35, 0x0a, 0x12, 0x50, - 0x75, 0x73, 0x68, 0x4e, 0x65, 0x77, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x50, 0x75, 0x73, - 0x68, 0x12, 0x1f, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x0b, 0x2e, 0x44, 0x42, 0x4d, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x52, 0x04, 0x64, 0x61, - 0x74, 0x61, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x39, 0x0a, 0x16, 0x4d, + 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x4e, 0x65, 0x77, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, + 0x72, 0x50, 0x75, 0x73, 0x68, 0x12, 0x1f, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x44, 0x42, 0x4d, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, + 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -402,20 +402,20 @@ func file_mainline_mainline_msg_proto_rawDescGZIP() []byte { var file_mainline_mainline_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 7) var file_mainline_mainline_msg_proto_goTypes = []interface{}{ - (*MainlineGetListReq)(nil), // 0: MainlineGetListReq - (*MainlineGetListResp)(nil), // 1: MainlineGetListResp - (*MainlineGetRewardReq)(nil), // 2: MainlineGetRewardReq - (*MainlineGetRewardResp)(nil), // 3: MainlineGetRewardResp - (*MainlineChallengeReq)(nil), // 4: MainlineChallengeReq - (*MainlineChallengeResp)(nil), // 5: MainlineChallengeResp - (*PushNewChapterPush)(nil), // 6: PushNewChapterPush - (*DBMainline)(nil), // 7: DBMainline + (*MainlineGetListReq)(nil), // 0: MainlineGetListReq + (*MainlineGetListResp)(nil), // 1: MainlineGetListResp + (*MainlineGetRewardReq)(nil), // 2: MainlineGetRewardReq + (*MainlineGetRewardResp)(nil), // 3: MainlineGetRewardResp + (*MainlineChallengeReq)(nil), // 4: MainlineChallengeReq + (*MainlineChallengeResp)(nil), // 5: MainlineChallengeResp + (*MainlineNewChapterPush)(nil), // 6: MainlineNewChapterPush + (*DBMainline)(nil), // 7: DBMainline } var file_mainline_mainline_msg_proto_depIdxs = []int32{ 7, // 0: MainlineGetListResp.data:type_name -> DBMainline 7, // 1: MainlineGetRewardResp.data:type_name -> DBMainline 7, // 2: MainlineChallengeResp.data:type_name -> DBMainline - 7, // 3: PushNewChapterPush.data:type_name -> DBMainline + 7, // 3: MainlineNewChapterPush.data:type_name -> DBMainline 4, // [4:4] is the sub-list for method output_type 4, // [4:4] is the sub-list for method input_type 4, // [4:4] is the sub-list for extension type_name @@ -503,7 +503,7 @@ func file_mainline_mainline_msg_proto_init() { } } file_mainline_mainline_msg_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PushNewChapterPush); i { + switch v := v.(*MainlineNewChapterPush); i { case 0: return &v.state case 1: diff --git a/pb/proto/errorcode.proto b/pb/proto/errorcode.proto index 06bcbfa37..28d75063a 100644 --- a/pb/proto/errorcode.proto +++ b/pb/proto/errorcode.proto @@ -86,6 +86,8 @@ enum ErrorCode { MainlineIDFailed = 1501; // 关卡ID 错误 MainlineNotFound = 1502; // 主线关卡不存在 MainlinePreNotFound = 1503; // 前置关卡不匹配 + MainlineRepeatReward = 1504; // 重复领奖 + MainlineCompleteReward = 1505; // 通关才能领奖 // task TaskInit = 1600; //初始化失败 diff --git a/pb/proto/mainline/mainline_msg.proto b/pb/proto/mainline/mainline_msg.proto index aaa7e0d48..48a204ebe 100644 --- a/pb/proto/mainline/mainline_msg.proto +++ b/pb/proto/mainline/mainline_msg.proto @@ -31,6 +31,6 @@ message MainlineChallengeResp { } // 推送新章节 -message PushNewChapterPush{ +message MainlineNewChapterPush{ DBMainline data = 1; } \ No newline at end of file