/// <summary> /// 服务器广播选庄 /// </summary> private void OnServerChooseBanker(byte[] obj) { AppDebug.Log("服务器广播选庄"); PAIGOW_ROOM_CHOOSEBANKER proto = PAIGOW_ROOM_CHOOSEBANKER.decode(obj); RoomPaiJiuProxy.Instance.OnServerChooseBanker(proto); if (PaiJiuSceneCtrl.Instance != null) { PaiJiuSceneCtrl.Instance.ChooseBanker(); } }
public void OnServerChooseBanker(PAIGOW_ROOM_CHOOSEBANKER proto) { AppDebug.Log(string.Format("通知选庄 座位号:{0}", proto.pos)); for (int i = 0; i < CurrentRoom.SeatList.Count; i++) { if (CurrentRoom.SeatList[i] != null && CurrentRoom.SeatList[i].IsBanker) { CurrentRoom.SeatList[i].IsBanker = false; } } Seat seat = GetSeatBySeatId(proto.pos); if (proto.hasIsBanker()) { //说明选庄成功 CurrentRoom.roomStatus = ROOM_STATUS.IDLE; BankerSeat = seat; seat.IsBanker = true; CurrentRoom.ChooseBankerSeat = null; } else { //否则就是通知谁在选庄 BankerSeat = null; CurrentRoom.roomStatus = ROOM_STATUS.CHOOSEBANKER; CurrentRoom.ChooseBankerSeat = seat; //设置由谁选庄 UIScenePaiJiuView } for (int i = 0; i < CurrentRoom.SeatList.Count; i++) { if (CurrentRoom.SeatList[i].PlayerId > 0) { //显示庄 TransferData data = new TransferData(); data.SetValue("seat", CurrentRoom.SeatList[i]); ModelDispatcher.Instance.Dispatch(ConstDefine_PaiJiu.ObKey_SetBankerAni, data); } } SendRoomInfoChangeNotify(); }