gamedefs.go 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751
  1. package gamelogic
  2. import (
  3. "encoding/json"
  4. "bet24.com/log"
  5. badge "bet24.com/servers/micros/badge/proto"
  6. )
  7. const (
  8. GAMEID = 38
  9. GAME_NAME = "quickludo"
  10. CHAIR_COUNT = 4
  11. PLANE_COUNT = 4
  12. )
  13. const (
  14. Phase_Free = iota
  15. Phase_Match //匹配结束
  16. Phase_Dice //掷骰子中
  17. Phase_Move //移动飞机中
  18. Phase_End //结束
  19. )
  20. const (
  21. ScoreType_Bet = iota
  22. ScoreType_End
  23. ScoreType_Return
  24. )
  25. const (
  26. TIMER_READY_0 = iota
  27. TIMER_READY_1
  28. TIMER_READY_2
  29. TIMER_READY_3
  30. TIMER_MATCH
  31. TIMER_GAME
  32. TIMER_ROBOT
  33. TIMER_ADD_ROBOT
  34. TIMER_REMOVE_ROBOT
  35. TIMER_QUIT_0
  36. TIMER_QUIT_1
  37. TIMER_QUIT_2
  38. TIMER_QUIT_3
  39. )
  40. const SEC_READY = 30 * 1000 //准备计时
  41. const SEC_MATCH = 4000 //匹配计时 4000 匹配动画时间
  42. const SEC_DELAY = 2000 //动画等待时间2s
  43. const SEC_MOVE_TIME = 300 //移动一格时间
  44. const SEC_NEXT_CHAIR = 500 //换人间隔
  45. const SEC_AUTO = 2000 //托管超时
  46. const SEC_ROBOT_CHAT = 5000
  47. const MAX_STEP = 58 // 终点
  48. const SAFE_START = 53 //安全通道起始坐标
  49. const LOOP_START = 52 //转圈起始位
  50. const LOOP_END = 51 //转圈截止位
  51. const (
  52. Action_Dice = iota // 投掷骰子
  53. Action_Move // 移动飞机
  54. Action_Drop // 2 弃牌
  55. Action_Invalid
  56. )
  57. // 飞机是否安全
  58. func isSafe(pos int) bool {
  59. //还未出发
  60. if pos == 0 {
  61. return true
  62. }
  63. if pos >= SAFE_START {
  64. return true
  65. }
  66. //第九格和第14格为安全区
  67. return (pos-9)%13 == 0 || (pos-14)%13 == 0
  68. }
  69. // 查找优先级高的棋子
  70. func (gs *GameScene) getPriorityPlane(chairId int) (int, int) {
  71. unsafePlane := make(map[int]int)
  72. farthestPlane := -1
  73. farthestPosition := -1
  74. myPlanes := gs.Players[chairId].Planes
  75. for k, v := range myPlanes {
  76. if !v.CanMove {
  77. continue
  78. }
  79. if v.Position > farthestPosition {
  80. farthestPlane = v.Id
  81. farthestPosition = v.Position
  82. }
  83. if isSafe(v.Position) {
  84. continue
  85. }
  86. for k1, v1 := range myPlanes {
  87. if k == k1 || !v1.CanMove {
  88. continue
  89. }
  90. //叠棋
  91. if v.Position == v1.Position && v.Id != v1.Id {
  92. continue
  93. }
  94. unsafePlane[v.Id] = v.Position
  95. }
  96. }
  97. unsafePlaneId := -1
  98. if len(unsafePlane) > 0 {
  99. farthest := -1 //最远的
  100. for unsafeId, unsafePosition := range unsafePlane {
  101. for i := 0; i < CHAIR_COUNT; i++ {
  102. //不跟自己比
  103. if i == chairId || !gs.Players[i].IsValid || gs.Players[i].Dropped {
  104. continue
  105. }
  106. if gs.Players[i].checkChairPosition(chairId, unsafePosition) == 2 {
  107. //有危险
  108. if unsafePosition > farthest {
  109. farthest = unsafePosition
  110. unsafePlaneId = unsafeId
  111. }
  112. }
  113. }
  114. }
  115. }
  116. //存在风险的棋子和最远端的棋子
  117. return unsafePlaneId, farthestPlane
  118. }
  119. // 检查起飞区附近是否有敌人
  120. func (gs *GameScene) checkTookOffArea(chairId int) bool {
  121. //检查全部玩家
  122. for i := 0; i < CHAIR_COUNT; i++ {
  123. if i == chairId || !gs.Players[i].IsValid || gs.Players[i].Dropped {
  124. continue
  125. }
  126. //坐标转换后在1-10之间的都算有棋子
  127. for _, v := range gs.Players[i].Planes {
  128. if v.Position == 0 {
  129. continue
  130. }
  131. if gs.Players[i].convertPlanePosition(v.Position) <= 10 {
  132. //有棋子
  133. return true
  134. }
  135. }
  136. }
  137. return false
  138. }
  139. // 是否相撞
  140. func isCrash(chair1, pos1, chair2, pos2 int) bool {
  141. if pos1 == 0 || pos2 == 0 || isSafe(pos1) || isSafe(pos2) {
  142. return false
  143. }
  144. return (chair1*13+pos1)%LOOP_START == (chair2*13+pos2)%LOOP_START
  145. }
  146. // 是否有效座位
  147. func isValidChair(chairId int) bool {
  148. return chairId >= 0 && chairId < CHAIR_COUNT
  149. }
  150. // 是否有效棋子
  151. func isValidPlane(planeId int) bool {
  152. return planeId >= 0 && planeId < PLANE_COUNT
  153. }
  154. // 是否有效点数
  155. func isValidPoint(point int) bool {
  156. return point >= 1 && point <= 6
  157. }
  158. type userAction struct {
  159. ChairId int
  160. Action int
  161. Number int
  162. PlaneId int
  163. }
  164. func (ua *userAction) dump() {
  165. log.Debug(" Chair[%d],Action[%d],PlaneId[%d],Number[%d]", ua.ChairId, ua.Action, ua.PlaneId, ua.Number)
  166. }
  167. // 弃权
  168. func (p *PlayerInfo) drop() {
  169. p.Dropped = true
  170. }
  171. // 检测位置是否撞机
  172. func (gs *GameScene) checkPositionIsCrashed(chairId, position, planeId int) (total int, tempCrashed *Plane, crashedPlayer *PlayerInfo) {
  173. total = 0
  174. //自己的棋子数量
  175. myPlaneCount := 0
  176. for i := 0; i < CHAIR_COUNT; i++ {
  177. //不能忽略自己的棋子 有可能自己的棋子和对方的棋子形成了安全区
  178. if i == chairId {
  179. planeCount := gs.Players[i].checkSamePositionCount(position, planeId)
  180. myPlaneCount += planeCount
  181. if planeCount != 0 {
  182. break
  183. }
  184. continue
  185. }
  186. //无效的玩家过滤
  187. if !gs.Players[i].IsValid {
  188. continue
  189. }
  190. if gs.Players[i].Dropped {
  191. continue
  192. }
  193. //检查加上步数后是否和该玩家的棋子是否相撞
  194. crashed := gs.Players[i].checkCrashed(chairId, position)
  195. crashedCount := len(crashed)
  196. if crashedCount < 1 {
  197. continue
  198. }
  199. total += crashedCount
  200. //如果当前用户有一个被踩则暂存
  201. if crashedCount == 1 {
  202. tempCrashed = crashed[0]
  203. crashedPlayer = &gs.Players[i]
  204. }
  205. }
  206. if total != 0 && myPlaneCount >= 1 {
  207. total += myPlaneCount
  208. }
  209. return total, tempCrashed, crashedPlayer
  210. }
  211. // 检测前方是否有敌人的棋子 (两人场判断)
  212. func (gs *GameScene) checkFrontHasEnemy(chairId, position, planeId int) bool {
  213. //敌人的座位号
  214. enemyChairId := (chairId + 2) % CHAIR_COUNT
  215. planeCount := gs.Players[chairId].checkSamePositionCount(position, planeId)
  216. if planeCount != 0 {
  217. return false
  218. }
  219. crashed := gs.Players[enemyChairId].checkCrashed(chairId, position)
  220. crashedCount := len(crashed)
  221. return crashedCount == 1
  222. }
  223. // 得到不能攻击的点数
  224. func (gs *GameScene) getUnAttackPoint(chairId int) []int {
  225. //临时标记
  226. points := []int{1, 2, 3, 4, 5, 6}
  227. unAttackPoint := make([]int, 0)
  228. attackPoint := make([]int, 0)
  229. for _, v := range gs.Players[chairId].Planes {
  230. //没有出机场或者已经到终点和快到终点的过滤
  231. if v.Position == 0 || v.Position == MAX_STEP || v.Position >= SAFE_START {
  232. continue
  233. }
  234. for _, p := range points {
  235. //可以攻击 则替换点数
  236. isHasEnemy := gs.checkFrontHasEnemy(chairId, v.Position+p, v.Id)
  237. if isHasEnemy {
  238. attackPoint = append(attackPoint, p)
  239. }
  240. }
  241. }
  242. if len(attackPoint) == 0 {
  243. return unAttackPoint
  244. }
  245. //剔除可以攻击的点数
  246. for _, v := range points {
  247. isHas := false
  248. for _, p := range attackPoint {
  249. if v == p {
  250. isHas = true
  251. break
  252. }
  253. }
  254. if !isHas {
  255. unAttackPoint = append(unAttackPoint, v)
  256. }
  257. }
  258. return unAttackPoint
  259. }
  260. // 检查棋子移动后结果
  261. func (gs *GameScene) checkPlaneMoveResult(chairId, position int) int {
  262. //临时标记
  263. temp := -1
  264. for i := 0; i < CHAIR_COUNT; i++ {
  265. //不跟自己比
  266. if i == chairId {
  267. continue
  268. }
  269. //无效的玩家过滤
  270. if !gs.Players[i].IsValid {
  271. continue
  272. }
  273. if gs.Players[i].Dropped {
  274. continue
  275. }
  276. //检查自己的棋子加上步数后 是否超过或者接近对手的棋子
  277. ret := gs.Players[i].checkChairPosition(chairId, position)
  278. if ret == 2 {
  279. //有危险则不在判断
  280. temp = ret
  281. break
  282. }
  283. if ret > temp {
  284. temp = ret
  285. }
  286. }
  287. return temp
  288. }
  289. // 检查自己是否落后对手超过10步以上了(只考虑最远端的)
  290. func (gs *GameScene) checkIsBehind(chairId int) bool {
  291. myPositionCount := gs.Players[chairId].calculatePosition()
  292. if myPositionCount < 10 {
  293. return false
  294. }
  295. for i := 0; i < CHAIR_COUNT; i++ {
  296. if i == chairId {
  297. continue
  298. }
  299. if !gs.Players[i].IsValid {
  300. continue
  301. }
  302. if gs.Players[i].Dropped {
  303. continue
  304. }
  305. //检查自己的棋子加上步数后 是否超过或者接近对手的棋子
  306. ret := gs.Players[i].calculatePosition()
  307. if ret >= myPositionCount+10 {
  308. return true
  309. }
  310. }
  311. return false
  312. }
  313. // 计算机器人飞机移动权重
  314. func (gs *GameScene) calcRobotPlaneWeight(chairId, number int) int {
  315. // 初始化变量
  316. tempWeight := -1 // 权重
  317. weightPlaneId := -1 // 权重最高的棋子
  318. planeId := -1
  319. farthest := -1 // 最远的
  320. tookOffCount, leaveCount := gs.Players[chairId].checkTookOffCount()
  321. checkTookOffArea := false
  322. if number == 6 && tookOffCount < 4 && leaveCount == tookOffCount {
  323. //摇到6 并且还有没有起飞的 已经起飞的都离开起飞区域了
  324. checkTookOffArea = gs.checkTookOffArea(chairId)
  325. }
  326. // 获取通道是否打开的信息
  327. openChannel := gs.Players[chairId].OpenChannel
  328. // 获取危险的棋子的编号
  329. unsafePlaneId, farthestPlane := gs.getPriorityPlane(chairId)
  330. for _, v := range gs.Players[chairId].Planes {
  331. if !v.CanMove {
  332. continue
  333. }
  334. id := v.Id
  335. position := v.Position
  336. movePosition := position + number
  337. if openChannel && movePosition == MAX_STEP {
  338. planeId = id
  339. break
  340. }
  341. weight := -1 // 权重
  342. relativePos := (movePosition) % 13 //移动后的相对坐标
  343. //计算距离
  344. safeDistance := (relativePos - 9) % 13
  345. if safeDistance <= (relativePos-14)%13 {
  346. safeDistance = (relativePos - 14) % 13
  347. }
  348. if movePosition == 48 {
  349. //最后一个安全区
  350. weight = 7
  351. } else if id == unsafePlaneId || safeDistance == 0 {
  352. weight = 6
  353. }
  354. if position == 0 && (checkTookOffArea || (tookOffCount == 1 && !openChannel)) {
  355. weight = 5
  356. }
  357. if openChannel {
  358. if movePosition >= LOOP_START {
  359. weight = 9
  360. }
  361. } else {
  362. if position == LOOP_END || movePosition > LOOP_END {
  363. weight = 0
  364. }
  365. }
  366. //判断是否可以攻击
  367. if position != 0 && (weight == -1 || weight == 6) {
  368. total, _, _ := gs.checkPositionIsCrashed(chairId, movePosition, id)
  369. if total == 1 {
  370. weight = 8
  371. }
  372. }
  373. if weight == -1 {
  374. weight = 3
  375. if position == 0 {
  376. weight = 2
  377. }
  378. if weight != 2 {
  379. moveResult := gs.checkPlaneMoveResult(chairId, movePosition) //移动后的结果
  380. if moveResult == 1 {
  381. //如果是可以追击则权重上升
  382. weight++
  383. } else if moveResult == 2 {
  384. if number != 6 {
  385. //超过去有危险
  386. weight = 1
  387. } else if gs.Players[chairId].ContinueSixPoint >= 1 {
  388. //摆脱机会不大 哪怕本次摇出6 接下来再次出6无法移动
  389. weight = 2
  390. if (position-9)%13 == 0 || (position-14)%13 == 0 {
  391. //已经在安全区
  392. weight = 1
  393. }
  394. }
  395. } else {
  396. //最远端的
  397. if id == farthestPlane {
  398. weight = 6
  399. }
  400. }
  401. }
  402. }
  403. if weight > tempWeight || (weight == tempWeight && position > farthest) {
  404. farthest = position
  405. weightPlaneId = id
  406. if weight > tempWeight {
  407. tempWeight = weight
  408. }
  409. }
  410. }
  411. //找到优先级更高的棋子时 根据权重选择
  412. if !isValidPlane(planeId) && isValidPlane(weightPlaneId) {
  413. planeId = weightPlaneId
  414. }
  415. return planeId
  416. }
  417. func (gs *GameScene) addAction(chairId, action, number, planeId int, isRobot bool) (bool, string, bool, int) {
  418. gs.initActionResult()
  419. //是否下一个玩家
  420. var isNextChair = false
  421. var stepCount = 0
  422. //判断数据有效性
  423. if chairId != gs.WhoseTurn {
  424. return false, "wrong turn", isNextChair, stepCount
  425. }
  426. if action == gs.Players[chairId].LastAction {
  427. return false, "wrong action", isNextChair, stepCount
  428. }
  429. //移动飞机
  430. if action == Action_Move {
  431. var isReach = false
  432. if !isValidPlane(planeId) {
  433. planeId = gs.tryMovePlane(chairId, isRobot)
  434. }
  435. ok, movePlaneId, isReach, moveStepCount, oldPosition := gs.Players[chairId].canMovePlane(planeId)
  436. if !ok {
  437. return false, "wrong movement", isNextChair, moveStepCount
  438. }
  439. stepCount = moveStepCount
  440. planeId = movePlaneId
  441. //获胜额外获得一次机会
  442. if !isReach {
  443. // 检测撞机
  444. total, tempCrashed, crashedPlayer := gs.checkPositionIsCrashed(chairId, gs.Players[chairId].Planes[planeId].Position, planeId)
  445. //一个区域如果出现2个棋子,无论是否同玩家 则为安全区 否则则攻击
  446. if total == 1 {
  447. gs.ActionResult.CrashedChairId = crashedPlayer.chairId //被撞击座位
  448. gs.ActionResult.CrashedPlaneId = tempCrashed.Id //被撞击棋子ID
  449. tempCrashed.Position = 0
  450. tempCrashed.CanMove = false
  451. //玩家被踩加一
  452. crashedPlayer.Death++
  453. //踩别人的棋子额外获得一次机会
  454. gs.Players[chairId].Kills++
  455. //打开通道
  456. gs.Players[chairId].OpenChannel = true
  457. //获得徽章
  458. badgeParam := badge.Scope{GameName: GAME_NAME}
  459. go badge.DoAction(gs.Players[chairId].userId, badge.Action_Game_Kill, 1, badgeParam)
  460. }
  461. //没有攻击玩家 并且 点数不是6 或者 6的次数没有超过限制 则到下一个玩家操作
  462. if total != 1 && (gs.Players[chairId].Number != 6 || gs.Players[chairId].ContinueSixPoint > 2) {
  463. isNextChair = true
  464. }
  465. }
  466. gs.ActionResult.PlaneId = planeId
  467. gs.ActionResult.OldPosition = oldPosition
  468. gs.ActionResult.Position = gs.Players[chairId].Planes[planeId].Position
  469. } else {
  470. if !isValidPoint(number) {
  471. return false, "wrong point", isNextChair, stepCount
  472. }
  473. //掷骰子
  474. ok := gs.Players[chairId].setRollNumber(number)
  475. gs.ActionResult.Number = number
  476. if ok {
  477. if !gs.Players[chairId].isCanMove() {
  478. isNextChair = true
  479. } else {
  480. gs.LastTurn = gs.WhoseTurn
  481. }
  482. //如果通道打开了则判断
  483. if gs.Players[chairId].OpenChannel {
  484. //如果都不移动则判断是否快到终点
  485. gs.Players[chairId].isWillWin()
  486. }
  487. } else {
  488. //如果点数设置失败(6的次数超过限制) 则直接跳过
  489. isNextChair = true
  490. }
  491. }
  492. gs.Players[chairId].LastAction = action
  493. gs.ActionResult.Action = action
  494. if isNextChair {
  495. //重置6次数 要在此处重置 否则会导致到终点后重新计算
  496. gs.Players[chairId].ContinueSixPoint = 0
  497. }
  498. gs.userActions = append(gs.userActions, userAction{ChairId: chairId, Action: action, Number: number, PlaneId: planeId})
  499. return true, "", isNextChair, stepCount
  500. }
  501. // 尝试移动飞机
  502. func (gs *GameScene) tryMovePlane(chairId int, isRobot bool) int {
  503. var planeId int = -1
  504. //判断是否被封禁
  505. openChannel := gs.Players[chairId].OpenChannel
  506. number := gs.Players[chairId].Number
  507. if isRobot {
  508. //机器人计算权重
  509. planeId = gs.calcRobotPlaneWeight(chairId, number)
  510. return planeId
  511. }
  512. //判断前端操作指令是否合理 托管
  513. if gs.Players[chairId].AutoOut {
  514. farthest := -1 //最远的
  515. tempPlaneId := -1 //临时标记
  516. for _, v := range gs.Players[chairId].Planes {
  517. if !v.CanMove {
  518. continue
  519. }
  520. //先出机场中棋子
  521. if v.Position == 0 {
  522. planeId = v.Id
  523. break
  524. }
  525. //其次走最后是距离
  526. if v.Position > farthest {
  527. if !openChannel && (v.Position == LOOP_END || v.Position+number > LOOP_END) {
  528. tempPlaneId = v.Id
  529. } else {
  530. farthest = v.Position
  531. planeId = v.Id
  532. }
  533. }
  534. }
  535. if !isValidPlane(planeId) {
  536. planeId = tempPlaneId
  537. }
  538. }
  539. return planeId
  540. }
  541. func (gs *GameScene) initActionResult() {
  542. gs.ActionResult = ActionResult{Action: -1, Number: -1, PlaneId: -1, OldPosition: -1, Position: -1, CrashedChairId: -1, CrashedPlaneId: -1}
  543. }
  544. func (gs *GameScene) getValidUserCount() int {
  545. ret := 0
  546. for i := 0; i < CHAIR_COUNT; i++ {
  547. if gs.Players[i].IsValid {
  548. ret++
  549. }
  550. }
  551. return ret
  552. }
  553. func (gs *GameScene) getScore(userId int) int {
  554. for i := 0; i < CHAIR_COUNT; i++ {
  555. if gs.Players[i].userId == userId {
  556. return gs.Players[i].Score
  557. }
  558. }
  559. return 0
  560. }
  561. func (gs *GameScene) getScene(chairId int, player bool) string {
  562. d, _ := json.Marshal(gs)
  563. return string(d)
  564. }
  565. // 找到下一个操作者 顺时针操作
  566. func (gs *GameScene) nextChair() {
  567. gs.LastTurn = gs.WhoseTurn
  568. for i := 1; i < CHAIR_COUNT; i++ {
  569. next := (gs.LastTurn + i) % CHAIR_COUNT
  570. if !gs.Players[next].IsValid {
  571. continue
  572. }
  573. if gs.Players[next].Dropped {
  574. continue
  575. }
  576. gs.Players[next].LastAction = Action_Move
  577. gs.WhoseTurn = next
  578. break
  579. }
  580. }
  581. func (gs *GameScene) addWinner(chairId int) (int, bool) {
  582. leftPlayerCount := 0
  583. totalPlayerCount := 0
  584. leftChair := CHAIR_COUNT
  585. for i := 0; i < CHAIR_COUNT; i++ {
  586. if !gs.Players[i].IsValid {
  587. continue
  588. }
  589. totalPlayerCount++
  590. if chairId == i {
  591. continue
  592. }
  593. if gs.Players[i].Dropped {
  594. gs.Players[i].Place = -1
  595. continue
  596. }
  597. leftPlayerCount++
  598. leftChair = i
  599. }
  600. multiple := totalPlayerCount
  601. //4人游戏第一名拿4份 第二名没有奖励
  602. if totalPlayerCount == 4 {
  603. multiple = 4
  604. }
  605. //大家都弃权了 第一名拿全部池子内金币
  606. if leftPlayerCount == 0 {
  607. gs.Players[chairId].Score = gs.pool
  608. gs.Players[chairId].Place = 1
  609. return gs.Players[chairId].Score, true
  610. }
  611. if gs.pool >= gs.base*multiple {
  612. gs.Players[chairId].Score = gs.base * multiple
  613. gs.Players[chairId].Place = 1
  614. } else if gs.pool <= gs.base && totalPlayerCount > 2 {
  615. //池子还有钱并且是4人游戏 则第二名拿剩下的一份
  616. gs.Players[chairId].Score = gs.pool
  617. gs.Players[chairId].Place = 2
  618. }
  619. gs.pool -= gs.Players[chairId].Score
  620. if gs.pool > 0 && leftPlayerCount == 1 {
  621. gs.Players[leftChair].Score = gs.pool
  622. gs.Players[leftChair].Place = 2
  623. gs.pool = 0
  624. }
  625. return gs.Players[chairId].Score, gs.pool == 0
  626. }
  627. // commands
  628. const (
  629. CMD_ROOMINFO = "CMD_ROOMINFO"
  630. CMD_ACTION = "CMD_ACTION"
  631. CMD_TABLECHAT = "CMD_TABLECHAT"
  632. CMD_CANCLE_AUTO = "CMD_CANCLE_AUTO"
  633. CMD_DROP = "CMD_DROP"
  634. )
  635. type CmdAction struct {
  636. Action int
  637. PlaneId int
  638. }
  639. // 广播Drop
  640. type CmdDrop struct {
  641. ChairId int
  642. }