コード例 #1
0
 public void SetValue(PKClubRoomInfo info)
 {
     InfoData             = info;
     RoomidLable.text     = info.codeId.ToString();
     RoundCountLable.text = info.playerCount + "人/" + info.gameCount + "局/" + info.playType;
     for (int i = 0; i < info.PKClubPlayerInfoList.Count; i++)
     {
         PlayreHeadList[i].gameObject.SetActive(true);
         DownloadImage.Instance.Download(PlayreHeadList[i], info.PKClubPlayerInfoList[i].HeadId);
     }
     if (info.playerCount == info.PKClubPlayerInfoList.Count)
     {
         IsPlaying = true;
         //游戏正在进行中
     }
 }
コード例 #2
0
    /// <summary>
    /// 俱乐部的房间列表返回
    /// </summary>
    /// <param name="obj"></param>
    private void onClubRoomListBack(NetworkMessage message)
    {
        //   message.writeInt32(room_list.Count);
        //   foreach (XYGQiPaiRoom item in room_list.Values)
        //   {
        //       message.writeUInt32(item.codeId);//房间id
        //       message.writeUInt8((byte)item.playType);//玩法类型,普通、包牌
        //       message.writeUInt32(item.getRoomConfig().playerCount);//玩家人数
        //       message.writeUInt32(item.getRoomConfig().gameCount);//局数
        //       message.writeBool(item.getRoomConfig().wuZhaTp);//无炸摊牌
        //       message.writeBool(item.getRoomConfig().faWangTp);//罚王摊牌
        //       message.writeInt32(item.getRoomConfig().jiangMa.Count);//奖码数
        //       foreach (var sub_item in item.getRoomConfig().jiangMa)
        //       {
        //           message.writeUInt32(sub_item);//奖码
        //       }
        //       message.writeString(create_player.name);//开房人名称
        //       message.writeUInt64(create_player.guid);//开房人guid
        //(//如果改玩家不存在则会返回以下数据
        //    message.writeString("无该人物数据");//开房人名称
        //       message.writeUInt64(0);//开房人guid )
        //   }
        //message.writeInt32(item.sitPlayerDict.Count);//在座玩家个数
        //foreach (var player_item in item.sitPlayerDict.Values)
        //{
        //    message.writeUInt8((byte)player_item.position);//玩家位置
        //    message.writeUInt64(player_item.guid);//玩家的guid
        //    message.writeString(player_item.playerBase.otherName);//玩家昵称
        //    message.writeString(player_item.playerBase.headId);//玩家头像


        int count = message.readInt32();

        GameData.PKClubRoomList = new List <PKClubRoomInfo>();
        for (int i = 0; i < count; i++)
        {
            PKClubRoomInfo info = new PKClubRoomInfo();
            info.codeId      = message.readUInt32(); //房间id
            info.playType    = message.readUInt8();  //玩法类型,普通、包牌
            info.playerCount = message.readUInt32(); //玩家人数
            info.gameCount   = message.readUInt32(); //局数
            info.wuZhaTp     = message.readBool();   //无炸摊牌
            info.faWangTp    = message.readBool();
            info.BaWang      = message.readBool();   //是否八王
            int count1 = message.readInt32();        //开奖数
            info.JiangMa = new List <uint>();
            for (int j = 0; j < count1; j++)
            {
                info.JiangMa.Add(message.readUInt32());
            }
            info.create_playername = message.readString();
            info.create_playerguid = message.readUInt64();

            int playerCount = message.readInt32();
            info.PKClubPlayerInfoList = new List <PKClubPlayerInfo>();
            for (int j = 0; j < playerCount; j++)
            {
                PKClubPlayerInfo pkinfo = new PKClubPlayerInfo();
                pkinfo.pos       = message.readUInt8();  //玩家位置
                pkinfo.Guid      = message.readUInt64(); //玩家的guid
                pkinfo.OtherName = message.readString(); //玩家昵称
                pkinfo.HeadId    = message.readString(); //玩家头像

                info.PKClubPlayerInfoList.Add(pkinfo);
            }

            GameData.PKClubRoomList.Add(info);
        }
        ;
        DzViewMain.Instance.CreatClubRoomList();
        // DzViewMain.Instance.CreatClubRoomList();
    }