// 请求出牌 public void reqOutPoker() { // 优先使用热更新的代码 if (ILRuntimeUtil.getInstance().checkDllClassHasFunc(m_hotfix_class, "reqOutPoker")) { ILRuntimeUtil.getInstance().getAppDomain().Invoke(m_hotfix_path, "reqOutPoker", null, null); return; } JsonData data = new JsonData(); data["tag"] = DDZ_GameData.getInstance().m_tag; data["uid"] = UserData.uid; data["playAction"] = (int)TLJCommon.Consts.DDZ_PlayAction.PlayAction_PlayerOutPoker; bool hasOutPoker = false; List <TLJCommon.PokerInfo> myOutPokerList = new List <TLJCommon.PokerInfo>(); // 自己出的牌 { JsonData jarray = new JsonData(); for (int i = 0; i < DDZ_GameData.getInstance().m_myPokerObjList.Count; i++) { PokerScript pokerScript = DDZ_GameData.getInstance().m_myPokerObjList[i].GetComponent <PokerScript>(); if (pokerScript.getIsJump()) { hasOutPoker = true; JsonData jd = new JsonData(); jd["num"] = pokerScript.getPokerNum(); jd["pokerType"] = pokerScript.getPokerType(); jarray.Add(jd); myOutPokerList.Add(new TLJCommon.PokerInfo(pokerScript.getPokerNum(), (TLJCommon.Consts.PokerType)pokerScript.getPokerType())); } } data["hasOutPoker"] = hasOutPoker; if (hasOutPoker) { data["pokerList"] = jarray; } } // 检测出牌合理性 { List <TLJCommon.PokerInfo> m_maxPlayerOutPokerList = DDZ_GameData.getInstance().m_maxPlayerOutPokerList; LandlordsCardsHelper.SetWeight(myOutPokerList); LandlordsCardsHelper.SetWeight(m_maxPlayerOutPokerList); if (myOutPokerList.Count != 0) { CardsType type; if (LandlordsCardsHelper.GetCardsType(myOutPokerList.ToArray(), out type)) { if (!DDZ_GameData.getInstance().m_isFreeOutPoker) { CardsType lastType; if (LandlordsCardsHelper.GetCardsType(m_maxPlayerOutPokerList.ToArray(), out lastType)) { List <PokerInfo[]> pokerInfoses = LandlordsCardsHelper.GetPrompt(myOutPokerList, m_maxPlayerOutPokerList, lastType); if (pokerInfoses.Count == 0) { ToastScript.createToast("出牌不符合规则"); return; } } else { ToastScript.createToast("上一家出牌不符合规则"); return; } } } else { ToastScript.createToast("自己出牌不符合规则"); return; } } else { if (DDZ_GameData.getInstance().m_isFreeOutPoker) { ToastScript.createToast("请选择您出的牌"); return; } else { // 不要 } } } PlayServiceSocket.s_instance.sendMessage(data.ToJson()); // 所有牌设为未选中 PokerScript.setAllPokerWeiXuanZe(); }