上传协议工具类代码

This commit is contained in:
liwei1dao 2023-04-20 21:19:20 +08:00
parent 8e92612731
commit c64cd72754
16 changed files with 368 additions and 60 deletions

View File

@ -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
}
}
},

View File

@ -373,4 +373,9 @@ enum ErrorCode {
//parkour
ParkourMemberFull = 4401; //
ParkourInviteOverdue = 4402; //
ParkourInviteNoPermissions = 4403; //
ParkourTargetTeamed = 4404; //
//reputation
ReputationTalentFull = 4501; //
}

View File

@ -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<string,int32> 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; //
}
//

View File

@ -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 {
}

View File

@ -105,3 +105,13 @@ message PvpInCmdResp {
message PvpFinishPush {
string battleid = 1;
}
message RPC_PVPTrusteeshipReq {
repeated string battleid = 1;
string uid = 2;
}
message RPC_PVPTrusteeshipResp {
}

View File

@ -4,7 +4,7 @@ option go_package = ".;pb";
message DBReputation {
string uid = 1; //@go_tags(`bson:"uid"`) ID
map<int32,Camp> camps = 2; //@go_tags(`bson:"camps"`) key id
CampAttr attrGlobal = 3; //@go_tags(`bson:"attrGlobal"`)
// CampAttr attrGlobal = 3; //@go_tags(`bson:"attrGlobal"`)
}
//

View File

@ -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{}

View File

@ -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; }

View File

@ -373,4 +373,9 @@ enum ErrorCode {
//parkour
ParkourMemberFull = 4401; //
ParkourInviteOverdue = 4402; //
ParkourInviteNoPermissions = 4403; //
ParkourTargetTeamed = 4404; //
//reputation
ReputationTalentFull = 4501; //
}

View File

@ -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<string,int32> 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; //
}
//

View File

@ -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 {
}

View File

@ -105,3 +105,13 @@ message PvpInCmdResp {
message PvpFinishPush {
string battleid = 1;
}
message RPC_PVPTrusteeshipReq {
repeated string battleid = 1;
string uid = 2;
}
message RPC_PVPTrusteeshipResp {
}

View File

@ -4,7 +4,7 @@ option go_package = ".;pb";
message DBReputation {
string uid = 1; //@go_tags(`bson:"uid"`) ID
map<int32,Camp> camps = 2; //@go_tags(`bson:"camps"`) key id
CampAttr attrGlobal = 3; //@go_tags(`bson:"attrGlobal"`)
// CampAttr attrGlobal = 3; //@go_tags(`bson:"attrGlobal"`)
}
//

View File

@ -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{}

View File

@ -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; }

View File

@ -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) {