From 4bb4be720419b8594602dc784a0fb7b7782bcf25 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Thu, 26 Oct 2023 15:33:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=8E=A9=E5=AE=B6=E5=9F=BA?= =?UTF-8?q?=E6=9C=AC=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/json/game_consumehero.json | 97 +++++- bin/json/game_item.json | 165 +++++++-- modules/entertainment/api_getlist.go | 32 ++ modules/entertainment/api_getreward.go | 57 ++++ modules/entertainment/match.go | 28 +- modules/entertainment/model.go | 20 ++ modules/entertainment/room.go | 42 +-- modules/entertainment/xxlPlat.go | 91 +++-- modules/entertainment/xxl_test.go | 2 +- pb/entertain_db.pb.go | 169 +++++++--- pb/entertain_msg.pb.go | 316 ++++++++++++++++-- sys/configure/structs/Game.ConsumeHeroData.go | 2 + 12 files changed, 838 insertions(+), 183 deletions(-) create mode 100644 modules/entertainment/api_getlist.go create mode 100644 modules/entertainment/api_getreward.go diff --git a/bin/json/game_consumehero.json b/bin/json/game_consumehero.json index 7ce4c8f4c..98d466747 100644 --- a/bin/json/game_consumehero.json +++ b/bin/json/game_consumehero.json @@ -2,49 +2,120 @@ { "key": "27000001", "type": 1, + "herocolor": 1, "skillname": { "key": "consume_consume_hero_skillname_01", - "text": "大消除" + "text": "搜刮一空" }, "skilltxt": { "key": "consume_consume_hero_skilltxt_01", "text": "随机消除7个方块" }, - "hero": 44004, - "consume": [ - { - "a": "attr", - "t": "gold", - "n": 1000 - } - ], + "hero": 51004, + "consume": [], "skilltype": 1, - "skillload": 7, + "skillload": 6, "skilleffect": 1, "skillvalue": 7 }, { "key": "27000002", "type": 2, + "herocolor": 2, "skillname": { "key": "consume_consume_hero_skillname_02", - "text": "技能名字1" + "text": "香蕉连成串" }, "skilltxt": { "key": "consume_consume_hero_skilltxt_02", - "text": "技能描述2" + "text": "消除中间的一列宝石" }, "hero": 25001, "consume": [ { "a": "attr", "t": "gold", - "n": 1000 + "n": 10 } ], "skilltype": 2, "skillload": 7, "skilleffect": 2, "skillvalue": 0 + }, + { + "key": "27000003", + "type": 2, + "herocolor": 3, + "skillname": { + "key": "consume_consume_hero_skillname_03", + "text": "臭屁四溢" + }, + "skilltxt": { + "key": "consume_consume_hero_skilltxt_03", + "text": "玩家标记(选中)一个方块,然后有100%的概率周围位置,标记完毕后,有60%概率继续标记周围位置,然后30%概率标记周围位置,最多蔓延4次,标记结束后,消除所有被标记的方块。" + }, + "hero": 0, + "consume": [ + { + "a": "attr", + "t": "gold", + "n": 20 + } + ], + "skilltype": 2, + "skillload": 7, + "skilleffect": 3, + "skillvalue": 0 + }, + { + "key": "27000004", + "type": 2, + "herocolor": 4, + "skillname": { + "key": "consume_consume_hero_skillname_04", + "text": "拦路抢劫" + }, + "skilltxt": { + "key": "consume_consume_hero_skilltxt_04", + "text": "选中一个方块,消除以该方块为中心,两条斜线上的所有方块(选中的方块也会被消除)。" + }, + "hero": 0, + "consume": [ + { + "a": "attr", + "t": "gold", + "n": 10 + } + ], + "skilltype": 2, + "skillload": 7, + "skilleffect": 4, + "skillvalue": 0 + }, + { + "key": "27000005", + "type": 2, + "herocolor": 5, + "skillname": { + "key": "consume_consume_hero_skillname_05", + "text": "劲爆小指头" + }, + "skilltxt": { + "key": "consume_consume_hero_skilltxt_05", + "text": "随机用炸弹代替一个方块,并直接引爆炸弹(炸弹是特殊方块,这里就是用炸弹代替,然后直接消掉该炸弹)。" + }, + "hero": 0, + "consume": [ + { + "a": "attr", + "t": "gold", + "n": 20 + } + ], + "skilltype": 2, + "skillload": 7, + "skilleffect": 5, + "skillvalue": 0 } ] \ No newline at end of file diff --git a/bin/json/game_item.json b/bin/json/game_item.json index 9bdb062b6..3e03f6c9a 100644 --- a/bin/json/game_item.json +++ b/bin/json/game_item.json @@ -20683,7 +20683,7 @@ "text": "豺狼小怪" }, "usetype": 1, - "color": 2, + "color": 1, "bagtype": 0, "index": 1, "special_type": 0, @@ -20759,9 +20759,132 @@ "gm": 0 }, { - "id": "27000100", + "id": "27000003", "name": { "key": "item_item_name_419", + "text": "食人鱼" + }, + "usetype": 1, + "color": 3, + "bagtype": 0, + "index": 1, + "special_type": 0, + "hold": 0, + "time": 0, + "reddottype": 0, + "effects": "", + "modelName": "", + "box_id": 0, + "synthetize_num": 0, + "synthetize_deplete": [], + "synthetize_get": [], + "decompose_deplete": [], + "decompose_get": [], + "access": [], + "use_skip": 0, + "upper_limit": 0, + "img": "tx_js_51012", + "intr": { + "key": "item_item_intr_414", + "text": "食人鱼的三消英雄卡" + }, + "describe": { + "key": "item_item_describe_414", + "text": "食人鱼怎么叫?" + }, + "dialogue": { + "key": "item_item_dialogue_412", + "text": "【什么味儿?】" + }, + "sale": [], + "gm": 0 + }, + { + "id": "27000004", + "name": { + "key": "item_item_name_420", + "text": "胡德先生" + }, + "usetype": 1, + "color": 4, + "bagtype": 0, + "index": 1, + "special_type": 0, + "hold": 0, + "time": 0, + "reddottype": 0, + "effects": "", + "modelName": "", + "box_id": 0, + "synthetize_num": 0, + "synthetize_deplete": [], + "synthetize_get": [], + "decompose_deplete": [], + "decompose_get": [], + "access": [], + "use_skip": 0, + "upper_limit": 0, + "img": "tx_js_51012", + "intr": { + "key": "item_item_intr_415", + "text": "胡德先生的三消英雄卡" + }, + "describe": { + "key": "item_item_describe_415", + "text": "胡德先生怎么叫?" + }, + "dialogue": { + "key": "item_item_dialogue_413", + "text": "【中!】" + }, + "sale": [], + "gm": 0 + }, + { + "id": "27000005", + "name": { + "key": "item_item_name_421", + "text": "大大" + }, + "usetype": 1, + "color": 5, + "bagtype": 0, + "index": 1, + "special_type": 0, + "hold": 0, + "time": 0, + "reddottype": 0, + "effects": "", + "modelName": "", + "box_id": 0, + "synthetize_num": 0, + "synthetize_deplete": [], + "synthetize_get": [], + "decompose_deplete": [], + "decompose_get": [], + "access": [], + "use_skip": 0, + "upper_limit": 0, + "img": "tx_js_51012", + "intr": { + "key": "item_item_intr_416", + "text": "大大的三消英雄卡" + }, + "describe": { + "key": "item_item_describe_416", + "text": "大大怎么叫?" + }, + "dialogue": { + "key": "item_item_dialogue_414", + "text": "【就这样吧。】" + }, + "sale": [], + "gm": 0 + }, + { + "id": "27000100", + "name": { + "key": "item_item_name_422", "text": "低级三消宝箱" }, "usetype": 5, @@ -20785,15 +20908,15 @@ "upper_limit": 0, "img": "item_17020001", "intr": { - "key": "item_item_intr_414", + "key": "item_item_intr_417", "text": "低级三消宝箱,里面的奖励寥寥无几" }, "describe": { - "key": "item_item_describe_414", + "key": "item_item_describe_417", "text": "低级三消宝箱,里面的奖励寥寥无几" }, "dialogue": { - "key": "item_item_dialogue_412", + "key": "item_item_dialogue_415", "text": "【就这?】" }, "sale": [], @@ -20802,7 +20925,7 @@ { "id": "27000101", "name": { - "key": "item_item_name_420", + "key": "item_item_name_423", "text": "中级三消宝箱" }, "usetype": 5, @@ -20826,15 +20949,15 @@ "upper_limit": 0, "img": "item_17020001", "intr": { - "key": "item_item_intr_415", + "key": "item_item_intr_418", "text": "中级三消宝箱,里面的奖励稀松平常" }, "describe": { - "key": "item_item_describe_415", + "key": "item_item_describe_418", "text": "中级三消宝箱,里面的奖励稀松平常" }, "dialogue": { - "key": "item_item_dialogue_413", + "key": "item_item_dialogue_416", "text": "【还行。】" }, "sale": [], @@ -20843,7 +20966,7 @@ { "id": "27000102", "name": { - "key": "item_item_name_421", + "key": "item_item_name_424", "text": "高级三消宝箱" }, "usetype": 5, @@ -20867,15 +20990,15 @@ "upper_limit": 0, "img": "item_17020001", "intr": { - "key": "item_item_intr_416", + "key": "item_item_intr_419", "text": "高级三消宝箱,里面的奖励值得期待" }, "describe": { - "key": "item_item_describe_416", + "key": "item_item_describe_419", "text": "高级三消宝箱,里面的奖励值得期待" }, "dialogue": { - "key": "item_item_dialogue_414", + "key": "item_item_dialogue_417", "text": "【嗯,不错。】" }, "sale": [], @@ -20884,7 +21007,7 @@ { "id": "27000103", "name": { - "key": "item_item_name_422", + "key": "item_item_name_425", "text": "完美三消宝箱" }, "usetype": 5, @@ -20908,15 +21031,15 @@ "upper_limit": 0, "img": "item_17020001", "intr": { - "key": "item_item_intr_417", + "key": "item_item_intr_420", "text": "完美三消宝箱,里面的奖励令人垂延" }, "describe": { - "key": "item_item_describe_417", + "key": "item_item_describe_420", "text": "完美三消宝箱,里面的奖励令人垂延" }, "dialogue": { - "key": "item_item_dialogue_415", + "key": "item_item_dialogue_418", "text": "【好家伙!】" }, "sale": [], @@ -20925,7 +21048,7 @@ { "id": "27000104", "name": { - "key": "item_item_name_423", + "key": "item_item_name_426", "text": "无双三消宝箱" }, "usetype": 5, @@ -20949,15 +21072,15 @@ "upper_limit": 0, "img": "item_17020001", "intr": { - "key": "item_item_intr_418", + "key": "item_item_intr_421", "text": "无双三消宝箱,里面的奖励天下无双" }, "describe": { - "key": "item_item_describe_418", + "key": "item_item_describe_421", "text": "无双三消宝箱,里面的奖励天下无双" }, "dialogue": { - "key": "item_item_dialogue_416", + "key": "item_item_dialogue_419", "text": "【我要的就是这个!】" }, "sale": [], diff --git a/modules/entertainment/api_getlist.go b/modules/entertainment/api_getlist.go new file mode 100644 index 000000000..aa65f6af3 --- /dev/null +++ b/modules/entertainment/api_getlist.go @@ -0,0 +1,32 @@ +package entertainment + +import ( + "go_dreamfactory/comm" + "go_dreamfactory/pb" +) + +//参数校验 +func (this *apiComp) GetListCheck(session comm.IUserSession, req *pb.EntertainGetListReq) (errdata *pb.ErrorData) { + + return +} + +func (this *apiComp) GetList(session comm.IUserSession, req *pb.EntertainGetListReq) (errdata *pb.ErrorData) { + var ( + list *pb.DBXXLData + err error + ) + list, err = this.module.model.getEntertainmList(session.GetUserId()) + if err != nil { + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_DBError, + Title: pb.ErrorCode_DBError.ToString(), + Message: err.Error(), + } + return + } + session.SendMsg(string(this.module.GetType()), "getlist", &pb.EntertainGetListResp{ + Data: list, + }) + return +} diff --git a/modules/entertainment/api_getreward.go b/modules/entertainment/api_getreward.go new file mode 100644 index 000000000..372126e01 --- /dev/null +++ b/modules/entertainment/api_getreward.go @@ -0,0 +1,57 @@ +package entertainment + +import ( + "go_dreamfactory/comm" + "go_dreamfactory/pb" +) + +//参数校验 +func (this *apiComp) RewardCheck(session comm.IUserSession, req *pb.EntertainRewardReq) (errdata *pb.ErrorData) { + + return +} + +// 赛季奖励 +func (this *apiComp) Reward(session comm.IUserSession, req *pb.EntertainRewardReq) (errdata *pb.ErrorData) { + var ( + list *pb.DBXXLData + err error + atno []*pb.UserAtno + ) + list, err = this.module.model.getEntertainmList(session.GetUserId()) + if err != nil { + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_DBError, + Title: pb.ErrorCode_DBError.ToString(), + Message: err.Error(), + } + return + } + + user, err := this.module.ModuleUser.GetUser(session.GetUserId()) + if err == nil { + + if conf, err := this.module.configure.GetGameConsumeintegral(user.Consumeexp); err == nil { + if _, ok := list.Reward[conf.Key]; !ok { + if errdata, atno = this.module.DispenseAtno(session, conf.Rewards, true); errdata != nil { + return + } + list.Reward[conf.Key] = 1 + this.module.model.modifyEntertainmList(session.GetUserId(), map[string]interface{}{ + "reward": list.Reward[conf.Key], + }) + } else { // 重复领取 + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_UserRepeadReward, + Title: pb.ErrorCode_UserRepeadReward.ToString(), + } + return + } + } + } + session.SendMsg(string(this.module.GetType()), "reward", &pb.EntertainRewardResp{ + Data: list, + Reward: atno, + }) + return +} diff --git a/modules/entertainment/match.go b/modules/entertainment/match.go index ac51aee08..59c16f436 100644 --- a/modules/entertainment/match.go +++ b/modules/entertainment/match.go @@ -68,17 +68,13 @@ func (this *matchComp) MatchNotic(players map[string]interface{}) (err error) { for pos, v := range playerSlice { if pos == 0 { p1 = &pb.PlayerData{ - Uid: v.Userinfo.Uid, - Name: v.Userinfo.Name, - Score: 0, - Cardid: v.Cardid, + Userinfo: v.Userinfo, + Cardid: v.Cardid, } } else if pos == 1 { p2 = &pb.PlayerData{ - Uid: v.Userinfo.Uid, - Name: v.Userinfo.Name, - Score: 0, - Cardid: v.Cardid, + Userinfo: v.Userinfo, + Cardid: v.Cardid, } } else { break @@ -91,11 +87,17 @@ func (this *matchComp) MatchNotic(players map[string]interface{}) (err error) { if robots, err := this.module.ModuleTools.RandRobotConfig(1); err == nil { if len(robots) > 0 { p2 = &pb.PlayerData{ - Uid: "999", // AI uid 暂定 - Name: robots[0].Name, - Score: 0, - Ps: 0, - Cardid: this.module.configure.GetRobotGameConsumeHero(), // 机器人临时数据 + Userinfo: &pb.BaseUserInfo{ + Uid: "999", + Sid: "", + Name: robots[0].Name, + Gender: robots[0].Sex, + Skin: robots[0].Showid, + Aframe: "", + Title: "", + Lv: robots[0].Lvshow, + }, + Cardid: this.module.configure.GetRobotGameConsumeHero(), } } } diff --git a/modules/entertainment/model.go b/modules/entertainment/model.go index d31f67c9b..2fb99ad24 100644 --- a/modules/entertainment/model.go +++ b/modules/entertainment/model.go @@ -3,8 +3,11 @@ package entertainment import ( "go_dreamfactory/comm" "go_dreamfactory/lego/core" + "go_dreamfactory/lego/sys/redis" "go_dreamfactory/modules" + "go_dreamfactory/pb" + "go.mongodb.org/mongo-driver/bson/primitive" "go.mongodb.org/mongo-driver/mongo" "go.mongodb.org/mongo-driver/x/bsonx" ) @@ -24,3 +27,20 @@ func (this *modelComp) Init(service core.IService, module core.IModule, comp cor }) return } + +func (this *modelComp) getEntertainmList(uid string) (result *pb.DBXXLData, err error) { + result = &pb.DBXXLData{} + if err = this.Get(uid, result); err != nil { + if redis.RedisNil != err { // 没有数据直接创建新的数据 + result.Id = primitive.NewObjectID().Hex() + result.Uid = uid + result.Reward = make(map[int32]int32) + } + } + err = nil + return result, err +} + +func (this *modelComp) modifyEntertainmList(uid string, data map[string]interface{}) error { + return this.Change(uid, data) +} diff --git a/modules/entertainment/room.go b/modules/entertainment/room.go index 16e04005b..f44f8e7a5 100644 --- a/modules/entertainment/room.go +++ b/modules/entertainment/room.go @@ -39,16 +39,16 @@ type Room struct { func (this *Room) operateTimeOut(task *timewheel.Task, args ...interface{}) { - if this.player1.Uid == this.curPower { // 给玩家2 + if this.player1.Userinfo.Uid == this.curPower { // 给玩家2 this.player1.Ps-- if this.player1.Ps <= 0 { // 体力消耗完权限给下一个人 - this.NexPower = this.player2.Uid + this.NexPower = this.player2.Userinfo.Uid this.player2.Ps = MaxPs // 恢复体力 } } else { // 权限给1号玩家 this.player2.Ps-- if this.player2.Ps <= 0 { - this.curPower = this.player1.Uid + this.curPower = this.player1.Userinfo.Uid this.player1.Ps = MaxPs // 恢复体力 this.round++ @@ -94,14 +94,14 @@ func (this *Room) InitRoom(module *Entertainment, p1 *pb.PlayerData, p2 *pb.Play this.module = module this.chessboard = new(MapData) this.chessboard.InitMap(module) // 初始化棋盘 - if s1, ok := this.module.GetUserSession(p1.Uid); !ok { + if s1, ok := this.module.GetUserSession(p1.Userinfo.Uid); !ok { this.module.PutUserSession(s1) } else { this.szSession = append(this.szSession, s1.Clone()) } - if p2.Uid != "999" { // 是否是机器人 - if s2, ok := this.module.GetUserSession(p2.Uid); !ok { + if p2.Userinfo.Uid != "999" { // 是否是机器人 + if s2, ok := this.module.GetUserSession(p2.Userinfo.Uid); !ok { this.module.PutUserSession(s2) } else { this.szSession = append(this.szSession, s2.Clone()) @@ -160,7 +160,7 @@ func (this *Room) AiOperator() { } } if this.player2.Ps <= 0 { // 权限给下一个人 - this.NexPower = this.player1.Uid + this.NexPower = this.player1.Userinfo.Uid this.player1.Ps = MaxPs this.round++ } @@ -190,7 +190,7 @@ func (this *Room) AiOperator() { return } this.curPower = this.NexPower - if len(this.szSession) == 1 && this.curPower == this.player2.Uid { + if len(this.szSession) == 1 && this.curPower == this.player2.Userinfo.Uid { this.AiOperator() } } @@ -215,7 +215,7 @@ func (this *Room) ReceiveMessage(session comm.IUserSession, stype string, msg pr } return } - if this.curPower == this.player1.Uid { + if this.curPower == this.player1.Userinfo.Uid { color = 1 } else { color = 2 @@ -327,7 +327,7 @@ func (this *Room) ReceiveMessage(session comm.IUserSession, stype string, msg pr return } - if this.curPower == this.player1.Uid { //权限校验 + if this.curPower == this.player1.Userinfo.Uid { //权限校验 this.player1.Score += curScore this.player1.Ps-- if bAddPs { @@ -338,7 +338,7 @@ func (this *Room) ReceiveMessage(session comm.IUserSession, stype string, msg pr } if this.player1.Ps <= 0 { - this.NexPower = this.player2.Uid + this.NexPower = this.player2.Userinfo.Uid if len(this.szSession) == 1 { // 校验2号玩家是不是AI AIOperator = true } @@ -355,7 +355,7 @@ func (this *Room) ReceiveMessage(session comm.IUserSession, stype string, msg pr } } if this.player2.Ps <= 0 { - this.NexPower = this.player1.Uid + this.NexPower = this.player1.Userinfo.Uid this.player1.Ps = MaxPs this.round++ if this.operatetimer != nil { @@ -409,8 +409,8 @@ func (this *Room) ReceiveMessage(session comm.IUserSession, stype string, msg pr } case "ready": if len(this.szSession) == 1 { // AI对战的话直接开始游戏 - this.NexPower = this.player1.Uid - this.curPower = this.player1.Uid + this.NexPower = this.player1.Userinfo.Uid + this.curPower = this.player1.Userinfo.Uid this.player1.Ps = MaxPs this.player2.Ps = 0 this.module.Debugf("match ai") @@ -426,15 +426,15 @@ func (this *Room) ReceiveMessage(session comm.IUserSession, stype string, msg pr } this.operatetimer = timewheel.Add(time.Second*MaxTime, this.operateTimeOut) } else { - if this.player1.Uid == session.GetUserId() { + if this.player1.Userinfo.Uid == session.GetUserId() { this.rd1 = true - } else if this.player2.Uid == session.GetUserId() { + } else if this.player2.Userinfo.Uid == session.GetUserId() { this.rd2 = true } this.module.Debugf("match user1ready:%v,ready2:%v", this.rd1, this.rd2) if this.rd1 && this.rd2 { // 两个玩家都准备好了 那么就开始游戏 - this.NexPower = this.player1.Uid - this.curPower = this.player1.Uid + this.NexPower = this.player1.Userinfo.Uid + this.curPower = this.player1.Userinfo.Uid this.player1.Ps = MaxPs this.player2.Ps = 0 if err := this.module.SendMsgSyncToSession(string(this.module.GetType()), "startgame", &pb.EntertainStartGamePush{ @@ -483,10 +483,10 @@ func (this *Room) GameOver() (errdata *pb.ErrorData) { timewheel.Remove(this.operatetimer) } var winner string - winner = this.player1.Uid + winner = this.player1.Userinfo.Uid bReward = true if this.player1.Score < this.player2.Score { - winner = this.player2.Uid + winner = this.player2.Userinfo.Uid winindex = 1 if len(this.szSession) == 1 { // 赢家是AI 的话不发奖 bReward = false @@ -495,7 +495,7 @@ func (this *Room) GameOver() (errdata *pb.ErrorData) { if bReward { // 发奖 if user, err := this.module.ModuleUser.GetUser(winner); err == nil { if conf, err := this.module.configure.GetGameConsumeintegral(user.Consumeexp); err == nil { - res = append(res, conf.Onereward...) + //res = append(res, conf.Onereward...) 这奖励手动领取 res = append(res, conf.Rewards...) if errdata, atno = this.module.DispenseAtno(this.szSession[winindex], res, true); errdata != nil { diff --git a/modules/entertainment/xxlPlat.go b/modules/entertainment/xxlPlat.go index 8e3d865ca..226895035 100644 --- a/modules/entertainment/xxlPlat.go +++ b/modules/entertainment/xxlPlat.go @@ -598,41 +598,60 @@ func (this *MapData) CheckInitPlat() { // 4, 1, 5, 3, 2, 3, 4, // 校验当前地图 有没有能消除的 -// func (this *MapData) CheckAndRefreshPlat() { -// bEliminate := false -// for k, v := range this.Plat { -// if v.Color == 0 { -// continue -// } -// x := int32(k % Height) // x -// y := int32(k / Height) // y -// if x+1 < Height { -// k1 := this.Plat[k].Color -// k2 := this.Plat[k+1].Color -// if k1 == k2 { -// if x > 0 { +func (this *MapData) CheckAndRefreshPlat() (bEliminate bool) { + bEliminate = false + for k, v := range this.Plat { + if v.Color == 0 { + continue + } + x := int32(k % Height) // x + y := int32(k / Height) // y + if x+2 < Height { + k1 := this.Plat[k].Color + k2 := this.Plat[k+1].Color + pos := k + 2 + // k3 := this.Plat[k+2].Color + if k1 == k2 { // 校验k3 左边和右边 + if y-1 >= 0 { // 左 + if this.Plat[pos-Width].Color == k1 { + bEliminate = true + return + } + } + if y+1 < Width { // 右 + if this.Plat[pos+Width].Color == k1 { + bEliminate = true + return + } + } + if x+3 < Height { // 上 + if this.Plat[pos+1].Color == k1 { + bEliminate = true + return + } + } + if true { // 下左右 + pos := k - 1 + if pos-1 >= 0 { // 下 + if this.Plat[k-2].Color == k1 { + bEliminate = true + return + } + } + // 左 -// } -// } + } -// k3 := this.Plat[k+2].Color -// // 找k+3的 上 左 又 -// if k1 == k2 && k2 == k3 { -// bEliminate = true -// } -// } - -// if k+2*Width < Total { -// k1 := this.Plat[k].Color -// k2 := this.Plat[k+Width].Color -// k3 := this.Plat[k+2*Width].Color - -// if k1 == k2 && k2 == k3 { -// bEliminate = true -// } -// } -// } -// if bEliminate { -// this.CheckInitPlat() -// } -// } + } + } + // 左右检测 + if y+1 < Width { + k1 := this.Plat[k].Color + k2 := this.Plat[k+Width].Color + if k1 == k2 { + // + } + } + } + return +} diff --git a/modules/entertainment/xxl_test.go b/modules/entertainment/xxl_test.go index 23f891156..21e0de3fa 100644 --- a/modules/entertainment/xxl_test.go +++ b/modules/entertainment/xxl_test.go @@ -85,7 +85,7 @@ func Test_Main(t *testing.T) { m := new(entertainment.MapData) m.InitMap(nil) m.SetMap() - + m.CheckAndRefreshPlat() //var szMap []*pb.MapData // if bSwap, m := m.AiSwapGirde(); bSwap { // szMap = append(szMap, m...) diff --git a/pb/entertain_db.pb.go b/pb/entertain_db.pb.go index 827b98dd1..b22851d46 100644 --- a/pb/entertain_db.pb.go +++ b/pb/entertain_db.pb.go @@ -169,12 +169,11 @@ type PlayerData struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name"` // 昵称 - Score int32 `protobuf:"varint,3,opt,name=score,proto3" json:"score"` // 积分 - Ps int32 `protobuf:"varint,4,opt,name=ps,proto3" json:"ps"` // 体力 - Cardid string `protobuf:"bytes,5,opt,name=cardid,proto3" json:"cardid"` // 出战的英雄卡 - Energy int32 `protobuf:"varint,6,opt,name=energy,proto3" json:"energy"` // 能量进度 + Userinfo *BaseUserInfo `protobuf:"bytes,1,opt,name=userinfo,proto3" json:"userinfo"` + Score int32 `protobuf:"varint,2,opt,name=score,proto3" json:"score"` // 积分 + Ps int32 `protobuf:"varint,3,opt,name=ps,proto3" json:"ps"` // 体力 + Cardid string `protobuf:"bytes,4,opt,name=cardid,proto3" json:"cardid"` // 出战的英雄卡 + Energy int32 `protobuf:"varint,5,opt,name=energy,proto3" json:"energy"` // 能量进度 } func (x *PlayerData) Reset() { @@ -209,18 +208,11 @@ func (*PlayerData) Descriptor() ([]byte, []int) { return file_entertain_entertain_db_proto_rawDescGZIP(), []int{2} } -func (x *PlayerData) GetUid() string { +func (x *PlayerData) GetUserinfo() *BaseUserInfo { if x != nil { - return x.Uid + return x.Userinfo } - return "" -} - -func (x *PlayerData) GetName() string { - if x != nil { - return x.Name - } - return "" + return nil } func (x *PlayerData) GetScore() int32 { @@ -257,9 +249,8 @@ type DBXXLMatch struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Userinfo *BaseUserInfo `protobuf:"bytes,1,opt,name=userinfo,proto3" json:"userinfo"` - Cardid string `protobuf:"bytes,2,opt,name=cardid,proto3" json:"cardid"` // 选择的卡片ID - Consumeexp int32 `protobuf:"varint,3,opt,name=consumeexp,proto3" json:"consumeexp"` // + Userinfo *BaseUserInfo `protobuf:"bytes,1,opt,name=userinfo,proto3" json:"userinfo"` + Cardid string `protobuf:"bytes,2,opt,name=cardid,proto3" json:"cardid"` // 选择的卡片ID } func (x *DBXXLMatch) Reset() { @@ -308,11 +299,67 @@ func (x *DBXXLMatch) GetCardid() string { return "" } -func (x *DBXXLMatch) GetConsumeexp() int32 { - if x != nil { - return x.Consumeexp +type DBXXLData struct { + state protoimpl.MessageState + 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 + Reward map[int32]int32 `protobuf:"bytes,3,rep,name=reward,proto3" json:"reward" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` // key 配置表唯一ID +} + +func (x *DBXXLData) Reset() { + *x = DBXXLData{} + if protoimpl.UnsafeEnabled { + mi := &file_entertain_entertain_db_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } - return 0 +} + +func (x *DBXXLData) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DBXXLData) ProtoMessage() {} + +func (x *DBXXLData) ProtoReflect() protoreflect.Message { + mi := &file_entertain_entertain_db_proto_msgTypes[4] + 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 DBXXLData.ProtoReflect.Descriptor instead. +func (*DBXXLData) Descriptor() ([]byte, []int) { + return file_entertain_entertain_db_proto_rawDescGZIP(), []int{4} +} + +func (x *DBXXLData) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *DBXXLData) GetUid() string { + if x != nil { + return x.Uid + } + return "" +} + +func (x *DBXXLData) GetReward() map[int32]int32 { + if x != nil { + return x.Reward + } + return nil } var File_entertain_entertain_db_proto protoreflect.FileDescriptor @@ -334,23 +381,31 @@ var file_entertain_entertain_db_proto_rawDesc = []byte{ 0x05, 0x52, 0x03, 0x63, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x70, 0x65, 0x63, 0x69, 0x61, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x73, - 0x70, 0x65, 0x63, 0x69, 0x61, 0x6c, 0x22, 0x88, 0x01, 0x0a, 0x0a, 0x50, 0x6c, 0x61, 0x79, 0x65, - 0x72, 0x44, 0x61, 0x74, 0x61, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, - 0x63, 0x6f, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x72, - 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x70, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x70, - 0x73, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x61, 0x72, 0x64, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x06, 0x63, 0x61, 0x72, 0x64, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x6e, 0x65, - 0x72, 0x67, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x65, 0x6e, 0x65, 0x72, 0x67, - 0x79, 0x22, 0x6f, 0x0a, 0x0a, 0x44, 0x42, 0x58, 0x58, 0x4c, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x12, - 0x29, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x0d, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, - 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x61, - 0x72, 0x64, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x63, 0x61, 0x72, 0x64, - 0x69, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x65, 0x78, 0x70, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x65, - 0x78, 0x70, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x70, 0x65, 0x63, 0x69, 0x61, 0x6c, 0x22, 0x8d, 0x01, 0x0a, 0x0a, 0x50, 0x6c, 0x61, 0x79, 0x65, + 0x72, 0x44, 0x61, 0x74, 0x61, 0x12, 0x29, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x69, 0x6e, 0x66, + 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x55, 0x73, + 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x69, 0x6e, 0x66, 0x6f, + 0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x70, 0x73, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x02, 0x70, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x61, 0x72, 0x64, 0x69, 0x64, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x63, 0x61, 0x72, 0x64, 0x69, 0x64, 0x12, 0x16, + 0x0a, 0x06, 0x65, 0x6e, 0x65, 0x72, 0x67, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, + 0x65, 0x6e, 0x65, 0x72, 0x67, 0x79, 0x22, 0x4f, 0x0a, 0x0a, 0x44, 0x42, 0x58, 0x58, 0x4c, 0x4d, + 0x61, 0x74, 0x63, 0x68, 0x12, 0x29, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x69, 0x6e, 0x66, 0x6f, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x55, 0x73, 0x65, + 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x69, 0x6e, 0x66, 0x6f, 0x12, + 0x16, 0x0a, 0x06, 0x63, 0x61, 0x72, 0x64, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x63, 0x61, 0x72, 0x64, 0x69, 0x64, 0x22, 0x98, 0x01, 0x0a, 0x09, 0x44, 0x42, 0x58, 0x58, + 0x4c, 0x44, 0x61, 0x74, 0x61, 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, 0x2e, 0x0a, 0x06, 0x72, 0x65, 0x77, 0x61, 0x72, + 0x64, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x44, 0x42, 0x58, 0x58, 0x4c, 0x44, + 0x61, 0x74, 0x61, 0x2e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, + 0x06, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x1a, 0x39, 0x0a, 0x0b, 0x52, 0x65, 0x77, 0x61, 0x72, + 0x64, 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, } @@ -366,22 +421,26 @@ func file_entertain_entertain_db_proto_rawDescGZIP() []byte { return file_entertain_entertain_db_proto_rawDescData } -var file_entertain_entertain_db_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_entertain_entertain_db_proto_msgTypes = make([]protoimpl.MessageInfo, 6) var file_entertain_entertain_db_proto_goTypes = []interface{}{ (*MapData)(nil), // 0: MapData (*GirdeData)(nil), // 1: GirdeData (*PlayerData)(nil), // 2: PlayerData (*DBXXLMatch)(nil), // 3: DBXXLMatch - (*BaseUserInfo)(nil), // 4: BaseUserInfo + (*DBXXLData)(nil), // 4: DBXXLData + nil, // 5: DBXXLData.RewardEntry + (*BaseUserInfo)(nil), // 6: BaseUserInfo } var file_entertain_entertain_db_proto_depIdxs = []int32{ 1, // 0: MapData.data:type_name -> GirdeData - 4, // 1: DBXXLMatch.userinfo:type_name -> BaseUserInfo - 2, // [2:2] is the sub-list for method output_type - 2, // [2:2] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name + 6, // 1: PlayerData.userinfo:type_name -> BaseUserInfo + 6, // 2: DBXXLMatch.userinfo:type_name -> BaseUserInfo + 5, // 3: DBXXLData.reward:type_name -> DBXXLData.RewardEntry + 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 + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name } func init() { file_entertain_entertain_db_proto_init() } @@ -439,6 +498,18 @@ func file_entertain_entertain_db_proto_init() { return nil } } + file_entertain_entertain_db_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DBXXLData); 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{ @@ -446,7 +517,7 @@ func file_entertain_entertain_db_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_entertain_entertain_db_proto_rawDesc, NumEnums: 0, - NumMessages: 4, + NumMessages: 6, NumExtensions: 0, NumServices: 0, }, diff --git a/pb/entertain_msg.pb.go b/pb/entertain_msg.pb.go index a1af51566..11c72e008 100644 --- a/pb/entertain_msg.pb.go +++ b/pb/entertain_msg.pb.go @@ -1086,6 +1086,195 @@ func (x *EntertainRefreshPush) GetMpadata() *MapData { return nil } +// 奖励领取列表 +type EntertainGetListReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *EntertainGetListReq) Reset() { + *x = EntertainGetListReq{} + if protoimpl.UnsafeEnabled { + mi := &file_entertain_entertain_msg_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EntertainGetListReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EntertainGetListReq) ProtoMessage() {} + +func (x *EntertainGetListReq) ProtoReflect() protoreflect.Message { + mi := &file_entertain_entertain_msg_proto_msgTypes[17] + 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 EntertainGetListReq.ProtoReflect.Descriptor instead. +func (*EntertainGetListReq) Descriptor() ([]byte, []int) { + return file_entertain_entertain_msg_proto_rawDescGZIP(), []int{17} +} + +type EntertainGetListResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Data *DBXXLData `protobuf:"bytes,1,opt,name=data,proto3" json:"data"` +} + +func (x *EntertainGetListResp) Reset() { + *x = EntertainGetListResp{} + if protoimpl.UnsafeEnabled { + mi := &file_entertain_entertain_msg_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EntertainGetListResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EntertainGetListResp) ProtoMessage() {} + +func (x *EntertainGetListResp) ProtoReflect() protoreflect.Message { + mi := &file_entertain_entertain_msg_proto_msgTypes[18] + 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 EntertainGetListResp.ProtoReflect.Descriptor instead. +func (*EntertainGetListResp) Descriptor() ([]byte, []int) { + return file_entertain_entertain_msg_proto_rawDescGZIP(), []int{18} +} + +func (x *EntertainGetListResp) GetData() *DBXXLData { + if x != nil { + return x.Data + } + return nil +} + +// 奖励领取列表 +type EntertainRewardReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Key int32 `protobuf:"varint,1,opt,name=key,proto3" json:"key"` +} + +func (x *EntertainRewardReq) Reset() { + *x = EntertainRewardReq{} + if protoimpl.UnsafeEnabled { + mi := &file_entertain_entertain_msg_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EntertainRewardReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EntertainRewardReq) ProtoMessage() {} + +func (x *EntertainRewardReq) ProtoReflect() protoreflect.Message { + mi := &file_entertain_entertain_msg_proto_msgTypes[19] + 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 EntertainRewardReq.ProtoReflect.Descriptor instead. +func (*EntertainRewardReq) Descriptor() ([]byte, []int) { + return file_entertain_entertain_msg_proto_rawDescGZIP(), []int{19} +} + +func (x *EntertainRewardReq) GetKey() int32 { + if x != nil { + return x.Key + } + return 0 +} + +type EntertainRewardResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Data *DBXXLData `protobuf:"bytes,1,opt,name=data,proto3" json:"data"` + Reward []*UserAtno `protobuf:"bytes,2,rep,name=reward,proto3" json:"reward"` +} + +func (x *EntertainRewardResp) Reset() { + *x = EntertainRewardResp{} + if protoimpl.UnsafeEnabled { + mi := &file_entertain_entertain_msg_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EntertainRewardResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EntertainRewardResp) ProtoMessage() {} + +func (x *EntertainRewardResp) ProtoReflect() protoreflect.Message { + mi := &file_entertain_entertain_msg_proto_msgTypes[20] + 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 EntertainRewardResp.ProtoReflect.Descriptor instead. +func (*EntertainRewardResp) Descriptor() ([]byte, []int) { + return file_entertain_entertain_msg_proto_rawDescGZIP(), []int{20} +} + +func (x *EntertainRewardResp) GetData() *DBXXLData { + if x != nil { + return x.Data + } + return nil +} + +func (x *EntertainRewardResp) GetReward() []*UserAtno { + if x != nil { + return x.Reward + } + return nil +} + var File_entertain_entertain_msg_proto protoreflect.FileDescriptor var file_entertain_entertain_msg_proto_rawDesc = []byte{ @@ -1204,8 +1393,21 @@ var file_entertain_entertain_msg_proto_rawDesc = []byte{ 0x74, 0x61, 0x22, 0x3a, 0x0a, 0x14, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x74, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x50, 0x75, 0x73, 0x68, 0x12, 0x22, 0x0a, 0x07, 0x6d, 0x70, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x4d, 0x61, - 0x70, 0x44, 0x61, 0x74, 0x61, 0x52, 0x07, 0x6d, 0x70, 0x61, 0x64, 0x61, 0x74, 0x61, 0x42, 0x06, - 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x70, 0x44, 0x61, 0x74, 0x61, 0x52, 0x07, 0x6d, 0x70, 0x61, 0x64, 0x61, 0x74, 0x61, 0x22, 0x15, + 0x0a, 0x13, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x74, 0x61, 0x69, 0x6e, 0x47, 0x65, 0x74, 0x4c, 0x69, + 0x73, 0x74, 0x52, 0x65, 0x71, 0x22, 0x36, 0x0a, 0x14, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x74, 0x61, + 0x69, 0x6e, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1e, 0x0a, + 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x44, 0x42, + 0x58, 0x58, 0x4c, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x26, 0x0a, + 0x12, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x74, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, + 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x03, 0x6b, 0x65, 0x79, 0x22, 0x58, 0x0a, 0x13, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x74, 0x61, + 0x69, 0x6e, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1e, 0x0a, 0x04, + 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x44, 0x42, 0x58, + 0x58, 0x4c, 0x44, 0x61, 0x74, 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x21, 0x0a, 0x06, + 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x55, + 0x73, 0x65, 0x72, 0x41, 0x74, 0x6e, 0x6f, 0x52, 0x06, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x42, + 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1220,7 +1422,7 @@ func file_entertain_entertain_msg_proto_rawDescGZIP() []byte { return file_entertain_entertain_msg_proto_rawDescData } -var file_entertain_entertain_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 17) +var file_entertain_entertain_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 21) var file_entertain_entertain_msg_proto_goTypes = []interface{}{ (*EntertainMatchReq)(nil), // 0: EntertainMatchReq (*EntertainMatchResp)(nil), // 1: EntertainMatchResp @@ -1239,33 +1441,41 @@ var file_entertain_entertain_msg_proto_goTypes = []interface{}{ (*EntertainRefreshPlatReq)(nil), // 14: EntertainRefreshPlatReq (*EntertainRefreshPlatResp)(nil), // 15: EntertainRefreshPlatResp (*EntertainRefreshPush)(nil), // 16: EntertainRefreshPush - (*PlayerData)(nil), // 17: PlayerData - (*MapData)(nil), // 18: MapData - (*UserAtno)(nil), // 19: UserAtno + (*EntertainGetListReq)(nil), // 17: EntertainGetListReq + (*EntertainGetListResp)(nil), // 18: EntertainGetListResp + (*EntertainRewardReq)(nil), // 19: EntertainRewardReq + (*EntertainRewardResp)(nil), // 20: EntertainRewardResp + (*PlayerData)(nil), // 21: PlayerData + (*MapData)(nil), // 22: MapData + (*UserAtno)(nil), // 23: UserAtno + (*DBXXLData)(nil), // 24: DBXXLData } var file_entertain_entertain_msg_proto_depIdxs = []int32{ - 17, // 0: EntertainStartGamePush.user1:type_name -> PlayerData - 17, // 1: EntertainStartGamePush.user2:type_name -> PlayerData - 18, // 2: EntertainStartGamePush.mpadata:type_name -> MapData - 18, // 3: EntertainOperatorRstPush.mpadata:type_name -> MapData - 17, // 4: EntertainOperatorRstPush.user1:type_name -> PlayerData - 17, // 5: EntertainOperatorRstPush.user2:type_name -> PlayerData - 17, // 6: EntertainGameOverPush.user1:type_name -> PlayerData - 17, // 7: EntertainGameOverPush.user2:type_name -> PlayerData - 18, // 8: EntertainGameOverPush.mpadata:type_name -> MapData - 19, // 9: EntertainGameOverPush.reward:type_name -> UserAtno - 17, // 10: EntertainEnterRoomPush.user1:type_name -> PlayerData - 17, // 11: EntertainEnterRoomPush.user2:type_name -> PlayerData - 18, // 12: EntertainReconnectResp.mpadata:type_name -> MapData - 17, // 13: EntertainReconnectResp.user1:type_name -> PlayerData - 17, // 14: EntertainReconnectResp.user2:type_name -> PlayerData - 18, // 15: EntertainRefreshPlatResp.mpadata:type_name -> MapData - 18, // 16: EntertainRefreshPush.mpadata:type_name -> MapData - 17, // [17:17] is the sub-list for method output_type - 17, // [17:17] is the sub-list for method input_type - 17, // [17:17] is the sub-list for extension type_name - 17, // [17:17] is the sub-list for extension extendee - 0, // [0:17] is the sub-list for field type_name + 21, // 0: EntertainStartGamePush.user1:type_name -> PlayerData + 21, // 1: EntertainStartGamePush.user2:type_name -> PlayerData + 22, // 2: EntertainStartGamePush.mpadata:type_name -> MapData + 22, // 3: EntertainOperatorRstPush.mpadata:type_name -> MapData + 21, // 4: EntertainOperatorRstPush.user1:type_name -> PlayerData + 21, // 5: EntertainOperatorRstPush.user2:type_name -> PlayerData + 21, // 6: EntertainGameOverPush.user1:type_name -> PlayerData + 21, // 7: EntertainGameOverPush.user2:type_name -> PlayerData + 22, // 8: EntertainGameOverPush.mpadata:type_name -> MapData + 23, // 9: EntertainGameOverPush.reward:type_name -> UserAtno + 21, // 10: EntertainEnterRoomPush.user1:type_name -> PlayerData + 21, // 11: EntertainEnterRoomPush.user2:type_name -> PlayerData + 22, // 12: EntertainReconnectResp.mpadata:type_name -> MapData + 21, // 13: EntertainReconnectResp.user1:type_name -> PlayerData + 21, // 14: EntertainReconnectResp.user2:type_name -> PlayerData + 22, // 15: EntertainRefreshPlatResp.mpadata:type_name -> MapData + 22, // 16: EntertainRefreshPush.mpadata:type_name -> MapData + 24, // 17: EntertainGetListResp.data:type_name -> DBXXLData + 24, // 18: EntertainRewardResp.data:type_name -> DBXXLData + 23, // 19: EntertainRewardResp.reward:type_name -> UserAtno + 20, // [20:20] is the sub-list for method output_type + 20, // [20:20] is the sub-list for method input_type + 20, // [20:20] is the sub-list for extension type_name + 20, // [20:20] is the sub-list for extension extendee + 0, // [0:20] is the sub-list for field type_name } func init() { file_entertain_entertain_msg_proto_init() } @@ -1480,6 +1690,54 @@ func file_entertain_entertain_msg_proto_init() { return nil } } + file_entertain_entertain_msg_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EntertainGetListReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_entertain_entertain_msg_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EntertainGetListResp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_entertain_entertain_msg_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EntertainRewardReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_entertain_entertain_msg_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EntertainRewardResp); 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{ @@ -1487,7 +1745,7 @@ func file_entertain_entertain_msg_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_entertain_entertain_msg_proto_rawDesc, NumEnums: 0, - NumMessages: 17, + NumMessages: 21, NumExtensions: 0, NumServices: 0, }, diff --git a/sys/configure/structs/Game.ConsumeHeroData.go b/sys/configure/structs/Game.ConsumeHeroData.go index b4b1f11f6..227532164 100644 --- a/sys/configure/structs/Game.ConsumeHeroData.go +++ b/sys/configure/structs/Game.ConsumeHeroData.go @@ -13,6 +13,7 @@ import "errors" type GameConsumeHeroData struct { Key string Type int32 + Herocolor int32 Skillname string Skilltxt string Hero int32 @@ -32,6 +33,7 @@ func (*GameConsumeHeroData) GetTypeId() int32 { func (_v *GameConsumeHeroData)Deserialize(_buf map[string]interface{}) (err error) { { var _ok_ bool; if _v.Key, _ok_ = _buf["key"].(string); !_ok_ { err = errors.New("key error"); return } } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["type"].(float64); !_ok_ { err = errors.New("type error"); return }; _v.Type = int32(_tempNum_) } + { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["herocolor"].(float64); !_ok_ { err = errors.New("herocolor error"); return }; _v.Herocolor = int32(_tempNum_) } {var _ok_ bool; var __json_text__ map[string]interface{}; if __json_text__, _ok_ = _buf["skillname"].(map[string]interface{}) ; !_ok_ { err = errors.New("_v.Skillname error"); return }; { var _ok_ bool; if _, _ok_ = __json_text__["key"].(string); !_ok_ { err = errors.New("key error"); return } }; { var _ok_ bool; if _v.Skillname, _ok_ = __json_text__["text"].(string); !_ok_ { err = errors.New("text error"); return } } } {var _ok_ bool; var __json_text__ map[string]interface{}; if __json_text__, _ok_ = _buf["skilltxt"].(map[string]interface{}) ; !_ok_ { err = errors.New("_v.Skilltxt error"); return }; { var _ok_ bool; if _, _ok_ = __json_text__["key"].(string); !_ok_ { err = errors.New("key error"); return } }; { var _ok_ bool; if _v.Skilltxt, _ok_ = __json_text__["text"].(string); !_ok_ { err = errors.New("text error"); return } } } { var _ok_ bool; var _tempNum_ float64; if _tempNum_, _ok_ = _buf["hero"].(float64); !_ok_ { err = errors.New("hero error"); return }; _v.Hero = int32(_tempNum_) }