|
|
|
|
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;
|
|
|
|
|
int32 nobilityLevel = 7; // 贵族等级
|
|
|
|
|
int64 integral = 8; // 用户积分(充值)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message Empty {}
|
|
|
|
|
|
|
|
|
|
// req
|
|
|
|
|
message PlatformUserReq {
|
|
|
|
|
string platform = 1;
|
|
|
|
|
string pUid = 2;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message PlatformUserResp {
|
|
|
|
|
User user = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 用户ID请求
|
|
|
|
|
message UserIdReq {
|
|
|
|
|
int64 userId = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 用户ID回复
|
|
|
|
|
message UserIdResp {
|
|
|
|
|
int64 userId = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
enum IntegralType {
|
|
|
|
|
Battle = 0; // 战斗
|
|
|
|
|
Gift = 1; // 礼物
|
|
|
|
|
Other = 10; // 其它积分
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 变更积分请求
|
|
|
|
|
message ChangeIntegralReq {
|
|
|
|
|
int64 userId = 1; // 系统用户ID
|
|
|
|
|
int64 battleId = 2; // 战斗ID(RPC内部)
|
|
|
|
|
int64 change = 3; // 变更数量
|
|
|
|
|
IntegralType integralType = 4; // 积分类型
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 变更积分回复
|
|
|
|
|
message ChangeIntegralResp {
|
|
|
|
|
int64 userId = 1; // 系统用户ID
|
|
|
|
|
int64 change = 2; // 本次变更积分数量,负数为扣减
|
|
|
|
|
int64 integral = 3; // 用户当前总积分
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 用户积分回复
|
|
|
|
|
message UserIntegralResp {
|
|
|
|
|
int64 userId = 1; // 用户ID
|
|
|
|
|
int64 integral = 2; // 用户当前总积分
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 用户打卡(签到)回复
|
|
|
|
|
message UserCheckInResp {
|
|
|
|
|
int32 code = 1;
|
|
|
|
|
string msg = 2; // 消息
|
|
|
|
|
int64 integralChange = 3; // 积分变动量
|
|
|
|
|
int64 integral = 4; // 变动后的积分量
|
|
|
|
|
bool isCritical = 5; // 是否发生了暴击奖励
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 转移用户积分
|
|
|
|
|
message TransferUserIntegralReq {
|
|
|
|
|
int64 userId = 1; // 源用户ID
|
|
|
|
|
int64 targetUserId = 2; // 目标用户
|
|
|
|
|
int64 transfer = 3; // 待转移量
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message TransferUserIntegralResp {
|
|
|
|
|
int32 code = 1;
|
|
|
|
|
string msg = 2; // 消息
|
|
|
|
|
|
|
|
|
|
int64 userId = 3;
|
|
|
|
|
string uname = 4;
|
|
|
|
|
string avatar = 5;
|
|
|
|
|
|
|
|
|
|
int64 targetUserId = 6;
|
|
|
|
|
string targetUname = 7;
|
|
|
|
|
string targetAvatar = 8;
|
|
|
|
|
|
|
|
|
|
int64 userIntegral = 10; // 源用户积分剩余
|
|
|
|
|
int64 targetUserIntegral = 11; // 目标用户积分剩余
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 用户送礼请求
|
|
|
|
|
message UserSendGiftReq {
|
|
|
|
|
string platform = 1; // 平台
|
|
|
|
|
int64 userId = 2; // 系统用户ID
|
|
|
|
|
string pUid = 3; // 平台用户ID
|
|
|
|
|
string roomId = 4; // 直播间ID
|
|
|
|
|
int64 giftId = 5; // 礼物ID
|
|
|
|
|
string giftName = 6; // 礼物名
|
|
|
|
|
int64 num = 7; // 赠送数量
|
|
|
|
|
int64 price = 8; // 礼物单价(系统不存在对应礼物数据时使用)
|
|
|
|
|
bool isPaid = 9; // 是否收费礼物
|
|
|
|
|
int64 battleId = 10; // 战局ID
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 用户送礼回复
|
|
|
|
|
message UserSendGiftResp {
|
|
|
|
|
ChangeIntegralResp integral = 10; // 积分变动
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 用户购买舰长请求
|
|
|
|
|
message UserBuyNobilityReq {
|
|
|
|
|
string platform = 1; // 平台
|
|
|
|
|
int64 userId = 2; // 系统用户ID
|
|
|
|
|
string pUid = 3; // 平台用户ID
|
|
|
|
|
int64 battleId = 4; // 战局ID
|
|
|
|
|
string roomId = 5; // 直播间ID
|
|
|
|
|
|
|
|
|
|
int64 giftId = 6; // 礼物ID
|
|
|
|
|
string giftName = 7; // 礼物名
|
|
|
|
|
int64 num = 8; // 赠送数量
|
|
|
|
|
int64 price = 9; // 礼物单价(系统不存在对应礼物数据时使用)
|
|
|
|
|
int64 level = 10; // 贵族等级
|
|
|
|
|
int64 startTime = 11; // 开始时间
|
|
|
|
|
int64 endTime = 12; // 结束时间
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 用户购买舰长回复
|
|
|
|
|
message UserBuyNobilityResp {
|
|
|
|
|
ChangeIntegralResp integral = 10; // 积分变动
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 通知-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 {
|
|
|
|
|
message Item {
|
|
|
|
|
int64 uid = 1; // 用户ID
|
|
|
|
|
string uname = 2; // 用户名
|
|
|
|
|
int32 position = 3; // 名次(特指在某一方的名次)
|
|
|
|
|
int64 damage = 4; // 伤害量
|
|
|
|
|
int64 deDamage = 5; // 承受伤害
|
|
|
|
|
int64 killUnit = 6; // 击杀单位数量
|
|
|
|
|
int64 deKillUnit = 7; // 被杀单位数量
|
|
|
|
|
}
|
|
|
|
|
int32 winCamp = 1; // 获胜阵营 1-蓝 2-红
|
|
|
|
|
int64 battleId = 2; // 战斗ID
|
|
|
|
|
repeated Item winItems = 10; // 获胜方数据
|
|
|
|
|
repeated Item lostItems = 11; // 战败方数据
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 通知-PvP战报 回复
|
|
|
|
|
message StatPvPReportResp {
|
|
|
|
|
message Item {
|
|
|
|
|
int64 uid = 1; // 用户ID
|
|
|
|
|
string uname = 2; // 用户名
|
|
|
|
|
int32 position = 3; // 名次(特指在某一方的名次)
|
|
|
|
|
int64 returnsIntegral = 4; // 回收的积分(获胜方才能回收,0不要展示)
|
|
|
|
|
int64 rewardPoolIntegral = 5; // 瓜分奖池分
|
|
|
|
|
int64 generalIntegral = 6; // 名将
|
|
|
|
|
int64 nobilityIntegral = 7; // 舰长|总督|贵族 加成分
|
|
|
|
|
int64 battleIntegral = 8; // 战斗结算奖励(普通)
|
|
|
|
|
int64 totalIntegral = 10; // 总计加分
|
|
|
|
|
}
|
|
|
|
|
repeated Item winItems = 1; // 获胜方数据
|
|
|
|
|
repeated Item lostItems = 2; // 战败方数据
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//////////////////// 礼包
|
|
|
|
|
|
|
|
|
|
enum GiftType {
|
|
|
|
|
starter = 0; // 新手礼包
|
|
|
|
|
subsistence = 1; // 低保
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message GiftPackItem {
|
|
|
|
|
string packType = 1; // 礼包类型 starter:新手礼包
|
|
|
|
|
string packName = 2; // 礼包名称
|
|
|
|
|
int64 integral = 3; // 获取的积分
|
|
|
|
|
repeated string title = 4; // 获取的称号
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 领取礼包
|
|
|
|
|
message DrawGiftPackReq {
|
|
|
|
|
int64 uid = 1;
|
|
|
|
|
string uname = 2;
|
|
|
|
|
string giftType = 3;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message DrawGiftPackResp {
|
|
|
|
|
int64 uid = 1;
|
|
|
|
|
string uname = 2;
|
|
|
|
|
int32 code = 3; // 领取结果 200:成功 201100:已经领取过 201101:已领取完
|
|
|
|
|
string msg = 4; // 消息 [领取成功|已经领取过|该用户已领取(当日|每周|每月)完所有礼包]
|
|
|
|
|
GiftPackItem item = 10;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
////////////////////// drawPool
|
|
|
|
|
|
|
|
|
|
// 往福利池中添加福利,扣除自己积分
|
|
|
|
|
message IncreaseWelfareReq {
|
|
|
|
|
int64 uid = 1; // 用户ID
|
|
|
|
|
string uname = 2; // 用户名
|
|
|
|
|
int64 welfare = 3; // 投入值
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
////////////////////// rank
|
|
|
|
|
enum RankType {
|
|
|
|
|
Unknown = 0;
|
|
|
|
|
Damage = 1; // 伤害榜
|
|
|
|
|
DeDamage = 2; // 受伤榜
|
|
|
|
|
General = 3; // 名将榜
|
|
|
|
|
DeGeneral = 4; // 落马榜
|
|
|
|
|
KillUnit = 5; // 小兵击杀
|
|
|
|
|
DeKillUnit = 6; // 小兵被杀
|
|
|
|
|
KillPlayer = 7; // 击杀玩家
|
|
|
|
|
DeKillPlayer = 8; // 被杀榜
|
|
|
|
|
Win = 9; // 获胜榜
|
|
|
|
|
Lost = 10; // 战败榜
|
|
|
|
|
FirstBlood = 11; // 一血榜
|
|
|
|
|
DeFirstBlood = 12; // 被拿一血榜
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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数据
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// RankPvpSubmitReq 手动排行榜结算
|
|
|
|
|
message RankPvpSubmitReq {
|
|
|
|
|
int32 rankType = 1; // 待结算的排行榜类型
|
|
|
|
|
bool allRankType = 2; // 是否直接结算所有排行类型
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message RankPvpSubmitResp {
|
|
|
|
|
message Result {
|
|
|
|
|
int64 userId = 1;
|
|
|
|
|
string username = 2;
|
|
|
|
|
string avatar = 3;
|
|
|
|
|
int64 integral = 4; // 获取到的积分数
|
|
|
|
|
string title = 5; // 获取到的称号
|
|
|
|
|
int64 titleDuration = 6; // 称号持续时间(单位: 秒,负数为无限长)
|
|
|
|
|
}
|
|
|
|
|
message Item {
|
|
|
|
|
int32 rankType = 1; // 排行榜类型
|
|
|
|
|
repeated Result results = 2; // 上榜玩家?
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
repeated Item items = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// UserRankReq 查询用户自己的排行
|
|
|
|
|
message UserRankReq {
|
|
|
|
|
int64 userId = 1; // 系统用户ID
|
|
|
|
|
string username = 2; // 用户名
|
|
|
|
|
int32 rankType = 3; // 排行榜类型
|
|
|
|
|
bool allRankType = 4; // 直接查询所有排行类型
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message UserRankResp {
|
|
|
|
|
message Item {
|
|
|
|
|
int32 rankType = 1; // 排行类型
|
|
|
|
|
int32 pos = 2; // 名次
|
|
|
|
|
int64 score = 3; // 分数
|
|
|
|
|
}
|
|
|
|
|
repeated Item items = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
service userCenter {
|
|
|
|
|
/// @ZeroGroup: platform_user
|
|
|
|
|
|
|
|
|
|
// retrievePlatformUser 新增或获取用户
|
|
|
|
|
rpc retrievePlatformUser(PlatformUserReq) returns (PlatformUserResp);
|
|
|
|
|
// getUserIdByPUid 通过平台用户id获取系统用户ID
|
|
|
|
|
rpc getUserIdByPUid(PlatformUserReq) returns (UserIdResp);
|
|
|
|
|
|
|
|
|
|
/// @ZeroGroup: integral
|
|
|
|
|
|
|
|
|
|
//ChangeIntegral 新增用户积分
|
|
|
|
|
rpc changeIntegral(ChangeIntegralReq) returns (ChangeIntegralResp);
|
|
|
|
|
//GetUserIntegral 获取用户积分
|
|
|
|
|
rpc getUserIntegral(UserIdReq) returns (UserIntegralResp);
|
|
|
|
|
//UserCheckIn 用户签到|打卡
|
|
|
|
|
rpc userCheckIn(UserIdReq) returns (UserCheckInResp);
|
|
|
|
|
//TransferUserIntegral 转移积分
|
|
|
|
|
rpc transferUserIntegral(TransferUserIntegralReq) returns (TransferUserIntegralResp);
|
|
|
|
|
|
|
|
|
|
/// @ZeroGroup: gift
|
|
|
|
|
|
|
|
|
|
// UserSendGift 用户赠送礼物
|
|
|
|
|
rpc userSendGift(UserSendGiftReq) returns(UserSendGiftResp);
|
|
|
|
|
rpc userBuyNobility(UserBuyNobilityReq) returns(UserBuyNobilityResp);
|
|
|
|
|
|
|
|
|
|
/// @ZeroGroup: statistics
|
|
|
|
|
|
|
|
|
|
rpc statPvpKill(StatPvPKillReq) returns (Empty);
|
|
|
|
|
rpc statPvpFirstBlood(StatPvPFirstBloodReq) returns (Empty);
|
|
|
|
|
rpc statPvpReport(StatPvPReportReq) returns (StatPvPReportResp);
|
|
|
|
|
|
|
|
|
|
/// @ZeroGroup: giftPack
|
|
|
|
|
|
|
|
|
|
rpc drawGiftPack(DrawGiftPackReq) returns(DrawGiftPackResp);
|
|
|
|
|
|
|
|
|
|
/// @ZeroGroup: drawPool
|
|
|
|
|
|
|
|
|
|
rpc increaseWelfare(IncreaseWelfareReq) returns (Empty);
|
|
|
|
|
|
|
|
|
|
/// @ZeroGroup: rank
|
|
|
|
|
|
|
|
|
|
// rankPvp pvp排行
|
|
|
|
|
rpc rankPvp(RankPvpReq) returns(RankPvpResp);
|
|
|
|
|
rpc rankPvpSubmit(RankPvpSubmitReq) returns(RankPvpSubmitResp);
|
|
|
|
|
rpc userRankPvp(UserRankReq) returns (UserRankResp);
|
|
|
|
|
}
|