From 85409bd46a93ab42f89cc558d0b9a19372397e42 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Tue, 18 Oct 2022 18:01:55 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9C=80=E6=B1=82=E5=8F=98=E6=9B=B4=20?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=A4=9A=E4=B8=AA=E9=9A=8F=E6=9C=BA=E5=89=A7?= =?UTF-8?q?=E6=83=85=E5=A5=96=E5=8A=B1=E3=80=82=E6=96=B0=E5=A2=9E=E5=A5=BD?= =?UTF-8?q?=E6=84=9F=E5=BA=A6=E5=A5=96=E5=8A=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/json/game_libraryfavor.json | 81 ++- bin/json/game_libraryhero.json | 32 + bin/json/game_msgdistrib.json | 2 +- bin/json/game_pagoda.json | 551 ------------------ modules/library/api.go | 1 + modules/library/api_getstoryreward.go | 28 +- modules/library/api_lvreward.go | 64 ++ modules/library/comp_configure.go | 21 +- modules/library/module.go | 3 +- pb/library_db.pb.go | 36 +- pb/library_msg.pb.go | 178 +++++- sys/configure/structs/Game.LibraryFavor.go | 14 +- .../structs/Game.LibraryFavorData.go | 15 + sys/configure/structs/Game.LibraryHeroData.go | 17 + 14 files changed, 432 insertions(+), 611 deletions(-) create mode 100644 modules/library/api_lvreward.go diff --git a/bin/json/game_libraryfavor.json b/bin/json/game_libraryfavor.json index 21626fb61..26c598dea 100644 --- a/bin/json/game_libraryfavor.json +++ b/bin/json/game_libraryfavor.json @@ -3,54 +3,117 @@ "id": 1, "star": 3, "favorlv": 1, - "expneed": 0 + "expneed": 0, + "prize": [ + { + "a": "attr", + "t": "gold", + "n": 1000 + } + ] }, { "id": 2, "star": 3, "favorlv": 2, - "expneed": 100 + "expneed": 100, + "prize": [ + { + "a": "attr", + "t": "gold", + "n": 1200 + } + ] }, { "id": 3, "star": 3, "favorlv": 3, - "expneed": 200 + "expneed": 200, + "prize": [ + { + "a": "attr", + "t": "gold", + "n": 1500 + } + ] }, { "id": 4, "star": 4, "favorlv": 1, - "expneed": 0 + "expneed": 0, + "prize": [ + { + "a": "attr", + "t": "gold", + "n": 1200 + } + ] }, { "id": 5, "star": 4, "favorlv": 2, - "expneed": 200 + "expneed": 200, + "prize": [ + { + "a": "attr", + "t": "gold", + "n": 1500 + } + ] }, { "id": 6, "star": 4, "favorlv": 3, - "expneed": 400 + "expneed": 400, + "prize": [ + { + "a": "attr", + "t": "gold", + "n": 1800 + } + ] }, { "id": 7, "star": 5, "favorlv": 1, - "expneed": 0 + "expneed": 0, + "prize": [ + { + "a": "attr", + "t": "gold", + "n": 1500 + } + ] }, { "id": 8, "star": 5, "favorlv": 2, - "expneed": 250 + "expneed": 250, + "prize": [ + { + "a": "attr", + "t": "gold", + "n": 1800 + } + ] }, { "id": 9, "star": 5, "favorlv": 3, - "expneed": 400 + "expneed": 400, + "prize": [ + { + "a": "attr", + "t": "gold", + "n": 2100 + } + ] } ] \ No newline at end of file diff --git a/bin/json/game_libraryhero.json b/bin/json/game_libraryhero.json index 275245cef..f86a79a7d 100644 --- a/bin/json/game_libraryhero.json +++ b/bin/json/game_libraryhero.json @@ -25,8 +25,16 @@ "n": 1000 } ], + "special_stroyprize": [ + { + "a": "attr", + "t": "gold", + "n": 2000 + } + ], "endid1": 10009, "endid2": 10010, + "endid3": 10011, "fid": [ 102 ] @@ -57,8 +65,16 @@ "n": 1000 } ], + "special_stroyprize": [ + { + "a": "attr", + "t": "gold", + "n": 2000 + } + ], "endid1": 10009, "endid2": 10010, + "endid3": 10011, "fid": [ 101 ] @@ -89,8 +105,16 @@ "n": 1000 } ], + "special_stroyprize": [ + { + "a": "attr", + "t": "gold", + "n": 2000 + } + ], "endid1": 10009, "endid2": 10010, + "endid3": 10011, "fid": [ 101 ] @@ -121,8 +145,16 @@ "n": 1000 } ], + "special_stroyprize": [ + { + "a": "attr", + "t": "gold", + "n": 2000 + } + ], "endid1": 10009, "endid2": 10010, + "endid3": 10011, "fid": [ 102 ] diff --git a/bin/json/game_msgdistrib.json b/bin/json/game_msgdistrib.json index 6ee5e9cd6..ca356330d 100644 --- a/bin/json/game_msgdistrib.json +++ b/bin/json/game_msgdistrib.json @@ -37,7 +37,7 @@ }, { "msgid": "moonfantasy", - "open": false, + "open": true, "routrules": "~/worker", "describe": "月之秘境" }, diff --git a/bin/json/game_pagoda.json b/bin/json/game_pagoda.json index 64c36e22c..c8a4fe2ad 100644 --- a/bin/json/game_pagoda.json +++ b/bin/json/game_pagoda.json @@ -28,557 +28,6 @@ }, "model_display": 250015 }, - { - "key": 2, - "pagoda_type": 101, - "Level_type": 1, - "layer_num": 2, - "monster_id": [ - 501004, - 501005 - ], - "reward": [ - { - "a": "attr", - "t": "diamond", - "n": 50 - }, - { - "a": "attr", - "t": "gold", - "n": 660 - } - ], - "exp": 840, - "fight_scene": "", - "name_display": { - "key": "pagoda_layer2", - "text": "第2层" - }, - "model_display": 340065 - }, - { - "key": 3, - "pagoda_type": 101, - "Level_type": 1, - "layer_num": 3, - "monster_id": [ - 501007, - 501008 - ], - "reward": [ - { - "a": "attr", - "t": "diamond", - "n": 50 - }, - { - "a": "attr", - "t": "gold", - "n": 897 - } - ], - "exp": 760, - "fight_scene": "", - "name_display": { - "key": "pagoda_layer3", - "text": "第3层" - }, - "model_display": 250015 - }, - { - "key": 4, - "pagoda_type": 101, - "Level_type": 1, - "layer_num": 4, - "monster_id": [ - 501010, - 501011 - ], - "reward": [ - { - "a": "item", - "t": "30001", - "n": 2 - }, - { - "a": "attr", - "t": "gold", - "n": 3446 - } - ], - "exp": 2315, - "fight_scene": "", - "name_display": { - "key": "pagoda_layer4", - "text": "第4层" - }, - "model_display": 340065 - }, - { - "key": 5, - "pagoda_type": 101, - "Level_type": 1, - "layer_num": 5, - "monster_id": [ - 501013, - 501014 - ], - "reward": [ - { - "a": "attr", - "t": "diamond", - "n": 50 - }, - { - "a": "attr", - "t": "gold", - "n": 4535 - } - ], - "exp": 3375, - "fight_scene": "", - "name_display": { - "key": "pagoda_layer5", - "text": "第5层" - }, - "model_display": 250015 - }, - { - "key": 6, - "pagoda_type": 101, - "Level_type": 1, - "layer_num": 6, - "monster_id": [ - 501016, - 501017 - ], - "reward": [ - { - "a": "attr", - "t": "diamond", - "n": 50 - }, - { - "a": "attr", - "t": "gold", - "n": 5624 - } - ], - "exp": 4050, - "fight_scene": "", - "name_display": { - "key": "pagoda_layer6", - "text": "第6层" - }, - "model_display": 340065 - }, - { - "key": 7, - "pagoda_type": 101, - "Level_type": 1, - "layer_num": 7, - "monster_id": [ - 501019, - 501020 - ], - "reward": [ - { - "a": "attr", - "t": "diamond", - "n": 50 - }, - { - "a": "attr", - "t": "gold", - "n": 7502 - } - ], - "exp": 5860, - "fight_scene": "", - "name_display": { - "key": "pagoda_layer7", - "text": "第7层" - }, - "model_display": 250015 - }, - { - "key": 8, - "pagoda_type": 101, - "Level_type": 1, - "layer_num": 8, - "monster_id": [ - 501022, - 501023 - ], - "reward": [ - { - "a": "item", - "t": "60002", - "n": 1 - }, - { - "a": "attr", - "t": "gold", - "n": 10453 - } - ], - "exp": 7580, - "fight_scene": "", - "name_display": { - "key": "pagoda_layer8", - "text": "第8层" - }, - "model_display": 340065 - }, - { - "key": 9, - "pagoda_type": 101, - "Level_type": 1, - "layer_num": 9, - "monster_id": [ - 501025, - 501026 - ], - "reward": [ - { - "a": "attr", - "t": "diamond", - "n": 50 - }, - { - "a": "attr", - "t": "gold", - "n": 13306 - } - ], - "exp": 9060, - "fight_scene": "", - "name_display": { - "key": "pagoda_layer9", - "text": "第9层" - }, - "model_display": 250015 - }, - { - "key": 10, - "pagoda_type": 101, - "Level_type": 1, - "layer_num": 10, - "monster_id": [ - 501028, - 501029 - ], - "reward": [ - { - "a": "attr", - "t": "diamond", - "n": 50 - }, - { - "a": "attr", - "t": "gold", - "n": 18206 - } - ], - "exp": 12700, - "fight_scene": "", - "name_display": { - "key": "pagoda_layer10", - "text": "第10层" - }, - "model_display": 340065 - }, - { - "key": 11, - "pagoda_type": 101, - "Level_type": 1, - "layer_num": 11, - "monster_id": [ - 501031, - 501032 - ], - "reward": [ - { - "a": "attr", - "t": "diamond", - "n": 50 - }, - { - "a": "attr", - "t": "gold", - "n": 22254 - } - ], - "exp": 18990, - "fight_scene": "", - "name_display": { - "key": "pagoda_layer11", - "text": "第11层" - }, - "model_display": 250015 - }, - { - "key": 12, - "pagoda_type": 101, - "Level_type": 1, - "layer_num": 12, - "monster_id": [ - 501034, - 501035 - ], - "reward": [ - { - "a": "item", - "t": "30001", - "n": 2 - }, - { - "a": "attr", - "t": "gold", - "n": 25593 - } - ], - "exp": 22170, - "fight_scene": "", - "name_display": { - "key": "pagoda_layer12", - "text": "第12层" - }, - "model_display": 340065 - }, - { - "key": 13, - "pagoda_type": 101, - "Level_type": 1, - "layer_num": 13, - "monster_id": [ - 501037, - 501038 - ], - "reward": [ - { - "a": "attr", - "t": "diamond", - "n": 50 - }, - { - "a": "attr", - "t": "gold", - "n": 30601 - } - ], - "exp": 25740, - "fight_scene": "", - "name_display": { - "key": "pagoda_layer13", - "text": "第13层" - }, - "model_display": 250015 - }, - { - "key": 14, - "pagoda_type": 101, - "Level_type": 1, - "layer_num": 14, - "monster_id": [ - 501040, - 501041 - ], - "reward": [ - { - "a": "attr", - "t": "diamond", - "n": 50 - }, - { - "a": "attr", - "t": "gold", - "n": 39286 - } - ], - "exp": 30600, - "fight_scene": "", - "name_display": { - "key": "pagoda_layer14", - "text": "第14层" - }, - "model_display": 340065 - }, - { - "key": 15, - "pagoda_type": 101, - "Level_type": 1, - "layer_num": 15, - "monster_id": [ - 501043, - 501044 - ], - "reward": [ - { - "a": "attr", - "t": "diamond", - "n": 50 - }, - { - "a": "attr", - "t": "gold", - "n": 43349 - } - ], - "exp": 36300, - "fight_scene": "", - "name_display": { - "key": "pagoda_layer15", - "text": "第15层" - }, - "model_display": 250015 - }, - { - "key": 16, - "pagoda_type": 101, - "Level_type": 1, - "layer_num": 16, - "monster_id": [ - 501046, - 501047 - ], - "reward": [ - { - "a": "item", - "t": "60002", - "n": 1 - }, - { - "a": "attr", - "t": "gold", - "n": 47415 - } - ], - "exp": 44100, - "fight_scene": "", - "name_display": { - "key": "pagoda_layer16", - "text": "第16层" - }, - "model_display": 340065 - }, - { - "key": 17, - "pagoda_type": 101, - "Level_type": 1, - "layer_num": 17, - "monster_id": [ - 501049, - 501050 - ], - "reward": [ - { - "a": "attr", - "t": "diamond", - "n": 50 - }, - { - "a": "attr", - "t": "gold", - "n": 63694 - } - ], - "exp": 65300, - "fight_scene": "", - "name_display": { - "key": "pagoda_layer17", - "text": "第17层" - }, - "model_display": 250015 - }, - { - "key": 18, - "pagoda_type": 101, - "Level_type": 1, - "layer_num": 18, - "monster_id": [ - 501052, - 501053 - ], - "reward": [ - { - "a": "attr", - "t": "diamond", - "n": 50 - }, - { - "a": "attr", - "t": "gold", - "n": 74187 - } - ], - "exp": 85200, - "fight_scene": "", - "name_display": { - "key": "pagoda_layer18", - "text": "第18层" - }, - "model_display": 340065 - }, - { - "key": 19, - "pagoda_type": 101, - "Level_type": 1, - "layer_num": 19, - "monster_id": [ - 501055, - 501056 - ], - "reward": [ - { - "a": "attr", - "t": "diamond", - "n": 50 - }, - { - "a": "attr", - "t": "gold", - "n": 85026 - } - ], - "exp": 102000, - "fight_scene": "", - "name_display": { - "key": "pagoda_layer19", - "text": "第19层" - }, - "model_display": 250015 - }, - { - "key": 20, - "pagoda_type": 101, - "Level_type": 1, - "layer_num": 20, - "monster_id": [ - 501058, - 501059 - ], - "reward": [ - { - "a": "item", - "t": "30001", - "n": 2 - }, - { - "a": "attr", - "t": "gold", - "n": 102031 - } - ], - "exp": 122400, - "fight_scene": "", - "name_display": { - "key": "pagoda_layer20", - "text": "第20层" - }, - "model_display": 340065 - }, { "key": 101, "pagoda_type": 201, diff --git a/modules/library/api.go b/modules/library/api.go index 7b178de88..16732567f 100644 --- a/modules/library/api.go +++ b/modules/library/api.go @@ -17,6 +17,7 @@ const ( LibraryActivationFetterResp = "activationfetter" LibraryChangePush = "change" LibraryGetStoryRewardResp = "getstoryreward" + LibraryLvRewardResp = "lvreward" ) type apiComp struct { diff --git a/modules/library/api_getstoryreward.go b/modules/library/api_getstoryreward.go index e26f6145d..649c8b4f2 100644 --- a/modules/library/api_getstoryreward.go +++ b/modules/library/api_getstoryreward.go @@ -7,6 +7,7 @@ package library import ( "go_dreamfactory/comm" "go_dreamfactory/pb" + cfg "go_dreamfactory/sys/configure/structs" "go_dreamfactory/utils" "strconv" @@ -58,12 +59,31 @@ func (this *apiComp) GetStoryReward(session comm.IUserSession, req *pb.LibraryGe break } } else if req.Rightend != 0 { // 剧情奖励 - if req.Rightend == conf.Rightend && _heroFetter.Stroyprize != conf.Rightend { - _heroFetter.Stroyprize = conf.Rightend + bRepeadGetReawrd := false + if req.Rightend == conf.Rightend || req.Rightend == conf.Endid1 || + req.Rightend == conf.Endid2 || req.Rightend == conf.Endid3 { + for _, v := range _heroFetter.Stroyprize { + if v == req.Rightend { + bRepeadGetReawrd = true + break + } + } + if bRepeadGetReawrd { // 重复领奖 + code = pb.ErrorCode_LibraryReward + return + } + var res []*cfg.Gameatn // + if req.Rightend == conf.Rightend { + res = conf.Stroyprize + } else { + res = conf.SpecialStroyprize + } + + _heroFetter.Stroyprize = append(_heroFetter.Stroyprize, req.Rightend) // 发奖 - code = this.module.DispenseRes(session, conf.Stroyprize, true) + code = this.module.DispenseRes(session, res, true) if code != pb.ErrorCode_Success { - this.module.Errorf("GetStoryReward err:add item : %v", conf.Stroyprize) + this.module.Errorf("GetStoryReward err:add item : %v", res) } mapData := make(map[string]interface{}, 0) mapData["stroyprize"] = _heroFetter.Stroyprize diff --git a/modules/library/api_lvreward.go b/modules/library/api_lvreward.go new file mode 100644 index 000000000..5cb611307 --- /dev/null +++ b/modules/library/api_lvreward.go @@ -0,0 +1,64 @@ +package library + +/* +* 单个英雄剧情id 奖励 + */ + +import ( + "go_dreamfactory/comm" + "go_dreamfactory/pb" + + "google.golang.org/protobuf/proto" +) + +//参数校验 +func (this *apiComp) LvRewardCheck(session comm.IUserSession, req *pb.LibraryLvRewardReq) (code pb.ErrorCode) { + if req.Oid == "" || req.Lv <= 0 { + code = pb.ErrorCode_ReqParameterError + } + return +} + +func (this *apiComp) LvReward(session comm.IUserSession, req *pb.LibraryLvRewardReq) (code pb.ErrorCode, data proto.Message) { + + resp := &pb.LibraryLvRewardResp{} + code = this.LvRewardCheck(session, req) + if code != pb.ErrorCode_Success { + return // 参数校验失败直接返回 + } + _heroFetter := this.module.modelFetter.getOneHeroFetter(session.GetUserId(), req.Oid) + if _heroFetter == nil { + code = pb.ErrorCode_ReqParameterError + return + } + curStar := this.module.configure.GetHeroConfigStar(_heroFetter.Heroid) // 查询原始星级 + if curStar == 0 { + code = pb.ErrorCode_ConfigNoFound + return + } + confData := this.module.configure.GetLibraryFavorData(curStar, req.Lv) + if len(confData.Prize) == 0 { + code = pb.ErrorCode_ReqParameterError + return + } + + for _, v := range _heroFetter.Lvprize { + if v == req.Lv { + code = pb.ErrorCode_LibraryReward // 重复领奖 + break + } + } + _heroFetter.Lvprize = append(_heroFetter.Lvprize, req.Lv) + // 发奖 + code = this.module.DispenseRes(session, confData.Prize, true) + if code != pb.ErrorCode_Success { + this.module.Errorf("GetStoryReward err:add item : %v", confData.Prize) + } + mapData := make(map[string]interface{}, 0) + mapData["lvprize"] = _heroFetter.Lvprize + this.module.modelFetter.modifyHeroFetterDataByObjId(session.GetUserId(), _heroFetter.Id, mapData) + resp.Data = _heroFetter + + session.SendMsg(string(this.module.GetType()), LibraryLvRewardResp, resp) + return +} diff --git a/modules/library/comp_configure.go b/modules/library/comp_configure.go index 1f906440a..8ffd527e5 100644 --- a/modules/library/comp_configure.go +++ b/modules/library/comp_configure.go @@ -22,6 +22,7 @@ const ( type configureComp struct { modules.MCompConfigure fetter map[int64]*cfg.GameLibraryFetterData + favor map[int64]*cfg.GameLibraryFavorData } //组件初始化接口 @@ -37,10 +38,27 @@ func (this *configureComp) Init(service core.IService, module core.IModule, comp this.fetter = make(map[int64]*cfg.GameLibraryFetterData, 0) configure.RegisterConfigure(game_libraryfetter, cfg.NewGameLibraryFetter, this.SetLibraryFetter) - + this.favor = make(map[int64]*cfg.GameLibraryFavorData, 0) + configure.RegisterConfigure(game_libraryfetter, cfg.NewGameLibraryFetter, this.SetLibraryFavor) return } +func (this *configureComp) SetLibraryFavor() { + if v, err := this.GetConfigure(game_favornum); err == nil { + if _configure, ok := v.(*cfg.GameLibraryFavor); ok { + for _, v1 := range _configure.GetDataList() { + this.favor[int64(v1.Star<<8)+int64(v1.Favorlv)] = v1 + } + return + } + } else { + err = fmt.Errorf("%T no is *cfg.GameLibraryFavor", v) + } +} +func (this *configureComp) GetLibraryFavorData(star, favorlv int32) (data *cfg.GameLibraryFavorData) { + return this.favor[int64(star<<8)+int64(favorlv)] +} + func (this *configureComp) SetLibraryFetter() { if v, err := this.GetConfigure(game_libraryfetter); err == nil { if _configure, ok := v.(*cfg.GameLibraryFetter); ok { @@ -53,6 +71,7 @@ func (this *configureComp) SetLibraryFetter() { err = fmt.Errorf("%T no is *cfg.GameLibraryFetter", v) } } + func (this *configureComp) GetLibraryFetter(fid, favorlv int32) (data *cfg.GameLibraryFetterData) { return this.fetter[int64(fid<<8)+int64(favorlv)] } diff --git a/modules/library/module.go b/modules/library/module.go index 0d61d6442..139833661 100644 --- a/modules/library/module.go +++ b/modules/library/module.go @@ -111,7 +111,8 @@ func (this *Library) createHeroFetter(uid string, heroConfId string) (obj *pb.DB Heroid: heroConfId, History: make([]int32, 0), Favorlv: 1, - Stroyprize: 0, + Stroyprize: make([]int32, 0), + Lvprize: make([]int32, 0), } if err := this.modelFetter.createHeroFetter(uid, obj); err != nil { code = pb.ErrorCode_DBError diff --git a/pb/library_db.pb.go b/pb/library_db.pb.go index b582eebb4..608484de3 100644 --- a/pb/library_db.pb.go +++ b/pb/library_db.pb.go @@ -129,13 +129,14 @@ type DBHeroFetter struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id" bson:"_id"` //ID - Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid" bson:"uid"` //用户ID - Heroid string `protobuf:"bytes,3,opt,name=heroid,proto3" json:"heroid"` // 英雄配置表id - History []int32 `protobuf:"varint,4,rep,packed,name=history,proto3" json:"history"` // 传记往事ID - Favorlv int32 `protobuf:"varint,5,opt,name=favorlv,proto3" json:"favorlv"` // 好感度等级 - Favorexp int32 `protobuf:"varint,6,opt,name=favorexp,proto3" json:"favorexp"` // 好感度经验 - Stroyprize int32 `protobuf:"varint,7,opt,name=stroyprize,proto3" json:"stroyprize"` // 剧情奖励 + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id" bson:"_id"` //ID + Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid" bson:"uid"` //用户ID + Heroid string `protobuf:"bytes,3,opt,name=heroid,proto3" json:"heroid"` // 英雄配置表id + History []int32 `protobuf:"varint,4,rep,packed,name=history,proto3" json:"history"` // 传记往事ID + Favorlv int32 `protobuf:"varint,5,opt,name=favorlv,proto3" json:"favorlv"` // 好感度等级 + Favorexp int32 `protobuf:"varint,6,opt,name=favorexp,proto3" json:"favorexp"` // 好感度经验 + Stroyprize []int32 `protobuf:"varint,7,rep,packed,name=stroyprize,proto3" json:"stroyprize"` // 剧情奖励 + Lvprize []int32 `protobuf:"varint,8,rep,packed,name=lvprize,proto3" json:"lvprize"` // 等级奖励 } func (x *DBHeroFetter) Reset() { @@ -212,11 +213,18 @@ func (x *DBHeroFetter) GetFavorexp() int32 { return 0 } -func (x *DBHeroFetter) GetStroyprize() int32 { +func (x *DBHeroFetter) GetStroyprize() []int32 { if x != nil { return x.Stroyprize } - return 0 + return nil +} + +func (x *DBHeroFetter) GetLvprize() []int32 { + if x != nil { + return x.Lvprize + } + return nil } var File_library_library_db_proto protoreflect.FileDescriptor @@ -245,7 +253,7 @@ var file_library_library_db_proto_rawDesc = []byte{ 0x38, 0x01, 0x1a, 0x38, 0x0a, 0x0a, 0x50, 0x72, 0x69, 0x7a, 0x65, 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, 0x22, 0xb8, 0x01, 0x0a, + 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xd2, 0x01, 0x0a, 0x0c, 0x44, 0x42, 0x48, 0x65, 0x72, 0x6f, 0x46, 0x65, 0x74, 0x74, 0x65, 0x72, 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, @@ -256,9 +264,11 @@ var file_library_library_db_proto_rawDesc = []byte{ 0x28, 0x05, 0x52, 0x07, 0x66, 0x61, 0x76, 0x6f, 0x72, 0x6c, 0x76, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x61, 0x76, 0x6f, 0x72, 0x65, 0x78, 0x70, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x66, 0x61, 0x76, 0x6f, 0x72, 0x65, 0x78, 0x70, 0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x6f, 0x79, - 0x70, 0x72, 0x69, 0x7a, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x73, 0x74, 0x72, - 0x6f, 0x79, 0x70, 0x72, 0x69, 0x7a, 0x65, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x70, 0x72, 0x69, 0x7a, 0x65, 0x18, 0x07, 0x20, 0x03, 0x28, 0x05, 0x52, 0x0a, 0x73, 0x74, 0x72, + 0x6f, 0x79, 0x70, 0x72, 0x69, 0x7a, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6c, 0x76, 0x70, 0x72, 0x69, + 0x7a, 0x65, 0x18, 0x08, 0x20, 0x03, 0x28, 0x05, 0x52, 0x07, 0x6c, 0x76, 0x70, 0x72, 0x69, 0x7a, + 0x65, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( diff --git a/pb/library_msg.pb.go b/pb/library_msg.pb.go index aa5d4dcbd..309745e42 100644 --- a/pb/library_msg.pb.go +++ b/pb/library_msg.pb.go @@ -660,6 +660,109 @@ func (x *LibraryChangePush) GetFetter() []*DBHeroFetter { return nil } +// 领取等级奖励 +type LibraryLvRewardReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Oid string `protobuf:"bytes,1,opt,name=oid,proto3" json:"oid"` // 对象唯一id + Lv int32 `protobuf:"varint,2,opt,name=lv,proto3" json:"lv"` // 好感度等级 +} + +func (x *LibraryLvRewardReq) Reset() { + *x = LibraryLvRewardReq{} + if protoimpl.UnsafeEnabled { + mi := &file_library_library_msg_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LibraryLvRewardReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LibraryLvRewardReq) ProtoMessage() {} + +func (x *LibraryLvRewardReq) ProtoReflect() protoreflect.Message { + mi := &file_library_library_msg_proto_msgTypes[13] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LibraryLvRewardReq.ProtoReflect.Descriptor instead. +func (*LibraryLvRewardReq) Descriptor() ([]byte, []int) { + return file_library_library_msg_proto_rawDescGZIP(), []int{13} +} + +func (x *LibraryLvRewardReq) GetOid() string { + if x != nil { + return x.Oid + } + return "" +} + +func (x *LibraryLvRewardReq) GetLv() int32 { + if x != nil { + return x.Lv + } + return 0 +} + +type LibraryLvRewardResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Data *DBHeroFetter `protobuf:"bytes,1,opt,name=data,proto3" json:"data"` +} + +func (x *LibraryLvRewardResp) Reset() { + *x = LibraryLvRewardResp{} + if protoimpl.UnsafeEnabled { + mi := &file_library_library_msg_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LibraryLvRewardResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LibraryLvRewardResp) ProtoMessage() {} + +func (x *LibraryLvRewardResp) ProtoReflect() protoreflect.Message { + mi := &file_library_library_msg_proto_msgTypes[14] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LibraryLvRewardResp.ProtoReflect.Descriptor instead. +func (*LibraryLvRewardResp) Descriptor() ([]byte, []int) { + return file_library_library_msg_proto_rawDescGZIP(), []int{14} +} + +func (x *LibraryLvRewardResp) GetData() *DBHeroFetter { + if x != nil { + return x.Data + } + return nil +} + var File_library_library_msg_proto protoreflect.FileDescriptor var file_library_library_msg_proto_rawDesc = []byte{ @@ -721,7 +824,15 @@ var file_library_library_msg_proto_rawDesc = []byte{ 0x61, 0x72, 0x79, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x25, 0x0a, 0x06, 0x66, 0x65, 0x74, 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x44, 0x42, 0x48, 0x65, 0x72, 0x6f, 0x46, 0x65, 0x74, 0x74, 0x65, 0x72, 0x52, 0x06, 0x66, 0x65, 0x74, 0x74, 0x65, 0x72, - 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x22, 0x36, 0x0a, 0x12, 0x4c, 0x69, 0x62, 0x72, 0x61, 0x72, 0x79, 0x4c, 0x76, 0x52, 0x65, 0x77, + 0x61, 0x72, 0x64, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x6f, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x03, 0x6f, 0x69, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x6c, 0x76, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x6c, 0x76, 0x22, 0x38, 0x0a, 0x13, 0x4c, 0x69, 0x62, 0x72, + 0x61, 0x72, 0x79, 0x4c, 0x76, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, + 0x21, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, + 0x44, 0x42, 0x48, 0x65, 0x72, 0x6f, 0x46, 0x65, 0x74, 0x74, 0x65, 0x72, 0x52, 0x04, 0x64, 0x61, + 0x74, 0x61, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( @@ -736,7 +847,7 @@ func file_library_library_msg_proto_rawDescGZIP() []byte { return file_library_library_msg_proto_rawDescData } -var file_library_library_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 14) +var file_library_library_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 16) var file_library_library_msg_proto_goTypes = []interface{}{ (*LibraryGetListReq)(nil), // 0: LibraryGetListReq (*LibraryGetListResp)(nil), // 1: LibraryGetListResp @@ -751,25 +862,28 @@ var file_library_library_msg_proto_goTypes = []interface{}{ (*LibraryActivationFetterReq)(nil), // 10: LibraryActivationFetterReq (*LibraryActivationFetterResp)(nil), // 11: LibraryActivationFetterResp (*LibraryChangePush)(nil), // 12: LibraryChangePush - nil, // 13: LibraryUseGiftReq.ItemsEntry - (*DBLibrary)(nil), // 14: DBLibrary - (*DBHeroFetter)(nil), // 15: DBHeroFetter + (*LibraryLvRewardReq)(nil), // 13: LibraryLvRewardReq + (*LibraryLvRewardResp)(nil), // 14: LibraryLvRewardResp + nil, // 15: LibraryUseGiftReq.ItemsEntry + (*DBLibrary)(nil), // 16: DBLibrary + (*DBHeroFetter)(nil), // 17: DBHeroFetter } var file_library_library_msg_proto_depIdxs = []int32{ - 14, // 0: LibraryGetListResp.data:type_name -> DBLibrary - 15, // 1: LibraryGetFetterListResp.data:type_name -> DBHeroFetter - 14, // 2: LibraryGetRewardResp.data:type_name -> DBLibrary - 15, // 3: LibraryGetStoryRewardResp.data:type_name -> DBHeroFetter - 13, // 4: LibraryUseGiftReq.items:type_name -> LibraryUseGiftReq.ItemsEntry - 15, // 5: LibraryUseGiftResp.data:type_name -> DBHeroFetter - 14, // 6: LibraryActivationFetterResp.data:type_name -> DBLibrary - 14, // 7: LibraryChangePush.data:type_name -> DBLibrary - 15, // 8: LibraryChangePush.fetter:type_name -> DBHeroFetter - 9, // [9:9] is the sub-list for method output_type - 9, // [9:9] is the sub-list for method input_type - 9, // [9:9] is the sub-list for extension type_name - 9, // [9:9] is the sub-list for extension extendee - 0, // [0:9] is the sub-list for field type_name + 16, // 0: LibraryGetListResp.data:type_name -> DBLibrary + 17, // 1: LibraryGetFetterListResp.data:type_name -> DBHeroFetter + 16, // 2: LibraryGetRewardResp.data:type_name -> DBLibrary + 17, // 3: LibraryGetStoryRewardResp.data:type_name -> DBHeroFetter + 15, // 4: LibraryUseGiftReq.items:type_name -> LibraryUseGiftReq.ItemsEntry + 17, // 5: LibraryUseGiftResp.data:type_name -> DBHeroFetter + 16, // 6: LibraryActivationFetterResp.data:type_name -> DBLibrary + 16, // 7: LibraryChangePush.data:type_name -> DBLibrary + 17, // 8: LibraryChangePush.fetter:type_name -> DBHeroFetter + 17, // 9: LibraryLvRewardResp.data:type_name -> DBHeroFetter + 10, // [10:10] is the sub-list for method output_type + 10, // [10:10] is the sub-list for method input_type + 10, // [10:10] is the sub-list for extension type_name + 10, // [10:10] is the sub-list for extension extendee + 0, // [0:10] is the sub-list for field type_name } func init() { file_library_library_msg_proto_init() } @@ -935,6 +1049,30 @@ func file_library_library_msg_proto_init() { return nil } } + file_library_library_msg_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LibraryLvRewardReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_library_library_msg_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LibraryLvRewardResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -942,7 +1080,7 @@ func file_library_library_msg_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_library_library_msg_proto_rawDesc, NumEnums: 0, - NumMessages: 14, + NumMessages: 16, NumExtensions: 0, NumServices: 0, }, diff --git a/sys/configure/structs/Game.LibraryFavor.go b/sys/configure/structs/Game.LibraryFavor.go index 722621d04..f220a9c47 100644 --- a/sys/configure/structs/Game.LibraryFavor.go +++ b/sys/configure/structs/Game.LibraryFavor.go @@ -9,34 +9,26 @@ package cfg type GameLibraryFavor struct { - _dataMap map[int32]*GameLibraryFavorData _dataList []*GameLibraryFavorData } func NewGameLibraryFavor(_buf []map[string]interface{}) (*GameLibraryFavor, error) { _dataList := make([]*GameLibraryFavorData, 0, len(_buf)) - dataMap := make(map[int32]*GameLibraryFavorData) for _, _ele_ := range _buf { if _v, err2 := DeserializeGameLibraryFavorData(_ele_); err2 != nil { return nil, err2 } else { _dataList = append(_dataList, _v) - dataMap[_v.Id] = _v } } - return &GameLibraryFavor{_dataList:_dataList, _dataMap:dataMap}, nil -} - -func (table *GameLibraryFavor) GetDataMap() map[int32]*GameLibraryFavorData { - return table._dataMap + return &GameLibraryFavor{_dataList:_dataList}, nil } func (table *GameLibraryFavor) GetDataList() []*GameLibraryFavorData { return table._dataList } -func (table *GameLibraryFavor) Get(key int32) *GameLibraryFavorData { - return table._dataMap[key] +func (table *GameLibraryFavor) Get(index int) *GameLibraryFavorData { + return table._dataList[index] } - diff --git a/sys/configure/structs/Game.LibraryFavorData.go b/sys/configure/structs/Game.LibraryFavorData.go index f2d3edf3b..5e76749ac 100644 --- a/sys/configure/structs/Game.LibraryFavorData.go +++ b/sys/configure/structs/Game.LibraryFavorData.go @@ -15,6 +15,7 @@ type GameLibraryFavorData struct { Star int32 Favorlv int32 Expneed int32 + Prize []*Gameatn } const TypeId_GameLibraryFavorData = 465616649 @@ -28,6 +29,20 @@ func (_v *GameLibraryFavorData)Deserialize(_buf map[string]interface{}) (err err { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["star"].(float64); !_ok_ { err = errors.New("star error"); return }; _v.Star = int32(_tempNum_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["favorlv"].(float64); !_ok_ { err = errors.New("favorlv error"); return }; _v.Favorlv = int32(_tempNum_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["expneed"].(float64); !_ok_ { err = errors.New("expneed error"); return }; _v.Expneed = int32(_tempNum_) } + { + var _arr_ []interface{} + var _ok_ bool + if _arr_, _ok_ = _buf["prize"].([]interface{}); !_ok_ { err = errors.New("prize error"); return } + + _v.Prize = make([]*Gameatn, 0, len(_arr_)) + + for _, _e_ := range _arr_ { + var _list_v_ *Gameatn + { var _ok_ bool; var _x_ map[string]interface{}; if _x_, _ok_ = _e_.(map[string]interface{}); !_ok_ { err = errors.New("_list_v_ error"); return }; if _list_v_, err = DeserializeGameatn(_x_); err != nil { return } } + _v.Prize = append(_v.Prize, _list_v_) + } + } + return } diff --git a/sys/configure/structs/Game.LibraryHeroData.go b/sys/configure/structs/Game.LibraryHeroData.go index 9424b99b0..746a820db 100644 --- a/sys/configure/structs/Game.LibraryHeroData.go +++ b/sys/configure/structs/Game.LibraryHeroData.go @@ -19,8 +19,10 @@ type GameLibraryHeroData struct { Startid int32 Rightend int32 Stroyprize []*Gameatn + SpecialStroyprize []*Gameatn Endid1 int32 Endid2 int32 + Endid3 int32 Fid []int32 } @@ -78,8 +80,23 @@ func (_v *GameLibraryHeroData)Deserialize(_buf map[string]interface{}) (err erro } } + { + var _arr_ []interface{} + var _ok_ bool + if _arr_, _ok_ = _buf["special_stroyprize"].([]interface{}); !_ok_ { err = errors.New("special_stroyprize error"); return } + + _v.SpecialStroyprize = make([]*Gameatn, 0, len(_arr_)) + + for _, _e_ := range _arr_ { + var _list_v_ *Gameatn + { var _ok_ bool; var _x_ map[string]interface{}; if _x_, _ok_ = _e_.(map[string]interface{}); !_ok_ { err = errors.New("_list_v_ error"); return }; if _list_v_, err = DeserializeGameatn(_x_); err != nil { return } } + _v.SpecialStroyprize = append(_v.SpecialStroyprize, _list_v_) + } + } + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["endid1"].(float64); !_ok_ { err = errors.New("endid1 error"); return }; _v.Endid1 = int32(_tempNum_) } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["endid2"].(float64); !_ok_ { err = errors.New("endid2 error"); return }; _v.Endid2 = int32(_tempNum_) } + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["endid3"].(float64); !_ok_ { err = errors.New("endid3 error"); return }; _v.Endid3 = int32(_tempNum_) } { var _arr_ []interface{} var _ok_ bool