From c64cd727541c9aba2679a687445bf058198e950c Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Thu, 20 Apr 2023 21:19:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E5=8D=8F=E8=AE=AE=E5=B7=A5?= =?UTF-8?q?=E5=85=B7=E7=B1=BB=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 | 173 ++++++++++++++++--- src/pb/proto/errorcode.proto | 5 + src/pb/proto/parkour/parkour_db.proto | 16 +- src/pb/proto/parkour/parkour_msg.proto | 49 +++++- src/pb/proto/pvp/pvp_msg.proto | 10 ++ src/pb/proto/reputation/reputation_db.proto | 2 +- src/pb/proto/reputation/reputation_msg.proto | 29 +++- src/pb/proto/user/user_msg.proto | 4 + src/pb/temop/errorcode.proto | 5 + src/pb/temop/parkour_db.proto | 16 +- src/pb/temop/parkour_msg.proto | 49 +++++- src/pb/temop/pvp_msg.proto | 10 ++ src/pb/temop/reputation_db.proto | 2 +- src/pb/temop/reputation_msg.proto | 29 +++- src/pb/temop/user_msg.proto | 4 + src/views/protocol/Index.vue | 25 +++ 16 files changed, 368 insertions(+), 60 deletions(-) diff --git a/src/pb/proto.js b/src/pb/proto.js index ce74a2b..cf16401 100644 --- a/src/pb/proto.js +++ b/src/pb/proto.js @@ -1602,7 +1602,10 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr PracticeYouQiecuoing: 4305, PracticeTargetQiecuoing: 4306, ParkourMemberFull: 4401, - ParkourInviteOverdue: 4402 + ParkourInviteOverdue: 4402, + ParkourInviteNoPermissions: 4403, + ParkourTargetTeamed: 4404, + ReputationTalentFull: 4501 } }, google: { @@ -7942,9 +7945,10 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr }, RaceTeamState: { values: { - teaming: 0, - matching: 1, - raceing: 2 + resting: 0, + teaming: 1, + matching: 2, + raceing: 3 } }, DBRaceMember: { @@ -8030,23 +8034,27 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr type: "RaceTeamState", id: 5 }, + currbattid: { + type: "string", + id: 6 + }, integral: { type: "int32", - id: 6 + id: 7 }, captainid: { type: "string", - id: 7 + id: 8 }, invite: { rule: "repeated", type: "DBRaceInvite", - id: 8 + id: 9 }, member: { rule: "repeated", type: "DBRaceMember", - id: 9 + id: 10 } } }, @@ -8100,6 +8108,26 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr } } }, + ParkourChangeMtsReq: { + fields: { + mtsid: { + type: "string", + id: 1 + } + } + }, + ParkourChangeMtsResp: { + fields: { + issucc: { + type: "bool", + id: 1 + }, + mtsid: { + type: "string", + id: 2 + } + } + }, ParkourInfoChangePush: { fields: { info: { @@ -8258,20 +8286,41 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr fields: {} }, ParkourAllSprintsPush: { - fields: {} - }, - ParkourRaceChanagePush: { fields: { - race: { - type: "DBRace", + left: { + type: "int32", id: 1 } } }, + ParkourPlayerHPChanagePush: { + fields: { + uid: { + type: "string", + id: 1 + }, + hp: { + type: "int32", + id: 2 + } + } + }, + ParkourScoreChanagePush: { + fields: { + red: { + type: "int32", + id: 1 + }, + blue: { + type: "int32", + id: 2 + } + } + }, ParkourRaceOverPush: { fields: { - race: { - type: "DBRace", + winside: { + type: "int32", id: 1 } } @@ -8292,6 +8341,17 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr RPCParkourJoinMatchResp: { fields: {} }, + RPCParkourCancelMatchReq: { + fields: { + captainid: { + type: "string", + id: 1 + } + } + }, + RPCParkourCancelMatchResp: { + fields: {} + }, RPCParkourMatchSuccReq: { fields: { red: { @@ -8309,6 +8369,21 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr RPCParkourMatchSuccResp: { fields: {} }, + RPC_ParkourTrusteeshipReq: { + fields: { + battleid: { + type: "string", + id: 1 + }, + uid: { + type: "string", + id: 2 + } + } + }, + RPC_ParkourTrusteeshipResp: { + fields: {} + }, DBPayOrder: { fields: { orderid: { @@ -9474,6 +9549,22 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr } } }, + RPC_PVPTrusteeshipReq: { + fields: { + battleid: { + rule: "repeated", + type: "string", + id: 1 + }, + uid: { + type: "string", + id: 2 + } + } + }, + RPC_PVPTrusteeshipResp: { + fields: {} + }, ReddotGetAllReq: { fields: {} }, @@ -9514,10 +9605,6 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr keyType: "int32", type: "Camp", id: 2 - }, - attrGlobal: { - type: "CampAttr", - id: 3 } } }, @@ -9574,9 +9661,24 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr } } }, + reputationTalenttestReq: { + fields: { + raceType: { + type: "int32", + id: 1 + }, + friendValue: { + type: "int32", + id: 2 + } + } + }, + reputationTalenttestResp: { + fields: {} + }, reputationUpgradeReq: { fields: { - zyId: { + nodeId: { type: "int32", id: 1 } @@ -9585,6 +9687,21 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr reputationUpgradeResp: { fields: {} }, + reputationTalentReq: { + fields: {} + }, + reputationTalentResp: { + fields: { + attrGlobal: { + type: "CampAttr", + id: 1 + }, + camp: { + type: "Camp", + id: 2 + } + } + }, RtaskTestReq: { fields: { rtaskType: { @@ -12122,6 +12239,22 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr moongold: { type: "int32", id: 10 + }, + talent1: { + type: "int32", + id: 11 + }, + talent2: { + type: "int32", + id: 12 + }, + talent3: { + type: "int32", + id: 13 + }, + talent4: { + type: "int32", + id: 14 } } }, diff --git a/src/pb/proto/errorcode.proto b/src/pb/proto/errorcode.proto index d6eb7c8..5405ecf 100644 --- a/src/pb/proto/errorcode.proto +++ b/src/pb/proto/errorcode.proto @@ -373,4 +373,9 @@ enum ErrorCode { //parkour ParkourMemberFull = 4401; //队伍成员已满 ParkourInviteOverdue = 4402; //邀请已过期 + ParkourInviteNoPermissions = 4403; //无权邀请 + ParkourTargetTeamed = 4404; //目标已组队 + + //reputation + ReputationTalentFull = 4501; //天赋满级 } diff --git a/src/pb/proto/parkour/parkour_db.proto b/src/pb/proto/parkour/parkour_db.proto index 14e988f..07d9d3d 100644 --- a/src/pb/proto/parkour/parkour_db.proto +++ b/src/pb/proto/parkour/parkour_db.proto @@ -8,9 +8,10 @@ enum RaceType { //队伍状态 enum RaceTeamState { - teaming = 0; //组队中 - matching = 1; //匹配中 - raceing = 2; //比赛中 + resting = 0; //休息中 + teaming = 1; //组队中 + matching = 2; //匹配中 + raceing = 3; //比赛中 } //队员信息 @@ -40,10 +41,11 @@ message DBParkour { map mounts = 3; //坐骑列表 string dfmount = 4; //默认坐骑 RaceTeamState state = 5; //队伍状态 - int32 integral = 6; //积分 - string captainid = 7; //队长id 当前所在队伍 - repeated DBRaceInvite invite = 8; //邀请列表 - repeated DBRaceMember member = 9; //成员列表 + string currbattid = 6; //当前战斗id + int32 integral = 7; //积分 + string captainid = 8; //队长id 当前所在队伍 + repeated DBRaceInvite invite = 9; //邀请列表 + repeated DBRaceMember member = 10; //成员列表 } //比赛数据 diff --git a/src/pb/proto/parkour/parkour_msg.proto b/src/pb/proto/parkour/parkour_msg.proto index ea69900..2eed3f2 100644 --- a/src/pb/proto/parkour/parkour_msg.proto +++ b/src/pb/proto/parkour/parkour_msg.proto @@ -13,6 +13,16 @@ message ParkourInfoResp { repeated DBParkour recommend = 2; } +//变更坐骑请求 +message ParkourChangeMtsReq { + string mtsid = 1; +} +//变更坐骑请求 +message ParkourChangeMtsResp { + bool issucc = 1; + string mtsid = 2; +} + //推送捕羊大赛用户信息改变 message ParkourInfoChangePush { DBParkour info = 1; @@ -120,22 +130,25 @@ message ParkourAvoidResp { //全员冲刺 message ParkourAllSprintsPush { - + int32 left = 1; //剩余时间 } -//比赛数值变化推送 -message ParkourRaceChanagePush { - DBRace race = 1; +//玩家hp变化通知 +message ParkourPlayerHPChanagePush { + string uid = 1; + int32 hp = 2; +} +//比赛分值变化 +message ParkourScoreChanagePush { + int32 red = 1; + int32 blue = 2; } -//比赛 +//比赛结束通知 message ParkourRaceOverPush { - DBRace race = 1; + int32 winside = 1; //0平局 1 红方胜利 2 蓝方胜利 } - - - ///匹配请求 RPC消息定义 服务器自用 客户端不用理会 message RPCParkourJoinMatchReq { string captainid = 1; //队长id @@ -146,6 +159,14 @@ message RPCParkourJoinMatchReq { message RPCParkourJoinMatchResp { } +//取消匹配 +message RPCParkourCancelMatchReq { + string captainid = 1; //队长id +} +message RPCParkourCancelMatchResp { + +} + ///匹配成功通知请求 message RPCParkourMatchSuccReq { repeated DBRaceMember red = 2; //临时红队 @@ -154,4 +175,14 @@ message RPCParkourMatchSuccReq { ///匹配成功通知请求 message RPCParkourMatchSuccResp { +} + +//托管求情 +message RPC_ParkourTrusteeshipReq { + string battleid = 1; + string uid = 2; +} + +message RPC_ParkourTrusteeshipResp { + } \ No newline at end of file diff --git a/src/pb/proto/pvp/pvp_msg.proto b/src/pb/proto/pvp/pvp_msg.proto index f47607e..df03342 100644 --- a/src/pb/proto/pvp/pvp_msg.proto +++ b/src/pb/proto/pvp/pvp_msg.proto @@ -105,3 +105,13 @@ message PvpInCmdResp { message PvpFinishPush { string battleid = 1; } + + +message RPC_PVPTrusteeshipReq { + repeated string battleid = 1; + string uid = 2; +} + +message RPC_PVPTrusteeshipResp { + +} \ No newline at end of file diff --git a/src/pb/proto/reputation/reputation_db.proto b/src/pb/proto/reputation/reputation_db.proto index d727589..3d95784 100644 --- a/src/pb/proto/reputation/reputation_db.proto +++ b/src/pb/proto/reputation/reputation_db.proto @@ -4,7 +4,7 @@ option go_package = ".;pb"; message DBReputation { string uid = 1; //@go_tags(`bson:"uid"`) 玩家ID map camps = 2; //@go_tags(`bson:"camps"`) key 阵营id - CampAttr attrGlobal = 3; //@go_tags(`bson:"attrGlobal"`) 全局阵营属性 + // CampAttr attrGlobal = 3; //@go_tags(`bson:"attrGlobal"`) 全局阵营属性 } // 阵营 diff --git a/src/pb/proto/reputation/reputation_msg.proto b/src/pb/proto/reputation/reputation_msg.proto index afb7b86..b27584a 100644 --- a/src/pb/proto/reputation/reputation_msg.proto +++ b/src/pb/proto/reputation/reputation_msg.proto @@ -1,8 +1,31 @@ syntax = "proto3"; option go_package = ".;pb"; +import "reputation/reputation_db.proto"; -message reputationUpgradeReq{ - int32 zyId = 1; //阵营ID 1-4 +//测试 +message reputationTalenttestReq{ + int32 raceType =1; + int32 friendValue = 2; +} +message reputationTalenttestResp{ + +} + + +//天赋树升级 +message reputationUpgradeReq{ + int32 nodeId = 1; //节点ID +} + +message reputationUpgradeResp{} + +//获取天赋树节点 +message reputationTalentReq{ + +} + +message reputationTalentResp{ + CampAttr attrGlobal = 1; + Camp camp = 2; } -message reputationUpgradeResp{} \ No newline at end of file diff --git a/src/pb/proto/user/user_msg.proto b/src/pb/proto/user/user_msg.proto index ff02e9c..a96ada2 100644 --- a/src/pb/proto/user/user_msg.proto +++ b/src/pb/proto/user/user_msg.proto @@ -66,6 +66,10 @@ message UserResChangedPush { int32 arenacoin = 8; //@go_tags(`bson:"arenacoin`) 竞技场币 int32 ps = 9; //@go_tags(`bson:"ps"`) 体力 int32 moongold = 10; //@go_tags(`bson:"moongold"`) 纯净月髓 + int32 talent1 = 11; //@go_tags(`bson:"talent1"`) 阵营1天赋点 + int32 talent2 = 12; //@go_tags(`bson:"talent2"`) 阵营2天赋点 + int32 talent3 = 13; //@go_tags(`bson:"talent3"`) 阵营3天赋点 + int32 talent4 = 14; //@go_tags(`bson:"talent4"`) 阵营4天赋点 } // 玩家在其它终端登录的通知 message UserOtherTermLoginPush { string uid = 1; } diff --git a/src/pb/temop/errorcode.proto b/src/pb/temop/errorcode.proto index d6eb7c8..5405ecf 100644 --- a/src/pb/temop/errorcode.proto +++ b/src/pb/temop/errorcode.proto @@ -373,4 +373,9 @@ enum ErrorCode { //parkour ParkourMemberFull = 4401; //队伍成员已满 ParkourInviteOverdue = 4402; //邀请已过期 + ParkourInviteNoPermissions = 4403; //无权邀请 + ParkourTargetTeamed = 4404; //目标已组队 + + //reputation + ReputationTalentFull = 4501; //天赋满级 } diff --git a/src/pb/temop/parkour_db.proto b/src/pb/temop/parkour_db.proto index 14e988f..07d9d3d 100644 --- a/src/pb/temop/parkour_db.proto +++ b/src/pb/temop/parkour_db.proto @@ -8,9 +8,10 @@ enum RaceType { //队伍状态 enum RaceTeamState { - teaming = 0; //组队中 - matching = 1; //匹配中 - raceing = 2; //比赛中 + resting = 0; //休息中 + teaming = 1; //组队中 + matching = 2; //匹配中 + raceing = 3; //比赛中 } //队员信息 @@ -40,10 +41,11 @@ message DBParkour { map mounts = 3; //坐骑列表 string dfmount = 4; //默认坐骑 RaceTeamState state = 5; //队伍状态 - int32 integral = 6; //积分 - string captainid = 7; //队长id 当前所在队伍 - repeated DBRaceInvite invite = 8; //邀请列表 - repeated DBRaceMember member = 9; //成员列表 + string currbattid = 6; //当前战斗id + int32 integral = 7; //积分 + string captainid = 8; //队长id 当前所在队伍 + repeated DBRaceInvite invite = 9; //邀请列表 + repeated DBRaceMember member = 10; //成员列表 } //比赛数据 diff --git a/src/pb/temop/parkour_msg.proto b/src/pb/temop/parkour_msg.proto index b428e9d..0103968 100644 --- a/src/pb/temop/parkour_msg.proto +++ b/src/pb/temop/parkour_msg.proto @@ -13,6 +13,16 @@ message ParkourInfoResp { repeated DBParkour recommend = 2; } +//变更坐骑请求 +message ParkourChangeMtsReq { + string mtsid = 1; +} +//变更坐骑请求 +message ParkourChangeMtsResp { + bool issucc = 1; + string mtsid = 2; +} + //推送捕羊大赛用户信息改变 message ParkourInfoChangePush { DBParkour info = 1; @@ -120,22 +130,25 @@ message ParkourAvoidResp { //全员冲刺 message ParkourAllSprintsPush { - + int32 left = 1; //剩余时间 } -//比赛数值变化推送 -message ParkourRaceChanagePush { - DBRace race = 1; +//玩家hp变化通知 +message ParkourPlayerHPChanagePush { + string uid = 1; + int32 hp = 2; +} +//比赛分值变化 +message ParkourScoreChanagePush { + int32 red = 1; + int32 blue = 2; } -//比赛 +//比赛结束通知 message ParkourRaceOverPush { - DBRace race = 1; + int32 winside = 1; //0平局 1 红方胜利 2 蓝方胜利 } - - - ///匹配请求 RPC消息定义 服务器自用 客户端不用理会 message RPCParkourJoinMatchReq { string captainid = 1; //队长id @@ -146,6 +159,14 @@ message RPCParkourJoinMatchReq { message RPCParkourJoinMatchResp { } +//取消匹配 +message RPCParkourCancelMatchReq { + string captainid = 1; //队长id +} +message RPCParkourCancelMatchResp { + +} + ///匹配成功通知请求 message RPCParkourMatchSuccReq { repeated DBRaceMember red = 2; //临时红队 @@ -154,4 +175,14 @@ message RPCParkourMatchSuccReq { ///匹配成功通知请求 message RPCParkourMatchSuccResp { +} + +//托管求情 +message RPC_ParkourTrusteeshipReq { + string battleid = 1; + string uid = 2; +} + +message RPC_ParkourTrusteeshipResp { + } \ No newline at end of file diff --git a/src/pb/temop/pvp_msg.proto b/src/pb/temop/pvp_msg.proto index e5c1ba4..d893d70 100644 --- a/src/pb/temop/pvp_msg.proto +++ b/src/pb/temop/pvp_msg.proto @@ -105,3 +105,13 @@ message PvpInCmdResp { message PvpFinishPush { string battleid = 1; } + + +message RPC_PVPTrusteeshipReq { + repeated string battleid = 1; + string uid = 2; +} + +message RPC_PVPTrusteeshipResp { + +} \ No newline at end of file diff --git a/src/pb/temop/reputation_db.proto b/src/pb/temop/reputation_db.proto index d727589..3d95784 100644 --- a/src/pb/temop/reputation_db.proto +++ b/src/pb/temop/reputation_db.proto @@ -4,7 +4,7 @@ option go_package = ".;pb"; message DBReputation { string uid = 1; //@go_tags(`bson:"uid"`) 玩家ID map camps = 2; //@go_tags(`bson:"camps"`) key 阵营id - CampAttr attrGlobal = 3; //@go_tags(`bson:"attrGlobal"`) 全局阵营属性 + // CampAttr attrGlobal = 3; //@go_tags(`bson:"attrGlobal"`) 全局阵营属性 } // 阵营 diff --git a/src/pb/temop/reputation_msg.proto b/src/pb/temop/reputation_msg.proto index afb7b86..37119f6 100644 --- a/src/pb/temop/reputation_msg.proto +++ b/src/pb/temop/reputation_msg.proto @@ -1,8 +1,31 @@ syntax = "proto3"; option go_package = ".;pb"; +import "reputation_db.proto"; -message reputationUpgradeReq{ - int32 zyId = 1; //阵营ID 1-4 +//测试 +message reputationTalenttestReq{ + int32 raceType =1; + int32 friendValue = 2; +} +message reputationTalenttestResp{ + +} + + +//天赋树升级 +message reputationUpgradeReq{ + int32 nodeId = 1; //节点ID +} + +message reputationUpgradeResp{} + +//获取天赋树节点 +message reputationTalentReq{ + +} + +message reputationTalentResp{ + CampAttr attrGlobal = 1; + Camp camp = 2; } -message reputationUpgradeResp{} \ No newline at end of file diff --git a/src/pb/temop/user_msg.proto b/src/pb/temop/user_msg.proto index 883beec..60a36ce 100644 --- a/src/pb/temop/user_msg.proto +++ b/src/pb/temop/user_msg.proto @@ -66,6 +66,10 @@ message UserResChangedPush { int32 arenacoin = 8; //@go_tags(`bson:"arenacoin`) 竞技场币 int32 ps = 9; //@go_tags(`bson:"ps"`) 体力 int32 moongold = 10; //@go_tags(`bson:"moongold"`) 纯净月髓 + int32 talent1 = 11; //@go_tags(`bson:"talent1"`) 阵营1天赋点 + int32 talent2 = 12; //@go_tags(`bson:"talent2"`) 阵营2天赋点 + int32 talent3 = 13; //@go_tags(`bson:"talent3"`) 阵营3天赋点 + int32 talent4 = 14; //@go_tags(`bson:"talent4"`) 阵营4天赋点 } // 玩家在其它终端登录的通知 message UserOtherTermLoginPush { string uid = 1; } diff --git a/src/views/protocol/Index.vue b/src/views/protocol/Index.vue index 9f34e3a..6b96162 100644 --- a/src/views/protocol/Index.vue +++ b/src/views/protocol/Index.vue @@ -198,6 +198,7 @@ export default defineComponent({ isshow: true, showdata: { name: 'liwei1dao', aog: 123 }, resultInfo: { li: 123 }, + timer: null, } }, computed: {}, @@ -327,6 +328,7 @@ export default defineComponent({ this.connecting = false this.pushlog('success', `连接创建成功`) socket.closelisten = this.closelisten + this.timer = setInterval(this.heartbeat, 30000) }) .catch((error) => { this.error = true @@ -343,6 +345,26 @@ export default defineComponent({ this.isconnect = false this.subSelect = null this.reqproto = [] + clearInterval(this.timer) + }, + heartbeat() { + let protoobj = proto.lookup('GatewayHeartbeatReq') + let message = proto.lookup('UserMessage') + let any = proto.lookup('google.protobuf.Any') + message.MainType = 'gateway' + message.SubType = 'heartbeat' + message.data = any.create({ + type_url: `type.googleapis.com/GatewayHeartbeatReq`, + value: proto.lookup('GatewayHeartbeatReq').encode(protoobj).finish(), // Or as packed buffer + }) + // if (this.subSelect.reqName == 'UserLoginReq') { + // //登录协议特殊处理 + // message.sec = this.buildsecStr(protoobj.account, protoobj.sid) + // } else { + // message.sec = this.buildsecStr() + // } + let buffer = proto.lookup('UserMessage').encode(message).finish() + socket.send(buffer) }, mainSelectUpdate(v) { console.log(v) @@ -431,6 +453,9 @@ export default defineComponent({ let mainType = message.MainType let subType = message.SubType let iskeep = false + if (mainType == 'gateway' && subType == 'heartbeat') { + return + } console.log('接收到消息 message', message) for (const v of this.proto_models) { if (v.mainType == mainType) {