Doudizhu.proto 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  1. package com.backfire.socket.socketProto;
  2. option java_package = "com.backfire.socket.socketProto";
  3. option java_outer_classname = "Doudizhu";
  4. /********************
  5. * 房间协议
  6. *******************/
  7. // 1.5 认证请求
  8. message AuthReq
  9. {
  10. optional uint64 uid = 1; //用户id
  11. optional string key = 2; //用户session key
  12. }
  13. // 1.6 认证回应
  14. message AuthRpy
  15. {
  16. optional uint32 ret = 1; //返回值,1成功,2失败
  17. optional uint32 retcode = 2; //错误码,成功0
  18. optional string retmsg = 3; //错误信息,扩展用
  19. }
  20. message LoginoutReq
  21. {
  22. optional uint32 cmd =1;
  23. }
  24. //3 游戏模块
  25. message Ready
  26. {
  27. optional uint32 isready = 1; //是否准备,如果不想在这个房间,可以发送这条指令,也可直接退出
  28. optional uint32 handcardAnimMS = 2; //发牌的动画时间(毫秒)
  29. }
  30. message ReadyReply
  31. {
  32. optional uint32 ret = 1; //
  33. optional uint32 retcode = 2; //
  34. optional string retmsg = 3; //
  35. repeated uint32 seats = 4; //哪些位置已经准备,这个的做法再商量
  36. }
  37. // 3.1 房间内座位上玩家信息
  38. message PlayerInfo
  39. {
  40. optional uint32 seatId = 1; //座位ID
  41. optional uint64 uid = 2; //用户ID
  42. optional string uName = 3; //用户名称
  43. optional string icon = 4; //用户头像
  44. optional uint64 money = 5; //用户金币数
  45. optional uint32 level = 6; //用户等级
  46. optional uint32 sex = 7; //用户性别
  47. repeated uint32 items = 8; //用户道具
  48. optional uint32 gameCount = 9; //游戏场数
  49. optional uint32 winCount = 10; //胜利场数
  50. optional uint32 dropCount = 11; //掉线次数
  51. optional uint32 runCount = 12; //逃跑次数
  52. optional uint64 lottery = 13; //彩券数目
  53. optional string sign = 14; //用户签名
  54. }
  55. // 3.2 广播房间内打牌人信息(通过座位)
  56. message BroadcastPlayerInfo
  57. {
  58. repeated PlayerInfo seatList = 1;
  59. }
  60. message RebindReq
  61. {
  62. optional uint64 uid = 1;
  63. optional string session = 2;
  64. }
  65. //重连
  66. message RebindRpy
  67. {
  68. optional uint32 ret = 1;
  69. optional uint32 retcode = 2;
  70. optional string retmsg = 3;
  71. optional GameStart gamestart = 4;
  72. optional QiangdizhuRpy qdzRpy = 5;
  73. optional BroadcastPlayerAction playerAction = 6;
  74. optional BroadcastPlayerInfo playerinfo = 7;
  75. optional HandCard handcard = 8;
  76. optional uint32 seatid = 9;
  77. repeated uint32 playerCardsRemain = 10;
  78. repeated PlayerDepositRpy deposited = 11;
  79. optional uint32 roomType = 12;
  80. repeated BroadcastLaiziCard laizi = 13;
  81. optional SeatRpy seatInfo = 14; //斗地主座位信息
  82. }
  83. // 3.3 用户坐下站起
  84. message SeatReq
  85. {
  86. optional uint64 uid = 1; //用户ID
  87. optional uint32 seatId = 2; //座位ID
  88. optional uint32 action = 3; //动作,1坐下,2站起
  89. optional uint32 autoready = 4; //1自动准备 2不自动准备
  90. optional uint32 roomid = 5; //房间ID
  91. }
  92. // 3.4 坐下站起状态返回
  93. message SeatRpy
  94. {
  95. optional uint32 ret = 1; //返回值,1成功,2失败
  96. optional uint32 retCode = 2; //错误码
  97. optional string retMsg = 3; //用户提示信息
  98. optional uint32 seatid = 4; //玩家的座位
  99. optional uint32 action = 5; //玩家的动作
  100. optional uint32 basepoint = 6; //底分
  101. optional uint32 readytimeout= 7; //准备超时
  102. optional uint32 awardRoom = 8; //大奖赛场 1是大奖赛,0为其他
  103. optional uint32 laiziFlag = 9; //是否癞子场,0是普通场,1是普通癞子,2是超级癞子
  104. optional string roomName = 10; //场次名称
  105. }
  106. // 3.5 牌局开始
  107. message GameStart
  108. {
  109. optional uint32 gameNum = 1; //房间内第N局牌次
  110. optional uint32 bet = 2; //底注
  111. repeated CardInfo commcard = 3; //三张公牌
  112. optional uint32 dizhu = 4; //地主位置
  113. optional uint32 timeout = 5; //出牌超时
  114. }
  115. // 3.6 抢地主
  116. message QiangdizhuReq
  117. {
  118. optional uint32 ratio = 1; //抢地主,抢倍率
  119. optional uint32 giveup = 2; //放弃
  120. }
  121. // 3.7 抢地主返回
  122. message QiangdizhuRpy
  123. {
  124. optional uint32 ret = 1; //
  125. optional uint32 retcode = 2; //
  126. optional string retmsg = 3; //
  127. optional uint32 ratio = 4; //返回当前倍率
  128. optional uint32 seatid = 5; //当前抢地主玩家位置
  129. optional uint32 timeout = 6; //抢地主倒计时时间
  130. optional uint32 callCount = 7; //当前是第几次抢
  131. }
  132. // 3.8 单张牌信息
  133. message CardInfo
  134. {
  135. optional uint32 cardFace = 1; //牌点,癞子模式时是癞子替用的牌 3-15,其中11:J 12:Q 13:K 14:A 15:2
  136. optional uint32 cardSuit = 2; //花色 1方块,2黑葵,3红心,4黑桃
  137. optional uint32 laiziFace = 3; //癞子的原始牌点 0:不是癞子牌 3-15:与cardFace相同
  138. }
  139. // 3.9 发玩家手牌
  140. message HandCard
  141. {
  142. repeated CardInfo handCardList = 1; //用户手牌
  143. }
  144. // 3.10 玩家动作(出牌,pass,发表情等)
  145. message PlayerPlayActionReq
  146. {
  147. optional uint64 uid = 1; //用户ID
  148. optional uint32 action = 2; //动作
  149. repeated CardInfo pushCardList = 3; //出牌列表
  150. optional uint32 emotionId = 4; //表情ID
  151. }
  152. // 3.11 返回玩家动作结果
  153. message PlayerPlayActionRpy
  154. {
  155. optional uint32 ret = 1; //返回值,1成功,2失败
  156. optional uint32 retCode = 2; //错误码,待定
  157. optional string retMsg = 3; //用户提示,不能打此牌型; 超时(待定)
  158. }
  159. // 3.12 对手的动作(出牌,pass,表情等)
  160. message BroadcastPlayerAction
  161. {
  162. optional uint64 uid = 1; //用户id
  163. optional uint32 seatid = 2; //出牌玩家seat
  164. optional uint32 action = 3; //动作,1pass,2打牌,3发表情
  165. repeated CardInfo pushCardList = 4; //对手出牌内容
  166. optional uint32 emotionId = 5; //表情ID
  167. optional uint64 nextuid = 6; //下一个出牌玩家uid
  168. optional uint32 nextseatid = 7; //下一个出牌玩家seatid
  169. optional uint32 pointratio = 8; //当前倍率
  170. optional uint32 cardType = 9; //牌型
  171. optional uint32 highcard = 10; //主牌型的最大牌
  172. }
  173. message ChatReq{
  174. optional uint64 uId = 1; //用户uid
  175. required uint32 seatId = 2; //用户seatid座位
  176. optional uint32 roomId = 3; //房间
  177. optional string chatMsg = 4; //聊天信息
  178. optional uint32 faceId = 5; //表情id
  179. }
  180. message BroadcastChat{
  181. required uint32 seatId = 1; //座位id
  182. optional string chatMsg = 2; //聊天信息
  183. optional uint32 faceId = 3; //表情id
  184. optional uint32 roomId = 4; //table ID
  185. }
  186. // 3.13 牌局结束
  187. message GameOver
  188. {
  189. optional uint32 winSide = 1; //胜利方 1地主 2农民
  190. repeated GameResult result = 2; //赢得金钱 1-3座位排列
  191. }
  192. message GameResult
  193. {
  194. optional uint32 seatid = 1; //用户座位号
  195. optional uint64 winMoney = 2; //赢得金钱
  196. optional uint32 winRatio = 3; //翻倍数 按座位
  197. optional uint32 bombs = 4; //炸弹数 按座位
  198. repeated CardInfo seatCards = 5; //座位上剩余牌
  199. optional uint32 spring = 6; //春天 按座位
  200. optional uint32 reward = 7; //活动奖励 按座位
  201. optional uint64 money = 8; //用户的钱数
  202. optional uint64 lottery = 9; //用户剩余彩券数
  203. optional uint64 winLottery = 10; //用户赢彩券数
  204. }
  205. //广播新增的癞子牌
  206. message BroadcastLaiziCard
  207. {
  208. optional CardInfo laizicard = 1; //癞子牌
  209. optional uint32 seatid = 2; //小癞子的玩家座位
  210. }
  211. //托管请求
  212. message PlayerDepositReq
  213. {
  214. optional uint32 isdeposited = 1; //1托管, 2取消托管
  215. }
  216. //托管回应
  217. message PlayerDepositRpy
  218. {
  219. optional uint32 seatid = 1; //托管座位
  220. optional uint64 uid = 2; //托管uid
  221. optional uint32 isdeposited = 3; //1托管, 2取消托管
  222. optional uint32 ret = 4;
  223. optional uint32 retcode = 5;
  224. optional string retmsg = 6;
  225. }