You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

97 lines
2.3 KiB
Protocol Buffer

syntax = "proto3";
package pb;
option go_package = "./pb";
// model
message User {
int64 id = 1;
string username = 2;
// platform
string platform = 3;
string pUid = 4;
string pUname = 5;
string pAvatar = 6;
string pInfo = 7;
}
message Empty {}
// req
message PlatformUserReq {
string platform = 1;
string pUid = 2;
}
message PlatformUserResp {
User user = 1;
}
// 通知-PvP伤害 statistics.pvp.damage
message StatPvPDamageReq {
int64 uid = 1; // 造成伤害的用户ID
optional int64 targetUid = 2; // 目标用户ID可能是基地不一定有
float damage = 3; // 伤害量
}
// 通知-PvP击杀单位 statistics.pvp.killunit
message StatPvPKillUnitReq {
int64 uid = 1; // 用户ID
optional int64 targetUid = 2; // 目标用户
string attacker = 3; // 造成击杀东西building:兵营 U0001:xxx兵 S0001: 技能)
string victim = 4; // 被击杀的东西U0001:xxx兵
}
// 通知-PvP杀兵营(人) statistics.pvp.kill
message StatPvPKillReq {
int64 uid = 1; // 用户ID
int64 targetUid = 2; // 目标用户
bool isGeneral = 3; // targetUid是否名将
}
// 通知-PvP一血 statistics.pvp.first
message StatPvPFirstBloodReq {
int64 uid = 1; // 用户ID
int32 type = 2; // 1-拿到一血 2-被破一血
}
// 通知-PvP战报 statistics.pvp.report
message StatPvPReportReq {
int32 winCamp = 1; // 获胜阵营 1-蓝 2-红
int64 generalUid = 2; // 名将UID
repeated int64 winUids = 3; // 战胜方玩家列表
repeated int64 lostUids = 4; // 战败方玩家列表
}
// rank
message RankPvpReq {
int32 type = 1; // rank类型
int32 topN = 2; // TopN
}
message RankPvpResp {
message Item {
int64 uid = 1;
string uname = 2;
int64 score = 3;
string avatar = 4;
}
int32 type = 1; // rank类型
repeated Item items = 2; // rank数据
}
service userCenter {
// user
rpc retrievePlatformUser(PlatformUserReq) returns (PlatformUserResp);
// statistics
rpc statPvpDamage(StatPvPDamageReq) returns (Empty);
rpc statPvpKillUnit(StatPvPKillUnitReq) returns (Empty);
rpc statPvpKill(StatPvPKillReq) returns (Empty);
rpc statPvpFirstBlood(StatPvPFirstBloodReq) returns (Empty);
rpc statPvpReport(StatPvPReportReq) returns (Empty);
// rank
rpc rankPvp(RankPvpReq) returns(RankPvpResp);
}