syntax = "proto3";

option go_package = "./msg";

//登录
message ResLogin {
  string userId = 1;
  string nikeName = 2;
}
//登录 响应
message ReqLogin {
  string nikeName = 1;
  string userId = 2;
  string gameStatus = 3;
  MsgError error = 4;
}

//进入大厅
message EnterHall {
  string userId = 1;
}

//离开大厅
message LeaveHall {
  string userId = 1;
}

//加入房间
message ResJoinRoom {
  string userId = 1;
  string roomId = 2;
  string gameId = 3;
}

//加入房间
message ReqJoinRoom {
  string userId = 1;
  string roomId = 2;
  string gameId = 3;
  int32 sitPos = 4;
  ReqRoom roomInfo = 5;
}

//玩法列表
message PlayList {
  string userId = 1;
}

//商城
message Shop {
  string userId = 1;
}

message ResGameInfo {
  string gameId = 1;
}
message ReqGameInfo {
  string gameId = 1;
  string gameName = 2;
  string gameStatus = 4;
  string gameType = 5;
  TeenPattiRoomList teenPattiRoomList = 6;
}

message TeenPattiRoomList {
  repeated TeenPattiRoom teenPattiRoom = 1;
}

message TeenPattiRoom {
  
  string boot = 1; //0.1
  string minBuyin = 2; // 1
  string chaalLimmit = 3; // 12.8
  string potLimit = 4; //102.40
  string totalPlayers = 5; // 3999
  string roomLevel = 6; //low - mid - high
  string roomId = 7;
  string type = 8; 
}

// 通知客户端发牌
message ReqDealCard {
  optional int32 sitPos = 1;
  optional int32 index = 2;
}

// 通知客户端操作
message ReqPlayerAction {
  int32 sitPos = 1;
  PlayerOpt playerOpt = 2;
}

// 接到玩家操作
message ResPlayerOptAction {
  int32 sitPos = 1;
  PlayerOpt playerOpt = 2;
  string roomId = 3;
  string gameId = 4;
  string userId = 5;
}

// PlayerOptType 玩家操作类型
enum PlayerOptType {
    OPT_NONE        = 0;  // 无操作
    OPT_SEEN   = 1;  // 看牌
    OPT_PACKED     = 2;  // 弃牌
    OPT_CHAAL        = 3;  // 跟注
    OPT_BIND         = 4;  // 绑定
    OPT_SELECT      = 5;  // 选择操作
    OPT_SHOW         = 6;  // 亮牌
}

message PlayerOpt {
    PlayerOptType opt_type = 1;  // 操作类型
    int32 bet_amount = 2;        // 下注金额
    int64 timestamp = 3;         // 操作时间戳
    repeated ReqCard seenCards = 4;  // 看牌的牌
}

message ReqRoom {
  string Id = 1;
  repeated ReqPlayer ReqPlayers = 2;
  int32 Status = 3;
  int32 Round = 4;
  ReqGameRound GameRound = 5;
}


message ReqCard {
  int32 Color = 1;
  int32 Point = 2;
}
message  ReqPlayer {
  string Id = 1;
  repeated ReqCard HandCards =2;
  optional int32 SitPos = 3;
  optional bool IsDealer = 4;
  optional bool IsSeen = 5;
  optional bool IsPacked = 6;
  optional bool IsShow = 7;
}

message ReqPlayerList {
  repeated ReqPlayer ReqPlayers = 1;
}

message ReqGameRound {
  repeated ReqRound Rounds = 1;
}

message ReqBet {
  int32 betAmount = 1;
}
message ReqRound {
    // 回合数
    int32 round = 1;
    // 回合座位
    int32 roundSitPos = 2;
    // 回合操作
    PlayerOpt playerOpt = 3;
    // 用户id
    string userId = 4;
}


//error
message MsgError {
  int32 error_code = 1;
  string error_msg = 2;
}

message Hello {
  string name = 1;
}