上传协议工具类代码

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, PracticeYouQiecuoing: 4305,
PracticeTargetQiecuoing: 4306, PracticeTargetQiecuoing: 4306,
ParkourMemberFull: 4401, ParkourMemberFull: 4401,
ParkourInviteOverdue: 4402 ParkourInviteOverdue: 4402,
ParkourInviteNoPermissions: 4403,
ParkourTargetTeamed: 4404,
ReputationTalentFull: 4501
} }
}, },
google: { google: {
@ -7942,9 +7945,10 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
}, },
RaceTeamState: { RaceTeamState: {
values: { values: {
teaming: 0, resting: 0,
matching: 1, teaming: 1,
raceing: 2 matching: 2,
raceing: 3
} }
}, },
DBRaceMember: { DBRaceMember: {
@ -8030,23 +8034,27 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
type: "RaceTeamState", type: "RaceTeamState",
id: 5 id: 5
}, },
currbattid: {
type: "string",
id: 6
},
integral: { integral: {
type: "int32", type: "int32",
id: 6 id: 7
}, },
captainid: { captainid: {
type: "string", type: "string",
id: 7 id: 8
}, },
invite: { invite: {
rule: "repeated", rule: "repeated",
type: "DBRaceInvite", type: "DBRaceInvite",
id: 8 id: 9
}, },
member: { member: {
rule: "repeated", rule: "repeated",
type: "DBRaceMember", 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: { ParkourInfoChangePush: {
fields: { fields: {
info: { info: {
@ -8258,20 +8286,41 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
fields: {} fields: {}
}, },
ParkourAllSprintsPush: { ParkourAllSprintsPush: {
fields: {}
},
ParkourRaceChanagePush: {
fields: { fields: {
race: { left: {
type: "DBRace", type: "int32",
id: 1 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: { ParkourRaceOverPush: {
fields: { fields: {
race: { winside: {
type: "DBRace", type: "int32",
id: 1 id: 1
} }
} }
@ -8292,6 +8341,17 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
RPCParkourJoinMatchResp: { RPCParkourJoinMatchResp: {
fields: {} fields: {}
}, },
RPCParkourCancelMatchReq: {
fields: {
captainid: {
type: "string",
id: 1
}
}
},
RPCParkourCancelMatchResp: {
fields: {}
},
RPCParkourMatchSuccReq: { RPCParkourMatchSuccReq: {
fields: { fields: {
red: { red: {
@ -8309,6 +8369,21 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
RPCParkourMatchSuccResp: { RPCParkourMatchSuccResp: {
fields: {} fields: {}
}, },
RPC_ParkourTrusteeshipReq: {
fields: {
battleid: {
type: "string",
id: 1
},
uid: {
type: "string",
id: 2
}
}
},
RPC_ParkourTrusteeshipResp: {
fields: {}
},
DBPayOrder: { DBPayOrder: {
fields: { fields: {
orderid: { 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: { ReddotGetAllReq: {
fields: {} fields: {}
}, },
@ -9514,10 +9605,6 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
keyType: "int32", keyType: "int32",
type: "Camp", type: "Camp",
id: 2 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: { reputationUpgradeReq: {
fields: { fields: {
zyId: { nodeId: {
type: "int32", type: "int32",
id: 1 id: 1
} }
@ -9585,6 +9687,21 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
reputationUpgradeResp: { reputationUpgradeResp: {
fields: {} fields: {}
}, },
reputationTalentReq: {
fields: {}
},
reputationTalentResp: {
fields: {
attrGlobal: {
type: "CampAttr",
id: 1
},
camp: {
type: "Camp",
id: 2
}
}
},
RtaskTestReq: { RtaskTestReq: {
fields: { fields: {
rtaskType: { rtaskType: {
@ -12122,6 +12239,22 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
moongold: { moongold: {
type: "int32", type: "int32",
id: 10 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 //parkour
ParkourMemberFull = 4401; // ParkourMemberFull = 4401; //
ParkourInviteOverdue = 4402; // ParkourInviteOverdue = 4402; //
ParkourInviteNoPermissions = 4403; //
ParkourTargetTeamed = 4404; //
//reputation
ReputationTalentFull = 4501; //
} }

View File

@ -8,9 +8,10 @@ enum RaceType {
// //
enum RaceTeamState { enum RaceTeamState {
teaming = 0; // resting = 0; //
matching = 1; // teaming = 1; //
raceing = 2; // matching = 2; //
raceing = 3; //
} }
// //
@ -40,10 +41,11 @@ message DBParkour {
map<string,int32> mounts = 3; // map<string,int32> mounts = 3; //
string dfmount = 4; // string dfmount = 4; //
RaceTeamState state = 5; // RaceTeamState state = 5; //
int32 integral = 6; // string currbattid = 6; //id
string captainid = 7; //id int32 integral = 7; //
repeated DBRaceInvite invite = 8; // string captainid = 8; //id
repeated DBRaceMember member = 9; // repeated DBRaceInvite invite = 9; //
repeated DBRaceMember member = 10; //
} }
// //

View File

@ -13,6 +13,16 @@ message ParkourInfoResp {
repeated DBParkour recommend = 2; repeated DBParkour recommend = 2;
} }
//
message ParkourChangeMtsReq {
string mtsid = 1;
}
//
message ParkourChangeMtsResp {
bool issucc = 1;
string mtsid = 2;
}
// //
message ParkourInfoChangePush { message ParkourInfoChangePush {
DBParkour info = 1; DBParkour info = 1;
@ -120,22 +130,25 @@ message ParkourAvoidResp {
// //
message ParkourAllSprintsPush { message ParkourAllSprintsPush {
int32 left = 1; //
} }
// //hp变化通知
message ParkourRaceChanagePush { message ParkourPlayerHPChanagePush {
DBRace race = 1; string uid = 1;
int32 hp = 2;
}
//
message ParkourScoreChanagePush {
int32 red = 1;
int32 blue = 2;
} }
// //
message ParkourRaceOverPush { message ParkourRaceOverPush {
DBRace race = 1; int32 winside = 1; //0 1 2
} }
/// RPC消息定义 /// RPC消息定义
message RPCParkourJoinMatchReq { message RPCParkourJoinMatchReq {
string captainid = 1; //id string captainid = 1; //id
@ -146,6 +159,14 @@ message RPCParkourJoinMatchReq {
message RPCParkourJoinMatchResp { message RPCParkourJoinMatchResp {
} }
//
message RPCParkourCancelMatchReq {
string captainid = 1; //id
}
message RPCParkourCancelMatchResp {
}
/// ///
message RPCParkourMatchSuccReq { message RPCParkourMatchSuccReq {
repeated DBRaceMember red = 2; // repeated DBRaceMember red = 2; //
@ -155,3 +176,13 @@ message RPCParkourMatchSuccReq {
message RPCParkourMatchSuccResp { message RPCParkourMatchSuccResp {
} }
//
message RPC_ParkourTrusteeshipReq {
string battleid = 1;
string uid = 2;
}
message RPC_ParkourTrusteeshipResp {
}

View File

@ -105,3 +105,13 @@ message PvpInCmdResp {
message PvpFinishPush { message PvpFinishPush {
string battleid = 1; 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 { message DBReputation {
string uid = 1; //@go_tags(`bson:"uid"`) ID string uid = 1; //@go_tags(`bson:"uid"`) ID
map<int32,Camp> camps = 2; //@go_tags(`bson:"camps"`) key 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"; syntax = "proto3";
option go_package = ".;pb"; option go_package = ".;pb";
import "reputation/reputation_db.proto";
//
message reputationTalenttestReq{
int32 raceType =1;
int32 friendValue = 2;
}
message reputationTalenttestResp{
}
//
message reputationUpgradeReq{ message reputationUpgradeReq{
int32 zyId = 1; //ID 1-4 int32 nodeId = 1; //ID
} }
message reputationUpgradeResp{} message reputationUpgradeResp{}
//
message reputationTalentReq{
}
message reputationTalentResp{
CampAttr attrGlobal = 1;
Camp camp = 2;
}

View File

@ -66,6 +66,10 @@ message UserResChangedPush {
int32 arenacoin = 8; //@go_tags(`bson:"arenacoin`) int32 arenacoin = 8; //@go_tags(`bson:"arenacoin`)
int32 ps = 9; //@go_tags(`bson:"ps"`) int32 ps = 9; //@go_tags(`bson:"ps"`)
int32 moongold = 10; //@go_tags(`bson:"moongold"`) 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; } message UserOtherTermLoginPush { string uid = 1; }

View File

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

View File

@ -8,9 +8,10 @@ enum RaceType {
// //
enum RaceTeamState { enum RaceTeamState {
teaming = 0; // resting = 0; //
matching = 1; // teaming = 1; //
raceing = 2; // matching = 2; //
raceing = 3; //
} }
// //
@ -40,10 +41,11 @@ message DBParkour {
map<string,int32> mounts = 3; // map<string,int32> mounts = 3; //
string dfmount = 4; // string dfmount = 4; //
RaceTeamState state = 5; // RaceTeamState state = 5; //
int32 integral = 6; // string currbattid = 6; //id
string captainid = 7; //id int32 integral = 7; //
repeated DBRaceInvite invite = 8; // string captainid = 8; //id
repeated DBRaceMember member = 9; // repeated DBRaceInvite invite = 9; //
repeated DBRaceMember member = 10; //
} }
// //

View File

@ -13,6 +13,16 @@ message ParkourInfoResp {
repeated DBParkour recommend = 2; repeated DBParkour recommend = 2;
} }
//
message ParkourChangeMtsReq {
string mtsid = 1;
}
//
message ParkourChangeMtsResp {
bool issucc = 1;
string mtsid = 2;
}
// //
message ParkourInfoChangePush { message ParkourInfoChangePush {
DBParkour info = 1; DBParkour info = 1;
@ -120,22 +130,25 @@ message ParkourAvoidResp {
// //
message ParkourAllSprintsPush { message ParkourAllSprintsPush {
int32 left = 1; //
} }
// //hp变化通知
message ParkourRaceChanagePush { message ParkourPlayerHPChanagePush {
DBRace race = 1; string uid = 1;
int32 hp = 2;
}
//
message ParkourScoreChanagePush {
int32 red = 1;
int32 blue = 2;
} }
// //
message ParkourRaceOverPush { message ParkourRaceOverPush {
DBRace race = 1; int32 winside = 1; //0 1 2
} }
/// RPC消息定义 /// RPC消息定义
message RPCParkourJoinMatchReq { message RPCParkourJoinMatchReq {
string captainid = 1; //id string captainid = 1; //id
@ -146,6 +159,14 @@ message RPCParkourJoinMatchReq {
message RPCParkourJoinMatchResp { message RPCParkourJoinMatchResp {
} }
//
message RPCParkourCancelMatchReq {
string captainid = 1; //id
}
message RPCParkourCancelMatchResp {
}
/// ///
message RPCParkourMatchSuccReq { message RPCParkourMatchSuccReq {
repeated DBRaceMember red = 2; // repeated DBRaceMember red = 2; //
@ -155,3 +176,13 @@ message RPCParkourMatchSuccReq {
message RPCParkourMatchSuccResp { message RPCParkourMatchSuccResp {
} }
//
message RPC_ParkourTrusteeshipReq {
string battleid = 1;
string uid = 2;
}
message RPC_ParkourTrusteeshipResp {
}

View File

@ -105,3 +105,13 @@ message PvpInCmdResp {
message PvpFinishPush { message PvpFinishPush {
string battleid = 1; 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 { message DBReputation {
string uid = 1; //@go_tags(`bson:"uid"`) ID string uid = 1; //@go_tags(`bson:"uid"`) ID
map<int32,Camp> camps = 2; //@go_tags(`bson:"camps"`) key 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"; syntax = "proto3";
option go_package = ".;pb"; option go_package = ".;pb";
import "reputation_db.proto";
//
message reputationTalenttestReq{
int32 raceType =1;
int32 friendValue = 2;
}
message reputationTalenttestResp{
}
//
message reputationUpgradeReq{ message reputationUpgradeReq{
int32 zyId = 1; //ID 1-4 int32 nodeId = 1; //ID
} }
message reputationUpgradeResp{} message reputationUpgradeResp{}
//
message reputationTalentReq{
}
message reputationTalentResp{
CampAttr attrGlobal = 1;
Camp camp = 2;
}

View File

@ -66,6 +66,10 @@ message UserResChangedPush {
int32 arenacoin = 8; //@go_tags(`bson:"arenacoin`) int32 arenacoin = 8; //@go_tags(`bson:"arenacoin`)
int32 ps = 9; //@go_tags(`bson:"ps"`) int32 ps = 9; //@go_tags(`bson:"ps"`)
int32 moongold = 10; //@go_tags(`bson:"moongold"`) 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; } message UserOtherTermLoginPush { string uid = 1; }

View File

@ -198,6 +198,7 @@ export default defineComponent({
isshow: true, isshow: true,
showdata: { name: 'liwei1dao', aog: 123 }, showdata: { name: 'liwei1dao', aog: 123 },
resultInfo: { li: 123 }, resultInfo: { li: 123 },
timer: null,
} }
}, },
computed: {}, computed: {},
@ -327,6 +328,7 @@ export default defineComponent({
this.connecting = false this.connecting = false
this.pushlog('success', `连接创建成功`) this.pushlog('success', `连接创建成功`)
socket.closelisten = this.closelisten socket.closelisten = this.closelisten
this.timer = setInterval(this.heartbeat, 30000)
}) })
.catch((error) => { .catch((error) => {
this.error = true this.error = true
@ -343,6 +345,26 @@ export default defineComponent({
this.isconnect = false this.isconnect = false
this.subSelect = null this.subSelect = null
this.reqproto = [] 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) { mainSelectUpdate(v) {
console.log(v) console.log(v)
@ -431,6 +453,9 @@ export default defineComponent({
let mainType = message.MainType let mainType = message.MainType
let subType = message.SubType let subType = message.SubType
let iskeep = false let iskeep = false
if (mainType == 'gateway' && subType == 'heartbeat') {
return
}
console.log('接收到消息 message', message) console.log('接收到消息 message', message)
for (const v of this.proto_models) { for (const v of this.proto_models) {
if (v.mainType == mainType) { if (v.mainType == mainType) {