コード例 #1
0
    /// <summary>
    /// 服务器广播每次结算
    /// </summary>
    /// <param name="obj"></param>
    private void OnServerBroadcastSettle(byte[] obj)
    {
        GP_ROOM_SETTLE proto = GP_ROOM_SETTLE.decode(obj);

        RoomGuPaiJiuProxy.Instance.SettleProxy(proto);
    }
コード例 #2
0
    /// <summary>
    /// 每次结算
    /// </summary>
    internal void SettleProxy(GP_ROOM_SETTLE proto)
    {
        CurrentRoom.roomStatus = ROOM_STATUS.SETTLE;
        //if (CurrentRoom.roomPokerList.Count != 0) CurrentRoom.roomPokerList.Clear();
        List <SeatEntity> seatList  = new List <SeatEntity>();
        List <SeatEntity> seatList1 = new List <SeatEntity>();
        TransferData      data      = new TransferData();

        for (int i = 0; i < proto.room.seatListCount(); i++)
        {
            GP_SEAT    op_seat = proto.room.getSeatList(i);
            SeatEntity seat    = GetSeatBySeatId(proto.room.getSeatList(i).pos);
            if (seat.pokerList.Count != 0)
            {
                seat.pokerList.Clear();
            }
            seat.seatStatus = SEAT_STATUS.SETTLE;
            if (seat.drawPokerList != null)
            {
                seat.drawPokerList.Clear();//清空是否翻牌集合
            }
            seat.isCuoPai   = 0;
            seat.firstPour  = 0;
            seat.secondPour = 0;
            seat.threePour  = 0;
            seat.Gold      += proto.room.getSeatList(i).earnings;
            seat.eamings    = proto.room.getSeatList(i).earnings;
            if (seat.IsBanker)
            {
                seat.firstPour = op_seat.getPourList(0);
            }
            for (int j = 0; j < op_seat.pokerListCount(); ++j)
            {
                GP_POKER protoPoker = op_seat.getPokerList(j);
                seat.pokerList.Add(new Poker()
                {
                    Index = protoPoker.index, //索引
                    Type  = protoPoker.type,  //花色
                    Size  = protoPoker.size,  //大小
                });
                CurrentRoom.roomPokerList.Add(new Poker()
                {
                    Index = protoPoker.index, //索引
                    Type  = protoPoker.type,  //花色
                    Size  = protoPoker.size,  //大小
                });
            }
            seatList.Add(seat);
            data.SetValue("Room", CurrentRoom);
            data.SetValue("RoomStatus", CurrentRoom.roomStatus);
            data.SetValue("Seat", seat);
            data.SetValue("PlayerSeat", PlayerSeat);
            data.SetValue("IsPlayer", seat == PlayerSeat);
#if IS_CHUANTONGPAIJIU
            if (seat != PlayerSeat)
            {
                SendNotification(ConstantGuPaiJiu.GroupEnd, data);      //实例化其他人的牌
            }
            SendNotification(ConstantGuPaiJiu.OnGuPaiSetBetPour, data); //重新设置庄家下注分数
            SendNotification(ConstantGuPaiJiu.SetSeatGold, data);       //设置玩家的金币
#endif

            SendNotification(ConstantGuPaiJiu.EndIamge, data);//隐藏组合完成的图片
        }
        data.SetValue("SeatList", seatList);
#if IS_BAODINGQIPAI
        SendNotification(ConstantGuPaiJiu.GroupEndJieSuan, data);
#endif
        SendNotification(ConstantGuPaiJiu.CloseDrawPoker, data);  //关闭翻牌倒计时和全开按钮
#if IS_CHUANTONGPAIJIU
        SendNotification(ConstantGuPaiJiu.LoadSmallResult, data); //小结算界面
        SendNotification(ConstantGuPaiJiu.PlayMusic, data);       //播放音乐
#endif
    }