Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

576 wiersze
21 KiB

  1. local ZPDef = ZPFramework.ZPImport("zp_base.luaScript.ZPDef")
  2. local ZPFuc = ZPFramework.ZPImport("zp_base.luaScript.ZPFunctions")
  3. local ZPSound = ZPFramework.ZPImport("zp_base.luaScript.ZPSound")
  4. local ZPMessage = ZPFramework.ZPImport("zp_base.luaScript.Protocol.ZPMessage")
  5. local ZPRoomPlayerView=ZPFramework.ZPImport("zp_base.luaScript.Views.Room.ZPRoomPlayerView")
  6. local ZPRoomToolView=ZPFramework.ZPImport("zp_base.luaScript.Views.Room.ZPRoomToolView")
  7. local ZPRoomXiaoJuChaPaiView=ZPFramework.ZPImport("zp_base.luaScript.Views.Room.ZPRoomXiaoJuChaPaiView")
  8. local ZPRoomXiaoJuView=ZPFramework.ZPImport("zp_base.luaScript.Views.Room.ZPRoomXiaoJuView")
  9. local ZPRoomOperationView=ZPFramework.ZPImport("zp_base.luaScript.Views.Room.ZPRoomOperationView")
  10. local ZPRoomCard=ZPFramework.ZPImport("zp_base.luaScript.Views.Room.ZPRoomCard")
  11. local ZPRoomCountAllView=ZPFramework.ZPImport("zp_base.luaScript.Views.Room.ZPRoomCountAllView")
  12. local ZPRoomPiaoFenView=ZPFramework.ZPImport("zp_base.luaScript.Views.Room.ZPRoomPiaoFenView")
  13. local ZPRoomSettingView=ZPFramework.ZPImport("zp_base.luaScript.Views.Room.ZPRoomSettingView")
  14. local ZPRoomQuickStartView=ZPFramework.ZPImport("zp_base.luaScript.Views.Room.ZPRoomQuickStartView")
  15. local ZPWanFa=ZPFramework.ImportWanFa("luaScript.SubGameDefine.ZiPai.ZPWanFa")
  16. local ZPRoomView = ZPFramework.ZPFrameworkClassImprot("zp_base.luaScript.Views.Room.ZPRoomView")
  17. local hejiangRoomView = class("hejiangRoomView", ZPRoomView)
  18. function hejiangRoomView:ctor()
  19. hejiangRoomView.super.ctor(self)
  20. end
  21. function hejiangRoomView:onEnter()
  22. hejiangRoomView.super.onEnter(self)
  23. end
  24. function hejiangRoomView:setTableImg(idx)
  25. local name = string.format("zp_hejiang/res/ui/zy_fangjian/bg/hj_fangjian_di_%d.jpg",idx)
  26. --桌布
  27. self.ui.Items.ImageView_bg:loadTexture(name)
  28. --[[ if idx == 1 or idx == 4 then
  29. self.ui.Items.Text_JuShu:setColor(cc.c3b(109,69,32))
  30. elseif idx == 2 or idx == 3 then
  31. self.ui.Items.Text_JuShu:setColor(cc.c3b(9,74,49))
  32. end--]]
  33. self:initLogo(idx);
  34. local cacheGameBgPic = "gameBgPicture"..(ZPDef.GameID or app.gameId)
  35. saveUserInfo(cacheGameBgPic,idx)
  36. end
  37. ---
  38. -- 初始化房间水印
  39. -- @return
  40. --
  41. --[[function hejiangRoomView:initLogo(idx)
  42. local config = getSubGameConfig(ZPDef.GameID or app.gameId) or {}
  43. local logoName = config.logo or string.format("zp_hejiang/res/ui/zy_fangjian/bg/hj_fangjian_watermark_%d.png", idx)
  44. self.ui.Items.ImageView_Logo:loadTexture(logoName)
  45. if config.isShowLogo == false then
  46. self.ui.Items.ImageView_Logo:setVisible(false)
  47. end
  48. end--]]
  49. --更新房间基础数据
  50. function hejiangRoomView:updateRoomBaseData()
  51. --初始化背景
  52. local ZiPaigameBgPicture = "gameBgPicture"..(ZPDef.GameID or app.gameId)
  53. local idx2 = tonumber(loadUserInfo(ZiPaigameBgPicture)) or 1
  54. self:setTableImg(idx2)
  55. local roomInfo = app.room.roomInfo;
  56. -- 房间号
  57. self.ui.Items.Text_roomNum:setText(tostring(roomInfo.nShowTableId));
  58. --局数
  59. self:updateGameNums()
  60. --房间玩法
  61. --local ruleAll = ZPFuc.getRuleInfo();
  62. --self.toolView.ui.Items.Text_Rule:setText(ruleAll)
  63. self:setRoomInfo()
  64. self:onUserReadyResponse()
  65. for i = 1,ZPDef.GameMaxPlayer do
  66. self.PlayerView:updatePlayerInfo(i)
  67. end
  68. -- 是否显示邀请好友
  69. self:setWetChatVisible(table.nums(app.room.roomInfo.memberList) < ZPFuc.getCreateRoomPlayerNum())
  70. self.toolView:showFastStart(true)
  71. if isReviewVersion() then
  72. self:setWetChatVisible(false);
  73. end
  74. -- 更新玩家手牌列表时,按需显示
  75. if app.room.roomInfo.nGameStartCount > 0 then
  76. self:setWetChatVisible(false)
  77. end
  78. if app.room.roomInfo.nGameStartCount == 0 then
  79. self.ui.Items.Button_tipai:setVisible(false)
  80. end
  81. end
  82. function hejiangRoomView:showDelayTimeTip(operations)
  83. if operations then
  84. for k,v in pairs(operations) do
  85. local viewId = app.room:getViewIdByUserId(v.nUserId)
  86. local isVisible = v.isCanOpereate == 1
  87. self.PlayerView:showArrowByViewId(viewId,isVisible,tonumber(v.time))
  88. end
  89. end
  90. end
  91. function hejiangRoomView:onGameReconnection()
  92. --logE("ZiPai当前版本号:"..ZPFuc.getZPCurVersion())
  93. --更新房间基础数据
  94. self:updateRoomBaseData()
  95. local roomInfo = app.room.roomInfo;
  96. --[[self:updateAllGpsInfo()
  97. self:checkGpsDistance(nil,roomInfo.nGameStartCount==0)
  98. self:checkMyGpsNeedUpdate();--]]
  99. --断线重连
  100. if roomInfo.nGameStartCount > 0 then
  101. local function runOnGameReconnection(onEnd)
  102. local roomInfo = app.room.roomInfo;
  103. --显示庄家
  104. self:updateBanker()
  105. self:showOwner()
  106. local myUserID = app.room:getMyRecordUserId()
  107. --解散状态
  108. local isDismiss = false
  109. local uid = 0
  110. for k,v in pairs(roomInfo.arrayTableInfo) do
  111. local viewId = app.room:getViewIdByUserId(k)
  112. local nOffLineState = v.nOnlineStatus
  113. --显示离线
  114. self.PlayerView:setPlayerOffLine(nOffLineState ~= 1,viewId)
  115. local viewId = app.room:getViewIdByUserId(k)
  116. --记录玩家解散状态 0:初始状态, 1:发起解散 2: 同意解散 3:不同意解散
  117. app.room.dismissInfo[k] = v.nDisbandStatus;
  118. --有人发起解散时才显示解散界面
  119. if v.nDisbandStatus == 1 then
  120. isDismiss = true
  121. uid = k
  122. end
  123. end
  124. self.PlayerView:setXiaoJiaFlagVis(true)
  125. --有人发起解散时才显示解散界面
  126. if isDismiss then
  127. app.room.roomInfo.nDismissStateTime = roomInfo.nDismissStateTime;
  128. app.room.roomInfo.nDismissToTalTime = roomInfo.nDismissToTalTime;
  129. local view = require("luaScript.Views.Room.RoomDismissView"):new(uid,app.room.roomInfo.memberList,roomInfo.nDismissStateTime)
  130. view:setAnchorPoint(cc.p(0.5, 0.5));
  131. app:showWaitDialog(view);
  132. end
  133. --如果一局结束,玩家点了准备,不再显示牌信息
  134. if ZPDef.ReconnectState.GAME_STATUS_ROUND_OVER == roomInfo.nStatus and roomInfo.memberList[myUserID].nPlayerFlag == 1
  135. or ZPDef.ReconnectState.GAME_STATUS_GAME_OVER == roomInfo.nStatus and roomInfo.memberList[myUserID].nPlayerFlag == 1
  136. then --游戏为停止或开始状态
  137. self:onUserReadyResponse()
  138. self.ui.Items.Button_tipai:setVisible(false)
  139. if onEnd then
  140. onEnd()
  141. end
  142. return
  143. end
  144. for k,v in pairs(roomInfo.tuoGuanInfo or {}) do
  145. local aiStatus = v.aiStatus;
  146. local nUserID = v.nUserID;
  147. local viewId = app.room:getViewIdByUserId(nUserID)
  148. local isTuoGuan = aiStatus == 1;
  149. if viewId == self:getMeViewId() then
  150. if isTuoGuan then
  151. self:showTuoGuan(true)
  152. self.isTuoGuan = true
  153. else
  154. self:showTuoGuan(false)
  155. self.isTuoGuan = false
  156. end
  157. end
  158. self.PlayerView:showTuoGuanByViewId(viewId,isTuoGuan)
  159. end
  160. --胡牌类型
  161. local huType = ZPDef.ReconnectHuType.NO_HU
  162. --状态显示
  163. if ZPDef.ReconnectState.GAME_STATUS_ROUND_OVER == roomInfo.nStatus
  164. or ZPDef.ReconnectState.GAME_STATUS_GAME_OVER == roomInfo.nStatus then --游戏为停止或开始状态
  165. self.ui.Items.Button_tipai:setVisible(false)
  166. --显示小局结算亮牌画布
  167. self:setLiangPaiVisible(true)
  168. --显示底牌
  169. self.xiaojuChaPaiView:showDiPai()
  170. --亮手牌
  171. huType = self.xiaojuChaPaiView:liangShouPai(true)
  172. local function nextCallBackFun()
  173. self:resetGameData()
  174. end
  175. self.xiaojuView = ZPRoomXiaoJuView:new(nextCallBackFun,true)
  176. self:addChild(self.xiaojuView)
  177. --播放黄庄动画
  178. if roomInfo.stopFlag == ZPDef.XiaoJuEndType.STOP_FLAG_HUANG_ZHUANG then
  179. self.xiaojuChaPaiView:PlayHuangZhuangAni(false)
  180. end
  181. self.xiaojuView:setVisible(false)
  182. self:setBtnSitDownVisible(false)
  183. end
  184. local diPaiMax = table.nums(roomInfo.dipaiList)
  185. for k,v in pairs(roomInfo.arrayTableInfo) do
  186. local viewId = app.room:getViewIdByUserId(k)
  187. local nScore = v.nTotalMoney or 0
  188. --玩家分数
  189. self.PlayerView:setPlayerScore(viewId,nScore)
  190. --扎鸟
  191. self.PlayerView:setPlayerPiaoFen(viewId,v.nZhaBirdScore)
  192. --恢复手牌
  193. if k == myUserID then
  194. self:createCard(false,myUserID,nil)
  195. end
  196. --恢复爆牌动画
  197. if v.nBaoPaiStatus == 2 and not (ZPDef.ReconnectState.GAME_STATUS_ROUND_OVER == roomInfo.nStatus
  198. or ZPDef.ReconnectState.GAME_STATUS_GAME_OVER == roomInfo.nStatus) then
  199. self.PlayerView:playBaoAnim(viewId)
  200. end
  201. local hushu = 0
  202. --恢复组合牌
  203. for key,value in pairsByKeys(v.tableWeaveCard) do
  204. local list,operationType = ZPFuc.getZPCardList(value.card,value.type)
  205. local isShow = true
  206. local card = value.opcard
  207. hushu = hushu + value.hushu
  208. --记录真实数据
  209. --过滤:碰胡和偎胡,坎提胡,坎跑胡 的组合牌不显示,这些组合牌在self:liangShouPai()里后面插回手里
  210. if ZPDef.ReconnectState.GAME_STATUS_ROUND_OVER == roomInfo.nStatus
  211. or ZPDef.ReconnectState.GAME_STATUS_GAME_OVER == roomInfo.nStatus then
  212. if roomInfo.stopFlag == ZPDef.XiaoJuEndType.STOP_FLAG_NORMAL then
  213. local nUserId = roomInfo.winUserId
  214. local viewId = app.room:getViewIdByUserId(nUserId)
  215. local huCard = roomInfo.huCard
  216. --不等于赢家的ID,组合牌就全部显示,赢家的需要判断
  217. if nUserId == k then
  218. if huType == ZPDef.ReconnectHuType.WEI_HU and operationType == ZPDef.OpType.OP_TYPE_MINGWEI and huCard == card then
  219. isShow = false
  220. elseif huType == ZPDef.ReconnectHuType.WEI_HU and operationType == ZPDef.OpType.OP_TYPE_ANWEI and huCard == card then
  221. isShow = false
  222. elseif huType == ZPDef.ReconnectHuType.PENG_HU and operationType == ZPDef.OpType.OP_TYPE_PENG and huCard == card then
  223. isShow = false
  224. elseif huType == ZPDef.ReconnectHuType.KAN_TI_HU and operationType == ZPDef.OpType.OP_TYPE_TI and huCard == card then
  225. isShow = false
  226. elseif huType == ZPDef.ReconnectHuType.KAN_PAO_HU and operationType == ZPDef.OpType.OP_TYPE_PAO and huCard == card then
  227. isShow = false
  228. end
  229. end
  230. end
  231. end
  232. --对于要显示的牌,除了一些普通的牌需要展示外,特殊的有:偎提胡,偎跑胡,碰跑胡,这个时候,组合牌还是显示偎,偎,跑的原先模样
  233. if isShow then
  234. if ZPDef.ReconnectState.GAME_STATUS_ROUND_OVER == roomInfo.nStatus
  235. or ZPDef.ReconnectState.GAME_STATUS_GAME_OVER == roomInfo.nStatus then
  236. if roomInfo.stopFlag == ZPDef.XiaoJuEndType.STOP_FLAG_NORMAL or
  237. roomInfo.stopFlag == ZPDef.XiaoJuEndType.STOP_FLAG_HU_DIRTY then
  238. local nUserId = roomInfo.winUserId
  239. local viewId = app.room:getViewIdByUserId(nUserId)
  240. --如果赢的是当前的人组合牌需要稍微处理下
  241. if nUserId == k then
  242. local huCard = roomInfo.huCard
  243. if operationType == ZPDef.OpType.OP_TYPE_TI and huCard == card and huType == ZPDef.ReconnectHuType.WEI_TI_HU then
  244. --偎提胡(结算亮一张偎牌,这里处理为明偎)
  245. operationType = ZPDef.OpType.OP_TYPE_MINGWEI
  246. elseif operationType == ZPDef.OpType.OP_TYPE_PAO and huCard == card and huType == ZPDef.ReconnectHuType.PENG_PAO_HU then
  247. --碰跑胡
  248. operationType = ZPDef.OpType.OP_TYPE_PENG
  249. elseif operationType == ZPDef.OpType.OP_TYPE_PAO and huCard == card and huType == ZPDef.ReconnectHuType.WEI_PAO_HU then
  250. --偎跑胡(结算亮一张偎牌,这里处理为明偎)
  251. operationType = ZPDef.OpType.OP_TYPE_MINGWEI
  252. end
  253. end
  254. end
  255. end
  256. list = ZPFuc.getOpCardFirstList(operationType,list,card)
  257. --上面吃或不吃不要用if else因为还可能都不成立
  258. local isMoPaiOrId = value.seatId
  259. self:recontactDoOperation(operationType,viewId,list,card,isMoPaiOrId)
  260. end
  261. end
  262. self.tableHuXiList[viewId] = hushu
  263. self.PlayerView:setPlayerHuXi(viewId,hushu)
  264. --self.PlayerView:setPlayerHuXi("油:"..tostring(hushu))
  265. end
  266. self:getLocalHuShu()
  267. for i = 1, 4 do
  268. local tt = self.qiPaiList[i]
  269. end
  270. local function showReconectDelayTip()
  271. for k,v in pairs(app.room.roomInfo.delayPlayer) do
  272. local operations = {}
  273. local viewId = app.room:getViewIdByUserId(v.uid)
  274. operations[viewId] = {}
  275. operations[viewId].nUserId = v.uid
  276. operations[viewId].time = v.DelayOptTime
  277. operations[viewId].isCanOpereate = v.DelayOptTime > 0 and 1 or 0
  278. self:showDelayTimeTip(operations)
  279. end
  280. end
  281. --恢复弃牌
  282. for k,v in pairs(roomInfo.arrayTableInfo) do
  283. local viewId = app.room:getViewIdByUserId(v.nUserId)
  284. local qiList = self.qiPaiList[viewId]
  285. for key,value in pairs(v.desertedArea) do
  286. local card = value.card
  287. local maxQi = table.nums(qiList)
  288. if maxQi > 0 then
  289. --染色弃牌
  290. local isInQiList = false
  291. for qiK,qiCard in pairs(qiList) do
  292. if qiCard == value.card then
  293. --染色弃牌
  294. self:playQiPaiAni(false,value.card,viewId,nil,true)
  295. isInQiList = true
  296. qiList[qiK] = nil
  297. break
  298. end
  299. end
  300. if not isInQiList then
  301. self:playQiPaiAni(false,value.card,viewId,nil,false)
  302. end
  303. else
  304. --普通弃牌
  305. self:playQiPaiAni(false,value.card,viewId,nil,false)
  306. end
  307. end
  308. end
  309. --听牌显示
  310. local max = table.nums(app.room.roomInfo.tingCards)
  311. if max > 0 then
  312. self:setTingCardViewVisible(true,app.room.roomInfo.tingCards)
  313. end
  314. --显示玩家剩余手牌
  315. if app.room.roomInfo.offLineInfo and next(app.room.roomInfo.offLineInfo) ~= nil then
  316. for i,v in pairs(app.room.roomInfo.offLineInfo) do
  317. if v.extInfo then
  318. local extIf = json.decode(v.extInfo)
  319. if extIf.LeftCard and v.nUserId then
  320. local viewId = app.room:getViewIdByUserId(v.nUserId)
  321. self.PlayerView:setLeftCardNum(viewId,true,tonumber(extIf.LeftCard))
  322. end
  323. end
  324. end
  325. end
  326. --状态显示
  327. if ZPDef.ReconnectState.GAME_STATUS_ROUND_OVER == roomInfo.nStatus
  328. or ZPDef.ReconnectState.GAME_STATUS_GAME_OVER == roomInfo.nStatus then --游戏为停止或开始状态
  329. self.PlayerView:hideLeftCard()
  330. --所有的暗偎默认亮起一张
  331. self:showLastAnWeiPai()
  332. --点炮显示
  333. self:showPaoImage()
  334. for hi,hv in pairs(app.room.roomInfo.hupaiInfo) do
  335. if hv.huPaiUid > -1 then
  336. local winerViewId = app.room:getViewIdByUserId(hv.huPaiUid)
  337. app.room.roomInfo.huType = hv.huTypes
  338. self:playHuEffect(winerViewId,nil,true)
  339. --self:setLayoutScoreTipVisible(true,playerList,false,nil,true)
  340. end
  341. end
  342. elseif ZPDef.ReconnectState.GAME_STATUS_WAIT_OP_TIAN_HU == roomInfo.nStatus
  343. or ZPDef.ReconnectState.GAME_STATUS_WAIT_OP_AFTER_TURN_OVER == roomInfo.nStatus
  344. or ZPDef.ReconnectState.GAME_STATUS_WAIT_OP_AFTER_OUTCARD == roomInfo.nStatus then -- 天胡,翻牌后等待玩家操作中,出牌后等待玩家操作中
  345. local nSeatId = roomInfo.showCardSeatId
  346. local nCard = roomInfo.showCard
  347. local operateCode = roomInfo.mainOpCode
  348. local viewId = app.room:getViewIdBySeatId(nSeatId)
  349. local nUserId = app.room:getUserIdBySeatId(nSeatId)
  350. --记录真实数据
  351. self.outCard = nCard
  352. self.EatOperationCode = operateCode
  353. self.moPaiViewId = viewId
  354. --显示剩余牌
  355. self:setCircleCardLeftPanelView(true,viewId,diPaiMax)
  356. if ZPDef.ReconnectState.GAME_STATUS_WAIT_OP_TIAN_HU == roomInfo.nStatus then
  357. --标记天胡
  358. self.isTianHu = true
  359. if viewId == self:getMeViewId() then
  360. self:showOpeation(ZPDef.OpCode.OP_HU,viewId)
  361. end
  362. elseif ZPDef.ReconnectState.GAME_STATUS_WAIT_OP_AFTER_OUTCARD == roomInfo.nStatus then
  363. --是否已经操作过 0表示没有,非0表示已经提交了操作
  364. if operateCode ~= ZPDef.OpCode.OP_CANCEL and roomInfo.isSubmitOp == 0 then
  365. self:showOpeation(operateCode)
  366. self:setOutCardVisible(true,viewId,nCard,false,nil,true)
  367. elseif roomInfo.isSubmitOp == 1 or roomInfo.isSubmitOp == 0 then
  368. self:setOutCardVisible(true,viewId,nCard,false,nil,true)
  369. --playVoiceCardValue(nCard,nUserId)
  370. elseif roomInfo.isSubmitOp == 2 then --比牌不显示出牌或者摸牌
  371. self.operationView:touchEatOneCardCallBack(true)
  372. end
  373. elseif ZPDef.ReconnectState.GAME_STATUS_WAIT_OP_AFTER_TURN_OVER == roomInfo.nStatus then
  374. if roomInfo.isSubmitOp == 1 then
  375. operateCode = 0
  376. self:playMoPaiAni(diPaiMax,nCard,viewId,operateCode,roomInfo.showCardFlag,nil,true)
  377. elseif roomInfo.isSubmitOp == 0 then
  378. self:playMoPaiAni(diPaiMax,nCard,viewId,operateCode,roomInfo.showCardFlag,nil,true)
  379. elseif roomInfo.isSubmitOp == 2 then --比牌不显示出牌或者摸牌
  380. self.operationView:touchEatOneCardCallBack(true)
  381. end
  382. end
  383. showReconectDelayTip()
  384. elseif ZPDef.ReconnectState.GAME_STATUS_WAIT_OUT_CARDS == roomInfo.nStatus then --等待玩家出牌中
  385. --显示底牌
  386. local viewId = app.room:getViewIdBySeatId(roomInfo.showCardSeatId)
  387. --显示剩余牌
  388. self:setCircleCardLeftPanelView(true,viewId,diPaiMax)
  389. if viewId == self:getMeViewId() then
  390. self:setGuideView(true)
  391. self.bOutCard = true
  392. end
  393. showReconectDelayTip()
  394. elseif ZPDef.ReconnectState.GAME_STATUS_AUTO_DISCSRD == roomInfo.nStatus then --玩家自动弃牌中
  395. local nSeatId = roomInfo.showCardSeatId
  396. local nCard = roomInfo.disCard
  397. local viewId = app.room:getViewIdBySeatId(nSeatId)
  398. --显示剩余牌
  399. self:setCircleCardLeftPanelView(true,viewId,diPaiMax)
  400. --弃牌
  401. self:playQiPaiAni(true,nCard,viewId,nil)
  402. elseif ZPDef.ReconnectState.GAME_STATUS_WAIT_OP_BAO == roomInfo.nStatus then --等待玩家爆牌中
  403. --爆牌中
  404. local viewId = app.room:getViewIdBySeatId(roomInfo.showCardSeatId)
  405. self:setCircleCardLeftPanelView(true,viewId,diPaiMax)
  406. for k,v in pairs(roomInfo.arrayTableInfo) do
  407. local viewId = app.room:getViewIdByUserId(k)
  408. --等待爆牌状态
  409. if v.nBaoPaiStatus == 1 and k == app.user.loginInfo.uid then
  410. self.operationView:showBaoPaiOpView(true)
  411. end
  412. end
  413. showReconectDelayTip()
  414. end
  415. if onEnd then
  416. onEnd()
  417. end
  418. end
  419. log("2000000000-ZPRoomView - self:addCallBack(runOnGameReconnection)" )
  420. self:addCallBack(runOnGameReconnection)
  421. else
  422. --未开局正常坐下这里会进来
  423. for k,v in pairs(roomInfo.memberList) do
  424. local viewId = app.room:getViewIdByUserId(k)
  425. local nOffLineState = v.nOnlineStatus or 1
  426. --显示离线
  427. self.PlayerView:setPlayerOffLine(nOffLineState ~= 1,viewId)
  428. end
  429. --未开局重连坐下
  430. for k,v in pairs(roomInfo.arrayTableInfo) do
  431. local viewId = app.room:getViewIdByUserId(k)
  432. local nOffLineState = v.nOnlineStatus
  433. --显示离线
  434. self.PlayerView:setPlayerOffLine(nOffLineState ~= 1,viewId)
  435. end
  436. end
  437. end
  438. function hejiangRoomView:resetGameData()
  439. logE("===========重置游戏数据===============")
  440. self.handCardRoot = {}
  441. self:setOutCardLineVisible(false)
  442. self:setWetChatVisible(false)
  443. self:setBtnSitDownVisible(false)
  444. self:setOutCardVisible(false)
  445. self:setOperatorPanelView(false)
  446. self:setGuideView(false)
  447. self:setHandTempCardVisible(false)
  448. self:setCircleCardLeftPanelView(false)
  449. self:setLiangPaiVisible(false)
  450. self:setTingCardViewVisible(false)
  451. self:setDingPiaoVisible(false)
  452. self:setLayoutScoreTipVisible(false)
  453. if self.PlayerView then
  454. self.PlayerView:setReadyStateVisible(false)
  455. self.PlayerView:setBankerVisible()
  456. self.PlayerView:setOperatorTipVisible(false)
  457. self.PlayerView:setAllClockVisible(false)
  458. self.PlayerView:hideLeftCard()
  459. self.PlayerView:setArrowStateVisible()
  460. end
  461. --隐藏工具界面 详情
  462. if self.toolView.ui.Items.ImageView_Rule_bg then
  463. self.toolView.ui.Items.ImageView_Rule_bg:setVisible(false)
  464. end
  465. --隐藏操作吃界面
  466. self.operationView:setAllEatView(false)
  467. --操作码
  468. self.operationLocalCode = 0
  469. self.isMoPaiOperator = false
  470. self.isGameOver = false
  471. self.isTianHu = false
  472. self.isGodHand = false
  473. --听牌重置
  474. self.isNoCardTingPai = false
  475. self.tingCardLocal = {}
  476. self.tableHuXiList = {}
  477. --弃牌
  478. self.qiPaiList = {}
  479. --发牌器
  480. self.ui.Items.ImageView_card_bg:removeAllChildren()
  481. self.fapaiqiLeftCard = nil
  482. self.ui.Items.TextBMFont_leftCardNum:setText("0")
  483. --庄家爆牌标志
  484. self.bankerBaoPao = nil
  485. --移除所有的牌局
  486. self.ui.Items.LayoutMain_4:removeAllChildren()
  487. self.ui.Items.Layout_Player_HuEffect:removeAllChildren()
  488. self:clearXJChaPaiView()
  489. for i = 1, ZPDef.GameMaxPlayer do
  490. local giveupName = string.format("Layout_giveUp_%d",i)
  491. local weaveCardName = string.format("Layout_player1Table_%d",i)
  492. --移除胡牌的时候点炮
  493. local outCardImgName = string.format("ImageView_outCardLight_%d",i)
  494. --重置开招次数
  495. self.playerZhao[i] = 0
  496. --弃牌数组
  497. self.qiPaiList[i] = {}
  498. self.ui.Items[weaveCardName]:removeAllChildren()
  499. self.ui.Items[giveupName]:removeAllChildren()
  500. self.ui.Items[outCardImgName]:removeAllChildren()
  501. end
  502. self.PlayerView:setHuXizero()
  503. if self.xiaojuView then
  504. self.xiaojuView:removeFromParent()
  505. self.xiaojuView = nil
  506. end
  507. if self.xiaojuChaPaiView then
  508. self.xiaojuChaPaiView:setVisible(false)
  509. end
  510. --停止一些动画
  511. self.ui:stopAllActions()
  512. end
  513. return hejiangRoomView