Exemple #1
0
        void OnGetValue(string json, int status)
        {
            AvtivityHistore_.Clear();
            FestivalAvtivityHistoreContent data = new FestivalAvtivityHistoreContent();

            data = JsonBase.DeserializeFromJson <FestivalAvtivityHistoreContent>(json.ToString());
            if (data.avtivityHistoreContent[0].status != 1)
            {
                Debug.LogError("获取网页json数据状态错误,status:" + data.avtivityHistoreContent[0].status);
                return;
            }
            for (int i = 0; i < data.avtivityHistoreContent.Count; i++)
            {
                for (int j = 0; j < data.avtivityHistoreContent[i].data.Count; j++)
                {
                    AvtivityHistoreContent content = new AvtivityHistoreContent();
                    content.tim       = data.avtivityHistoreContent[i].data[j].tim;
                    content.awardType = data.avtivityHistoreContent[i].data[j].awardType;
                    content.awardNum  = data.avtivityHistoreContent[i].data[j].awardNum;
                    AvtivityHistore_.Add(content);
                }
            }
            SaveHistory = AvtivityHistore_.Count;
            OnShowWinPanel();
        }
        /// <summary>
        /// 获取已开放县城的信息
        /// </summary>
        /// <param name="json"></param>
        public void GetCountyMessage(string json, int status)
        {
            anhui.MahjongCommonMethod             mcm  = anhui.MahjongCommonMethod.Instance;
            SelectAreaPanelData.CountyMessageData data = new SelectAreaPanelData.CountyMessageData();
            data = JsonBase.DeserializeFromJson <SelectAreaPanelData.CountyMessageData>(json.ToString());
            if (data.CountyData[0].status != 1)
            {
                Debug.LogError("获取已开放县城的信息错误,status:" + data.CountyData[0].status);
                return;
            }

            //保存获取的城市信息
            for (int i = 0; i < data.CountyData.Count; i++)
            {
                for (int j = 0; j < data.CountyData[i].data.Count; j++)
                {
                    int countyId = System.Convert.ToInt32(data.CountyData[i].data[j].countyId);
                    if (mcm._dicDisConfig.ContainsKey(countyId))
                    {
                        mcm._dicDisConfig[countyId].VALID = System.Convert.ToInt32(data.CountyData[i].data[j].flag);
                    }
                }
            }

            //为方法id赋值
            for (int i = 0; i < mcm._districtConfig.Count; i++)
            {
                if (mcm._districtConfig[i].COUNTY_ID == GameData.Instance.SelectAreaPanelData.iCountyId && mcm._districtConfig[i].VALID == 2)
                {
                    string[] id = mcm._districtConfig[i].METHOD.Split('_');
                    for (int k = 0; k < id.Length; k++)
                    {
                        int ID = System.Convert.ToInt16(id[k]);
                        if (ID != 0)
                        {
                            Debug.LogWarning("获取已开放县城的信息");
                            mcm.lsMethodId.Add(ID);
                        }
                    }
                }
            }

            GameData gd = GameData.Instance;
            GamePlayingMethodPanelData gpmpd = gd.GamePlayingMethodPanelData;

            gpmpd.PanelShow = true;
            //gpmpd.GameIndex = 1; //默认打开第一个
            SystemMgr.Instance.GamePlayingMethodSystem.UpdateShow();
        }
Exemple #3
0
        public void GetGrade_Round(string json, int status)
        {
            Grade_RoundData_.Clear();
            Grade_RoundMessageData data = new Grade_RoundMessageData();

            data = JsonBase.DeserializeFromJson <Grade_RoundMessageData>(json.ToString());
            if (data.RoundMessageData[0].status != 1)
            {
                Debug.LogError("获取网页json数据状态错误,status:" + data.RoundMessageData[0].status);
                return;
            }
            //将数据保存到list中
            for (int i = 0; i < data.RoundMessageData.Count; i++)
            {
                for (int j = 0; j < data.RoundMessageData[i].data.Count; j++)
                {
                    if (Convert.ToInt32(GradeRoom.disType) != 5 && String.Equals(GradeRoom.disTime, data.RoundMessageData[i].data[j].endTim))
                    {
                        continue;
                    }
                    Grade_RoundData grade = new Grade_RoundData();
                    grade.gameNum        = data.RoundMessageData[i].data[j].gameNum;
                    grade.playing_method = data.RoundMessageData[i].data[j].playing_method;
                    grade.dealer         = data.RoundMessageData[i].data[j].dealer;
                    grade.point[0]       = data.RoundMessageData[i].data[j].point1;
                    grade.point[1]       = data.RoundMessageData[i].data[j].point2;
                    grade.point[2]       = data.RoundMessageData[i].data[j].point3;
                    grade.point[3]       = data.RoundMessageData[i].data[j].point4;
                    grade.nickName[0]    = data.RoundMessageData[i].data[j].nick1;
                    grade.nickName[1]    = data.RoundMessageData[i].data[j].nick2;
                    grade.nickName[2]    = data.RoundMessageData[i].data[j].nick3;
                    grade.nickName[3]    = data.RoundMessageData[i].data[j].nick4;
                    grade.headUrl[0]     = data.RoundMessageData[i].data[j].head1;
                    grade.headUrl[1]     = data.RoundMessageData[i].data[j].head2;
                    grade.headUrl[2]     = data.RoundMessageData[i].data[j].head3;
                    grade.headUrl[3]     = data.RoundMessageData[i].data[j].head4;
                    grade.selfDrawnSeat  = data.RoundMessageData[i].data[j].selfDrawnSeat;
                    grade.shootSeat      = data.RoundMessageData[i].data[j].shootSeat;
                    grade.endTime        = MahjongCommonMethod.Instance.UnixTimeStampToDateTime(Convert.ToDouble(data.RoundMessageData[i].data[j].endTim), 0);
                    grade.replayCode     = String.Format("{0:0000000}", data.RoundMessageData[i].data[j].replayCode);
                    Grade_RoundData_.Add(grade);
                }
            }

            // Debug.LogWarning ("开始产生对应的战绩预置体");
            SpwanHistroyGrade_Round();
        }
Exemple #4
0
        /// <summary>
        /// 获取大厅登录公告内容
        /// </summary>
        /// <param name="json"></param>
        public void GetBulletinData(string json, int status)
        {
            //Debug.LogError("登录公告信息内容:" + json);

            BulletinContentData.Clear();
            lsBulletinContent data = new lsBulletinContent();

            data = JsonBase.DeserializeFromJson <lsBulletinContent>(json.ToString());
            if (data.LoginBulletinData[0].status != 1)
            {
                Debug.LogError("获取网页json数据状态错误,status:" + data.LoginBulletinData[0].status);
                return;
            }

            //表示没有公告,直接显示登陆界面
            if (data.LoginBulletinData[0].data.Count == 0 || SDKManager.Instance.IOSCheckStaus == 1)
            {
                bg.SetActive(false);
                GameData gd = GameData.Instance;
                gd.WXLoginPanelData.isPanelShow = true;
                SystemMgr.Instance.WXLoginSystem.UpdateShow();
                // SDKManager.Instance.iUserId_iAuthType_ServerType = MahjongCommonMethod .Instance .iUserid + LobbyContants.SeverType;//赋值
                if (PlayerPrefs.HasKey(SDKManager.Instance.iUserId_iAuthType_ServerType) && Network.NetworkMgr.Instance.LobbyServer.Connected)
                {
                    SDKManager.Instance.gameObject.GetComponent <CameControler>().PostMsg("loading");//加载loading画面---认证回应
                    GameData.Instance.PlayerNodeDef.isSencondTime = 2;
                    //判断是否过期
                    Debug.LogError("玩家认证类型:===================1");
                    SDKManager.Instance.GetRefreshToken(PlayerPrefs.GetString(SDKManager.Instance.szrefresh_token));
                }
                return;
            }

            for (int i = 0; i < data.LoginBulletinData.Count; i++)
            {
                for (int j = 0; j < data.LoginBulletinData[i].data.Count; j++)
                {
                    BulletinContent content = new BulletinContent();
                    content.title   = data.LoginBulletinData[i].data[j].title;
                    content.content = "\t" + data.LoginBulletinData[i].data[j].content;
                    BulletinContentData.Add(content);
                }
            }

            ShowBulletin();
        }
Exemple #5
0
        /// <summary>
        /// 获取玩家的下级推广员的数量
        /// </summary>
        /// <param name="json"></param>
        /// <returns></returns>
        public void GetProductCount(string json, int status)
        {
            int          count = 0;
            ProductData_ data  = new ProductData_();

            data = JsonBase.DeserializeFromJson <ProductData_>(json.ToString());

            if (data.Product[0].status == 1)
            {
                count = data.Product[0].sp_num;
                //Debug.LogError("count:" + data.Product[0].sp_num);
            }

            if (count > 0 && PlayerPrefs.GetFloat(Guide.Promote.ToString()) == 0)
            {
                OpenIndexGuide(Guide.Promote);
            }
        }
Exemple #6
0
        /// <summary>
        /// 获取已开放城市的信息
        /// </summary>
        /// <param name="json"></param>
        public void GetCityMessage(string json, int status)
        {
            listCityMessage.Clear();
            CityMessageData data = new CityMessageData();

            data = JsonBase.DeserializeFromJson <CityMessageData>(json.ToString());
            if (data.CityData[0].status != 1)
            {
                Debug.LogError("获取网页json数据状态错误,status:" + data.CityData[0].status);
                return;
            }


            ParlorShowPanelData pspd = GameData.Instance.ParlorShowPanelData;

            //保存获取的城市信息
            for (int i = 0; i < data.CityData.Count; i++)
            {
                for (int j = 0; j < data.CityData[i].data.Count; j++)
                {
                    CityMessage message = new CityMessage();
                    message.cityId   = data.CityData[i].data[j].cityId;
                    message.cityName = data.CityData[i].data[j].cityName;
                    message.flag     = data.CityData[i].data[j].flag;
                    listCityMessage.Add(message);
                    if (System.Convert.ToInt16(message.flag) == 2)
                    {
                        pspd.listCityMessage.Add(message);
                    }
                }
            }
            //获取城市信息成功
            isGetCitySuccess = true;

            if (isGetCountySuccess)
            {
                //改变地图大小
                UIMainView.Instance.SelectAreaPanel.ChangeScale();
            }
        }
        /// <summary>
        /// 获取已开放城市的信息
        /// </summary>
        /// <param name="json"></param>
        public void GetCityMessage(string json, int status)
        {
            anhui.MahjongCommonMethod           mcm  = anhui.MahjongCommonMethod.Instance;
            SelectAreaPanelData.CityMessageData data = new SelectAreaPanelData.CityMessageData();
            data = JsonBase.DeserializeFromJson <SelectAreaPanelData.CityMessageData>(json.ToString());
            if (data.CityData[0].status != 1)
            {
                Debug.LogError("获取网页json数据状态错误,status:" + data.CityData[0].status);
                return;
            }

            //保存获取的城市信息
            for (int i = 0; i < data.CityData.Count; i++)
            {
                for (int j = 0; j < data.CityData[i].data.Count; j++)
                {
                    int cityId = System.Convert.ToInt32(data.CityData[i].data[j].cityId);
                    if (mcm._dicCityConfig.ContainsKey(cityId))
                    {
                        mcm._dicCityConfig[cityId].VALID = System.Convert.ToInt32(data.CityData[i].data[j].flag);
                    }
                }
            }
        }
    void OnGetValue_(string json, int status)
    {
        RPConfigFor15_16_ rpc = new RPConfigFor15_16_();

        rpc = JsonBase.DeserializeFromJson <RPConfigFor15_16_>(json.ToString());

        RPConfigFor15_16 data = new RPConfigFor15_16();

        if (rpc.rp[0].status != 1)
        {
            Debug.LogError("获取网页json数据状态错误,status:" + rpc.rp[0].status + "," + rpc.rp[0].assetNum + "," + rpc.rp[0].assetType);
            return;
        }
        data.status    = rpc.rp[0].status;
        data.assetNum  = rpc.rp[0].assetNum;
        data.assetType = rpc.rp[0].assetType;
        data.type      = rpc.rp[0].type;
        int    Type = Convert.ToInt32(data.assetType);
        int    RpType = -1;
        string str = "", str1 = "";

        switch (Type)
        {
        case 1:
        {
            str    = "现金";
            str1   = "元";
            RpType = 3;
            GameData.Instance.PlayerNodeDef.userDef.da2Asset[0] += Convert.ToInt32(data.assetNum);
        }
        break;

        case 2:
        {
            str    = "话费";
            str1   = "元";
            RpType = 4;
            GameData.Instance.PlayerNodeDef.userDef.da2Asset[1] += Convert.ToInt32(data.assetNum);
        }
        break;

        case 3:
        {
            str    = "流量";
            str1   = "M";
            RpType = 1;
            GameData.Instance.PlayerNodeDef.userDef.da2Asset[2] += Convert.ToInt32(data.assetNum);
        }
        break;

        case 4:
        {
            str    = "储值卡";
            str1   = "元";
            RpType = 2;
            GameData.Instance.PlayerNodeDef.userDef.da2Asset[3] += Convert.ToInt32(data.assetNum);
        }
        break;

        case 5:
        {
            str    = "代金券";
            str1   = "张";
            RpType = 5;
        }
        break;

        case 6:
        {
            str    = "赠币";
            str1   = "个";
            RpType = 0;
            GameData.Instance.PlayerNodeDef.iBindCoin += Convert.ToInt32(data.assetNum);
        }
        break;
        }
        int index = data.type - 1;

        UIMgr.GetInstance().ShowRedPagePanel.OnSetValueAndNotOpenPanel(index, 1, 3 /*表示点击红包的时候不做处理*/, RedPage[index].Name, RedPageShowPanel.NowState.Lobby);

        RPContent rp2 = new RPContent();

        rp2.Image        = UIMainView.Instance.RedPagePanel.RedPage[index].Image;
        rp2.Name         = UIMainView.Instance.RedPagePanel.RedPage[index].Name;
        rp2.ShareNum     = UIMainView.Instance.RedPagePanel.RedPage[index].ShareNum;
        rp2.CanUseNum    = UIMainView.Instance.RedPagePanel.RedPage[index].CanUseNum;
        rp2.GetMoneyNum  = data.assetNum;
        rp2.GetMoneyType = str;
        rp2.isShare      = UIMainView.Instance.RedPagePanel.RedPage[index].isShare;
        rp2.RpNumber     = UIMainView.Instance.RedPagePanel.RedPage[index].RpNumber;
        rp2.Describe     = UIMainView.Instance.RedPagePanel.RedPage[index].Describe;
        UIMainView.Instance.RedPagePanel.RedPage[index] = rp2;
        UIMgr.GetInstance().ShowRedPagePanel.DirectOpenRedPagePanel(data.assetNum, RpType, rp2.Describe);// str, str1, rp2.Name);

        Debug.LogError("领取的红包:" + data.assetNum + str1 + str);
        Debug.LogError("获得资源类型:1现金,2话费,3流量,4储值卡,(5代金券,6赠币没有对应字段)" + Type);

        SystemMgr.Instance.RedPageShowSystem.UpdateShow();

        //获取红包数量
        Messenger_anhui.Broadcast(MainViewLobbyPanel.MESSAGE_REDPAGE);
        UIMainView.Instance.LobbyPanel.BtnRefresh();
    }
        /// <summary>
        /// 获取玩家的回放数据
        /// </summary>
        /// <param name="json"></param>
        /// <param name="status"></param>
        void GetPlayerPlayBackData(string json, int status)
        {
            PlayBackData        pbd  = GameData.Instance.PlayBackData;
            PlayBackMessageData data = new PlayBackMessageData();

            data = JsonBase.DeserializeFromJson <PlayBackMessageData>(json.ToString());
            if (data.lsPlayBackMessageData[0].status != 1)
            {
                Debug.LogError("获取网页json数据状态错误,status:" + data.lsPlayBackMessageData[0].status);
                UIMgr.GetInstance().GetUIMessageView().Show("您的回放数据版本过低,无法查看!");
                return;
            }

            //将数据保存到list中
            for (int i = 0; i < data.lsPlayBackMessageData.Count; i++)
            {
                //庄家座位号赋值
                pbd.byDealerSeat = Convert.ToInt32(data.lsPlayBackMessageData[i].dealer);

                //昵称赋值
                pbd.sName[0] = data.lsPlayBackMessageData[i].nick1;
                pbd.sName[1] = data.lsPlayBackMessageData[i].nick2;
                pbd.sName[2] = data.lsPlayBackMessageData[i].nick3;
                pbd.sName[3] = data.lsPlayBackMessageData[i].nick4;

                //头像赋值
                pbd.sHeadUrl[0] = data.lsPlayBackMessageData[i].head1;
                pbd.sHeadUrl[1] = data.lsPlayBackMessageData[i].head2;
                pbd.sHeadUrl[2] = data.lsPlayBackMessageData[i].head3;
                pbd.sHeadUrl[3] = data.lsPlayBackMessageData[i].head4;

                //性别赋值
                pbd.sex[0] = Convert.ToInt32(data.lsPlayBackMessageData[i].sex1);
                pbd.sex[1] = Convert.ToInt32(data.lsPlayBackMessageData[i].sex2);
                pbd.sex[2] = Convert.ToInt32(data.lsPlayBackMessageData[i].sex3);
                pbd.sex[3] = Convert.ToInt32(data.lsPlayBackMessageData[i].sex4);

                //玩家id赋值
                pbd.iUserId[0] = Convert.ToInt32(data.lsPlayBackMessageData[i].uid1);
                pbd.iUserId[1] = Convert.ToInt32(data.lsPlayBackMessageData[i].uid2);
                pbd.iUserId[2] = Convert.ToInt32(data.lsPlayBackMessageData[i].uid3);
                pbd.iUserId[3] = Convert.ToInt32(data.lsPlayBackMessageData[i].uid4);

                //添加房间号,玩法id
                pbd.sRoomId         = String.Format("{0:000000}", data.lsPlayBackMessageData[i].roomNum);
                pbd.iMethodId       = Convert.ToInt16(data.lsPlayBackMessageData[i].playing_method);
                pbd.iCurrentGameNum = data.lsPlayBackMessageData[i].roomProgress;

                //  Debug.LogError("玩家的第一视角座位号:" + Convert.ToInt32(data.lsPlayBackMessageData[i].seatIndex));

                pbd.ShowSeatNum = Convert.ToInt32(data.lsPlayBackMessageData[i].seatIndex) + 1;

                //改变第一视角的座位号
                for (int j = 0; j < pbd.iUserId.Length; j++)
                {
                    if (GameData.Instance.PlayerNodeDef.iUserId == pbd.iUserId[j])
                    {
                        pbd.ShowSeatNum = j + 1;
                    }
                }

                //确定玩家的操作步数
                pbd.iAllDealNum = data.lsPlayBackMessageData[i].replay.Split(',').Length;

                //解析版本号
                pbd.iPlayBackVersion = Convert.ToInt32(data.lsPlayBackMessageData[i].replay.Split('>')[0]);
                if (pbd.iPlayBackVersion < pbd.iPbVersion_Old)
                {
                    UIMgr.GetInstance().GetUIMessageView().Show("您的回放数据版本过低,无法查看!");
                    SDKManager.Instance.gameObject.GetComponent <anhui.CameControler>().PostMsg("uloading");
                    return;
                }

                //解析玩法配置回应消息(直接调用的消息结构体,后面有补位“0”)
                string message = data.lsPlayBackMessageData[i].replay.Split('>')[1] + "000000";
                int    ioffset = 0;


                //如果是版本2则,读取最新的消息
                if (pbd.iPlayBackVersion == pbd.iPbVersion_New)
                {
                    MahjongGame_AH.Network.Message.NetMsg.ClientPlayingMethodConfRes msg = new MahjongGame_AH.Network.Message.NetMsg.ClientPlayingMethodConfRes();
                    ioffset = msg.parseBytes(pbd.GetByteToString(message, 48), ioffset);
                    pbd.playingMethodConf = msg.playingMethodConf;


                    //解析玩家的初试分数
                    string[] sPoint = data.lsPlayBackMessageData[i].replay.Split('>')[2].Split(',');
                    for (int k = 0; k < 4; k++)
                    {
                        pbd.iPoint[k]     = Convert.ToInt16(sPoint[k]);
                        pbd.iPointInit[k] = Convert.ToInt16(sPoint[k]);
                    }
                    //解析回放数据
                    pbd.sPlayBackMessageData = new string[pbd.iAllDealNum];
                    pbd.sPlayBackMessageData = data.lsPlayBackMessageData[i].replay.Split('>')[3].Split(',');
                }
                //如果是版本1,则读取上个版本的消息
                else if (pbd.iPlayBackVersion == pbd.iPbVersion_Old)
                {
                    MahjongGame_AH.Network.Message.NetMsg.ClientPlayingMethodConfRes_2 msg = new MahjongGame_AH.Network.Message.NetMsg.ClientPlayingMethodConfRes_2();
                    ioffset = msg.parseBytes(pbd.GetByteToString(message, 20), ioffset);
                    pbd.playingMethodConf_2 = msg.playingMethodConf;
                    //解析回放数据
                    pbd.sPlayBackMessageData = new string[pbd.iAllDealNum];
                    pbd.sPlayBackMessageData = data.lsPlayBackMessageData[i].replay.Split('>')[3].Split(',');
                }

                //解析玩法参数
                string[] str = data.lsPlayBackMessageData[i].param.Split(',');
                for (int j = 0; j < str.Length; j++)
                {
                    pbd.iPlayMethodParam[j] = Convert.ToUInt32(str[j]);
                }

                //Debug.LogError("回放数据:" + data.lsPlayBackMessageData[i].replay);

                //开放参数赋值
                if (!data.lsPlayBackMessageData[i].param.Contains(","))
                {
                    //跳转场景
                    anhui.MahjongCommonMethod.Instance.SkipPlayBack_();
                    //pbd.OpenPlayBackScene();
                    //UnityEngine.SceneManagement.SceneManager.LoadScene("GradePlayBack", UnityEngine.SceneManagement.LoadSceneMode.Additive);
                    //Application.LoadLevelAdditiveAsync("GradePlayBack");
                    return;
                }

                string[] param = data.lsPlayBackMessageData[i].param.Split(',');
                for (int k = 0; k < param.Length; k++)
                {
                    pbd.iOpenRoomParam[i] = Convert.ToUInt32(param[k]);
                }
            }

            //跳转场景
            anhui.MahjongCommonMethod.Instance.SkipPlayBack_();
            //pbd.OpenPlayBackScene();
            //UnityEngine.SceneManagement.SceneManager.LoadScene("GradePlayBack", UnityEngine.SceneManagement.LoadSceneMode.Additive);
            //Application.LoadLevelAdditiveAsync("GradePlayBack");
        }
        /// <summary>
        /// 解析网页获取的json数据
        /// </summary>
        /// <param name="json"></param>
        public void GetMessageData(string json, int status)
        {
            GradeMessage.Clear();
            HistroyGradeMessageData data = new HistroyGradeMessageData();

            data = JsonBase.DeserializeFromJson <HistroyGradeMessageData>(json.ToString());
            //Debug.LogError("+++++++++++++++战绩+++++++++++"+json.ToString());
            if (data.HistoryMessageData[0].status != 1)
            {
                Debug.LogError("获取网页json数据状态错误,status:" + data.HistoryMessageData[0].status);
                return;
            }

            //将数据保存到list中
            for (int i = 0; i < data.HistoryMessageData.Count; i++)
            {
                for (int j = 0; j < data.HistoryMessageData[i].data.Count; j++)
                {
                    if (Convert.ToInt32(data.HistoryMessageData[i].data[j].uid1) == 0)
                    {
                        continue;
                    }
                    HistroyGradeMessage_Self grade = new HistroyGradeMessage_Self();

                    grade.openRoomId     = data.HistoryMessageData[i].data[j].openRoomId;
                    grade.playing_method = data.HistoryMessageData[i].data[j].playing_method;
                    grade.roomNum        = data.HistoryMessageData[i].data[j].roomNum;
                    grade.disType        = data.HistoryMessageData[i].data[j].disType;
                    grade.disTime        = data.HistoryMessageData[i].data[j].disTim;
                    grade.openTim        = anhui.MahjongCommonMethod.Instance.UnixTimeStampToDateTime(Convert.ToDouble(data.HistoryMessageData[i].data[j].openTim), 0);
                    int mul = 1;  //分数的倍数
                    if (Convert.ToInt32(grade.playing_method) == 14)
                    {
                        mul = 100;
                    }

                    grade.point[0]           = Convert.ToInt32(data.HistoryMessageData[i].data[j].point1) * mul;
                    grade.point[1]           = Convert.ToInt32(data.HistoryMessageData[i].data[j].point2) * mul;
                    grade.point[2]           = Convert.ToInt32(data.HistoryMessageData[i].data[j].point3) * mul;
                    grade.point[3]           = Convert.ToInt32(data.HistoryMessageData[i].data[j].point4) * mul;
                    grade.nickName[0]        = data.HistoryMessageData[i].data[j].nick1;
                    grade.nickName[1]        = data.HistoryMessageData[i].data[j].nick2;
                    grade.nickName[2]        = data.HistoryMessageData[i].data[j].nick3;
                    grade.nickName[3]        = data.HistoryMessageData[i].data[j].nick4;
                    grade.headUrl[0]         = data.HistoryMessageData[i].data[j].head1;
                    grade.headUrl[1]         = data.HistoryMessageData[i].data[j].head2;
                    grade.headUrl[2]         = data.HistoryMessageData[i].data[j].head3;
                    grade.headUrl[3]         = data.HistoryMessageData[i].data[j].head4;
                    grade.userid[0]          = data.HistoryMessageData[i].data[j].uid1;
                    grade.userid[1]          = data.HistoryMessageData[i].data[j].uid2;
                    grade.userid[2]          = data.HistoryMessageData[i].data[j].uid3;
                    grade.userid[3]          = data.HistoryMessageData[i].data[j].uid4;
                    grade.playerComplient[0] = data.HistoryMessageData[i].data[j].comp1;
                    grade.playerComplient[1] = data.HistoryMessageData[i].data[j].comp2;
                    grade.playerComplient[2] = data.HistoryMessageData[i].data[j].comp3;
                    grade.playerComplient[3] = data.HistoryMessageData[i].data[j].comp4;
                    GradeMessage.Add(grade);
                }
            }

            //判断红点
            if (data.HistoryMessageData[0].data.Count > 0 && Convert.ToInt64(data.HistoryMessageData[0].data[data.HistoryMessageData[0].data.Count - 1].disTim) > timer)
            {
                UIMainView.Instance.LobbyPanel.RedPoint[2].gameObject.SetActive(true);
            }

            ////判断新手引导是否需要指引
            //if(PlayerPrefs.GetFloat(NewPlayerGuide.Guide.HistroyGrade.ToString())==0&& data.HistoryMessageData[0].data.Count > 0)
            //{
            //    NewPlayerGuide.Instance.OpenIndexGuide(NewPlayerGuide.Guide.HistroyGrade);
            //    NewPlayerGuide.Instance.SetTimeHideGuide_Ie(5f, NewPlayerGuide.Guide.HistroyGrade);
            //}


            //判断代理的新手引导
            if (PlayerPrefs.GetFloat(NewPlayerGuide.Guide.JoinAgency.ToString()) == 0 && data.HistoryMessageData[0].data.Count > 0)
            {
                NewPlayerGuide.Instance.OpenIndexGuide(NewPlayerGuide.Guide.JoinAgency);
                NewPlayerGuide.Instance.SetTimeHideGuide_Ie(5f, NewPlayerGuide.Guide.JoinAgency);
            }
        }
Exemple #11
0
        /// <summary>
        /// 获取已开放县城的信息
        /// </summary>
        /// <param name="json"></param>
        public void GetCountyMessage(string json, int status)
        {
            dicCountyMessage.Clear();
            CountyMessageData data = new CountyMessageData();

            data = JsonBase.DeserializeFromJson <CountyMessageData>(json.ToString());
            if (data.CountyData[0].status != 1)
            {
                Debug.LogError("获取网页json数据状态错误,status:" + data.CountyData[0].status);
                return;
            }

            ParlorShowPanelData pspd = GameData.Instance.ParlorShowPanelData;

            //保存获取的城市信息
            for (int i = 0; i < data.CountyData.Count; i++)
            {
                for (int j = 0; j < data.CountyData[i].data.Count; j++)
                {
                    CountyMessage message = new CountyMessage();
                    message.cityId     = data.CountyData[i].data[j].cityId;
                    message.countyId   = data.CountyData[i].data[j].countyId;
                    message.countyName = data.CountyData[i].data[j].countyName;
                    message.flag       = data.CountyData[i].data[j].flag;
                    message.num        = data.CountyData[i].data[j].num;
                    bool isAdd = false;
                    if (System.Convert.ToInt16(message.flag) == 2)
                    {
                        isAdd = true;
                    }

                    //如果字典中已经有这个键,直接添加县
                    if (dicCountyMessage.ContainsKey(System.Convert.ToInt32(message.cityId)))
                    {
                        dicCountyMessage[System.Convert.ToInt32(message.cityId)].Add(message);
                    }
                    else
                    {
                        List <CountyMessage> county = new List <CountyMessage>();
                        county.Add(message);
                        dicCountyMessage.Add(System.Convert.ToInt32(message.cityId), county);
                    }


                    if (isAdd)
                    {
                        if (pspd.dicCountyMessage.ContainsKey(System.Convert.ToInt32(message.cityId)))
                        {
                            pspd.dicCountyMessage[System.Convert.ToInt32(message.cityId)].Add(message);
                        }
                        else
                        {
                            List <CountyMessage> county = new List <CountyMessage>();
                            county.Add(message);
                            pspd.dicCountyMessage.Add(System.Convert.ToInt32(message.cityId), county);
                        }
                    }
                }
            }

            ////添加县城的测试
            //CountyMessage message_ = new CountyMessage();
            //message_.countyId = "140428";
            //message_.cityId = "355";
            //message_.countyName = "长子县";
            //message_.flag = "2";
            //List<CountyMessage> county_ = new List<CountyMessage>();
            //county_.Add(message_);
            //if (dicCountyMessage.ContainsKey(System.Convert.ToInt32(message_.cityId)))
            //{
            //    dicCountyMessage[System.Convert.ToInt32(message_.cityId)].Add(message_);
            //}

            //获取县的信息成功
            isGetCountySuccess = true;

            if (isGetCitySuccess)
            {
                //改变地图大小
                UIMainView.Instance.SelectAreaPanel.ChangeScale();
            }
        }
Exemple #12
0
        /// <summary>
        /// 获取大厅网关的数据
        /// </summary>
        void GetDomainData(string json)
        {
            Domain_ data = new Domain_();

            data = JsonBase.DeserializeFromJson <Domain_>(json.ToString());
            if (data.Domain_Data[0].status != 1)
            {
                Debug.LogError("获取网页json数据状态错误,status:" + data.Domain_Data[0].status);
                //ComeLobby();
                //获取更新数据失败,提示玩家版本更新失败,重新登录
                CommenRemind("客 服", "重 试", "亲,网站服务器连接不上,请稍后重试或联系客服寻求帮助!", () => { CustomerPanel.SetActive(true); },
                             () => { StartCoroutine(GetUpdateMessage()); }, () => { BtnQuitApp(); });
                return;
            }

            domain = data.Domain_Data[0];

            //如果最新版本大于当前版本,显示更新
            if (Convert.ToInt16(domain.updateFlag) == 1)
            {
                //先判断消息版本,如果消息版本不一样,则直接更新到最新版本
                Debug.LogError(domain.newVer);
                if (Convert.ToInt32(domain.newVer) != MahjongLobby_AH.LobbyContants.ClientVersion)
                {
                    //如果是安卓热更
                    if (Application.platform == RuntimePlatform.Android)
                    {
                        VersionNew = Convert.ToInt32(domain.newVer);
                        Debug.LogError("开始更新进程");
                        iStatus = Convert.ToInt16(domain.updateFlag);
                        //开始下载md5文件,显示更新包体大小
                        StartCoroutine(DownloadMd5());
                        return;
                    }
                    else if (Application.platform == RuntimePlatform.IPhonePlayer)
                    {
                        UpdateFrame.SetActive(true);
                        UpdateContent.text = "发现新版本,是否更新?";
                        return;
                    }
                    //如果是ios,提示进入应用商店更新
                }
            }

            LobbyContants.SeverVersion = (short)Convert.ToInt32(domain.server_ver);
            //LobbyContants.SeverVersion = 10002;
            LobbyContants.LOBBY_GATEWAY_IP = domain.ip.ToString();
            if (Application.platform == RuntimePlatform.IPhonePlayer)
            {
                //为网关地址赋值
                if (Convert.ToInt32(domain.examine) == 1 && LobbyContants.isContorledByBack)
                {
                    SDKManager.Instance.CheckStatus   = 1;
                    SDKManager.Instance.IOSCheckStaus = 1;

                    SDKManager.Instance.IsConnectNetWork = 2;
                    if (!string.IsNullOrEmpty(domain.ip_ios))
                    {
                        MahjongLobby_AH.LobbyContants.LOBBY_GATEWAY_IP = domain.ip_ios;
                    }
                    // PlayerPrefs.DeleteAll();
                    //  SDKManager.Instance.gameObject.GetComponent<Consolation.TestConsole>()._isShowWind.gameObject.SetActive(false);
                }
                else
                {
                    //  SDKManager.Instance.gameObject.GetComponent<Consolation.TestConsole>()._isShowWind.gameObject.SetActive(true);
                }
                SDKManager.Instance.iShowGuestLogin = Convert.ToInt32(domain.ykFlag);
            }
            if (!string.IsNullOrEmpty(domain.port))
            {
                MahjongLobby_AH.LobbyContants.LOBBY_GATEWAY_PORT = int.Parse(domain.port);
            }

            iStatus = 0;



            //Debug.LogError("更新状态:" + iStatus);

            //表示该版本不用更新,直接跳转场景
            if (iStatus == 0)
            {
                UpdateContent_Down.gameObject.SetActive(false);
                ComeLobby();
            }
        }
Exemple #13
0
        /// <summary>
        /// 解析网页获取的json数据
        /// </summary>
        /// <param name="json"></param>
        public void GetMessageData(string json, int status)
        {
            PlayerMessageData.Clear();
            playerMessageData data = new playerMessageData();

            data = JsonBase.DeserializeFromJson <playerMessageData>(json.ToString());
            if (data.MessageData[0].status != 1)
            {
                Debug.LogError("获取网页json数据状态错误,status:" + data.MessageData[0].status);
                return;
            }

            //将数据保存到list中
            for (int i = 0; i < data.MessageData.Count; i++)
            {
                PlayerMessageData.Add(data.MessageData[i]);
                ParlorShowPanelData pspd = GameData.Instance.ParlorShowPanelData;
                pspd.ParlorCheckList = new List <Message>();
                for (int j = 0; j < data.MessageData[i].data.Count; j++)
                {
                    //过滤消息类型,如果玩家消息类型为审核类型,直接过滤添加到馆主的审核列表
                    if (Convert.ToInt32(data.MessageData[i].data[j].msgType) == 3)
                    {
                        pspd.ParlorCheckList.Add(data.MessageData[i].data[j]);
                        UIMainView.Instance.ParlorShowPanel.ShowPointRedPoint(0, MainViewParlorShowPanel.ParlorBtn.CheckList);
                        continue;
                    }

                    //如果玩家收到封馆和解除状态,就会通知馆主消息
                    if (Convert.ToInt32(data.MessageData[i].data[j].msgType) == 4)
                    {
                        Debug.LogError("parlorStatus_feng:" + PlayerPrefs.GetInt("parlorStatus_feng"));
                        if (PlayerPrefs.GetInt("parlorStatus_feng") == 0)
                        {
                            StringBuilder str = new StringBuilder();
                            str.Append("您的麻将馆已被封馆,并将于");
                            int timer_ = (int)MahjongCommonMethod.Instance.DateTimeToUnixTimestamp(DateTime.Now) - Convert.ToInt32(data.MessageData[i].data[j].sendTim);
                            str.Append((7 - timer_ / 86400));
                            str.Append("天后自动解散,请尽快联系官方客服解封");
                            UIMgr.GetInstance().GetUIMessageView().Show(str.ToString());
                            PlayerPrefs.SetInt("parlorStatus_feng", (int)MahjongCommonMethod.Instance.DateTimeToUnixTimestamp(DateTime.Now));
                            PlayerPrefs.SetInt("parlorStatus_jie", 0);
                            //修改玩家麻将馆的节点信息
                            if (pspd.parlorInfoDef[0] != null)
                            {
                                pspd.parlorInfoDef[0].iStatus = 1;
                            }
                        }



                        continue;
                    }

                    //如果玩家收到封馆和解除状态,就会通知馆主消息
                    if (Convert.ToInt32(data.MessageData[i].data[j].msgType) == 5)
                    {
                        Debug.LogError("parlorStatus_jie:" + PlayerPrefs.GetInt("parlorStatus_jie"));
                        if (PlayerPrefs.GetInt("parlorStatus_jie") == 0)
                        {
                            StringBuilder str = new StringBuilder();
                            str.Append("您的麻将馆已被解封!");
                            UIMgr.GetInstance().GetUIMessageView().Show(str.ToString());
                            PlayerPrefs.SetInt("parlorStatus_jie", (int)MahjongCommonMethod.Instance.DateTimeToUnixTimestamp(DateTime.Now));
                            PlayerPrefs.SetInt("parlorStatus_feng", 0);
                            //修改玩家麻将馆的节点信息
                            if (pspd.parlorInfoDef[0] != null)
                            {
                                pspd.parlorInfoDef[0].iStatus = 0;
                            }
                        }
                        continue;
                    }


                    if (Convert.ToInt32(data.MessageData[i].data[j].sendTim) > timer)
                    {
                        //有新的消息,显示提示红点
                        UIMainView.Instance.LobbyPanel.RedPoint[1].gameObject.SetActive(true);
                    }
                }
            }

            if (status == 2)
            {
                UIMainView.Instance.ParlorShowPanel.SpwanParlorCheckList();
                SDKManager.Instance.gameObject.GetComponent <CameControler>().PostMsg("uloading", "正在读取信息,请稍候...");
                return;
            }

            if (status == 1)
            {
                float nowTime = MahjongCommonMethod.Instance.DateTimeToUnixTimestamp(DateTime.Now);
                //如果是新玩家会通知固定消息
                if (PlayerPrefs.GetFloat("RegistTime") == 0 || SDKManager.Instance.CheckStatus == 1)
                {
                    Debug.LogWarning("不需要添加固定通知消息");
                }
                else if (nowTime - PlayerPrefs.GetFloat("RegistTime") < 604800f)
                {
                    PlayerMessage message = new PlayerMessage();
                    message.status = 1;
                    Message message_0 = new Message();
                    message_0.mid     = "0";
                    message_0.msgType = "1";
                    message_0.sendTim = nowTime.ToString();
                    message_0.content = "“姐们,打麻将的诀窍是什么?”\n“多摸,多扛,拼命碰,不放炮。”\n“欧巴,咱们比试比试。”\n“行嘛,欧巴要打一亿飘两亿的。”\n【麻将】是经典国粹棋牌游戏,国人最热爱桌上游泳,据研究中老年人多打麻将还可以健脑活血。有别于其它棋牌游戏,麻将变化多样,考验策略技巧,是令人乐此不疲的博弈游戏。赢了还可以像休闲益智类休闲游戏一样分享战绩和排名到朋友圈、微信好友得瑟得瑟。 \n【双喜麻将】是一款还原山西本土玩法,绿色健康的麻将棋牌游戏,为大家提供轻松愉悦的游戏氛围,游戏内禁止任何形式的赌博行为,一旦发现将永久封停游戏账号。请各位玩家遵守健康游戏和禁赌忠告,轻松游戏,快乐修行是我们的宗旨,祝大家游戏开心!\n◆游戏特色:\n1、山西本土玩法,原汁原味直接上手来一圈;\n2、创建房间,邀请好友,实时对战,尽享自由娱乐体验;\n3、海量金币登陆游戏天天送,操作简单、休闲放松的最佳选择;\n4、时尚简约浓郁中国风,真实还原游戏模式,更接地气;\n5、为你和好友提供同IP报警、防外挂的稳定安全对局环境;/n6、收集更多家乡玩法,快关注官方微信公众号【双喜麻将】联系我们吧,有奖哦!";
                    message_0.operate = "0";
                    PlayerMessageData[0].data.Add(message_0);
                }

                //产生对应的消息面板
                UIMainView.Instance.PlayerMessagePanel.SpwanAgencyMessagePanel();
                SDKManager.Instance.gameObject.GetComponent <CameControler>().PostMsg("uloading", "正在读取信息,请稍候...");
            }
        }
Exemple #14
0
        /// <summary>
        /// 解析网页获取的json数据
        /// </summary>
        /// <param name="json"></param>
        public void GetMessageData(string json, int status = 0)
        {
            RoomMessage.Clear();
            InsteadRecordMessageData data = new InsteadRecordMessageData();

            data = JsonBase.DeserializeFromJson <InsteadRecordMessageData>(json.ToString());
            if (data.InsteadRecordMessage[0].status != 1)
            {
                Debug.LogError("获取网页json数据状态错误,status:" + data.InsteadRecordMessage[0].status);
                return;
            }



            //将数据保存到list中
            for (int i = 0; i < data.InsteadRecordMessage.Count; i++)
            {
                for (int j = 0; j < data.InsteadRecordMessage[i].data.Count; j++)
                {
                    if (Convert.ToInt16(data.InsteadRecordMessage[i].data[j].disType) == 0)
                    {
                        continue;
                    }
                    InsteadOpenRoomMessage grade = new InsteadOpenRoomMessage();
                    grade.openRoomId         = data.InsteadRecordMessage[i].data[j].openRoomId;
                    grade.roomNum            = data.InsteadRecordMessage[i].data[j].roomNum;
                    grade.openTim            = data.InsteadRecordMessage[i].data[j].openTim;
                    grade.payCard            = data.InsteadRecordMessage[i].data[j].payCard;
                    grade.disType            = data.InsteadRecordMessage[i].data[j].disType;
                    grade.disTim             = data.InsteadRecordMessage[i].data[j].disTim;
                    grade.point[0]           = (data.InsteadRecordMessage[i].data[j].point1);
                    grade.point[1]           = (data.InsteadRecordMessage[i].data[j].point2);
                    grade.point[2]           = (data.InsteadRecordMessage[i].data[j].point3);
                    grade.point[3]           = (data.InsteadRecordMessage[i].data[j].point4);
                    grade.nickName[0]        = data.InsteadRecordMessage[i].data[j].nick1;
                    grade.nickName[1]        = data.InsteadRecordMessage[i].data[j].nick2;
                    grade.nickName[2]        = data.InsteadRecordMessage[i].data[j].nick3;
                    grade.nickName[3]        = data.InsteadRecordMessage[i].data[j].nick4;
                    grade.headUrl[0]         = data.InsteadRecordMessage[i].data[j].head1;
                    grade.headUrl[1]         = data.InsteadRecordMessage[i].data[j].head2;
                    grade.headUrl[2]         = data.InsteadRecordMessage[i].data[j].head3;
                    grade.headUrl[3]         = data.InsteadRecordMessage[i].data[j].head4;
                    grade.userid[0]          = data.InsteadRecordMessage[i].data[j].uid1;
                    grade.userid[1]          = data.InsteadRecordMessage[i].data[j].uid2;
                    grade.userid[2]          = data.InsteadRecordMessage[i].data[j].uid3;
                    grade.userid[3]          = data.InsteadRecordMessage[i].data[j].uid4;
                    grade.playerComplient[0] = data.InsteadRecordMessage[i].data[j].comp1;
                    grade.playerComplient[1] = data.InsteadRecordMessage[i].data[j].comp2;
                    grade.playerComplient[2] = data.InsteadRecordMessage[i].data[j].comp3;
                    grade.playerComplient[3] = data.InsteadRecordMessage[i].data[j].comp4;
                    grade.color = data.InsteadRecordMessage[i].data[j].color;
                    RoomMessage.Add(grade);
                }
            }

            if (RoomMessage.Count == 0)
            {
                isNoRecord = true;
            }
            else
            {
                isNoRecord = false;
            }
        }