syntax = "proto3";
option go_package = ".;pb";

enum RaceType {
    ordinary = 0;
    prop = 1;
}

//队伍状态
enum RaceTeamState {
    resting = 0;            //休息中
    teaming = 1;            //组队中
    matching = 2;           //匹配中
    raceing = 3;            //比赛中
}

//队员信息
message DBRaceMember {
    string uid = 1;                         //用户id
    string name = 2;                        //用户名称
    string avatar = 3;                      //用户头像
    int32 lv = 4;                           //等级
    string mount = 5;                       //上阵坐骑
    int32 maxhp = 6;                        //初始血量
    int32 currhp = 7;                       //当前血量
    int32 innermost = 8;                    //里程数
    bool ready = 9;                         //是否准备
    bool isai = 10;                          //是否是ai
    bool isoff = 11;                        //是否离线
}

message DBRaceInvite {
    string uid = 1;                         //用户id
    string name = 2;                        //用户名称
    string avatar = 3;                      //用户头像
    int32 lv = 4;                           //等级
    int64 expired = 5;                      //过期时间
}

//个人竞赛信息
message DBParkour {
    string id = 1;                          //@go_tags(`bson:"_id"`)                队伍id
    string uid = 2;                         //用户id  
    map<string,int32> mounts = 3;           //坐骑列表
    string dfmount = 4;                     //默认坐骑
    RaceTeamState state = 5;                //队伍状态
    string currbattid = 6;                  //当前战斗id
    int32 integral = 7;                     //积分
    string captainid = 8;                   //队长id 当前所在队伍
    repeated DBRaceInvite invite = 9;       //邀请列表
    repeated DBRaceMember member = 10;      //成员列表
    int32 reward = 11;// 积分信息奖励
}

//比赛数据
message DBRace {
    string id = 1;                          //@go_tags(`bson:"_id"`)                比赛唯一id
    string servicePath  = 2;                //比赛所在服务
    RaceType rtype = 3;                     //比赛类型
    int32 trackid = 4;                      //赛道id
    int32 innermost =5;                    //里程数
    repeated DBRaceMember redmember = 6;                 //红方队伍
    repeated DBRaceMember bulemember = 7;                //蓝方队伍
}
