Esempio n. 1
0
    /// <summary>
    /// 服务器广播游戏结束
    /// </summary>
    private void OnServerBroadcastGameOver(byte[] obj)
    {
        GP_ROOM_GAMEOVER proto = GP_ROOM_GAMEOVER.decode(obj);

        if (!proto.hasRoom())
        {
            ExitGame();
            return;
        }
        UIViewUtil.Instance.LoadWindowAsync(UIWindowType.GuPaiJiuResult, (GameObject go) =>
        {
            m_UIGuPaiJiuResultView = go.GetComponent <UIGuPaiJiuResultView>();
            m_UIGuPaiJiuResultView.SetUI(proto);
            m_GuPaiJiuResult = null;
        });
    }
Esempio n. 2
0
    /// <summary>
    /// 正常游戏下设置排行
    /// </summary>
    /// <param name="proto"></param>
    public void SetUI(GP_ROOM_GAMEOVER proto)
    {
        seatList = new List <SeatEntity>();
        for (int i = 0; i < proto.room.seatListCount(); i++)
        {
            GP_SEAT op_seat = proto.room.getSeatList(i);
            if (op_seat.playerId == 0)
            {
                continue;
            }
            SeatEntity seat = new SeatEntity();
            seat.PlayerId  = op_seat.playerId; //玩家ID
            seat.Nickname  = op_seat.nickname; //玩家名字
            seat.Pos       = op_seat.pos;
            seat.Avatar    = op_seat.avatar;   //玩家头像
            seat.Gender    = op_seat.gender;   //玩家性别
            seat.Gold      = op_seat.gold;     //底分
            seat.Pos       = op_seat.pos;      //座位位置
            seat.pokerList = new List <Poker>();
            for (int j = 0; j < op_seat.maxPokerListCount(); j++)
            {
                GP_POKER op_Poker = op_seat.getMaxPokerList(j);
                seat.pokerList.Add(new Poker()
                {
                    Index = op_Poker.index, //索引
                    Type  = op_Poker.type,  //花色
                    Size  = op_Poker.size,  //大小
                });
            }
            seatList.Add(seat);
        }
        SeatSort(seatList);
#if IS_CHUANTONGPAIJIU
        LoadRanking(seatList);
#else
        SetResult(seatList);
#endif
    }