/// <summary> /// 处理玩家选择玩法的按钮 /// </summary> /// <param name="go"></param> void HandleBtnGamePlayMethod(GameObject go) { string name = go.name; int index = Convert.ToInt32(name.Split('_')[1]); CreatRoomMessagePanelData crmpd = GameData.Instance.CreatRoomMessagePanelData; bool isContainMethor = false; //在这里初始化创建房间的参数 for (int i = 0; i < crmpd.allRoomMethor.Count; i++) { // Debug.LogError("--"+crmpd.allRoomMethor[i].methord + "_" + crmpd.roomMessage_[0].ToString("X8") + "_" + crmpd.roomMessage_[1].ToString("X8") + "_" + crmpd.roomMessage_[2].ToString("X8") + "_" + crmpd.roomMessage_[3].ToString("X8") + "_" + crmpd.roomMessage_[4].ToString("X8") + "_" + crmpd.roomMessage_[5].ToString("X8")); if (crmpd.allRoomMethor[i].methord == index) { isContainMethor = true; crmpd.roomMessage_ = crmpd.allRoomMethor[i].param; // Debug.LogError("读取:" + index + "_" + crmpd.roomMessage_[0].ToString("X8") + "_" + crmpd.roomMessage_[1].ToString("X8") + "_" + crmpd.roomMessage_[2].ToString("X8") + "_" + crmpd.roomMessage_[3].ToString("X8") + "_" + crmpd.roomMessage_[4].ToString("X8") + "_" + crmpd.roomMessage_[5].ToString("X8")); } } if (!isContainMethor) { for (int i = 0; i < crmpd.roomMessage_.Length; i++) { crmpd.roomMessage_[i] = 0; } // Debug.LogError("读取不存在:" ); } crmpd.MethodId = index; UpdateMethodShow(index); }
/// <summary> /// 处理点击取消按钮 /// </summary> void HandleBtnCanel() { GameData gd = GameData.Instance; CreatRoomMessagePanelData crmpd = gd.CreatRoomMessagePanelData; crmpd.PanelShow = false; UpdateShow(); }
/// <summary> /// 处理点击邀请按钮 /// </summary> void HandleBtnShareWx() { string url = MahjongLobby_AH.SDKManager.WXInviteUrl + MahjongCommonMethod.Instance.RoomId; // Debug.LogError("分享链接" + url); string city; try { city = MahjongLobby_AH.GameData.Instance.SelectAreaPanelData.listCityMessage[MahjongLobby_AH.GameData.Instance.PlayerNodeDef.iCityId].cityName; } catch (System.Exception) { city = "双喜"; } StringBuilder title = new StringBuilder(); // Debug.LogError("玩法Num" + MahjongCommonMethod.Instance.iPlayingMethod); if (MahjongLobby_AH.SDKManager.Instance.CheckStatus == 1) { title.AppendFormat("{0}麻将->{1}<-房号:{2} 点击进入房间", city, "推倒胡", MahjongCommonMethod.Instance.RoomId); } else { title.AppendFormat("{0}麻将->{1}<-房号:{2} 点击进入房间", city, MahjongCommonMethod.Instance._dicMethodConfig[MahjongCommonMethod.Instance.iPlayingMethod].METHOD_NAME, MahjongCommonMethod.Instance.RoomId); } #region 配置 StringBuilder discription = new StringBuilder(); Debug.LogWarning("老板标志位" + GameData.Instance.PlayerPlayingPanelData.byOpenRoomMode); int opmd = GameData.Instance.PlayerPlayingPanelData.byOpenRoomMode; if (opmd == 2) { discription.Append("【老板开房】"); } //&& MahjongLobby_AH.GameData.Instance.ParlorShowPanelData.GetNowMahjongPavilionID() == MahjongLobby_AH.GameData.Instance.PlayerNodeDef.iUserId) discription.Append("玩法:"); CreatRoomMessagePanelData cd = MahjongLobby_AH.GameData.Instance.CreatRoomMessagePanelData; // Debug.LogWarning("AA支付" + cd.roomMessage_[13]); //if (cd.roomMessage_[13] == 1) // { // discription.Append("AA支付"); // } MahjongCommonMethod.Instance.ShowParamOfOpenRoom(ref discription, cd.roomMessage_, 0, MahjongCommonMethod.Instance.iPlayingMethod); // MahjongCommonMethod.Instance.GetWeiteInfoForMethodID(discription, cd.MethodId, cd.roomMessage_); #endregion 配置 // Debug.LogError("===" + discription); if (cd.roomMessage_[4] > 0) { discription.Append("预约 " + cd.roomMessage_[4] + " 分钟 "); } if (cd.roomMessage_[5] > 0) { discription.Append("托管 " + cd.roomMessage_[5] + " 分钟"); } MahjongLobby_AH.SDKManager.Instance.HandleShareWX(url, title.ToString(), discription.ToString(), 0, 0, 22, ""); }
/// <summary> /// 老板点击邀请 /// </summary> public void BtnInvitation() { SystemMgr.Instance.AudioSystem.PlayAuto(AudioSystem.AudioType.VIEW_CLOSE); string url = SDKManager.WXInviteUrl + m_openRoomInfo.iRoomNum.ToString("d6"); string city; try { city = GameData.Instance.SelectAreaPanelData.listCityMessage[GameData.Instance.PlayerNodeDef.iCityId].cityName; } catch (Exception) { city = "双喜"; } StringBuilder title = new StringBuilder(); if (SDKManager.Instance.CheckStatus == 1) { title.AppendFormat("{0}麻将->{1}<-房间号:{2} 点击进入房间", city, "推倒胡", m_openRoomInfo.iRoomNum.ToString("d6")); } else { title.AppendFormat("{0}麻将->{1}<-房间号:{2} 点击进入房间", city, mcm._dicMethodConfig[m_openRoomInfo.iPlayingMethod].METHOD_NAME, m_openRoomInfo.iRoomNum.ToString("d6")); } #region 配置 StringBuilder discription = new StringBuilder(); Debug.LogWarning("----" + m_openRoomInfo.PavilionID); if (m_openRoomInfo.PavilionID > 0)// && GameData.Instance.ParlorShowPanelData.GetNowMahjongPavilionID() == GameData.Instance.PlayerNodeDef.iUserId) { discription.Append("【老板开房】"); } discription.Append("玩法:"); CreatRoomMessagePanelData cd = GameData.Instance.CreatRoomMessagePanelData; mcm.ShowParamOfOpenRoom(ref discription, cd.roomMessage_, 0, MahjongCommonMethod.Instance.iPlayingMethod); //MahjongCommonMethod.Instance.GetWeiteInfoForMethodID(discription, m_openRoomInfo.iPlayingMethod, m_openRoomInfo.caOpenRoomParam); #endregion 配置 Debug.Log("---" + discription); Debug.LogWarning("分享预约" + m_openRoomInfo.caOpenRoomParam[4]); Debug.LogWarning("分享托管" + m_openRoomInfo.caOpenRoomParam[5]); if (m_openRoomInfo.caOpenRoomParam[4] > 0) { discription.Append("预约 " + m_openRoomInfo.caOpenRoomParam[4] + " 分钟 "); } if (m_openRoomInfo.caOpenRoomParam[5] > 0) { discription.Append("托管 " + m_openRoomInfo.caOpenRoomParam[5] + " 分钟"); } SDKManager.Instance.HandleShareWX(url, title.ToString(), discription.ToString(), 0, 0, 0, ""); }
/// <summary> /// 处理玩家选择房间番数的按钮 /// </summary> /// <param name="go"></param> void HandleBtnGameMul(GameObject go) { string name = go.name; int index = Convert.ToInt32(name.Split('_')[1]); GameData gd = GameData.Instance; CreatRoomMessagePanelData crmpd = gd.CreatRoomMessagePanelData; crmpd.MulLimit = index * 2; crmpd.ChoiceIndex[1] = index; UpdateShow(); }
/// <summary> /// 面板的更新显示 /// </summary> public void UpdateShow(int status) { GameData gd = GameData.Instance; GamePlayingMethodPanelData gpmpd = gd.GamePlayingMethodPanelData; CreatRoomMessagePanelData crmpd = GameData.Instance.CreatRoomMessagePanelData; if (gpmpd.PanelShow) { if (MahjongLobby_AH.GameData.Instance.CreatRoomMessagePanelData != null) { //if (crmpd.CreatRoomType == 1 && SDKManager.Instance.IOSCheckStaus == 0 && SDKManager.Instance.CheckStatus == 0) if (UIMainView.Instance.ParlorShowPanel.ParlorMessagePanel.gameObject.activeSelf == false && SDKManager.Instance.IOSCheckStaus == 0 && SDKManager.Instance.CheckStatus == 0) { SwitchLocation.SetActive(true); BtnParent.GetComponent <GridLayoutGroup>().padding.top = 5; } else { SwitchLocation.SetActive(false); BtnParent.GetComponent <GridLayoutGroup>().padding.top = -50; } } GameData.Instance.isShowQuitPanel = false; gameObject.SetActive(true); SpwanBtn(status); if (SDKManager.Instance.IOSCheckStaus == 1 || SDKManager.Instance.CheckStatus == 1) { for (int i = 0; i < IosHideBtn.Length; i++) { IosHideBtn[i].SetActive(false); } //BtnParent.GetComponent<GridLayoutGroup>().padding.top = -50; } else { for (int i = 0; i < IosHideBtn.Length; i++) { IosHideBtn[i].SetActive(true); } //BtnParent.GetComponent<GridLayoutGroup>().padding.top = 5; } } else { GameData.Instance.isShowQuitPanel = true; gameObject.SetActive(false); } }
/// <summary> /// 点击代开房间按钮 /// </summary> void HandleInsteadCreatRoom() { GameData gd = GameData.Instance; CreatRoomMessagePanelData crmpd = gd.CreatRoomMessagePanelData; PlayerNodeDef pnd = gd.PlayerNodeDef; InsteadOpenRoomPanelData iorpd = gd.InsteadOpenRoomPanelData; iorpd.OpenRoomInfo_UnStart.Clear(); PlayerPrefs.SetFloat(GameData.RedPoint.FirstOpenInsteadPanel.ToString() + GameData.Instance.PlayerNodeDef.iUserId, 2); ////如果不是代理,让玩家查看代理规则 //if(pnd.iIsProxy != 1) //{ // UIMgr.GetInstance().GetUIMessageView().Show("温馨提示", TextConstant.LOOKDAILI, DailiRule,null,0,false,-1,2,0); // return; //} ////判断代理如果房卡数量小于0个,不让开房 //if ((pnd.iRoomCard + pnd.iFreeCard) < 0) //{ // UIMgr.GetInstance().GetUIMessageView().Show("您的金币数量不足,暂时不能使用代开房间功能哦!", ok); // return; //} ////判断玩家是否是代理 //if (pnd.iIsProxy == 1) //{ // //发送玩家的开房信息请求 // NetMsg.ClientOpenRoomInfoReq msg = new NetMsg.ClientOpenRoomInfoReq(); // msg.iUserId = pnd.iUserId; // Network.NetworkMgr.Instance.LobbyServer.SendOpenRoomInfoReq(msg); // iorpd.isClickInsteadOpenRoom = true; //} }
/// <summary> /// 点击创建房间按钮 /// </summary> void HandleOpenRoomBtn() { SelectAreaPanelData sapd = GameData.Instance.SelectAreaPanelData; //对应县区选择玩法 anhui.MahjongCommonMethod.Instance.lsMethodId = new List <int>(); string[] id = anhui.MahjongCommonMethod.Instance._dicDisConfig[sapd.iCountyId].METHOD.Split('_'); for (int k = 0; k < id.Length; k++) { int ID = Convert.ToInt16(id[k]); if (ID != 0) { Debug.LogWarning("点击创建房间按钮"); anhui.MahjongCommonMethod.Instance.lsMethodId.Add(ID); } } GameData gd = GameData.Instance; CreatRoomMessagePanelData srmpd = gd.CreatRoomMessagePanelData; //打开创建房间面板 srmpd.CreatRoomType = 2; srmpd.PanelShow = true; SystemMgr.Instance.CreatRoomMessageSystem.UpdateShow(); }
/// <summary> /// 处理点击确定按钮 /// </summary> void HandleBtnOk() { GameData gd = GameData.Instance; CreatRoomMessagePanelData crmpd = gd.CreatRoomMessagePanelData; InsteadOpenRoomPanelData iorpd = gd.InsteadOpenRoomPanelData; SelectAreaPanelData sapd = GameData.Instance.SelectAreaPanelData; crmpd.PanelShow = false; NetMsg.ClientOpenRoomReq msg = new NetMsg.ClientOpenRoomReq(); msg.iUserId = GameData.Instance.PlayerNodeDef.iUserId; msg.cGameId = (byte)anhui.MahjongCommonMethod.Instance._dicMethodConfig[crmpd.MethodId].gameid; msg.iPlayingMethod = crmpd.MethodId; msg.iCompliment = crmpd.iCompliment; msg.iDisconnectRate = crmpd.iDisconnectRate; msg.iDiscardTime = crmpd.iDiscardTime; msg.iRoomCard = crmpd.iRoomCard; // Debug.LogError("房卡;"+crmpd.iRoomCard); msg.cOpenRoomMode = (byte)crmpd.CreatRoomType; msg.byColorFlag = (byte)crmpd.iColorFlag; msg.caParam = crmpd.roomMessage_; msg.iCountyId = sapd.iCountyId; if (msg.cOpenRoomMode > 1) { msg.iParlorId = GameData.Instance.ParlorShowPanelData.iParlorId; } else { anhui.MahjongCommonMethod.Instance.iParlorId = 0; } // Debug.Log("出牌参数0:" + msg.caParam[0].ToString("X8") + "_" + msg.caParam[2].ToString("X8") + "/n" + "出牌参数1:" + msg.caParam[1].ToString("X8") + "_" + msg.caParam[3].ToString("X8")); // Debug.Log("玩法id:" + msg.iPlayingMethod + ",游戏编号:" + msg.cGameId // + ",开放模式:" + msg.cOpenRoomMode + ",馆主id:" + msg.iParlorId + "县ID:" + msg.iCountyId); //保存玩家的本次创建房间的详细信息 // string willSaveRoomRule = ""; // for (int i = 0; i < msg.caParam.Length; i++) // { // if (i == 0) // { // willSaveRoomRule += msg.caParam[i]; // } // else // { // willSaveRoomRule += ("," + msg.caParam[i]); // } // } // PlayerPrefs.DeleteKey("OpenRoomMsgg"); PlayerPrefs.SetInt("iPlayingMethod", msg.iPlayingMethod); // PlayerPrefs.SetInt("iCountyId", msg.iCountyId); // 开房所属县id // PlayerPrefs.SetString("OpenRoomMsgg", willSaveRoomRule); //如果玩家赞的数量或者断线率或者出牌速度小于房间设置,不让创建房间 if (gd.PlayerNodeDef.iPlayCardAcc > 0 && (gd.PlayerNodeDef.iPlayCardTimeAcc / gd.PlayerNodeDef.iPlayCardAcc) > msg.iDiscardTime && msg.iDiscardTime > 0) { UIMgr.GetInstance().GetUIMessageView().Show("您的出牌速度不满足,自己设置的开房条件"); return; } if (gd.PlayerNodeDef.iGameNumAcc > 0 && ((gd.PlayerNodeDef.iDisconnectAcc / (float)gd.PlayerNodeDef.iGameNumAcc) * 100f) > msg.iDisconnectRate && msg.iDisconnectRate > 0) { UIMgr.GetInstance().GetUIMessageView().Show("您的断线率不满足,自己设置的开房条件"); return; } if (gd.PlayerNodeDef.iCompliment < msg.iCompliment && msg.iCompliment > 0) { UIMgr.GetInstance().GetUIMessageView().Show("您的赞的数量不满足,自己设置的开房条件"); return; } //处理玩家选择的房间信息是否符合要求 NetworkMgr.Instance.LobbyServer.SendOpenRoomReq(msg); //iorpd.PanelShow = false; iorpd.isClickInsteadOpenRoom = false; iorpd.isFirstSpwanInsteadRecord = true; SystemMgr.Instance.InsteadOpenRoomSystem.UpdateShow(); UpdateShow(); }
public void BtnChioce() { CreatRoomMessagePanelData crmpd = GameData.Instance.CreatRoomMessagePanelData; anhui.MahjongCommonMethod mcm = anhui.MahjongCommonMethod.Instance; if (!mcm._dicMethodConfig.ContainsKey(crmpd.MethodId)) { return; } if (SystemMgr.Instance) { SystemMgr.Instance.AudioSystem.PlayAuto(AudioSystem.AudioType.VIEW_CLOSE); } if (MahjongLobby_AH.UIMainView.Instance.CreatRoomMessagePanel != null) { Text label = null; if (gameObject.GetComponent <Toggle>().isOn) { Text[] label2 = UIMainView.Instance.CreatRoomMessagePanel.RuleParent_.GetComponentsInChildren <Text>(); for (int j = 0; j < label2.Length; j++) { if (label2[j].text == "抢庄") { isfatherusOn = label2[j].transform.parent.GetComponent <Toggle>().isOn; color_nor = label2[j].color; label = label2[j]; break; } } } for (int j = 0; j < mcm.methiod.Count; j++) { if (mcm._dicMethodConfig[crmpd.MethodId].METHOD == mcm.methiod[j].id) { if (mcm.methiod[j].num1 == num) { crmpd.iPrice = 0; mcm.WriteInt32toInt4(ref crmpd.roomMessage_[1], crmpd.iPrice, 16); UIMainView.Instance.CreatRoomMessagePanel.QuanBukexuan = true; OnSetSelfPlayState(label, true); } else if (mcm.methiod[j].num2 == num) { crmpd.iPrice = 1; UIMainView.Instance.CreatRoomMessagePanel.QuanBukexuan = true; mcm.WriteInt32toInt4(ref crmpd.roomMessage_[1], crmpd.iPrice, 16); OnSetSelfPlayState(label, true); } else if (mcm.methiod[j].num3 == num) { crmpd.iPrice = 2; UIMainView.Instance.CreatRoomMessagePanel.QuanBukexuan = true; mcm.WriteInt32toInt4(ref crmpd.roomMessage_[1], crmpd.iPrice, 16); OnSetSelfPlayState(label, true); } break; } } // Debug.LogError("MID" + GameData.Instance.CreatRoomMessagePanelData.MethodId); if (GameData.Instance.CreatRoomMessagePanelData.MethodId == 20015) { if (num == 4) { crmpd.iPrice = 3; mcm.WriteInt32toInt4(ref crmpd.roomMessage_[1], crmpd.iPrice, 16); UIMainView.Instance.CreatRoomMessagePanel.QuanBukexuan = false; OnSetSelfPlayState(label, false); } else if (num == 8) { crmpd.iPrice = 4; mcm.WriteInt32toInt4(ref crmpd.roomMessage_[1], crmpd.iPrice, 16); UIMainView.Instance.CreatRoomMessagePanel.QuanBukexuan = false; OnSetSelfPlayState(label, false); } else if (num == 12) { crmpd.iPrice = 5; mcm.WriteInt32toInt4(ref crmpd.roomMessage_[1], crmpd.iPrice, 16); UIMainView.Instance.CreatRoomMessagePanel.QuanBukexuan = false; OnSetSelfPlayState(label, false); } } } else { for (int j = 0; j < mcm.methiod.Count; j++) { if (mcm._dicMethodConfig[crmpd.MethodId].METHOD == mcm.methiod[j].id) { if (mcm.methiod[j].num1 == num) { crmpd.iPrice = 0; mcm.WriteInt32toInt4(ref crmpd.roomMessage_[1], crmpd.iPrice, 16); } else if (mcm.methiod[j].num2 == num) { crmpd.iPrice = 1; mcm.WriteInt32toInt4(ref crmpd.roomMessage_[1], crmpd.iPrice, 16); } else if (mcm.methiod[j].num3 == num) { crmpd.iPrice = 2; mcm.WriteInt32toInt4(ref crmpd.roomMessage_[1], crmpd.iPrice, 16); } break; } } } // Debug.LogError(num); mcm.WriteColumnValue(ref crmpd.roomMessage_, 4, (sbyte)(crmpd.iPrice > 2 ? 1 : 0), 2); crmpd.iRoomCard = pay; UIMainView.Instance.CreatRoomMessagePanel.UpdataToShowForSelectUseGoldCreatRoom(); }
//绑定按钮 void AddDelgeteToCountyBtn(int index) { SystemMgr.Instance.AudioSystem.PlayAuto(AudioSystem.AudioType.VIEW_CLOSE); sapd.iCountyId = index; NetMsg.ClientCityCountyReq msg = new NetMsg.ClientCityCountyReq(); msg.iUserId = GameData.Instance.PlayerNodeDef.iUserId; msg.iCityId = sapd.iCityId; msg.iCountyId = sapd.iCountyId; Debug.Log("msg.iCityId:" + msg.iCityId + ",msg.iCountyId:" + msg.iCountyId); if (sapd.iCountyId != GameData.Instance.PlayerNodeDef.iCountyId) { NetworkMgr.Instance.LobbyServer.SendCityCountyReq(msg); } //给出选择成功提示,同时修改玩法界面 ScaleAreaPanel(); // UIMgr.GetInstance().GetUIMessageView().Show("恭喜您修改地区成功", Ok); //如果是正常写入玩家市县id if (sapd.iOpenStatus == 1) { //sapd.iCountyId = index; //NetMsg.ClientCityCountyReq msg = new NetMsg.ClientCityCountyReq(); //msg.iUserId = GameData.Instance.PlayerNodeDef.iUserId; //msg.iCityId = sapd.iCityId; //msg.iCountyId = sapd.iCountyId; //NetworkMgr.Instance.LobbyServer.SendCityCountyReq(msg); } //如果是在创建房间点击选择市县id else if (sapd.iOpenStatus == 2) { sapd.iCountyId = index; GameData.Instance.ParlorShowPanelData.iCountyId[2] = index; PlayerPrefs.SetInt("CityId" + GameData.Instance.PlayerNodeDef.iUserId, sapd.iCityId); PlayerPrefs.SetInt("CountyId" + GameData.Instance.PlayerNodeDef.iUserId, sapd.iCountyId); //修改玩法id anhui.MahjongCommonMethod.Instance.lsMethodId = new List <int>(); string[] id = anhui.MahjongCommonMethod.Instance._dicDisConfig[index].METHOD.Split('_'); for (int k = 0; k < id.Length; k++) { int ID = Convert.ToInt16(id[k]); if (ID != 0) { Debug.LogWarning("绑定按钮"); anhui.MahjongCommonMethod.Instance.lsMethodId.Add(ID); } } //修改初始方法的id GameData.Instance.CreatRoomMessagePanelData.MethodId = anhui.MahjongCommonMethod.Instance.lsMethodId[0]; CreatRoomMessagePanelData crmpd = GameData.Instance.CreatRoomMessagePanelData; //在这里初始化创建房间的参数 for (int i = 0; i < crmpd.iParamOpenRoomMessage.Length; i++) { crmpd.iParamOpenRoomMessage[i] = 0; } Debug.LogWarning(GameData.Instance.ParlorShowPanelData.iCountyId[2] + "," + crmpd.CreatRoomType); //更新面板 UIMainView.Instance.CreatRoomMessagePanel.UpdateShowMethod(GameData.Instance.CreatRoomMessagePanelData.MethodId); UIMainView.Instance.CreatRoomMessagePanel.SpwanPlayMethodBtn(); SystemMgr.Instance.CreatRoomMessageSystem.UpdateShow(); SystemMgr.Instance.LobbyMainSystem.UpdateShow(); } //if (sapd.iOpenStatus == 5) //{ // sapd.iCountyId = index; // PlayerPrefs.SetInt("CityId", sapd.iCityId); // PlayerPrefs.SetInt("CountyId", sapd.iCountyId); //} //if (sapd.iOpenStatus > 1) //{ //} //ParlorShowPanelData pspd = GameData.Instance.ParlorShowPanelData; //if (sapd.iOpenStatus == 3) //{ // pspd.iCountyId[0] = index; //} //if (sapd.iOpenStatus == 4) //{ // pspd.iCountyId[1] = index; //} //if (sapd.iOpenStatus == 6) //{ // GameData.Instance.GamePlayingMethodPanelData.CountyId = index; //} //申请开馆信息 if (sapd.iOpenStatus == 7) { ParlorShowPanelData pspd = GameData.Instance.ParlorShowPanelData; pspd.iCountyId[0] = index; UIMainView.Instance.ParlorShowPanel.ApplyCreatParlorCertl.GetTgMessage(index); } }
/// <summary> /// 点击创建房间按钮 /// </summary> void HandleCreatRoom(int createroom) { SelectAreaPanelData sapd = GameData.Instance.SelectAreaPanelData; //对应县区选择玩法 MahjongCommonMethod.Instance.lsMethodId = new List <int>(); GameData gd = GameData.Instance; CreatRoomMessagePanelData crmpd = gd.CreatRoomMessagePanelData; int countId = 0; if (createroom == 1) { countId = sapd.iCountyId; } else { countId = GameData.Instance.ParlorShowPanelData.iCountyId[2]; } string[] id = MahjongCommonMethod.Instance._dicDisConfig[countId].METHOD.Split('_'); for (int k = 0; k < id.Length; k++) { int ID = System.Convert.ToInt16(id[k]); if (ID != 0) { MahjongCommonMethod.Instance.lsMethodId.Add(ID); } } crmpd.CreatRoomType = createroom; crmpd.PanelShow = true; UIMainView.Instance.CreatRoomMessagePanel.m_CreateRoomSource = createroom; //if (PlayerPrefs.HasKey("OpenRoomMsgg")) //{ // //获取玩家上次创建房间的默认参数 // string message = PlayerPrefs.GetString("OpenRoomMsgg"); // if (PlayerPrefs.HasKey("iPlayingMethod")) // { // crmpd.iParamMethid = PlayerPrefs.GetInt("iPlayingMethod"); // } // string[] msgs = message.Split(','); // if (crmpd.iParamMethid > 0) // { // for (int i = 0; i < msgs.Length; i++) // { // crmpd.roomMessage_[i] = Convert.ToUInt32(msgs[i]); // } // } // Debug.LogWarningFormat("{0}:{1}\n{2}:{3}\n{4}:{5}", crmpd.roomMessage_[0].ToString("X8"), // crmpd.roomMessage_[1].ToString("X8"), crmpd.roomMessage_[2].ToString("X8"), crmpd.roomMessage_[3].ToString("X8"), // crmpd.roomMessage_[4].ToString("X8"), crmpd.roomMessage_[5].ToString("X8") // ); //} ////////////////////////////////////////////////////////////////////// if (UIMainView.Instance.CreatRoomMessagePanel.m_showNew[0] != null) { if (!PlayerPrefs.HasKey("CreatRoomShowNew" + GameData.Instance.PlayerNodeDef.iUserId)) { PlayerPrefs.SetInt("CreatRoomShowNew" + GameData.Instance.PlayerNodeDef.iUserId, 0); } int CreatRoomShowNew_num = PlayerPrefs.GetInt("CreatRoomShowNew" + GameData.Instance.PlayerNodeDef.iUserId); if (CreatRoomShowNew_num <= 3) { UIMainView.Instance.CreatRoomMessagePanel.m_showNew[0].SetActive(true); CreatRoomShowNew_num++; PlayerPrefs.SetInt("CreatRoomShowNew" + GameData.Instance.PlayerNodeDef.iUserId, CreatRoomShowNew_num); } else { MonoBehaviour.Destroy(UIMainView.Instance.CreatRoomMessagePanel.m_showNew[0]); PlayerPrefs.DeleteKey("CreatRoomShowNew" + GameData.Instance.PlayerNodeDef.iUserId); } } ////////////////////////////////////////////////////////////////////// SystemMgr.Instance.CreatRoomMessageSystem.UpdateShow(); UIMainView.Instance.CreatRoomMessagePanel.UpdateShowMethod(GameData.Instance.CreatRoomMessagePanelData.MethodId); }
/// <summary> /// 处理点击玩法按钮 /// </summary> void HandlePlayingMehod() { GameData gd = GameData.Instance; GamePlayingMethodPanelData gpmpd = gd.GamePlayingMethodPanelData; CreatRoomMessagePanelData crmpd = gd.CreatRoomMessagePanelData; SelectAreaPanelData sapd = gd.SelectAreaPanelData; ParlorShowPanelData pspd = gd.ParlorShowPanelData; if (crmpd.CreatRoomType == 1) { gpmpd.CountyId = sapd.iCountyId; string[] id = MahjongCommonMethod.Instance._dicDisConfig[gpmpd.CountyId].METHOD.Split('_'); MahjongCommonMethod.Instance.lsMethodId = new List <int>(); for (int i = 0; i < id.Length; i++) { // Debug.LogWarning("处理点击玩法按钮1"); MahjongCommonMethod.Instance.lsMethodId.Add(System.Convert.ToInt32(id[i])); } } else { gpmpd.CountyId = pspd.iCountyId[2]; } if (gpmpd.Status != 1) { GameData.Instance.CreatRoomMessagePanelData.MethodId = System.Convert.ToInt32(MahjongCommonMethod.Instance._dicDisConfig[gpmpd.CountyId].METHOD.Split('_')[0]); string[] id = MahjongCommonMethod.Instance._dicDisConfig[gpmpd.CountyId].METHOD.Split('_'); MahjongCommonMethod.Instance.lsMethodId = new List <int>(); for (int i = 0; i < id.Length; i++) { // Debug.LogWarning("处理点击玩法按钮2"); MahjongCommonMethod.Instance.lsMethodId.Add(System.Convert.ToInt32(id[i])); } } else { gpmpd.Status = 0; } //如果玩家的没有可玩的玩法 if (MahjongCommonMethod.Instance.lsMethodId.Count <= 0) { if (SDKManager.Instance.IOSCheckStaus == 1) { //获取所有城市的信息 MahjongCommonMethod.Instance.GetPlayerMessageData_IE(LobbyContants.MAJONG_PORT_URL_T + SelectAreaPanelData.url_city , null, gpmpd.GetCityMessage, "CityData"); //获取所有县城的信息 MahjongCommonMethod.Instance.GetPlayerMessageData_IE(LobbyContants.MAJONG_PORT_URL_T + SelectAreaPanelData.url_county , null, gpmpd.GetCountyMessage, "CountyData"); } else { //获取所有城市的信息 MahjongCommonMethod.Instance.GetPlayerMessageData_IE(LobbyContants.MAJONG_PORT_URL + SelectAreaPanelData.url_city , null, gpmpd.GetCityMessage, "CityData"); //获取所有县城的信息 MahjongCommonMethod.Instance.GetPlayerMessageData_IE(LobbyContants.MAJONG_PORT_URL + SelectAreaPanelData.url_county , null, gpmpd.GetCountyMessage, "CountyData"); } } else { gpmpd.PanelShow = true; //gpmpd.GameIndex = 1; //默认打开第一个 SystemMgr.Instance.GamePlayingMethodSystem.UpdateShow(0); } }