上传pb工具代码

This commit is contained in:
liwei1dao 2022-09-06 19:20:55 +08:00
parent 389fea4ef9
commit 81931aed43
5 changed files with 490 additions and 174 deletions

View File

@ -8,6 +8,321 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
go_package: ".;pb"
})
.addJSON({
BattleType: {
values: {
nil: 0,
pve: 1,
pvp: 2,
pvb: 3
}
},
PlayType: {
values: {
mainline: 0,
pagoda: 1,
moonfantasy: 2
}
},
BBattleState: {
values: {
"in": 0,
end: 2
}
},
DBBattleComp: {
values: {
draw: 0,
red: 1,
bule: 2
}
},
DBBattleFormt: {
fields: {
leadpos: {
type: "int32",
id: 1
},
team: {
rule: "repeated",
type: "DBHero",
id: 2
}
}
},
DBBattleRecord: {
fields: {
id: {
type: "string",
id: 1
},
btype: {
type: "BattleType",
id: 2
},
ptype: {
type: "PlayType",
id: 3
},
plevel: {
type: "string",
id: 4
},
state: {
type: "BBattleState",
id: 5
},
redCompId: {
type: "string",
id: 6
},
redflist: {
rule: "repeated",
type: "DBBattleFormt",
id: 7
},
blueCompId: {
type: "string",
id: 8
},
buleflist: {
rule: "repeated",
type: "DBBattleFormt",
id: 9
},
roundresult: {
rule: "repeated",
type: "DBBattleComp",
id: 10
},
result: {
type: "DBBattleComp",
id: 11
}
}
},
SkillData: {
fields: {
skillID: {
type: "int32",
id: 1
},
skillLv: {
type: "int32",
id: 2
}
}
},
DBHero: {
fields: {
id: {
type: "string",
id: 1
},
uid: {
type: "string",
id: 2
},
heroID: {
type: "string",
id: 3
},
star: {
type: "int32",
id: 4
},
lv: {
type: "int32",
id: 5
},
exp: {
type: "int32",
id: 6
},
juexingLv: {
type: "int32",
id: 7
},
captainSkill: {
type: "int32",
id: 8
},
normalSkill: {
rule: "repeated",
type: "SkillData",
id: 9
},
property: {
keyType: "string",
type: "int32",
id: 10
},
addProperty: {
keyType: "string",
type: "int32",
id: 11
},
cardType: {
type: "int32",
id: 12
},
curSkin: {
type: "int32",
id: 13
},
skins: {
rule: "repeated",
type: "int32",
id: 14
},
block: {
type: "bool",
id: 15
},
equipID: {
rule: "repeated",
type: "string",
id: 16
},
resonateNum: {
type: "int32",
id: 17
},
distributionResonate: {
type: "int32",
id: 18
},
energy: {
keyType: "string",
type: "int32",
id: 19
},
sameCount: {
type: "int32",
id: 20
},
suiteId: {
type: "int32",
id: 21
},
suiteExtId: {
type: "int32",
id: 22
},
isOverlying: {
type: "bool",
id: 23
},
energyProperty: {
keyType: "string",
type: "int32",
id: 24
},
juexProperty: {
keyType: "string",
type: "int32",
id: 25
}
}
},
Floor: {
fields: {
h4: {
type: "int32",
id: 1
},
h5: {
type: "int32",
id: 2
}
}
},
DBHeroRecord: {
fields: {
id: {
type: "string",
id: 1
},
uid: {
type: "string",
id: 2
},
star4: {
type: "int32",
id: 3
},
star5: {
type: "int32",
id: 4
},
mtime: {
type: "int64",
id: 5
},
drawcount: {
type: "int32",
id: 6
}
}
},
BattlePVEReq: {
fields: {
ptype: {
type: "PlayType",
id: 1
},
leadpos: {
type: "int32",
id: 2
},
teamids: {
rule: "repeated",
type: "string",
id: 3
},
mformat: {
rule: "repeated",
type: "int32",
id: 4
}
}
},
BattleInfo: {
fields: {
id: {
type: "string",
id: 1
},
btype: {
type: "BattleType",
id: 2
},
ptype: {
type: "PlayType",
id: 3
},
redCompId: {
type: "string",
id: 4
},
redflist: {
rule: "repeated",
type: "DBBattleFormt",
id: 5
},
blueCompId: {
type: "string",
id: 6
},
buleflist: {
rule: "repeated",
type: "DBBattleFormt",
id: 7
}
}
},
BattleReport: {
fields: {}
},
ChatChannel: {
values: {
World: 0,
@ -847,170 +1162,6 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
}
}
},
SkillData: {
fields: {
skillID: {
type: "int32",
id: 1
},
skillLv: {
type: "int32",
id: 2
}
}
},
DBHero: {
fields: {
id: {
type: "string",
id: 1
},
uid: {
type: "string",
id: 2
},
heroID: {
type: "string",
id: 3
},
star: {
type: "int32",
id: 4
},
lv: {
type: "int32",
id: 5
},
exp: {
type: "int32",
id: 6
},
juexingLv: {
type: "int32",
id: 7
},
captainSkill: {
type: "int32",
id: 8
},
normalSkill: {
rule: "repeated",
type: "SkillData",
id: 9
},
property: {
keyType: "string",
type: "int32",
id: 10
},
addProperty: {
keyType: "string",
type: "int32",
id: 11
},
cardType: {
type: "int32",
id: 12
},
curSkin: {
type: "int32",
id: 13
},
skins: {
rule: "repeated",
type: "int32",
id: 14
},
block: {
type: "bool",
id: 15
},
equipID: {
rule: "repeated",
type: "string",
id: 16
},
resonateNum: {
type: "int32",
id: 17
},
distributionResonate: {
type: "int32",
id: 18
},
energy: {
keyType: "string",
type: "int32",
id: 19
},
sameCount: {
type: "int32",
id: 20
},
suiteId: {
type: "int32",
id: 21
},
suiteExtId: {
type: "int32",
id: 22
},
isOverlying: {
type: "bool",
id: 23
},
energyProperty: {
keyType: "string",
type: "int32",
id: 24
},
juexProperty: {
keyType: "string",
type: "int32",
id: 25
}
}
},
Floor: {
fields: {
h4: {
type: "int32",
id: 1
},
h5: {
type: "int32",
id: 2
}
}
},
DBHeroRecord: {
fields: {
id: {
type: "string",
id: 1
},
uid: {
type: "string",
id: 2
},
star4: {
type: "int32",
id: 3
},
star5: {
type: "int32",
id: 4
},
mtime: {
type: "int64",
id: 5
},
drawcount: {
type: "int32",
id: 6
}
}
},
DBFriend: {
fields: {
uid: {
@ -2452,7 +2603,7 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
id: 2
},
monster: {
type: "int32",
type: "string",
id: 3
},
ctime: {
@ -2505,12 +2656,12 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
id: 2
},
monster: {
type: "int32",
type: "string",
id: 3
}
}
},
MoonfantasyDareReq: {
MoonfantasyAskReq: {
fields: {
uid: {
type: "string",
@ -2522,7 +2673,68 @@ var $root = ($protobuf.roots["default"] || ($protobuf.roots["default"] = new $pr
}
}
},
MoonfantasyDareResp: {
MoonfantasyAskResp: {
fields: {
code: {
type: "ErrorCode",
id: 1
}
}
},
MoonfantasyBattleReq: {
fields: {
uid: {
type: "string",
id: 1
},
mid: {
type: "string",
id: 2
},
leadpos: {
type: "int32",
id: 3
},
teamids: {
rule: "repeated",
type: "string",
id: 4
}
}
},
MoonfantasyBattleResp: {
fields: {
code: {
type: "ErrorCode",
id: 1
},
monster: {
type: "string",
id: 2
},
info: {
type: "BattleInfo",
id: 3
}
}
},
MoonfantasyReceiveReq: {
fields: {
bid: {
type: "string",
id: 2
},
monster: {
type: "string",
id: 3
},
report: {
type: "BattleReport",
id: 4
}
}
},
MoonfantasyReceiveResp: {
fields: {
issucc: {
type: "bool",

View File

@ -0,0 +1,51 @@
syntax = "proto3";
option go_package = ".;pb";
import "hero_db.proto";
enum BattleType {
nil = 0;
pve = 1;
pvp = 2;
pvb = 3;
}
//
enum PlayType {
mainline = 0; //线
pagoda = 1; //
moonfantasy = 2; //
}
//
enum BBattleState {
in = 0;
end = 2;
}
//
enum DBBattleComp {
draw = 0; //
red = 1; //
bule = 2; //
}
//
message DBBattleFormt {
int32 leadpos = 1; //
repeated DBHero team = 2;
}
//
message DBBattleRecord {
string id = 1; //id
BattleType btype = 2; //
PlayType ptype = 3; //
string plevel = 4; //
BBattleState state = 5; //
string redCompId = 6; //id
repeated DBBattleFormt redflist = 7; //
string blueCompId = 8; //id
repeated DBBattleFormt buleflist = 9; //
repeated DBBattleComp roundresult = 10; //
DBBattleComp result = 11; //
}

View File

@ -0,0 +1,25 @@
syntax = "proto3";
option go_package = ".;pb";
import "battle_db.proto";
// pve ( 使 )
message BattlePVEReq {
PlayType ptype = 1; //
int32 leadpos = 2; //
repeated string teamids = 3; //
repeated int32 mformat = 4; //
}
//
message BattleInfo {
string id = 1; //id
BattleType btype = 2; //
PlayType ptype = 3; //
string redCompId = 4; //id
repeated DBBattleFormt redflist = 5; //
string blueCompId = 6; //id
repeated DBBattleFormt buleflist = 7; //
}
//
message BattleReport {}

View File

@ -4,7 +4,7 @@ option go_package = ".;pb";
message DBMoonfantasy {
string id = 1; //@go_tags(`bson:"_id"`) ID
string uid = 2; //id
int32 monster = 3; //id
string monster = 3; //id
int64 ctime = 4; //
int32 joinnum = 5; //
int32 numup = 6; //

View File

@ -1,5 +1,7 @@
syntax = "proto3";
option go_package = ".;pb";
import "errorcode.proto";
import "battle_msg.proto";
///
message MoonfantasyTriggerReq {
@ -10,17 +12,43 @@ message MoonfantasyTriggerReq {
///
message MoonfantasyTriggerResp {
bool issucc = 1; //
string mid = 2; //id //
int32 monster = 3; //id
bool issucc = 1; //
string mid = 2; //id //
string monster = 3; //id
}
///
message MoonfantasyDareReq {
message MoonfantasyAskReq {
string uid = 1; //id
string mid = 2; //id
}
message MoonfantasyDareResp {
message MoonfantasyAskResp {
ErrorCode code = 1; //
}
///
message MoonfantasyBattleReq {
string uid = 1; //id
string mid = 2; //id
int32 leadpos = 3; //
repeated string teamids = 4; //
}
message MoonfantasyBattleResp {
ErrorCode code = 1; //
string monster = 2; //id
BattleInfo info = 3;
}
///
message MoonfantasyReceiveReq {
string bid = 2; //id id来领取奖励
string monster = 3; //id
BattleReport report = 4; //
}
///
message MoonfantasyReceiveResp {
bool issucc = 1; //
}