syntax = "proto3";
option go_package = ".;pb";
import "parkour_db.proto";

//请求比赛信息
message ParkourInfoReq {
   
}

//请求比赛信息请求
message ParkourInfoResp {
    bool isopen = 1;                        //当前赛事是否开启
    DBParkour info = 2;
    repeated DBRaceMember recommend = 3;
}

// 观察其他玩家信息
message ParkourViewPlayerReq{
    repeated string uid = 1;
}

message ParkourData {
    string uid = 1;
    string name = 2;  //用户名称
    string avatar = 3; //用户头像
    int32 lv = 4; //等级
    int64 offlineTime = 5; //最近一次下线时间 -1在线
}

message ParkourViewPlayerResp{
    repeated ParkourData player = 1;
}

//变更坐骑请求
message ParkourChangeMtsReq {
    string mtsid = 1;
}
//变更坐骑请求
message ParkourChangeMtsResp {
    bool issucc = 1;
    string mtsid = 2;
}

// //推送捕羊大赛用户信息改变
// message ParkourInfoChangePush {
//     DBParkour info = 1;
// }

//组队邀请请求
message ParkourInviteReq {
    string uid = 1;         //邀请队友
}
//组队邀请回应
message ParkourInviteResp {
    bool issucc = 1;
    DBParkour team = 2;
}
//组队邀请通知推送
message ParkourInviteNoticePush {
    DBParkour team = 1;
    int32 state = 2;    //1 发起请求 2拒绝请求 3接收请求
}
//推送队伍对变化通知
message ParkourTeamChanagePush {
    DBParkour team = 1;
}

//邀请处理请求
message ParkourInviteHandleReq{
    string captainid = 1;     //队长id
    int32 state = 2;          //2拒绝请求 3接收请求
}
  
message ParkourInviteHandleResp{
    bool isSucc = 1;
}

//退出 请求
message ParkourQuitTeamReq {
    string captainid = 1;       //队长id
}
//退出 回应
message ParkourQuitTeamResp {
    
}
//队伍成员加入推送
message ParkourTeamJoinNoticePush {
    DBRaceMember member = 1;
}
//队伍成员退出推送
message ParkourTeamQuitNoticePush {
    DBRaceMember member = 1;
}
//队伍解散通知推送
message ParkourTeamDisbandNoticePush {
    
}

//匹配请求 只有队长有权限
message ParkourRaceMatchReq {
    string captainid = 1;     //队长id
}

//匹配请求
message ParkourRaceMatchResp {

}

//匹配取消请求  只有队长有权限
message ParkourRaceMatchCancelReq {
    string captainid = 1;     //队长id
}


// 加入某个队伍
message ParkourJoinTeamReq{
    string uid = 1;
}

message ParkourJoinTeamResp{
    DBParkour team = 1;
}

//匹配取消请求
message ParkourRaceMatchCancelResp {

}

//匹配成功
message ParkourRaceMatchStartPush {
    DBParkour team = 1;
}
//匹配取消通知
message ParkourRaceMatchCancelPush {
    DBParkour team = 1;
}
//匹配成功
message ParkourRaceMatchSuccPush {
    DBRace race = 1;
}

//准备完毕
message ParkourReadyReq {
    string battleid = 1;
}
//准备完毕
message ParkourReadyResp {

}

//竞速开始推送
message ParkourRaceStartPush {
    int32 countdown = 1;            //倒计时
}

//射门请求
message ParkourShotReq {
    string battleid = 1;
}

//射门请求
message ParkourShotResp {
    
}

// 领取奖励
message ParkourGetRewardReq {
    int32 rid = 1;              //领奖id
}

message ParkourGetRewardResp {
    DBParkour info =1;
}

//躲避障碍请求
message ParkourAvoidReq {
    string battleid = 1;
    float distance = 2;
}

//躲避障碍请求 回应
message ParkourAvoidResp {
    
}

//恢复Hp请求
message ParkourRecoverHpReq {
    string battleid = 1;
}

//恢复Hp请求
message ParkourRecoverHpResp {
    bool issucc = 1;            //恢复成功
}

//全员冲刺
message ParkourAllSprintsPush {
    int32 left = 1;                 //剩余时间
}
message ParkourInfoChangePush  {
    DBParkour	Info =1  ;
}

//玩家hp变化通知
message ParkourPlayerHPChanagePush {
    map<string,int32> change = 1; //key是uid,value是hp
    // string uid = 1;
    // int32 hp = 2;
}
//比赛分值变化
message ParkourScoreChanagePush {
    int32 redscore = 1;
    int32 redenergy = 2;
    int32 bluescore = 3;
    int32 blueenergy = 4;
}

//比赛结束通知
message ParkourRaceOverPush {
    int32 winside = 1;          //0平局 1 红方胜利 2 蓝方胜利
}

///匹配请求 RPC消息定义 服务器自用 客户端不用理会
message RPCParkourJoinMatchReq {
    string captainid = 1;                   //队长id
    repeated DBRaceMember member = 2;                //成员数
}

///RPC消息定义 服务器自用 客户端不用理会
message RPCParkourJoinMatchResp {
}

//取消匹配
message RPCParkourCancelMatchReq {
    string captainid = 1;                   //队长id
}
message RPCParkourCancelMatchResp {
    
}

///匹配成功通知请求
message RPCParkourMatchSuccReq {
    repeated DBRaceMember red = 2;                     //临时红队
    repeated DBRaceMember bule = 3;                    //临时蓝队
}
///匹配成功通知请求
message RPCParkourMatchSuccResp {
    
}

//托管求情
message RPC_ParkourTrusteeshipReq {
    string battleid = 1;
    string uid = 2;
}

message RPC_ParkourTrusteeshipResp {

}