github.com/lianghucheng/zrddz@v0.0.0-20200923083010-c71f680932e2/src/msg/room.go (about)

     1  package msg
     2  
     3  const (
     4  	S2C_CreateRoom_InnerError    = 1 // 创建房间出错,请稍后重试
     5  	S2C_CreateRoom_InOtherRoom   = 3 // 正在其他房间对局,是否回去?
     6  	S2C_CreateRoom_RuleError     = 5 // 规则错误,请稍后重试
     7  	S2C_CreateRoom_LackOfChips   = 6 // 需要 S2C_CreateRoom.MinChips 筹码才能游戏,请先购买筹码
     8  	S2C_CreateRoom_MaxChipsLimit = 7 //
     9  )
    10  
    11  type S2C_CreateRoom struct {
    12  	Error    int
    13  	MinChips int64 // 最小筹码
    14  	MaxChips int64 // 最大筹码
    15  }
    16  
    17  type C2S_EnterRoom struct {
    18  	RoomNumber string
    19  }
    20  
    21  const (
    22  	S2C_EnterRoom_OK            = 0
    23  	S2C_EnterRoom_NotCreated    = 1 // "房间: " + S2C_EnterRoom.RoomNumber + " 未创建"
    24  	S2C_EnterRoom_Full          = 2 // "房间: " + S2C_EnterRoom.RoomNumber + " 玩家人数已满"
    25  	S2C_EnterRoom_Unknown       = 4 // 进入房间出错,请稍后重试
    26  	S2C_EnterRoom_IPConflict    = 5 // IP重复,无法进入
    27  	S2C_EnterRoom_LackOfChips   = 6 // 需要 + S2C_EnterRoom.MinChips + 筹码才能进入,请先购买筹码
    28  	S2C_EnterRoom_NotRightNow   = 7 // 比赛暂未开始,请到时再来
    29  	S2C_EnterRoom_MaxChipsLimit = 8 //
    30  )
    31  
    32  type S2C_EnterRoom struct {
    33  	Error         int
    34  	RoomType      int // 房间类型: 0 练习、1 底分匹配、2 底分私人、3 VIP私人、4 红包匹配、5 红包私人
    35  	RoomNumber    string
    36  	Position      int
    37  	BaseScore     int
    38  	RedPacketType int // 红包种类(元): 1、10、100、999
    39  	RoomDesc      string
    40  	MaxPlayers    int   // 最大玩家数
    41  	MinChips      int64 // 最小筹码
    42  	MaxChips      int64 // 最大筹码
    43  	Tickects      int64 // 门票金额
    44  	GamePlaying   bool  // 游戏是否进行中
    45  }
    46  
    47  type C2S_GetAllPlayers struct{}
    48  
    49  type S2C_SitDown struct {
    50  	Position   int
    51  	AccountID  int
    52  	LoginIP    string
    53  	Nickname   string
    54  	Headimgurl string
    55  	Sex        int
    56  	Owner      bool
    57  	Ready      bool
    58  	Chips      int64
    59  }
    60  
    61  type S2C_StandUp struct {
    62  	Position int
    63  }
    64  
    65  type C2S_ExitRoom struct{}
    66  
    67  const (
    68  	S2C_ExitRoom_OK          = 0
    69  	S2C_ExitRoom_GamePlaying = 1 // 游戏进行中,不能退出房间
    70  )
    71  
    72  type S2C_ExitRoom struct {
    73  	Error    int
    74  	Position int
    75  }
    76  
    77  // 更新座位上的玩家筹码
    78  type S2C_UpdatePlayerChips struct {
    79  	Position int
    80  	Chips    int64
    81  }
    82  
    83  // 系统托管
    84  type C2S_SystemHost struct {
    85  	Host bool
    86  }
    87  
    88  type S2C_SystemHost struct {
    89  	Position int
    90  	Host     bool
    91  }
    92  
    93  type C2S_SetVIPRoomChips struct {
    94  	Chips int64
    95  }
    96  
    97  const (
    98  	S2C_SetVIPChips_OK          = 0
    99  	S2C_SetVIPChips_ChipsUnset  = 1 // (前端显示输入筹码界面)
   100  	S2C_SetVIPChips_LackOfChips = 2 // 筹码不足,请先购买筹码
   101  )
   102  
   103  type S2C_SetVIPRoomChips struct {
   104  	Error    int
   105  	Position int
   106  	Chips    int64
   107  }
   108  
   109  type C2S_ChangeTable struct{}