Exemplo n.º 1
0
        public void OnProcessKinMember(IntPtr ptr, int nLen, int nType)
        {
            // 更新成员数据
            IntPtrVaArgParseHelper helper = new IntPtrVaArgParseHelper(ptr, nLen);

            switch ((ProcessKinMember)nType)
            {
            // 添加
            case ProcessKinMember.PKM_MEMBER_ADD:
            {
                GameLogic.cmd_kin_membernode cmdKinMember = helper.get <GameLogic.cmd_kin_membernode>();

                m_KinMemberList.Add(cmdKinMember);
            }
            break;

            // 更新
            case ProcessKinMember.PKM_MEMBER_UPDATE:
            {
                GameLogic.cmd_kin_membernode cmdKinMember = helper.get <GameLogic.cmd_kin_membernode>();
                for (int i = 0; i < m_KinMemberList.Count; ++i)
                {
                    if (m_KinMemberList[i].dwPDBID == cmdKinMember.dwPDBID)
                    {
                        m_KinMemberList[i] = cmdKinMember;
                        break;
                    }
                }
            }
            break;

            // 删除
            case ProcessKinMember.PKM_MEMBER_REMOVE:
            {
                GameLogic.cmd_kin_remove_member cmdRemoveMember = helper.get <GameLogic.cmd_kin_remove_member>();
                for (int i = 0; i < m_KinMemberList.Count; ++i)
                {
                    if (m_KinMemberList[i].dwPDBID == cmdRemoveMember.nPlayerPDBID)
                    {
                        m_KinMemberList.RemoveAt(i);
                        break;
                    }
                }
            }
            break;
            }
            UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_KIN_UPDATEMEMBER, null);
        }
Exemplo n.º 2
0
        public void OnRecvKinMemberList(IntPtr ptr, int nLen)
        {
            IntPtrVaArgParseHelper helper = new IntPtrVaArgParseHelper(ptr, nLen);

            m_kinBaseData = helper.get <GameLogic.cmd_kin_basedata>();

            m_KinMemberList.Clear();
            for (int i = 0; i < m_kinBaseData.nMemberCount; ++i)
            {
                GameLogic.cmd_kin_membernode cmdNodeData = helper.get <GameLogic.cmd_kin_membernode>();
                // 添加到数据管理中心
                m_KinMemberList.Add(cmdNodeData);
            }

            UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_KIN_RECEV_MEMBERLIST, null);
        }
Exemplo n.º 3
0
        public void OnUpdateClanMember(IntPtr ptr, int nLen)
        {
            IntPtrVaArgParseHelper helper = new IntPtrVaArgParseHelper(ptr, nLen);

            GameLogic.cmd_kin_membernode cmdKinMember = helper.get <GameLogic.cmd_kin_membernode>();
            for (int i = 0; i < m_clanMemberData.Count; ++i)
            {
                if (m_clanMemberData[i].nPDBID == cmdKinMember.dwPDBID)
                {
                    cmd_clan_memberlist node = m_clanMemberData[i];
                    node.nIsOnline      = (byte)cmdKinMember.bIsOnline;
                    node.nGameStatus    = cmdKinMember.byGameState;
                    m_clanMemberData[i] = node;
                    UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_CLAN_UPDATEMEMBER, null);
                    return;
                }
            }
        }
Exemplo n.º 4
0
        public void SetKinMemberData()
        {
            ListKinMember.DataSource.Clear();
            ListKinMember.OnSelect.RemoveListener(OnSelectKinMember);
            ListKinMember.onRightClick.RemoveListener(OnSelectKinMember);

            cmd_kin_basedata          cmdHead  = LogicDataCenter.kinDataManager.LegendKinBaseData;
            List <cmd_kin_membernode> listData = LogicDataCenter.kinDataManager.LegendKinMemberList;

            UIWidgets.ObservableList <UListItemKinMember> dataSource = new UIWidgets.ObservableList <UListItemKinMember>();
            ListKinMember.DataSource.Clear();
            for (int i = 0; i < cmdHead.nMemberCount; ++i)
            {
                GameLogic.cmd_kin_membernode cmdNodeData = listData[i];
                UListItemKinMember           item        = new UListItemKinMember();
                Toggle tOffLineTog = OffLineTog.GetComponent <Toggle>();
                if (!tOffLineTog.isOn && cmdNodeData.bIsOnline == 0)
                {
                    // 隐藏不在线玩家
                    continue;
                }
                item.IdentityID  = cmdNodeData.nIdentity;
                item.PlayerID    = cmdNodeData.dwPDBID;
                item.GradIcon   += cmdNodeData.szGradeName;
                item.PersonIcon  = cmdNodeData.nFaceID;
                item.PersonName += cmdNodeData.szName;
                item.Power      += cmdNodeData.dwBattleVal;
                item.PowerRank  += cmdNodeData.dwBVOrder;
                item.GameState   = cmdNodeData.byGameState;
                item.Level      += cmdNodeData.nLevel;
                item.isOnline    = cmdNodeData.bIsOnline;
                item.nSex        = cmdNodeData.nSex;
                item.nLastOrder  = cmdNodeData.dwLastOrder;
                item.nBVOrder    = cmdNodeData.dwBVOrder;
                PopupAction      = new UPopupAction();
                if (EntityFactory.MainHeroView.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_ID) != item.PlayerID)
                {
                    PopupAction.Add(UPopupItemDataGetPlayerDetail.GetDescString(), new UPopupItemDataGetPlayerDetail(item.PlayerID));
                    PopupAction.Add(UPopupItemDataTeamInvite.GetDescString(), new UPopupItemDataTeamInvite(item.PlayerID));
                    PopupAction.Add(UPopupItemDataTeamRequest.GetDescString(), new UPopupItemDataTeamRequest(item.PlayerID));
                }
                item.PopupAction = PopupAction;
                dataSource.Add(item);
            }

            // 排序
            IEnumerable <UListItemKinMember> ListQuery = from item in dataSource
                                                         orderby item.isOnline descending, item.IdentityID descending, item.Power descending
            select item;

            UIWidgets.ObservableList <UListItemKinMember> tDataSource = new UIWidgets.ObservableList <UListItemKinMember>();
            foreach (UListItemKinMember Item in ListQuery)
            {
                tDataSource.Add(Item);
            }

            ListKinMember.DataSource = tDataSource;

            ListKinMember.OnSelect.AddListener(OnSelectKinMember);
            ListKinMember.onRightClick.AddListener(OnSelectKinMember);

            // 设置战队基本数据
            KinName.text         = cmdHead.szKinName;
            KinShaikhName.text   = cmdHead.szShaikhName;
            KinLevel.text        = cmdHead.nKinLevel.ToString();
            TotalMemberInfo.text = cmdHead.nOnlineCount + " / " + cmdHead.nMemberCount + "( " + ULocalizationService.Instance.Get("UIView", "KinMember", "MaxCountDes") + cmdHead.nKinMaxMember + ")";
            TotalFight.text      = cmdHead.nTotalFight.ToString();
            TotalOrder.text      = cmdHead.nFightOrder.ToString();

            KinLabel.text    = cmdHead.szKinLabel;
            MatchResult.text = cmdHead.nMatchWinNum + " / " + cmdHead.nMatchTotalNum;
            GoldAward.SetData(cmdHead.nGoldNum);
            SilverAward.SetData(cmdHead.nSilverNum);

            KinNoticeDes.text = cmdHead.szNotice;
        }