From 6313a4615959a65cb3d5d4599bcaa4f7cefe7be6 Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Fri, 22 Jul 2022 22:47:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E9=A1=B5=E9=9D=A2=E5=B7=A5?= =?UTF-8?q?=E5=85=B7=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pb/proto.js | 59 +++++++++++++++++++++--------------- src/pb/proto/hero_msg.proto | 15 +++------ src/pb/proto/items_msg.proto | 10 ++++-- src/views/protocol/Index.vue | 5 +-- 4 files changed, 50 insertions(+), 39 deletions(-) diff --git a/src/pb/proto.js b/src/pb/proto.js index 0f6f344..4469c29 100644 --- a/src/pb/proto.js +++ b/src/pb/proto.js @@ -1283,18 +1283,6 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr } } }, - HeroAddNewHeroPush: { - fields: { - hero: { - type: "DBHero", - id: 1 - }, - count: { - type: "int32", - id: 2 - } - } - }, HeroGetSpecifiedReq: { fields: { heroCoinfigID: { @@ -1323,18 +1311,9 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr } } }, - HeroDelHeroPush: { - fields: { - heros: { - keyType: "string", - type: "int32", - id: 1 - } - } - }, HeroDrawCardReq: { fields: { - drawCount: { + drawType: { type: "int32", id: 1 } @@ -1349,6 +1328,15 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr } } }, + HeroChangePush: { + fields: { + list: { + rule: "repeated", + type: "DBHero", + id: 1 + } + } + }, DB_UserItemData: { fields: { gridId: { @@ -1424,7 +1412,20 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr } }, ItemsUseItemResp: { - fields: {} + fields: { + GridId: { + type: "string", + id: 1 + }, + Amount: { + type: "uint32", + id: 2 + }, + issucc: { + type: "bool", + id: 3 + } + } }, ItemsSellItemReq: { fields: { @@ -1444,9 +1445,17 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr }, ItemsSellItemResp: { fields: { - Item: { - type: "DB_UserItemData", + GridId: { + type: "string", id: 1 + }, + Amount: { + type: "uint32", + id: 2 + }, + issucc: { + type: "bool", + id: 3 } } }, diff --git a/src/pb/proto/hero_msg.proto b/src/pb/proto/hero_msg.proto index e1bf715..716d336 100644 --- a/src/pb/proto/hero_msg.proto +++ b/src/pb/proto/hero_msg.proto @@ -123,12 +123,6 @@ message HeroLockResp { DBHero hero = 1; // 英雄对象 } -// 增加新英雄推送 -message HeroAddNewHeroPush { - DBHero hero = 1; // 英雄对象 - int32 count = 2; //数量 -} - // 测试用(获取指定星级等级的英雄) message HeroGetSpecifiedReq { int32 heroCoinfigID = 1; // 英雄配置ID @@ -141,13 +135,14 @@ message HeroGetSpecifiedResp { DBHero hero = 1; // 英雄对象 } -message HeroDelHeroPush { map heros = 1; } - // 抽卡 message HeroDrawCardReq { - int32 drawCount = 1; // 抽卡次数, 只能是单抽和十抽 + int32 drawType = 1; // 抽卡类型 见drawCardCost表 } message HeroDrawCardResp { repeated int32 heroes = 1; // 返回英雄的configID -} \ No newline at end of file +} + +// 英雄变化推送 +message HeroChangePush { repeated DBHero list = 1; } \ No newline at end of file diff --git a/src/pb/proto/items_msg.proto b/src/pb/proto/items_msg.proto index 401ce7d..aa3734b 100644 --- a/src/pb/proto/items_msg.proto +++ b/src/pb/proto/items_msg.proto @@ -24,7 +24,11 @@ message ItemsUseItemReq { } //使用物品请求 回应 -message ItemsUseItemResp {} +message ItemsUseItemResp { + string GridId = 1; //格子Id + uint32 Amount = 2; //使用数量 + bool issucc = 3; //是否成功 +} //出售道具请求sailitem message ItemsSellItemReq { @@ -35,5 +39,7 @@ message ItemsSellItemReq { //出售道具请求 回应 message ItemsSellItemResp { - DB_UserItemData Item = 1; //变化物品 + string GridId = 1; //格子Id + uint32 Amount = 2; //使用数量 + bool issucc = 3; //是否成功 } \ No newline at end of file diff --git a/src/views/protocol/Index.vue b/src/views/protocol/Index.vue index 7631720..9cf41a5 100644 --- a/src/views/protocol/Index.vue +++ b/src/views/protocol/Index.vue @@ -338,10 +338,12 @@ export default defineComponent({ let keys = Object.keys(this.subSelect.reqproto.fields) for (const v of keys) { let rule = this.subSelect.reqproto.fields[v].rule + let keyType = this.subSelect.reqproto.fields[v].keyType let ftype = this.subSelect.reqproto.fields[v].type let range = [] let fvalue = null - if (!rule) { + + if (!rule && !keyType) { switch (ftype) { case 'int32': case 'int64': @@ -378,7 +380,6 @@ export default defineComponent({ fvalue = {} } } - break } } else {