Пример #1
0
        public void UpdateCupCompetitionInfo(IntPtr ptrParam, int nPtrLen)
        {
            IntPtrVaArgParseHelper helper            = new IntPtrVaArgParseHelper(ptrParam, nPtrLen);
            long llegendCupId                        = helper.get <long>();
            cmd_legendcup_recv_competition_node node = helper.get <cmd_legendcup_recv_competition_node>();

            // 自己战队dida相关
            if (!(CheckIsSelfInCompetitionMember(node.nKin1ID) == false && CheckIsSelfInCompetitionMember(node.nKin2ID) == false))
            {
                bool bDida = (node.byCompetitionNodeState == (byte)ECompetitionNodeState.emNodeState_CanEnter);
                SetLegendCupDIDA(bDida, llegendCupId, node.nRoundID, node.nSearchID);
            }

            // 更新节点信息
            cmd_legendcup_recv_cuplist_node cupBaseData = LogicDataCenter.legendCupDataManager.GetSingleLegendCupNode(llegendCupId);

            if (cupBaseData.nLegendCupID == 0)
            {
                return;
            }

            if (!m_legendCupCompetitionDic.ContainsKey(llegendCupId))
            {
                return;
            }
            SingleCompetitionInfo competitionInfo = m_legendCupCompetitionDic[llegendCupId];

            if (competitionInfo == null || competitionInfo.nodeInfo == null)
            {
                return;
            }

            for (int i = 0; i < competitionInfo.nodeInfo.Count; i++)
            {
                if (competitionInfo.nodeInfo[i].nSearchID == node.nSearchID)
                {
                    competitionInfo.nodeInfo[i] = node;
                    break;
                }
            }

            // 通知相应界面
            LegendCupIDData uiData = new LegendCupIDData();

            uiData.nLegendCupID = competitionInfo.headInfo.nLegendCupID;
            if (competitionInfo.headInfo.byCompetitionType == (int)ERoundCompetitionType.emType_GroupCompetition)
            {
                UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_LEGENDCUP_GROUP_UPDATE, uiData);
            }
            else if (competitionInfo.headInfo.byCompetitionType == (int)ERoundCompetitionType.emType_KnockoutCompetition)
            {
                // 大淘汰赛、小淘汰赛界面合并
                UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_LEGENDCUP_SMALLKNOCKOUT_UPDATE, uiData);
            }
        }
Пример #2
0
        public void RecvCupCompetitionInfo(IntPtr ptrParam, int nPtrLen)
        {
            IntPtrVaArgParseHelper helper = new IntPtrVaArgParseHelper(ptrParam, nPtrLen);

            cmd_legendcup_recv_competition_head head = helper.get <cmd_legendcup_recv_competition_head>();
            long nLegendCupID = head.nLegendCupID;

            if (!m_legendCupCompetitionDic.ContainsKey(nLegendCupID))
            {
                SingleCompetitionInfo info = new SingleCompetitionInfo();
                m_legendCupCompetitionDic.Add(nLegendCupID, info);
            }

            m_legendCupCompetitionDic[nLegendCupID].headInfo = head;

            // 时间不从这里获取,改为单独下发RecvCupCompetitionAllRoundTime()
            //m_legendCupCompetition.roundInfo = new List<cmd_legendcup_recv_competition_roundinfo>();
            for (int i = 0; i < head.nRoundID; i++)
            {
                cmd_legendcup_recv_competition_roundinfo roundData = helper.get <cmd_legendcup_recv_competition_roundinfo>();
                //m_legendCupCompetition.roundInfo.Add(roundData);
            }
            m_legendCupCompetitionDic[nLegendCupID].nodeInfo = new List <cmd_legendcup_recv_competition_node>();
            for (int i = 0; i < head.nCompetitionNodeCount; ++i)
            {
                cmd_legendcup_recv_competition_node nodeData = helper.get <cmd_legendcup_recv_competition_node>();
                m_legendCupCompetitionDic[nLegendCupID].nodeInfo.Add(nodeData);
            }

            // 通知相应界面
            LegendCupIDData uiData = new LegendCupIDData();

            uiData.nLegendCupID = nLegendCupID;
            if (head.byCompetitionType == (int)ERoundCompetitionType.emType_GroupCompetition)
            {
                UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_LEGENDCUP_GROUP_SHOW, uiData);
            }
            else if (head.byCompetitionType == (int)ERoundCompetitionType.emType_KnockoutCompetition)
            {
                // 大淘汰赛、小淘汰赛界面合并
                UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_LEGENDCUP_SMALLKNOCKOUT_SHOW, uiData);
            }
        }
Пример #3
0
        public void RecvCupCompetitionAllRoundTime(IntPtr ptrParam, int nPtrLen)
        {
            IntPtrVaArgParseHelper helper = new IntPtrVaArgParseHelper(ptrParam, nPtrLen);

            cmd_legendcup_competition_kinmemberhead headData = helper.get <cmd_legendcup_competition_kinmemberhead>();
            long nLegendCupID = headData.nLegendCupID;

            if (!m_legendCupCompetitionDic.ContainsKey(nLegendCupID))
            {
                SingleCompetitionInfo info = new SingleCompetitionInfo();
                m_legendCupCompetitionDic.Add(nLegendCupID, info);
            }

            // 时间从这里获取
            m_legendCupCompetitionDic[nLegendCupID].roundInfo = new List <cmd_legendcup_recv_competition_roundinfo>();
            for (int i = 0; i < headData.nMemberCount; i++)
            {
                cmd_legendcup_recv_competition_roundinfo roundData = helper.get <cmd_legendcup_recv_competition_roundinfo>();
                m_legendCupCompetitionDic[nLegendCupID].roundInfo.Add(roundData);
            }
        }