diff --git a/bin/json/game_consumehero.json b/bin/json/game_consumehero.json index 98d466747..07cecf56d 100644 --- a/bin/json/game_consumehero.json +++ b/bin/json/game_consumehero.json @@ -1,8 +1,14 @@ [ { - "key": "27000001", + "key": "51004", "type": 1, "herocolor": 1, + "hero": 51004, + "img": "tx_js_51004", + "intr": { + "key": "consume_consume_hero_intr_01", + "text": "豺狼小怪的三消英雄卡。" + }, "skillname": { "key": "consume_consume_hero_skillname_01", "text": "搜刮一空" @@ -11,7 +17,6 @@ "key": "consume_consume_hero_skilltxt_01", "text": "随机消除7个方块" }, - "hero": 51004, "consume": [], "skilltype": 1, "skillload": 6, @@ -19,9 +24,15 @@ "skillvalue": 7 }, { - "key": "27000002", + "key": "25001", "type": 2, "herocolor": 2, + "hero": 25001, + "img": "tx_js_51012", + "intr": { + "key": "consume_consume_hero_intr_02", + "text": "小猴子的三消英雄卡。" + }, "skillname": { "key": "consume_consume_hero_skillname_02", "text": "香蕉连成串" @@ -30,7 +41,6 @@ "key": "consume_consume_hero_skilltxt_02", "text": "消除中间的一列宝石" }, - "hero": 25001, "consume": [ { "a": "attr", @@ -44,9 +54,15 @@ "skillvalue": 0 }, { - "key": "27000003", + "key": "13002", "type": 2, "herocolor": 3, + "hero": 13002, + "img": "tx_js_51012", + "intr": { + "key": "consume_consume_hero_intr_03", + "text": "食人鱼的三消英雄卡" + }, "skillname": { "key": "consume_consume_hero_skillname_03", "text": "臭屁四溢" @@ -55,7 +71,6 @@ "key": "consume_consume_hero_skilltxt_03", "text": "玩家标记(选中)一个方块,然后有100%的概率周围位置,标记完毕后,有60%概率继续标记周围位置,然后30%概率标记周围位置,最多蔓延4次,标记结束后,消除所有被标记的方块。" }, - "hero": 0, "consume": [ { "a": "attr", @@ -69,9 +84,15 @@ "skillvalue": 0 }, { - "key": "27000004", + "key": "33003", "type": 2, "herocolor": 4, + "hero": 33003, + "img": "tx_js_51012", + "intr": { + "key": "consume_consume_hero_intr_04", + "text": "胡德先生的三消英雄卡" + }, "skillname": { "key": "consume_consume_hero_skillname_04", "text": "拦路抢劫" @@ -80,7 +101,6 @@ "key": "consume_consume_hero_skilltxt_04", "text": "选中一个方块,消除以该方块为中心,两条斜线上的所有方块(选中的方块也会被消除)。" }, - "hero": 0, "consume": [ { "a": "attr", @@ -94,9 +114,15 @@ "skillvalue": 0 }, { - "key": "27000005", + "key": "13005", "type": 2, "herocolor": 5, + "hero": 13005, + "img": "tx_js_51012", + "intr": { + "key": "consume_consume_hero_intr_05", + "text": "大大的三消英雄卡" + }, "skillname": { "key": "consume_consume_hero_skillname_05", "text": "劲爆小指头" @@ -105,7 +131,6 @@ "key": "consume_consume_hero_skilltxt_05", "text": "随机用炸弹代替一个方块,并直接引爆炸弹(炸弹是特殊方块,这里就是用炸弹代替,然后直接消掉该炸弹)。" }, - "hero": 0, "consume": [ { "a": "attr", diff --git a/bin/json/game_mainstage.json b/bin/json/game_mainstage.json index 8b8268303..b2aed738b 100644 --- a/bin/json/game_mainstage.json +++ b/bin/json/game_mainstage.json @@ -17505,7 +17505,7 @@ "destroy": 1, "progress": 0, "stroyshow": 0, - "frontstoryid": 20200, + "frontstoryid": 202000, "afterstoryid": 0, "maingroupName": { "key": "", @@ -17554,7 +17554,7 @@ "stage_param": 0, "inherit": 0, "battle_fail": 0, - "venturemodelspeed": 9, + "venturemodelspeed": 0, "venturemodelscale": 1, "move_type": 0, "venturemodel": "Person/43002/43002_q.prefab", @@ -17580,8 +17580,8 @@ "destroy": 1, "progress": 1, "stroyshow": 0, - "frontstoryid": 20201, - "afterstoryid": 20202, + "frontstoryid": 202010, + "afterstoryid": 202020, "maingroupName": { "key": "", "text": "" @@ -17677,7 +17677,7 @@ "stage_param": 10001, "inherit": 0, "battle_fail": 0, - "venturemodelspeed": 0, + "venturemodelspeed": 9, "venturemodelscale": 1, "move_type": 0, "venturemodel": "Person/yacht/yacht.prefab", @@ -17704,7 +17704,7 @@ "progress": 1, "stroyshow": 0, "frontstoryid": 0, - "afterstoryid": 0, + "afterstoryid": 202050, "maingroupName": { "key": "", "text": "" @@ -17748,7 +17748,7 @@ "buried_type": 0, "buried": 0, "grouptype": [], - "Episodetype": 1, + "Episodetype": 3, "stage_param": 0, "inherit": 0, "battle_fail": 0, @@ -17778,8 +17778,8 @@ "destroy": 1, "progress": 1, "stroyshow": 0, - "frontstoryid": 20205, - "afterstoryid": 20207, + "frontstoryid": 0, + "afterstoryid": 0, "maingroupName": { "key": "", "text": "" @@ -17837,10 +17837,8 @@ "n": 1 } ], - "BattleReadyID": 116, - "FormatList": [ - 103021 - ], + "BattleReadyID": 0, + "FormatList": [], "helphero": [], "banhero": [], "star": [ @@ -17901,8 +17899,8 @@ "destroy": 1, "progress": 1, "stroyshow": 0, - "frontstoryid": 20208, - "afterstoryid": 20210, + "frontstoryid": 202070, + "afterstoryid": 0, "maingroupName": { "key": "", "text": "" @@ -17962,7 +17960,7 @@ ], "BattleReadyID": 116, "FormatList": [ - 103031 + 103021 ], "helphero": [], "banhero": [], @@ -18024,8 +18022,8 @@ "destroy": 1, "progress": 1, "stroyshow": 0, - "frontstoryid": 20211, - "afterstoryid": 20212, + "frontstoryid": 202080, + "afterstoryid": 202100, "maingroupName": { "key": "", "text": "" @@ -18085,7 +18083,7 @@ ], "BattleReadyID": 116, "FormatList": [ - 103041 + 103031 ], "helphero": [], "banhero": [], @@ -18117,7 +18115,7 @@ "buried_type": 0, "buried": 0, "grouptype": [], - "Episodetype": 7, + "Episodetype": 1, "stage_param": 0, "inherit": 0, "battle_fail": 0, @@ -18147,8 +18145,8 @@ "destroy": 1, "progress": 1, "stroyshow": 0, - "frontstoryid": 20215, - "afterstoryid": 0, + "frontstoryid": 202110, + "afterstoryid": 202120, "maingroupName": { "key": "", "text": "" @@ -18178,8 +18176,10 @@ ], "lotteryward": 0, "commonaward": [], - "BattleReadyID": 0, - "FormatList": [], + "BattleReadyID": 116, + "FormatList": [ + 103041 + ], "helphero": [], "banhero": [], "star": [], @@ -18198,7 +18198,7 @@ "buried_type": 0, "buried": 0, "grouptype": [], - "Episodetype": 7, + "Episodetype": 3, "stage_param": 0, "inherit": 0, "battle_fail": 0, @@ -18228,7 +18228,7 @@ "destroy": 1, "progress": 1, "stroyshow": 0, - "frontstoryid": 20217, + "frontstoryid": 202130, "afterstoryid": 0, "maingroupName": { "key": "", @@ -18309,7 +18309,7 @@ "destroy": 1, "progress": 1, "stroyshow": 0, - "frontstoryid": 20223, + "frontstoryid": 202150, "afterstoryid": 0, "maingroupName": { "key": "", @@ -18368,10 +18368,8 @@ "n": 1 } ], - "BattleReadyID": 116, - "FormatList": [ - 103051 - ], + "BattleReadyID": 0, + "FormatList": [], "helphero": [], "banhero": [], "star": [ @@ -18402,8 +18400,8 @@ "buried_type": 0, "buried": 0, "grouptype": [], - "Episodetype": 1, - "stage_param": 0, + "Episodetype": 2, + "stage_param": 1, "inherit": 0, "battle_fail": 0, "venturemodelspeed": 12, @@ -18491,10 +18489,8 @@ "n": 1 } ], - "BattleReadyID": 116, - "FormatList": [ - 103061 - ], + "BattleReadyID": 0, + "FormatList": [], "helphero": [], "banhero": [], "star": [ @@ -18525,7 +18521,7 @@ "buried_type": 0, "buried": 0, "grouptype": [], - "Episodetype": 7, + "Episodetype": 1, "stage_param": 0, "inherit": 0, "battle_fail": 0, @@ -18555,7 +18551,7 @@ "destroy": 1, "progress": 1, "stroyshow": 0, - "frontstoryid": 20229, + "frontstoryid": 202300, "afterstoryid": 0, "maingroupName": { "key": "", @@ -18574,20 +18570,50 @@ "text": "" }, "exp": 0, - "hero_exp": 0, - "ps_consume": [], - "ps_mg": [], + "hero_exp": 400, + "ps_consume": [ + { + "a": "attr", + "t": "ps", + "n": 9 + } + ], + "ps_mg": [ + { + "a": "attr", + "t": "ps", + "n": 1 + } + ], "firstaward": [ { "a": "attr", "t": "gold", "n": 8000 + }, + { + "a": "equi", + "t": "11613", + "n": 1 } ], - "lotteryward": 0, - "commonaward": [], - "BattleReadyID": 0, - "FormatList": [], + "lotteryward": 17111610, + "commonaward": [ + { + "a": "attr", + "t": "gold", + "n": 8000 + }, + { + "a": "equi", + "t": "11623", + "n": 1 + } + ], + "BattleReadyID": 116, + "FormatList": [ + 103061 + ], "helphero": [], "banhero": [], "star": [], @@ -18621,7 +18647,7 @@ "venturetype": 0, "ventureavatar": [], "scene_effect": [], - "scene_effectfilter": "", + "scene_effectfilter": "效果8", "is_near": 0, "openlevel": 1, "EditorStage": 0, @@ -18636,8 +18662,8 @@ "destroy": 1, "progress": 1, "stroyshow": 0, - "frontstoryid": 20230, - "afterstoryid": 20231, + "frontstoryid": 202310, + "afterstoryid": 202330, "maingroupName": { "key": "", "text": "" @@ -18736,7 +18762,7 @@ "venturemodelspeed": 12, "venturemodelscale": 1, "move_type": 0, - "venturemodel": "Person/badcar/badcar.prefab", + "venturemodel": "Person/54016/54016_q.prefab", "bubbletalk": { "key": "", "text": "" @@ -18759,8 +18785,8 @@ "destroy": 1, "progress": 1, "stroyshow": 0, - "frontstoryid": 20232, - "afterstoryid": 20233, + "frontstoryid": 202320, + "afterstoryid": 202330, "maingroupName": { "key": "", "text": "" @@ -18852,7 +18878,7 @@ "buried_type": 0, "buried": 0, "grouptype": [], - "Episodetype": 7, + "Episodetype": 3, "stage_param": 0, "inherit": 0, "battle_fail": 0, @@ -18882,7 +18908,7 @@ "destroy": 1, "progress": 1, "stroyshow": 0, - "frontstoryid": 20236, + "frontstoryid": 202350, "afterstoryid": 0, "maingroupName": { "key": "", diff --git a/bin/json/game_pushgift.json b/bin/json/game_pushgift.json index 11235591a..1680d6164 100644 --- a/bin/json/game_pushgift.json +++ b/bin/json/game_pushgift.json @@ -2,11 +2,11 @@ { "id": 1, "name": { - "key": "push_gift_name_1", + "key": "push_push_name_1", "text": "英雄特惠礼包" }, "title": { - "key": "push_push_1", + "key": "push_push_title_1", "text": "月末狂欢,冰点特价" }, "resource": "", @@ -30,11 +30,11 @@ { "id": 2, "name": { - "key": "push_gift_name_2", + "key": "push_push_name_2", "text": "充值礼包" }, "title": { - "key": "push_push_2", + "key": "push_push_title_2", "text": "月末狂欢,冰点特价" }, "resource": "", @@ -58,11 +58,11 @@ { "id": 3, "name": { - "key": "push_gift_name_3", + "key": "push_push_name_3", "text": "月卡礼包" }, "title": { - "key": "push_push_3", + "key": "push_push_title_3", "text": "月末狂欢,冰点特价" }, "resource": "", @@ -86,11 +86,11 @@ { "id": 4, "name": { - "key": "push_gift_name_4", + "key": "push_push_name_4", "text": "累充礼包" }, "title": { - "key": "push_push_4", + "key": "push_push_title_4", "text": "月末狂欢,冰点特价" }, "resource": "", @@ -114,11 +114,11 @@ { "id": 5, "name": { - "key": "push_gift_name_5", + "key": "push_push_name_5", "text": "登陆礼包" }, "title": { - "key": "push_push_5", + "key": "push_push_title_5", "text": "月末狂欢,冰点特价" }, "resource": "", @@ -142,11 +142,11 @@ { "id": 6, "name": { - "key": "push_gift_name_6", + "key": "push_push_name_6", "text": "循环塔礼包" }, "title": { - "key": "push_push_6", + "key": "push_push_title_6", "text": "月末狂欢,冰点特价" }, "resource": "", @@ -170,11 +170,11 @@ { "id": 7, "name": { - "key": "push_gift_name_7", + "key": "push_push_name_7", "text": "种族塔礼包" }, "title": { - "key": "push_push_7", + "key": "push_push_title_7", "text": "月末狂欢,冰点特价" }, "resource": "", diff --git a/bin/json/game_taskround.json b/bin/json/game_taskround.json index ee59c97d8..aabc88f3d 100644 --- a/bin/json/game_taskround.json +++ b/bin/json/game_taskround.json @@ -190,7 +190,7 @@ }, "type_id": 13000007, "active": 10, - "jump_interface": 11012, + "jump_interface": 10013, "icon": "wp_icon_0001", "reword": [ { @@ -218,7 +218,7 @@ }, "type_id": 13000008, "active": 10, - "jump_interface": 11012, + "jump_interface": 10013, "icon": "wp_icon_0001", "reword": [ { @@ -246,7 +246,7 @@ }, "type_id": 13000009, "active": 10, - "jump_interface": 11012, + "jump_interface": 10013, "icon": "wp_icon_0002", "reword": [ { diff --git a/bin/json/game_treasuremap.json b/bin/json/game_treasuremap.json index 0faeafee8..ca90bdfbf 100644 --- a/bin/json/game_treasuremap.json +++ b/bin/json/game_treasuremap.json @@ -21,15 +21,15 @@ ], "name": { "key": "treasuremap_map_name_1", - "text": "" + "text": "原始人藏宝图" }, "explain": { "key": "treasuremap_map_explain_1", - "text": "" + "text": "原始人藏宝图" }, "describe": { "key": "treasuremap_map_desribe_1", - "text": "" + "text": "原始人藏宝图" } }, { diff --git a/comm/core.go b/comm/core.go index f8eeeec93..f135f31e7 100644 --- a/comm/core.go +++ b/comm/core.go @@ -44,6 +44,7 @@ const ( PandaType = "panda" //熊猫武馆资源 MountsType = "mts" //捕羊大赛坐骑资源 TitleType = "title" //称号资源 + XxlType = "xxl" //三消卡片资源 ) type Autogenerated struct { diff --git a/comm/imodule.go b/comm/imodule.go index 22a19c9bf..18debe6f0 100644 --- a/comm/imodule.go +++ b/comm/imodule.go @@ -672,4 +672,8 @@ type ( ICanineRabbit interface { CreateRoom(sessions []IUserSession, rulesStr string) (roomid string, err error) } + IEntertainment interface { + // 添加三消卡片资源 + AddXxlCard(session IUserSession, cards map[string]int32, bPush bool) (errdata *pb.ErrorData) + } ) diff --git a/modules/entertainment/api_getreward.go b/modules/entertainment/api_getreward.go index 796cf6b3f..0c5939e1c 100644 --- a/modules/entertainment/api_getreward.go +++ b/modules/entertainment/api_getreward.go @@ -7,7 +7,12 @@ import ( //参数校验 func (this *apiComp) RewardCheck(session comm.IUserSession, req *pb.EntertainRewardReq) (errdata *pb.ErrorData) { - + if req.Key == 0 { + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + } + } return } @@ -30,14 +35,13 @@ func (this *apiComp) Reward(session comm.IUserSession, req *pb.EntertainRewardRe user, err := this.module.ModuleUser.GetUser(session.GetUserId()) if err == nil { - if user.Consumeexp == 0 { // 0 不让领 - errdata = &pb.ErrorData{ - Code: pb.ErrorCode_UserRepeadReward, - Title: pb.ErrorCode_UserRepeadReward.ToString(), + if conf, err := this.module.configure.GetGameConsumeintegralReward(req.Key); err == nil { + if user.Consumeexp < conf.Key { + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_UserRepeadReward, + Title: pb.ErrorCode_UserRepeadReward.ToString(), + } } - return - } - 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 diff --git a/modules/entertainment/api_match.go b/modules/entertainment/api_match.go index fd31abd3f..774550aa6 100644 --- a/modules/entertainment/api_match.go +++ b/modules/entertainment/api_match.go @@ -31,7 +31,7 @@ func (this *apiComp) Match(session comm.IUserSession, req *pb.EntertainMatchReq) Uid: user.Uid, Sid: user.Sid, Name: user.Name, - Gender: 0, + Gender: user.Gender, Skin: user.CurSkin, Aframe: "", Title: user.Curtitle, diff --git a/modules/entertainment/configure.go b/modules/entertainment/configure.go index 84ddde6a2..f107d4fe3 100644 --- a/modules/entertainment/configure.go +++ b/modules/entertainment/configure.go @@ -128,3 +128,18 @@ func (this *configureComp) GetRobotGameConsumeHero() (cardid string) { return } + +func (this *configureComp) GetGameConsumeintegralReward(key int32) (conf *cfg.GameIntegralData, err error) { + var ( + v interface{} + ) + if v, err = this.GetConfigure(game_integral); err == nil { + if configure, ok := v.(*cfg.GameIntegral); ok { + if conf = configure.Get(key); conf != nil { + return + } + } + } + err = comm.NewNotFoundConfErr(moduleName, game_integral, key) + return +} diff --git a/modules/entertainment/model.go b/modules/entertainment/model.go index 4f3140e15..d08be51ac 100644 --- a/modules/entertainment/model.go +++ b/modules/entertainment/model.go @@ -6,6 +6,8 @@ import ( "go_dreamfactory/lego/sys/redis" "go_dreamfactory/modules" "go_dreamfactory/pb" + "go_dreamfactory/sys/db" + "go_dreamfactory/utils" "go.mongodb.org/mongo-driver/bson/primitive" "go.mongodb.org/mongo-driver/mongo" @@ -29,12 +31,30 @@ func (this *modelComp) Init(service core.IService, module core.IModule, comp cor } func (this *modelComp) getEntertainmList(uid string) (result *pb.DBXXLData, err error) { + var ( + dbModel *db.DBModel + ) result = &pb.DBXXLData{} - if err = this.Get(uid, result); err != nil { + if db.IsCross() { + if tag, _, b := utils.UIdSplit(uid); b { + if conn, err := db.ServerDBConn(tag); err == nil { + dbModel = db.NewDBModel(comm.TableEntertainm, conn) + + } + } + } + if dbModel == nil { + err = this.Get(uid, result) + } else { + err = dbModel.Get(uid, result) + } + + if err != nil { if redis.RedisNil != err { // 没有数据直接创建新的数据 result.Id = primitive.NewObjectID().Hex() result.Uid = uid result.Reward = make(map[int32]int32) + result.Card = make(map[string]int32, 0) } } err = nil @@ -42,5 +62,18 @@ func (this *modelComp) getEntertainmList(uid string) (result *pb.DBXXLData, err } func (this *modelComp) modifyEntertainmList(uid string, data map[string]interface{}) error { - return this.Change(uid, data) + var ( + err error + ) + if db.IsCross() { + if tag, _, b := utils.UIdSplit(uid); b { + if conn, err := db.ServerDBConn(tag); err == nil { + dbModel := db.NewDBModel(comm.TableEntertainm, conn) + err = dbModel.Change(uid, data) + } + } + } else { + err = this.Change(uid, data) + } + return err } diff --git a/modules/entertainment/module.go b/modules/entertainment/module.go index 223075ff1..d76519a3b 100644 --- a/modules/entertainment/module.go +++ b/modules/entertainment/module.go @@ -56,12 +56,37 @@ func (this *Entertainment) Start() (err error) { return } -func (this *Entertainment) BroadcastRoomMsg(uids ...string) { - this.SendMsgToUsers(string(this.GetType()), "message", &pb.EntertainStartGamePush{ - User1: &pb.PlayerData{}, - User2: &pb.PlayerData{}, - Mpadata: &pb.MapData{}, - Power: "", - Round: 0, - }, uids...) +// 分发资源 +func (this *Entertainment) AddXxlCard(session comm.IUserSession, cards map[string]int32, bPush bool) (errdata *pb.ErrorData) { + + var ( + result *pb.DBXXLData + err error + ) + for k := range cards { + if _, err := this.model.module.configure.GetGameConsumeHero(k); err != nil { + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ReqParameterError, + Title: pb.ErrorCode_ReqParameterError.ToString(), + Message: err.Error(), + } + return + } + } + if result, err = this.model.getEntertainmList(session.GetUserId()); err != nil { + return + } + for k, v := range cards { + result.Card[k] += v + } + this.model.modifyEntertainmList(session.GetUserId(), map[string]interface{}{ + "card": result.Card, + }) + + if bPush { + session.SendMsg(string(this.GetType()), "titlelist", &pb.EntertainChangePush{ + Card: result.Card, + }) + } + return } diff --git a/modules/entertainment/xxlPlat.go b/modules/entertainment/xxlPlat.go index 226895035..a42b51547 100644 --- a/modules/entertainment/xxlPlat.go +++ b/modules/entertainment/xxlPlat.go @@ -61,7 +61,8 @@ func (this *MapData) InitMap(module *Entertainment) { for i := 0; i < Width*Height; i++ { this.Plat[i] = this.CreateGride(int32(i)) } - this.SetMap() // 方便测试固定地图 + this.SetIndelibilityPlat() + //this.SetMap() // 方便测试固定地图 } // 交换2个元素(参数 oid ) @@ -83,30 +84,14 @@ func (this *MapData) SwapGirde(oldId, newId int32) (bSwap bool) { return } -func (this *MapData) SetMap() { - sz2 := []int32{ - 1, 1, 2, 5, 1, 5, 2, - 3, 2, 3, 1, 2, 4, 4, - 2, 1, 1, 3, 6, 4, 1, - 4, 1, 1, 4, 3, 6, 3, - 4, 3, 4, 5, 1, 6, 1, - 5, 4, 2, 5, 3, 3, 1, - 4, 1, 5, 3, 2, 3, 4, - } - var pos int - for index := Width - 1; index >= 0; index-- { - for j := 0; j < Height; j++ { - this.Plat[index+j*Height].Color = sz2[pos] - this.Plat[index+j*Height].Cid = sz2[pos] - pos++ - } - } -} func (this *MapData) Debugf() { fmt.Printf("================\n") + var v int for index := Width - 1; index >= 0; index-- { for j := 0; j < Height; j++ { - fmt.Printf("%d:%d ", this.Plat[index+j*Height].Oid, this.Plat[index+j*Height].Color) + v = index + j*7 + fmt.Printf("%d:%d ", v, this.Plat[index+j*Height].Color) + } fmt.Printf("\n") } @@ -589,13 +574,26 @@ func (this *MapData) CheckInitPlat() { } } -// 1, 1, 2, 5, 1, 5, 2, -// 3, 2, 3, 1, 2, 4, 4, -// 2, 1, 1, 3, 6, 4, 1, -// 4, 1, 1, 4, 3, 6, 3, -// 4, 3, 4, 5, 1, 6, 1, -// 5, 4, 2, 5, 3, 3, 1, -// 4, 1, 5, 3, 2, 3, 4, +func (this *MapData) SetMap() { + sz2 := []int32{ + 1, 1, 2, 5, 1, 5, 2, + 3, 2, 3, 1, 2, 4, 4, + 2, 1, 1, 3, 6, 4, 1, + 4, 1, 1, 4, 3, 6, 3, + 4, 3, 4, 5, 1, 6, 1, + 5, 4, 2, 5, 3, 3, 1, + 4, 1, 5, 3, 2, 3, 4, + } + var pos int + for index := Width - 1; index >= 0; index-- { + for j := 0; j < Height; j++ { + this.Plat[index+j*Height].Color = sz2[pos] + this.Plat[index+j*Height].Cid = sz2[pos] + pos++ + } + } + this.SetIndelibilityPlat() +} // 校验当前地图 有没有能消除的 func (this *MapData) CheckAndRefreshPlat() (bEliminate bool) { @@ -609,49 +607,122 @@ func (this *MapData) CheckAndRefreshPlat() (bEliminate bool) { 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 { + if true { + pos := k + 2 + if pos/Width+1 < Width { // 右 + p := this.Plat[pos+Width].Color + if p == k1 { + bEliminate = true + return + } + } + if pos%Height+1 < Height { // 上 + p := this.Plat[pos+1].Color + if p == k1 { bEliminate = true return } } - // 左 - } - } } - // 左右检测 - if y+1 < Width { + if y+2 < Height { k1 := this.Plat[k].Color k2 := this.Plat[k+Width].Color - if k1 == k2 { - // + + if k1 == k2 { // 校验k3 左边和右边 + if true { + pos := k + 2*Width + if pos/Width+1 < Width { // 右 + p := this.Plat[pos+Width].Color + if p == k1 { + bEliminate = true + return + } + } + if pos%Height+1 < Width { // 上 + p := this.Plat[pos+1].Color + if p == k1 { + bEliminate = true + return + } + } + } + } + } + } + + for index := Width - 1; index >= 0; index-- { + for j := 0; j < Height; j++ { + k := index + j*7 + if j+3 < Width { + k1 := this.Plat[k].Color + k2 := this.Plat[k+2*Width].Color + pos := index + (j+1)*7 + if k1 == k2 { + // 上 + if pos%Height+1 < Height { + p := this.Plat[pos+1].Color + if p == k1 { + bEliminate = true + return + } + } + } + } + } + } + // 上下检测中间元素左右互换 + for i := 0; i < Height; i++ { + for j := 0; j < Height; j++ { + k := j + i*7 + if k%Height+3 < Height { + k1 := this.Plat[k].Color + k2 := this.Plat[k+2].Color + pos := k + 1 + if k1 == k2 { + if pos/Height+1 < Width { // 右 + p := this.Plat[pos+Width].Color + if p == k1 { + bEliminate = true + return + } + } + } } } } return } + +// 生成一个不能消除的地图 +func (this *MapData) SetIndelibilityPlat() { + for k, v := range this.Plat { + if v.Color == 0 { + continue + } + x := int32(k % Height) // x + + if x+2 < Height { + k1 := this.Plat[k].Color + k2 := this.Plat[k+1].Color + k3 := this.Plat[k+2].Color + if k1 == k2 && k2 == k3 { + this.Plat[k+2].Cid = (k3+1)%5 + 1 + this.Plat[k+2].Color = (k3+1)%5 + 1 + } + } + + 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 { + this.Plat[k+2*Width].Cid = (k3+1)%5 + 1 + this.Plat[k+2*Width].Color = (k3+1)%5 + 1 + } + } + } +} diff --git a/modules/entertainment/xxl_test.go b/modules/entertainment/xxl_test.go index 21e0de3fa..3b23a3ba8 100644 --- a/modules/entertainment/xxl_test.go +++ b/modules/entertainment/xxl_test.go @@ -84,8 +84,23 @@ func Test_Main(t *testing.T) { }() m := new(entertainment.MapData) m.InitMap(nil) - m.SetMap() - m.CheckAndRefreshPlat() + for i := 0; i < 100; i++ { + m := new(entertainment.MapData) + m.InitMap(nil) + //m.SetMap() + m.SetIndelibilityPlat() + d, _ := m.CheckMap(0, true) + if len(d) > 0 { + fmt.Println("===========有消除") + m.Debugf() + } + + if m.CheckAndRefreshPlat() { + m.Debugf() + fmt.Println("xxxx") + } + } + //var szMap []*pb.MapData // if bSwap, m := m.AiSwapGirde(); bSwap { // szMap = append(szMap, m...) diff --git a/modules/gm/module.go b/modules/gm/module.go index c991356f1..121d1ecbc 100644 --- a/modules/gm/module.go +++ b/modules/gm/module.go @@ -76,7 +76,8 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (errdata *pb.Er this.Debugf("create CMD :%s", cmd) // 打印个日志方便查询 datas := strings.Split(keys[1], ",") if len(datas) == 3 && (comm.TitleType == datas[0] || datas[0] == comm.AttrType || datas[0] == comm.ItemType || - datas[0] == comm.HeroType || datas[0] == comm.EquipmentType || datas[0] == comm.VipType || datas[0] == comm.AtlasType || datas[0] == comm.PandaType || datas[0] == comm.MountsType) { + datas[0] == comm.HeroType || datas[0] == comm.EquipmentType || datas[0] == comm.VipType || + datas[0] == comm.AtlasType || datas[0] == comm.PandaType || datas[0] == comm.MountsType || datas[0] == comm.XxlType) { num, err := strconv.Atoi(datas[2]) if err != nil { errdata = &pb.ErrorData{ diff --git a/modules/modulebase.go b/modules/modulebase.go index a38ab6c6c..3c4b7d913 100644 --- a/modules/modulebase.go +++ b/modules/modulebase.go @@ -28,22 +28,23 @@ type ModuleBase struct { options IOptions scomp comm.ISC_GateRouteComp //网关服务组件 //常用的一些通用模块 在底层注册好 - ModuleSys comm.ISys //系统 - ModuleUser comm.IUser //用户模块 - ModuleItems comm.IItems //道具背包模块 - ModuleHero comm.IHero //英雄模块 - ModuleEquipment comm.IEquipment //装备模块 - ModuleFriend comm.IFriend //好友 - ModuleSociaty comm.ISociaty //公会 - ModulePrivilege comm.IPrivilege // 月卡 - ModuleSmithy comm.ISmithy //铁匠铺 - ModulePractice comm.IPractice //练功房 - ModuleTools comm.ITools //工具类 获取一些通用配置 - ModuleBuried comm.IBuried //触发埋点中心 - ModuleMail comm.Imail //邮件 - ModuleActivity comm.IActivity //活动模块 - ModuleUiGame comm.IUiGame // - ModuleDragon comm.IDragon // + ModuleSys comm.ISys //系统 + ModuleUser comm.IUser //用户模块 + ModuleItems comm.IItems //道具背包模块 + ModuleHero comm.IHero //英雄模块 + ModuleEquipment comm.IEquipment //装备模块 + ModuleFriend comm.IFriend //好友 + ModuleSociaty comm.ISociaty //公会 + ModulePrivilege comm.IPrivilege // 月卡 + ModuleSmithy comm.ISmithy //铁匠铺 + ModulePractice comm.IPractice //练功房 + ModuleTools comm.ITools //工具类 获取一些通用配置 + ModuleBuried comm.IBuried //触发埋点中心 + ModuleMail comm.Imail //邮件 + ModuleActivity comm.IActivity //活动模块 + ModuleUiGame comm.IUiGame // + ModuleDragon comm.IDragon // + ModuleEntertain comm.IEntertainment // } // 重构模块配置对象 @@ -154,6 +155,11 @@ func (this *ModuleBase) Start() (err error) { return } this.ModuleDragon = module.(comm.IDragon) + + if module, err = this.service.GetModule(comm.ModuleEntertainment); err != nil { + return + } + this.ModuleEntertain = module.(comm.IEntertainment) return } @@ -471,6 +477,7 @@ func (this *ModuleBase) DispenseRes(session comm.IUserSession, res []*cfg.Gameat mts map[string]int32 // 捕羊大赛资源 per map[string]int32 // 捕羊大赛资源 title map[string]int32 // 称号资源 + xxl map[string]int32 // 三消卡片资源 ) items = make(map[string]int32, 0) heros = make(map[string]int32, 0) @@ -482,6 +489,7 @@ func (this *ModuleBase) DispenseRes(session comm.IUserSession, res []*cfg.Gameat mts = make(map[string]int32, 0) per = make(map[string]int32, 0) title = make(map[string]int32, 0) + xxl = make(map[string]int32, 0) for _, v := range res { switch v.A { @@ -507,6 +515,8 @@ func (this *ModuleBase) DispenseRes(session comm.IUserSession, res []*cfg.Gameat per[v.T] = 1 case comm.TitleType: title[v.T] = 1 + case comm.XxlType: + xxl[v.T] += v.N default: this.Error("not found res type", log.Field{Key: "Type", Value: v.A}) // 找不到资源类型 } @@ -559,6 +569,10 @@ func (this *ModuleBase) DispenseRes(session comm.IUserSession, res []*cfg.Gameat errdata = this.ModuleUser.AddTitle(session, title, bPush) this.Debugf("发放用户称号资源资源: %v errdata: %v", mts, errdata) } + if len(xxl) > 0 { + errdata = this.ModuleEntertain.AddXxlCard(session, xxl, bPush) + this.Debugf("发放三消卡片资源资源: %v errdata: %v", mts, errdata) + } return } @@ -698,6 +712,7 @@ func (this *ModuleBase) DispenseAtno(session comm.IUserSession, res []*cfg.Gamea mts map[string]int32 // 捕羊大赛资源 per map[string]int32 // 捕羊大赛资源 title map[string]int32 // 称号资源 + xxl map[string]int32 // 三消资源 equipschange []*pb.DB_Equipment heroschange []*pb.UserAtno itemschange []*pb.UserAtno @@ -712,6 +727,7 @@ func (this *ModuleBase) DispenseAtno(session comm.IUserSession, res []*cfg.Gamea mts = make(map[string]int32, 0) per = make(map[string]int32, 0) title = make(map[string]int32, 0) + xxl = make(map[string]int32, 0) for _, v := range res { switch v.A { @@ -737,6 +753,8 @@ func (this *ModuleBase) DispenseAtno(session comm.IUserSession, res []*cfg.Gamea per[v.T] = 1 case comm.TitleType: title[v.T] = 1 + case comm.XxlType: + xxl[v.T] += v.N default: this.Error("not found res type", log.Field{Key: "Type", Value: v.A}) // 找不到资源类型 } @@ -863,6 +881,20 @@ func (this *ModuleBase) DispenseAtno(session comm.IUserSession, res []*cfg.Gamea } this.Debugf("发放用户称号资源资源: %v errdata: %v", mts, errdata) } + + if len(xxl) > 0 { + if errdata = this.ModuleEntertain.AddXxlCard(session, xxl, bPush); errdata != nil { + return + } + for k, v := range xxl { + atno = append(atno, &pb.UserAtno{ + A: comm.TitleType, + T: k, + N: v, + }) + } + this.Debugf("发放三消卡片资源资源: %v errdata: %v", mts, errdata) + } return } diff --git a/pb/entertain_db.pb.go b/pb/entertain_db.pb.go index b22851d46..063d39d8d 100644 --- a/pb/entertain_db.pb.go +++ b/pb/entertain_db.pb.go @@ -26,9 +26,10 @@ type MapData struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Data []*GirdeData `protobuf:"bytes,1,rep,name=data,proto3" json:"data"` // 地图数据 - CurSocre int32 `protobuf:"varint,2,opt,name=curSocre,proto3" json:"curSocre"` // 本次地图更新得分 - CurEnergy int32 `protobuf:"varint,3,opt,name=curEnergy,proto3" json:"curEnergy"` // 本次掉落获得的能量 + Data []*GirdeData `protobuf:"bytes,1,rep,name=data,proto3" json:"data"` // 地图数据 + CurSocre int32 `protobuf:"varint,2,opt,name=curSocre,proto3" json:"curSocre"` // 本次地图更新得分 + CurEnergy int32 `protobuf:"varint,3,opt,name=curEnergy,proto3" json:"curEnergy"` // 本次掉落获得的能量 + ChangeType int32 `protobuf:"varint,4,opt,name=changeType,proto3" json:"changeType"` // 1 地图刷新类型 } func (x *MapData) Reset() { @@ -84,6 +85,13 @@ func (x *MapData) GetCurEnergy() int32 { return 0 } +func (x *MapData) GetChangeType() int32 { + if x != nil { + return x.ChangeType + } + return 0 +} + // 消消乐 type GirdeData struct { state protoimpl.MessageState @@ -304,9 +312,10 @@ type DBXXLData 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 - 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 + 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 + Card map[string]int32 `protobuf:"bytes,4,rep,name=card,proto3" json:"card" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` // key 卡id value 数量(可为0) } func (x *DBXXLData) Reset() { @@ -362,51 +371,66 @@ func (x *DBXXLData) GetReward() map[int32]int32 { return nil } +func (x *DBXXLData) GetCard() map[string]int32 { + if x != nil { + return x.Card + } + return nil +} + var File_entertain_entertain_db_proto protoreflect.FileDescriptor var file_entertain_entertain_db_proto_rawDesc = []byte{ 0x0a, 0x1c, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x74, 0x61, 0x69, 0x6e, 0x2f, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x74, 0x61, 0x69, 0x6e, 0x5f, 0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0a, - 0x63, 0x6f, 0x6d, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x63, 0x0a, 0x07, 0x4d, 0x61, - 0x70, 0x44, 0x61, 0x74, 0x61, 0x12, 0x1e, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x47, 0x69, 0x72, 0x64, 0x65, 0x44, 0x61, 0x74, 0x61, 0x52, - 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x75, 0x72, 0x53, 0x6f, 0x63, 0x72, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x63, 0x75, 0x72, 0x53, 0x6f, 0x63, 0x72, - 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x75, 0x72, 0x45, 0x6e, 0x65, 0x72, 0x67, 0x79, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x63, 0x75, 0x72, 0x45, 0x6e, 0x65, 0x72, 0x67, 0x79, 0x22, - 0x75, 0x0a, 0x09, 0x47, 0x69, 0x72, 0x64, 0x65, 0x44, 0x61, 0x74, 0x61, 0x12, 0x10, 0x0a, 0x03, - 0x6f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6f, 0x69, 0x64, 0x12, 0x14, - 0x0a, 0x05, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x63, - 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, - 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, 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, + 0x63, 0x6f, 0x6d, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x83, 0x01, 0x0a, 0x07, 0x4d, + 0x61, 0x70, 0x44, 0x61, 0x74, 0x61, 0x12, 0x1e, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x47, 0x69, 0x72, 0x64, 0x65, 0x44, 0x61, 0x74, 0x61, + 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x75, 0x72, 0x53, 0x6f, 0x63, + 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x63, 0x75, 0x72, 0x53, 0x6f, 0x63, + 0x72, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x75, 0x72, 0x45, 0x6e, 0x65, 0x72, 0x67, 0x79, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x63, 0x75, 0x72, 0x45, 0x6e, 0x65, 0x72, 0x67, 0x79, + 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x54, 0x79, 0x70, 0x65, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x54, 0x79, 0x70, 0x65, + 0x22, 0x75, 0x0a, 0x09, 0x47, 0x69, 0x72, 0x64, 0x65, 0x44, 0x61, 0x74, 0x61, 0x12, 0x10, 0x0a, + 0x03, 0x6f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x6f, 0x69, 0x64, 0x12, + 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, + 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, + 0x28, 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, 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, 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, + 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, 0xfb, 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, 0x12, 0x28, 0x0a, 0x04, 0x63, 0x61, 0x72, 0x64, + 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x44, 0x42, 0x58, 0x58, 0x4c, 0x44, 0x61, + 0x74, 0x61, 0x2e, 0x43, 0x61, 0x72, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x04, 0x63, 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, 0x1a, 0x37, 0x0a, + 0x09, 0x43, 0x61, 0x72, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, + 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -421,7 +445,7 @@ 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, 6) +var file_entertain_entertain_db_proto_msgTypes = make([]protoimpl.MessageInfo, 7) var file_entertain_entertain_db_proto_goTypes = []interface{}{ (*MapData)(nil), // 0: MapData (*GirdeData)(nil), // 1: GirdeData @@ -429,18 +453,20 @@ var file_entertain_entertain_db_proto_goTypes = []interface{}{ (*DBXXLMatch)(nil), // 3: DBXXLMatch (*DBXXLData)(nil), // 4: DBXXLData nil, // 5: DBXXLData.RewardEntry - (*BaseUserInfo)(nil), // 6: BaseUserInfo + nil, // 6: DBXXLData.CardEntry + (*BaseUserInfo)(nil), // 7: BaseUserInfo } var file_entertain_entertain_db_proto_depIdxs = []int32{ 1, // 0: MapData.data:type_name -> GirdeData - 6, // 1: PlayerData.userinfo:type_name -> BaseUserInfo - 6, // 2: DBXXLMatch.userinfo:type_name -> BaseUserInfo + 7, // 1: PlayerData.userinfo:type_name -> BaseUserInfo + 7, // 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 + 6, // 4: DBXXLData.card:type_name -> DBXXLData.CardEntry + 5, // [5:5] is the sub-list for method output_type + 5, // [5:5] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name } func init() { file_entertain_entertain_db_proto_init() } @@ -517,7 +543,7 @@ func file_entertain_entertain_db_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_entertain_entertain_db_proto_rawDesc, NumEnums: 0, - NumMessages: 6, + NumMessages: 7, NumExtensions: 0, NumServices: 0, }, diff --git a/pb/entertain_msg.pb.go b/pb/entertain_msg.pb.go index 11c72e008..2c3bece3c 100644 --- a/pb/entertain_msg.pb.go +++ b/pb/entertain_msg.pb.go @@ -1275,6 +1275,54 @@ func (x *EntertainRewardResp) GetReward() []*UserAtno { return nil } +// 英雄卡数据变更推送 +type EntertainChangePush struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Card map[string]int32 `protobuf:"bytes,1,rep,name=card,proto3" json:"card" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` // key 卡id value 数量(可为0) +} + +func (x *EntertainChangePush) Reset() { + *x = EntertainChangePush{} + if protoimpl.UnsafeEnabled { + mi := &file_entertain_entertain_msg_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EntertainChangePush) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EntertainChangePush) ProtoMessage() {} + +func (x *EntertainChangePush) ProtoReflect() protoreflect.Message { + mi := &file_entertain_entertain_msg_proto_msgTypes[21] + 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 EntertainChangePush.ProtoReflect.Descriptor instead. +func (*EntertainChangePush) Descriptor() ([]byte, []int) { + return file_entertain_entertain_msg_proto_rawDescGZIP(), []int{21} +} + +func (x *EntertainChangePush) GetCard() map[string]int32 { + if x != nil { + return x.Card + } + return nil +} + var File_entertain_entertain_msg_proto protoreflect.FileDescriptor var file_entertain_entertain_msg_proto_rawDesc = []byte{ @@ -1406,8 +1454,17 @@ var file_entertain_entertain_msg_proto_rawDesc = []byte{ 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, + 0x73, 0x65, 0x72, 0x41, 0x74, 0x6e, 0x6f, 0x52, 0x06, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x22, + 0x82, 0x01, 0x0a, 0x13, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x74, 0x61, 0x69, 0x6e, 0x43, 0x68, 0x61, + 0x6e, 0x67, 0x65, 0x50, 0x75, 0x73, 0x68, 0x12, 0x32, 0x0a, 0x04, 0x63, 0x61, 0x72, 0x64, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x74, 0x61, 0x69, + 0x6e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x75, 0x73, 0x68, 0x2e, 0x43, 0x61, 0x72, 0x64, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x04, 0x63, 0x61, 0x72, 0x64, 0x1a, 0x37, 0x0a, 0x09, 0x43, + 0x61, 0x72, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x3a, 0x02, 0x38, 0x01, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1422,7 +1479,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, 21) +var file_entertain_entertain_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 23) var file_entertain_entertain_msg_proto_goTypes = []interface{}{ (*EntertainMatchReq)(nil), // 0: EntertainMatchReq (*EntertainMatchResp)(nil), // 1: EntertainMatchResp @@ -1445,37 +1502,40 @@ var file_entertain_entertain_msg_proto_goTypes = []interface{}{ (*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 + (*EntertainChangePush)(nil), // 21: EntertainChangePush + nil, // 22: EntertainChangePush.CardEntry + (*PlayerData)(nil), // 23: PlayerData + (*MapData)(nil), // 24: MapData + (*UserAtno)(nil), // 25: UserAtno + (*DBXXLData)(nil), // 26: DBXXLData } var file_entertain_entertain_msg_proto_depIdxs = []int32{ - 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 + 23, // 0: EntertainStartGamePush.user1:type_name -> PlayerData + 23, // 1: EntertainStartGamePush.user2:type_name -> PlayerData + 24, // 2: EntertainStartGamePush.mpadata:type_name -> MapData + 24, // 3: EntertainOperatorRstPush.mpadata:type_name -> MapData + 23, // 4: EntertainOperatorRstPush.user1:type_name -> PlayerData + 23, // 5: EntertainOperatorRstPush.user2:type_name -> PlayerData + 23, // 6: EntertainGameOverPush.user1:type_name -> PlayerData + 23, // 7: EntertainGameOverPush.user2:type_name -> PlayerData + 24, // 8: EntertainGameOverPush.mpadata:type_name -> MapData + 25, // 9: EntertainGameOverPush.reward:type_name -> UserAtno + 23, // 10: EntertainEnterRoomPush.user1:type_name -> PlayerData + 23, // 11: EntertainEnterRoomPush.user2:type_name -> PlayerData + 24, // 12: EntertainReconnectResp.mpadata:type_name -> MapData + 23, // 13: EntertainReconnectResp.user1:type_name -> PlayerData + 23, // 14: EntertainReconnectResp.user2:type_name -> PlayerData + 24, // 15: EntertainRefreshPlatResp.mpadata:type_name -> MapData + 24, // 16: EntertainRefreshPush.mpadata:type_name -> MapData + 26, // 17: EntertainGetListResp.data:type_name -> DBXXLData + 26, // 18: EntertainRewardResp.data:type_name -> DBXXLData + 25, // 19: EntertainRewardResp.reward:type_name -> UserAtno + 22, // 20: EntertainChangePush.card:type_name -> EntertainChangePush.CardEntry + 21, // [21:21] is the sub-list for method output_type + 21, // [21:21] is the sub-list for method input_type + 21, // [21:21] is the sub-list for extension type_name + 21, // [21:21] is the sub-list for extension extendee + 0, // [0:21] is the sub-list for field type_name } func init() { file_entertain_entertain_msg_proto_init() } @@ -1738,6 +1798,18 @@ func file_entertain_entertain_msg_proto_init() { return nil } } + file_entertain_entertain_msg_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*EntertainChangePush); 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{ @@ -1745,7 +1817,7 @@ func file_entertain_entertain_msg_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_entertain_entertain_msg_proto_rawDesc, NumEnums: 0, - NumMessages: 21, + NumMessages: 23, NumExtensions: 0, NumServices: 0, }, diff --git a/sys/configure/structs/Game.ConsumeHeroData.go b/sys/configure/structs/Game.ConsumeHeroData.go index 227532164..ed8582412 100644 --- a/sys/configure/structs/Game.ConsumeHeroData.go +++ b/sys/configure/structs/Game.ConsumeHeroData.go @@ -14,9 +14,11 @@ type GameConsumeHeroData struct { Key string Type int32 Herocolor int32 + Hero int32 + Img string + Intr string Skillname string Skilltxt string - Hero int32 Consume []*Gameatn Skilltype int32 Skillload int32 @@ -34,9 +36,11 @@ func (_v *GameConsumeHeroData)Deserialize(_buf map[string]interface{}) (err erro { 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 _tempNum_ float64; if _tempNum_, _ok_ = _buf["hero"].(float64); !_ok_ { err = errors.New("hero error"); return }; _v.Hero = int32(_tempNum_) } + { var _ok_ bool; if _v.Img, _ok_ = _buf["img"].(string); !_ok_ { err = errors.New("img error"); return } } + {var _ok_ bool; var __json_text__ map[string]interface{}; if __json_text__, _ok_ = _buf["intr"].(map[string]interface{}) ; !_ok_ { err = errors.New("_v.Intr error"); return }; { var _ok_ bool; if _, _ok_ = __json_text__["key"].(string); !_ok_ { err = errors.New("key error"); return } }; { var _ok_ bool; if _v.Intr, _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["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_) } { var _arr_ []interface{} var _ok_ bool