From b4007d4b97d9dc59cbaf03c78a13b7f8fd4215b9 Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Wed, 31 Aug 2022 14:32:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0pb=E6=B5=8B=E8=AF=95=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 | 334 +++++++++++++++++++++++++++++ src/pb/proto/hunting_db.proto | 25 +++ src/pb/proto/hunting_msg.proto | 29 +++ src/pb/proto/moonfantasy_db.proto | 13 ++ src/pb/proto/moonfantasy_msg.proto | 22 ++ src/pb/proto/viking_db.proto | 25 +++ src/pb/proto/viking_msg.proto | 29 +++ src/views/protocol/Index.vue | 3 + 8 files changed, 480 insertions(+) create mode 100644 src/pb/proto/hunting_db.proto create mode 100644 src/pb/proto/hunting_msg.proto create mode 100644 src/pb/proto/moonfantasy_db.proto create mode 100644 src/pb/proto/moonfantasy_msg.proto create mode 100644 src/pb/proto/viking_db.proto create mode 100644 src/pb/proto/viking_msg.proto diff --git a/src/pb/proto.js b/src/pb/proto.js index 5060e47..1d3fce9 100644 --- a/src/pb/proto.js +++ b/src/pb/proto.js @@ -1817,6 +1817,135 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr } } }, + DBHunting: { + fields: { + id: { + type: "string", + id: 1 + }, + uid: { + type: "string", + id: 2 + }, + challengeCount: { + type: "int32", + id: 3 + }, + boos: { + keyType: "int32", + type: "int32", + id: 4 + }, + buyCount: { + type: "int32", + id: 5 + }, + cTime: { + type: "int64", + id: 6 + }, + challengeTime: { + keyType: "int32", + type: "int32", + id: 7 + } + } + }, + DBHuntingRank: { + fields: { + id: { + type: "string", + id: 1 + }, + uid: { + type: "string", + id: 2 + }, + difficulty: { + type: "int32", + id: 3 + }, + bosstype: { + type: "int32", + id: 4 + }, + nickname: { + type: "string", + id: 5 + }, + icon: { + type: "string", + id: 6 + }, + lv: { + type: "int32", + id: 7 + }, + costTime: { + type: "int32", + id: 8 + } + } + }, + HuntingGetListReq: { + fields: {} + }, + HuntingGetListResp: { + fields: { + data: { + type: "DBHunting", + id: 1 + } + } + }, + HuntingChallengeReq: { + fields: { + bossType: { + type: "int32", + id: 1 + }, + difficulty: { + type: "int32", + id: 2 + } + } + }, + HuntingChallengeResp: { + fields: { + data: { + type: "DBHunting", + id: 1 + } + } + }, + HuntingBuyReq: { + fields: { + count: { + type: "int32", + id: 1 + } + } + }, + HuntingBuyResp: { + fields: { + data: { + type: "DBHunting", + id: 1 + } + } + }, + HuntingRankListReq: { + fields: {} + }, + HuntingRankListResp: { + fields: { + ranks: { + rule: "repeated", + type: "DBHuntingRank", + id: 1 + } + } + }, DB_UserItemData: { fields: { gridId: { @@ -2290,6 +2419,82 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr } } }, + DBMoonfantasy: { + fields: { + id: { + type: "string", + id: 1 + }, + uid: { + type: "string", + id: 2 + }, + monster: { + type: "int32", + id: 3 + }, + ctime: { + type: "int64", + id: 4 + }, + joinnum: { + type: "int32", + id: 5 + }, + numup: { + type: "int32", + id: 6 + }, + unitmup: { + type: "int32", + id: 7 + }, + record: { + keyType: "string", + type: "int32", + id: 8 + } + } + }, + MoonfantasyTriggerReq: { + fields: {} + }, + MoonfantasyTriggerResp: { + fields: { + issucc: { + type: "bool", + id: 1 + }, + mid: { + type: "string", + id: 2 + }, + monster: { + type: "int32", + id: 3 + } + } + }, + MoonfantasyDareReq: { + fields: { + uid: { + type: "string", + id: 1 + }, + mid: { + type: "string", + id: 2 + } + } + }, + MoonfantasyDareResp: { + fields: { + issucc: { + type: "bool", + id: 1 + } + } + }, DBSystemNotify: { fields: { id: { @@ -3484,6 +3689,135 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr id: 13 } } + }, + DBViking: { + fields: { + id: { + type: "string", + id: 1 + }, + uid: { + type: "string", + id: 2 + }, + challengeCount: { + type: "int32", + id: 3 + }, + boos: { + keyType: "int32", + type: "int32", + id: 4 + }, + buyCount: { + type: "int32", + id: 5 + }, + cTime: { + type: "int64", + id: 6 + }, + challengeTime: { + keyType: "int32", + type: "int32", + id: 7 + } + } + }, + DBVikingRank: { + fields: { + id: { + type: "string", + id: 1 + }, + uid: { + type: "string", + id: 2 + }, + difficulty: { + type: "int32", + id: 3 + }, + bosstype: { + type: "int32", + id: 4 + }, + nickname: { + type: "string", + id: 5 + }, + icon: { + type: "string", + id: 6 + }, + lv: { + type: "int32", + id: 7 + }, + costTime: { + type: "int32", + id: 8 + } + } + }, + VikingGetListReq: { + fields: {} + }, + VikingGetListResp: { + fields: { + data: { + type: "DBViking", + id: 1 + } + } + }, + VikingChallengeReq: { + fields: { + bossType: { + type: "int32", + id: 1 + }, + difficulty: { + type: "int32", + id: 2 + } + } + }, + VikingChallengeResp: { + fields: { + data: { + type: "DBViking", + id: 1 + } + } + }, + VikingBuyReq: { + fields: { + count: { + type: "int32", + id: 1 + } + } + }, + VikingBuyResp: { + fields: { + data: { + type: "DBViking", + id: 1 + } + } + }, + VikingRankListReq: { + fields: {} + }, + VikingRankListResp: { + fields: { + ranks: { + rule: "repeated", + type: "DBVikingRank", + id: 1 + } + } } }); diff --git a/src/pb/proto/hunting_db.proto b/src/pb/proto/hunting_db.proto new file mode 100644 index 0000000..d7b2cb5 --- /dev/null +++ b/src/pb/proto/hunting_db.proto @@ -0,0 +1,25 @@ +syntax = "proto3"; +option go_package = ".;pb"; + + +message DBHunting { + string id = 1; //@go_tags(`bson:"_id"`) ID + string uid = 2; //@go_tags(`bson:"uid"`) 用户ID + int32 challengeCount = 3; //@go_tags(`bson:"challengeCount"`) 挑战次数 + map boos = 4; // key boos 类型 value 难度 + int32 buyCount = 5;//@go_tags(`bson:"buyCount"`) 购买次数 + int64 cTime = 6; //@go_tags(`bson:"cTime"`) 修改时间 + map challengeTime = 7; //@go_tags(`bson:"challengeTime"`) 每个难度通关时间 +} + +// 狩猎排行榜 +message DBHuntingRank { + string id = 1; //@go_tags(`bson:"_id"`) ID + string uid = 2; //@go_tags(`bson:"uid"`) 用户ID + int32 difficulty = 3; // 难度 + int32 bosstype = 4; // boss类型塔类型 + string nickname = 5;// 昵称 + string icon = 6; // 玩家头像 + int32 lv = 7; // 玩家等级 + int32 costTime = 8; //@go_tags(`bson:"costTime"`) 闯关耗时 单位s +} \ No newline at end of file diff --git a/src/pb/proto/hunting_msg.proto b/src/pb/proto/hunting_msg.proto new file mode 100644 index 0000000..07dac8e --- /dev/null +++ b/src/pb/proto/hunting_msg.proto @@ -0,0 +1,29 @@ +syntax = "proto3"; +option go_package = ".;pb"; +import "hunting_db.proto"; + +message HuntingGetListReq {} + +message HuntingGetListResp { DBHunting data = 1; } + +// 挑战 +message HuntingChallengeReq { + int32 bossType = 1; // boos 类型 + int32 difficulty = 2; // 难度 +} + +message HuntingChallengeResp { DBHunting data = 1; } + +// 购买 +message HuntingBuyReq { + int32 count = 1; // 购买次数 +} + +message HuntingBuyResp { DBHunting data = 1; } + +// 排行榜 +message HuntingRankListReq {} + +message HuntingRankListResp { + repeated DBHuntingRank ranks = 1; // 排行数据 有序的 注意boss类型 +} \ No newline at end of file diff --git a/src/pb/proto/moonfantasy_db.proto b/src/pb/proto/moonfantasy_db.proto new file mode 100644 index 0000000..32aeeb5 --- /dev/null +++ b/src/pb/proto/moonfantasy_db.proto @@ -0,0 +1,13 @@ +syntax = "proto3"; +option go_package = ".;pb"; + +message DBMoonfantasy { + string id = 1; //@go_tags(`bson:"_id"`) ID + string uid = 2; //用户id + int32 monster = 3; //怪物id + int64 ctime = 4; //创建时间 + int32 joinnum = 5; //参与人数 + int32 numup = 6; //人数上限 + int32 unitmup = 7; //单人可挑战次数 + map record = 8; //挑战记录 +} \ No newline at end of file diff --git a/src/pb/proto/moonfantasy_msg.proto b/src/pb/proto/moonfantasy_msg.proto new file mode 100644 index 0000000..43c9626 --- /dev/null +++ b/src/pb/proto/moonfantasy_msg.proto @@ -0,0 +1,22 @@ +syntax = "proto3"; +option go_package = ".;pb"; + +///触发秘境 +message MoonfantasyTriggerReq {} + +///触发秘境 +message MoonfantasyTriggerResp { + bool issucc = 1; //是否成功 + string mid = 2; //唯一id //挑战时需要传递的数据 + int32 monster = 3; //怪物id +} + +///挑战秘境 +message MoonfantasyDareReq { + string uid = 1; //发布者用户id + string mid = 2; //唯一id +} + +message MoonfantasyDareResp { + bool issucc = 1; //是否成功 +} \ No newline at end of file diff --git a/src/pb/proto/viking_db.proto b/src/pb/proto/viking_db.proto new file mode 100644 index 0000000..accc621 --- /dev/null +++ b/src/pb/proto/viking_db.proto @@ -0,0 +1,25 @@ +syntax = "proto3"; +option go_package = ".;pb"; + +//维京远征 +message DBViking { + string id = 1; //@go_tags(`bson:"_id"`) ID + string uid = 2; //@go_tags(`bson:"uid"`) 用户ID + int32 challengeCount = 3; //@go_tags(`bson:"challengeCount"`) 挑战次数 + map boos = 4; // key boos 类型 value 难度 + int32 buyCount = 5;//@go_tags(`bson:"buyCount"`) 购买次数 + int64 cTime = 6; //@go_tags(`bson:"cTime"`) 修改时间 + map challengeTime = 7; //@go_tags(`bson:"challengeTime"`) 每个难度通关时间 +} + +// 维京远征排行榜 +message DBVikingRank { + string id = 1; //@go_tags(`bson:"_id"`) ID + string uid = 2; //@go_tags(`bson:"uid"`) 用户ID + int32 difficulty = 3; // 难度 + int32 bosstype = 4; // boss类型塔类型 + string nickname = 5;// 昵称 + string icon = 6; // 玩家头像 + int32 lv = 7; // 玩家等级 + int32 costTime = 8; //@go_tags(`bson:"costTime"`) 闯关耗时 单位s +} \ No newline at end of file diff --git a/src/pb/proto/viking_msg.proto b/src/pb/proto/viking_msg.proto new file mode 100644 index 0000000..025fbcc --- /dev/null +++ b/src/pb/proto/viking_msg.proto @@ -0,0 +1,29 @@ +syntax = "proto3"; +option go_package = ".;pb"; +import "viking_db.proto"; + +message VikingGetListReq {} + +message VikingGetListResp { DBViking data = 1; } + +// 挑战 +message VikingChallengeReq { + int32 bossType = 1; // boos 类型 + int32 difficulty = 2; // 难度 +} + +message VikingChallengeResp { DBViking data = 1; } + +// 购买 +message VikingBuyReq { + int32 count = 1; // 购买次数 +} + +message VikingBuyResp { DBViking data = 1; } + +// 排行榜 +message VikingRankListReq {} + +message VikingRankListResp { + repeated DBVikingRank ranks = 1; // 排行数据 有序的 注意boss类型 +} \ No newline at end of file diff --git a/src/views/protocol/Index.vue b/src/views/protocol/Index.vue index 73364a3..dc27168 100644 --- a/src/views/protocol/Index.vue +++ b/src/views/protocol/Index.vue @@ -220,6 +220,9 @@ export default defineComponent({ { mainType: 'martialhall', subs: [] }, { mainType: 'gourmet', subs: [] }, { mainType: 'smithy', subs: [] }, + { mainType: 'moonfantasy', subs: [] }, + { mainType: 'viking', subs: [] }, + { mainType: 'hunting', subs: [] }, ]) for (const v of Object.keys(proto)) { for (const v1 of proto_models) {