/// <summary> /// 组合完成显示组合完成的图片 /// </summary> /// <param name="data"></param> private void SetEndIamge(TransferData data) { SeatEntity seat = data.GetValue <SeatEntity>("Seat"); ROOM_STATUS roomStatus = data.GetValue <ROOM_STATUS>("RoomStatus"); SetSeatInfo(seat, roomStatus); }
/// <summary> /// 当玩家下注结束后设置分数 /// </summary> /// <param name="data"></param> private void SetBetPour(TransferData data) { SeatEntity seat = data.GetValue <SeatEntity>("Seat"); ROOM_STATUS roomStatus = data.GetValue <ROOM_STATUS>("RoomStatus"); SetBetPourUI(seat, roomStatus); }
public void StartGameRelated(Room currRoom, Seat playerSeat) { ROOM_STATUS roomStart = currRoom.roomStatus; List <Seat> seatList = currRoom.SeatList; Debug.Log("设置开始游戏相关 roomStart: " + roomStart); if (m_StartGame != null) { bool isAllReady = (playerSeat.IsBanker && roomStart == ROOM_STATUS.READY); int playerSum = 0; for (int i = 0; i < seatList.Count; i++) { if (seatList[i].PlayerId > 0) { playerSum++; } if (seatList[i].PlayerId > 0 && seatList[i].seatStatus != SEAT_STATUS.SEAT_STATUS_READY) { isAllReady = false; break; } } if (m_StartGame != null) { m_StartGame.gameObject.SetActive(isAllReady && playerSum >= 2); } } }
private void OnSeatGameInfoChanged(TransferData data) { SeatEntity seat = data.GetValue <SeatEntity>("Seat"); ROOM_STATUS roomStatus = data.GetValue <ROOM_STATUS>("RoomStatus"); SetSeatInfo(seat, roomStatus); }
private void SetPool(SeatEntity seat, ROOM_STATUS roomStatus) { m_betPool.SetActive(roomStatus == ROOM_STATUS.POUR); ClostChip1(); ClostChip2(); ClostChip3(); }
/// <summary> /// 设置头道显示 /// </summary> /// <param name="seat"></param> /// <param name="roomStatus"></param> #if IS_BAODINGQIPAI private void SetPool(SeatEntity seat, ROOM_STATUS roomStatus) { m_betPool1.SetActive(roomStatus == ROOM_STATUS.POUR); m_betTexts[0].text = ""; m_betTexts[1].text = ""; m_betTexts[2].text = ""; }
public void build(byte[] data) { ByteBuffer buf = ByteBuffer.wrap(data); for (int i = 0; i < this.__flag.Length; i++) { this.__flag[i] = buf.get(); } if (this.hasIsSucceed()) { if (buf.get() == 1) { this.isSucceed = true; } else { this.isSucceed = false; } } if (this.hasPos()) { this.pos = buf.getInt(); } if (this.hasStatus()) { this.status = (ROOM_STATUS)buf.get(); } }
private void SetGarbBankerBtn(ROOM_STATUS roomStatus, int isGrabBaker, long roomUnixtime) { m_GrabBanker.SetActive(roomStatus == ROOM_STATUS.GRABBANKER && isGrabBaker == 3); if (isGrabBaker == 3) { OpenInvertedTime(roomUnixtime); //设置时间 } }
/// <summary> /// 抢庄按钮显示 /// </summary> /// <param name="data"></param> private void GarbBankerSceneView(TransferData data) { ROOM_STATUS roomStatus = data.GetValue <ROOM_STATUS>("RoomStatus"); int isGrabBaker = data.GetValue <int>("isGrabBaker"); long roomUnixtime = data.GetValue <long>("Unixtime"); SetGarbBankerBtn(roomStatus, isGrabBaker, roomUnixtime); }
/// <summary> ///通知玩家下注 /// </summary> private void TellBetInfoChanged(TransferData data) { SeatEntity seat = data.GetValue <SeatEntity>("Seat"); ROOM_STATUS roomStatus = data.GetValue <ROOM_STATUS>("RoomStatus"); //SetPourScore(seat,roomStatus); SetPool(seat, roomStatus); SetChipFrame(seat); }
/// <summary> /// 通知翻牌 /// </summary> private void TellIsBankeDraw(TransferData data) { long drawTime = data.GetValue <long>("Time"); bool IsPlayer = data.GetValue <bool>("IsPlayer"); SeatEntity seat = data.GetValue <SeatEntity>("Seat"); ROOM_STATUS roomStatus = data.GetValue <ROOM_STATUS>("RoomStatus"); SetCheckPoker(roomStatus, seat, IsPlayer, drawTime); }
/// <summary> /// 组合牌结束 /// </summary> /// <param name="data"></param> private void GroupEnd(TransferData data) { SeatEntity seat = data.GetValue <SeatEntity>("Seat"); ROOM_STATUS roomStatus = data.GetValue <ROOM_STATUS>("RoomStatus"); bool IsPlayer = data.GetValue <bool>("IsPlayer"); GuPaiJiuSeatCtrl currSeatCrtl = GetSeatCtrlBySeatPos(seat.Index); currSeatCrtl.SeatCtrlGroupEnd(seat, roomStatus); }
/// <summary> /// 设置按钮显隐 /// </summary> /// <param name="seat"></param> /// <param name="roomStatus"></param> private void SetBtn(SeatEntity seat, ROOM_STATUS roomStatus) { m_ButtonReady.gameObject.SetActive(seat.seatStatus == SEAT_STATUS.IDLE); m_btnAlreadyReady.gameObject.SetActive(roomStatus == ROOM_STATUS.READY && seat.seatStatus == SEAT_STATUS.READY); m_ButtonOpening.gameObject.SetActive((roomStatus == ROOM_STATUS.READY || roomStatus == ROOM_STATUS.IDLE) && seat.IsBanker); m_ButtonShare.gameObject.SetActive(roomStatus == ROOM_STATUS.IDLE || roomStatus == ROOM_STATUS.READY); if (!SystemProxy.Instance.IsInstallWeChat) { m_ButtonShare.gameObject.SetActive(false); } }
private void OnSeatGameInfoChanged(TransferData data) { SeatEntity seat = data.GetValue <SeatEntity>("Seat"); bool isPlayer = data.GetValue <bool>("IsPlayer"); ROOM_STATUS roomStatus = data.GetValue <ROOM_STATUS>("RoomStatus"); if (isPlayer) { SetBtn(seat, roomStatus); } }
private void OnSeatInfoChanged(TransferData data) { SeatEntity seat = data.GetValue <SeatEntity>("Seat"); ROOM_STATUS roomStatus = data.GetValue <ROOM_STATUS>("RoomStatus"); SetSeatInfo(seat, roomStatus); if (roomStatus == ROOM_STATUS.GRABBANKER) { OnSetQiangGarbBankerImage(data); } }
public void SetSeatInfo(SeatEntity seat, ROOM_STATUS roomStatus) { if (!gameObject.activeSelf && seat.PlayerId != 0) { m_PlayerInfo.SetGold(seat); } gameObject.SetActive(seat.PlayerId != 0); m_PlayerInfo.SetUI(seat); m_Ready.gameObject.SetActive(seat.isReady && seat.seatStatus == SEAT_STATUS.IDLE); }
/// <summary> /// 每局结算,清空发牌挂载点和房间挂载点 /// </summary> private void LoopCloseDeal(TransferData data)//SeatEntity seat,bool IsPlayer { SeatEntity seat = data.GetValue <SeatEntity>("Seat"); RoomEntity room = data.GetValue <RoomEntity>("Room"); ROOM_STATUS roomStatus = data.GetValue <ROOM_STATUS>("RoomStatus"); bool IsPlayer = data.GetValue <bool>("IsPlayer"); CloseDealTran(); if (IsPlayer) { ModelDispatcher.Instance.Dispatch(ConstantGuPaiJiu.CloseRoomPokerTran);//清空房间挂载点 } }
public void build(byte[] data) { ByteBuffer buf = ByteBuffer.wrap(data); for (int i = 0; i < this.__flag.Length; i++) { this.__flag[i] = buf.get(); } if (this.hasSettingId()) { this.settingId = buf.getInt(); } if (this.hasRoomId()) { this.roomId = buf.getInt(); } if (this.hasLoop()) { this.loop = buf.getInt(); } if (this.hasMaxLoop()) { this.maxLoop = buf.getInt(); } if (this.hasOwnerId()) { this.ownerId = buf.getInt(); } if (this.hasSeatinfo()) { int size = buf.getShort(); for (int i = 0; i < size; i++) { byte[] bytes = new byte[buf.getInt()]; buf.get(ref bytes, 0, bytes.Length); this.seatinfo.Add(SEAT_INFO.decode(bytes)); } } if (this.hasRoomStatus()) { this.room_status = (ROOM_STATUS)buf.get(); } }
private void SetCheckPoker(ROOM_STATUS roomStatus, SeatEntity seat, bool IsPlayer, long drawTime) { if (roomStatus == ROOM_STATUS.CHECK) { #if IS_CHUANTONGPAIJIU if (IsPlayer) { m_BtnOpen.SetActive(seat.IsBanker); } #endif OpenPokerTimeImage.gameObject.SetActive(true); OpenInvertedTime(drawTime); } }
IEnumerator SetCtrlJieSuanTor(SeatEntity seat, ROOM_STATUS roomStatus) { if ((seat.seatStatus == SEAT_STATUS.SETTLE || seat.seatStatus == SEAT_STATUS.GROUPDONE || seat.isCuoPai == 1) && roomStatus != ROOM_STATUS.IDLE) { isShowType = true; } if (pokerList.Count != 0) { pokerList.Clear(); } for (int i = 0; i < seat.pokerList.Count; i++) { pokerList.Add(seat.pokerList[i].Type); if (m_nSeatIndex != 0) { CloseHandContainer(m_HandContainer[i]); } if (m_nSeatIndex != 0) { LoadPoker(seat.Index, seat.pokerList[i].Type, m_HandContainer[i], i, false, true, seat); } if (i == 1) { if (m_nSeatIndex != 0) { ConfirmPoker(pokerList); } if (seat.PlayerId != 0) { string MusicName = string.Format("gp_{0}_{1}", pokerType1, seat.Gender); AudioEffectManager.Instance.Play(MusicName, Vector3.zero); } yield return(new WaitForSeconds(1f)); } else if (i == 3) { if (m_nSeatIndex != 0) { ConfirmPoker(pokerList); } if (seat.PlayerId != 0) { string MusicName = string.Format("gp_{0}_{1}", pokerType2, seat.Gender); AudioEffectManager.Instance.Play(MusicName, Vector3.zero); } } } // ConfirmPoker(pokerList); }
private void SetBetPourUI(SeatEntity seat, ROOM_STATUS roomStatus) { if (m_nSeatIndex == seat.Index) { if (m_betPoolGuo != null) { m_betPoolGuo.SetActive(false); } if (m_betPool != null) { m_betPool.gameObject.SetActive(false); } if (m_betPool1 != null) { if (m_betPool1 != null) { m_betPool1.SetActive(false); } } if (seat.IsBanker) { //if (m_betPoolGuo != null) m_betPoolGuo.SetActive(roomStatus == ROOM_STATUS.POUR || roomStatus == ROOM_STATUS.DEAL || roomStatus == ROOM_STATUS.GROUPPOKER || roomStatus == ROOM_STATUS.CHECK|| roomStatus == ROOM_STATUS.SETTLE); if (m_betPoolGuo != null) { m_betPoolGuo.SetActive(seat.firstPour != 0); } if (m_betPourGuoText != null) { m_betPourGuoText.text = seat.firstPour.ToString(); } } else { #if IS_BAODINGQIPAI if (m_betPool1 != null) { m_betPool1.SetActive((roomStatus == ROOM_STATUS.POUR && seat.seatStatus == SEAT_STATUS.WAITDEAL) || roomStatus == ROOM_STATUS.DEAL || roomStatus == ROOM_STATUS.GROUPPOKER || roomStatus == ROOM_STATUS.CHECK || roomStatus == ROOM_STATUS.CUOPAI); //&& !m_betPool.gameObject.activeSelf } #else if (m_betPool != null) { m_betPool.gameObject.SetActive((roomStatus == ROOM_STATUS.POUR && seat.seatStatus == SEAT_STATUS.WAITDEAL) || roomStatus == ROOM_STATUS.DEAL || roomStatus == ROOM_STATUS.GROUPPOKER || roomStatus == ROOM_STATUS.CHECK); //&& !m_betPool.gameObject.activeSelf } #endif SetBetPour(seat.firstPour, seat.secondPour, seat.threePour); } } }
private void OnSeatInfoChanged(TransferData data) { SeatEntity seat = data.GetValue <SeatEntity>("Seat"); bool isPlayer = data.GetValue <bool>("IsPlayer"); RoomEntity room = data.GetValue <RoomEntity>("Room"); ROOM_STATUS roomStatus = data.GetValue <ROOM_STATUS>("RoomStatus"); if (roomStatus == ROOM_STATUS.GRABBANKER) { if (isPlayer) { SetGarbBankerBtn(roomStatus, seat.isGrabBanker, room.roomUnixtime); } } }
/// <summary> /// 正常游戏中改变座位信息 /// </summary> /// <param name="data"></param> private void OnSeatGameInfoChanged(TransferData data) { SeatEntity seat = data.GetValue <SeatEntity>("Seat"); RoomEntity room = data.GetValue <RoomEntity>("Room"); ROOM_STATUS roomStatus = data.GetValue <ROOM_STATUS>("RoomStatus"); bool IsPlayer = data.GetValue <bool>("IsPlayer"); if (m_nSeatIndex == seat.Index) { if (roomStatus == ROOM_STATUS.READY)//当房间处于空闲,清空庄下面的发牌挂载点和房间挂载点 { // LoopCloseDeal(seat,IsPlayer); } } }
private void OnSeatInfoChanged(TransferData data) { SeatEntity seat = data.GetValue <SeatEntity>("Seat"); bool isPlayer = data.GetValue <bool>("IsPlayer"); RoomEntity room = data.GetValue <RoomEntity>("Room"); ROOM_STATUS roomStatus = data.GetValue <ROOM_STATUS>("RoomStatus"); if (roomStatus == ROOM_STATUS.CHECK) { if (isPlayer) { SetCheckPoker(roomStatus, seat, isPlayer, room.roomUnixtime); } } }
/// <summary> /// 下注完成,设置下注分数 /// </summary> /// <param name="data"></param> private void SetPourPool(TransferData data) { SeatEntity seat = data.GetValue <SeatEntity>("Seat"); bool IsPlayer = data.GetValue <bool>("IsPlayer"); ROOM_STATUS roomStatus = data.GetValue <ROOM_STATUS>("RoomStatus"); if (seat.IsBanker) { ZhuangScore = seat.firstPour; } if (IsPlayer) { SetPourScore(seat, roomStatus); } }
public void build(byte[] data) { ByteBuffer buf = ByteBuffer.wrap(data); for (int i = 0; i < this.__flag.Length; i++) { this.__flag[i] = buf.get(); } if (this.hasPlayerId()) { this.playerId = buf.getInt(); } if (this.hasPos()) { this.pos = buf.getInt(); } if (this.hasNickname()) { byte[] bytes = new byte[buf.getShort()]; buf.get(ref bytes, 0, bytes.Length); this.nickname = System.Text.Encoding.UTF8.GetString(bytes); } if (this.hasAvatar()) { byte[] bytes = new byte[buf.getShort()]; buf.get(ref bytes, 0, bytes.Length); this.avatar = System.Text.Encoding.UTF8.GetString(bytes); } if (this.hasGender()) { this.gender = buf.get(); } if (this.hasGold()) { this.gold = buf.getInt(); } if (this.hasStatus()) { this.status = (ROOM_STATUS)buf.get(); } }
/// <summary> /// 房间信息变更 /// </summary> /// <param name="obj"></param> private void OnSeatInfoChanged(TransferData data) { SeatEntity seat = data.GetValue<SeatEntity>("SeatEntity"); ROOM_STATUS roomStatus = data.GetValue<ROOM_STATUS>("RoomStatus"); bool isPlayer = data.GetValue<bool>("IsPlayer"); if (isPlayer) { m_btnShiSanZhangViewStartGame.gameObject.SetActive(roomStatus == ROOM_STATUS.ROOM_STATUS_IDLE && seat.Pos == 1); m_btnReayShiSanZhangView.gameObject.SetActive(seat.seatStatus == SEAT_STATUS.SEAT_STATUS_IDLE); m_ButtonShare.gameObject.SetActive(roomStatus == ROOM_STATUS.ROOM_STATUS_IDLE); if (!SystemProxy.Instance.IsInstallWeChat) { m_ButtonShare.gameObject.SetActive(false); } } }
/// <summary> /// 开始切牌(选择切牌顿数) /// </summary> /// <param name="data"></param> private void StartCutPoker(TransferData data) { bool IsPlayer = data.GetValue <bool>("IsPlayer"); if (m_CutPokerObj) { m_CutPokerObj.SetActive(false); } if (IsPlayer) { isSendNoCutPoker = false; isSendCutPoker = true; RoomEntity room = data.GetValue <RoomEntity>("Room"); curRoomStatus = room.roomStatus; isPlayCutPokerAni = true; } }
public void IsCutGuoRelated(Room currRoom, Seat playerSeat) { ROOM_STATUS roomStatus = currRoom.roomStatus; //在一局打了n把之后可切锅 在结算阶段 未操作时显示 #if IS_ZHANGJIAKOU if (m_CutGuoItem != null) { m_CutGuoItem.gameObject.SetActive(playerSeat.IsBanker && playerSeat.isCutGuo == 3 && roomStatus == ROOM_STATUS.SETTLE && currRoom.dealTime >= 4); } #elif IS_PAIJIU if (m_CutGuoItem != null) { m_CutGuoItem.gameObject.SetActive(playerSeat.IsBanker && playerSeat.isCutGuo == 3 && roomStatus == ROOM_STATUS.SETTLE && currRoom.dealTime >= 3); } #endif }
private void SetSeatInfo(SeatEntity seat, ROOM_STATUS roomStatus) { if (m_Index == seat.Index) { m_SeatPos = seat.Pos; if (seat.PlayerId == 0) { gameObject.SetActive(false); } else { gameObject.SetActive(true); } m_PlayerInfo.SetUI(seat); m_imgReady.gameObject.SetActive(seat.seatStatus == SEAT_STATUS.SEAT_STATUS_READY && roomStatus == ROOM_STATUS.ROOM_STATUS_IDLE); } }