 
syntax = "proto3";

import "protocol.proto";

package rpc_ds;

//数据服务定义
service DataSevice {
  rpc CreateRoom (CreateRoomRequest) returns (CreateRoomReply) {}
  rpc Buyin (BuyinRequest) returns (BuyinReply) {}
  rpc GameEnd (GameEndRequest) returns (GameEndReply) {}
  rpc RoomEnd (RoomEndRequest) returns (RoomEndReply) {}
  rpc ShowCard (ShowCardRequest) returns (ShowCardReply) {}
}

message AllianceItem {
  string alliance_name = 1;
  repeated int32 Clubids = 2;
}

message CreateRoomRequest {
  uint64 room_uuid = 1;
  protocol.RoomParams param = 2;
  uint32 createtime = 3;
  string ownername = 4;
  string ownerhead = 5;
  uint32 roomid = 6;
  uint32 creatorid = 7;
  int32 allianceid = 8;
  string alliancename = 9;
  string ownerclubname = 10;
  repeated int32 alliance_club_ids = 11;//联盟俱乐部ids
  map<int32, AllianceItem> mapAllianceClubIds = 12; // 
  repeated int32 club_adminids = 13;//俱乐部管理员ids
}

message CreateRoomReply {
	uint32 result = 1; //0:success; 1:failed
}

message BuyinRequest{
    uint64 room_uuid = 1;
    uint32 roomid = 2;
	protocol.PlayerBuyinInfo buyin = 3;
	string rolehead = 4;
	int32  clubid = 5;
	uint32 room_createtime = 6;
	string playername = 7;
	string clubname = 8;
	int32 owner_id = 9;
	int32 create_club_uid = 10;
	int32 allianceid = 11; //联盟id 联盟牌局：联盟id 非联盟牌局：-1
}

message BuyinReply{
	uint32 result = 1; //0:success; 1:failed
}

message PlayerEndInfo{
	uint32 playerid = 1;
	int32 winbet = 2;
	string playername = 3;
	string playerhead = 4;
	int32 total_buyin = 5;
	int32 curr_record = 6;
	uint32 handcount = 7;
	int32 last_buyin_clubid = 8;
}

message GameEndRequest{
    uint64 room_uuid = 1;
    uint32 roomid = 2;
	uint32 total_handcount = 3;
	uint32 maxpot = 4;	
	int32 inurance_winbet = 5;
	repeated PlayerEndInfo players = 6;
	protocol.GameRecord game_record = 7;
	uint64 game_uuid = 8;
	int32 room_max_pot = 9;    //本房间牌局里面，最大一个pot的金额
	int32 room_total_buyin = 10; //所有人的有效带入总和
	int32 game_start_time = 11;
	int64 jackpot_winbet = 12;
	uint32 game_mode = 13;
	uint32 short_full = 14;
	string replay = 15;
}

message GameEndReply{
	uint32 result = 1; //0:success; 1:failed
}

message RoomEndRequest {
    uint64 room_uuid = 1;
    uint32 roomid = 2;
	int32 room_create_time = 3; //房间创建时间戳
	int32 room_time_limit = 4;  //设定的游戏时长（秒数）
	string room_owner_name = 5;
	int32 room_rule_blind_enum = 6; //小盲的筹码数
	int32 room_game_hand = 7; 	//本房间总共进行了多少游戏手数
	int32 room_max_pot = 8;    //本房间牌局里面，最大一个pot的金额
	int32 room_total_buyin = 9; //所有人的有效带入总和
	repeated protocol.PlayerSettlement settles = 10;
}

message RoomEndReply{
	uint32 result = 1; //0:success; 1:failed
}

message ShowCardRequest {
    uint32 roomid = 1;
    uint64 room_uuid = 2;
    uint32 uid = 3;
    uint64 game_uuid = 4;
    int32 cards = 5;
	bool  show_all = 6;
}

message ShowCardReply{
	uint32 result = 1; //0:success; 1:failed
}
