Exemplo n.º 1
0
        public void OnRecvClanBaseData(IntPtr ptr, int nLen)
        {
            IntPtrVaArgParseHelper helper = new IntPtrVaArgParseHelper(ptr, nLen);

            m_clanBaseData = helper.get <cmd_clan_basedata>();

            m_clanMemberData.Clear();
            for (int i = 0; i < m_clanBaseData.nMemberCount; ++i)
            {
                cmd_clan_memberlist cmdMemberlist = helper.get <cmd_clan_memberlist>();
                m_clanMemberData.Add(cmdMemberlist);
            }
            SortClanMember();

            m_clanApplyMemberData.Clear();
            for (int i = 0; i < m_clanBaseData.nApplyMemberNum; ++i)
            {
                cmd_clan_applymember cmdApplyMemberlist = helper.get <cmd_clan_applymember>();
                m_clanApplyMemberData.Add(cmdApplyMemberlist);
            }

            UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_CLAN_BASEDATA, null);
            UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_CLAN_UPDATEMEMBER, null);
            UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_CLAN_APPLY_MEMBER_TIP, null);
        }
Exemplo n.º 2
0
        private void SortClanMember(bool bUpdate = true)
        {
            if (bUpdate)
            {
                // 先重新计算战力排名
                m_clanMemberData.Sort((x, y) => { if (x.dwBattleVal == y.dwBattleVal)
                                                  {
                                                      return(0);
                                                  }
                                                  else
                                                  {
                                                      return((x.dwBattleVal > y.dwBattleVal) ? -1 : 1);
                                                  } });
                //int nLastBV = -1;
                //int nLastOrder = 0;
                for (int i = 0; i < m_clanMemberData.Count; ++i)
                {
                    cmd_clan_memberlist memberInfo = m_clanMemberData[i];
                    int nOrder = i + 1;

                    /*
                     * if (nLastBV == memberInfo.dwBattleVal)
                     * {
                     *  nOrder = nLastOrder;
                     * }
                     * else
                     * {
                     *  nLastBV = memberInfo.dwBattleVal;
                     *  nLastOrder = nOrder;
                     * }*/
                    memberInfo.dwBVOrder = nOrder;
                    m_clanMemberData[i]  = memberInfo;
                }
            }

            // 再排个序
            m_clanMemberData.Sort(
                (x, y) =>
            {
                if (x.nIsOnline != y.nIsOnline)
                {
                    return((x.nIsOnline > y.nIsOnline) ? -1 : 1);
                }
                else if (x.nKinID != y.nKinID)
                {
                    return((x.nKinID < y.nKinID) ? -1 : 1);
                }
                else
                {
                    return((x.dwBVOrder < y.dwBVOrder) ? -1 : 1);
                }
            }
                );
        }
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 OnRecvClanAddMember(IntPtr ptr, int nLen)
        {
            IntPtrVaArgParseHelper helper        = new IntPtrVaArgParseHelper(ptr, nLen);
            cmd_clan_memberlist    cmdMemberlist = helper.get <cmd_clan_memberlist>();

            for (int i = 0; i < m_clanMemberData.Count; ++i)
            {
                if (m_clanMemberData[i].nPDBID == cmdMemberlist.nPDBID)
                {
                    m_clanMemberData[i] = cmdMemberlist;
                    SortClanMember();
                    UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_CLAN_UPDATEMEMBER, null);
                    return;
                }
            }

            m_clanMemberData.Add(cmdMemberlist);
            SortClanMember();
            UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_CLAN_UPDATEMEMBER, null);
        }
Exemplo n.º 5
0
        public void OnUpdateClanBaseData()
        {
            cmd_clan_basedata cmdBasedata = LogicDataCenter.clanDataManager.ClanBaseData;

            clanInfoName.text = String.Format("{0}<color=#ffffff>{1}</color>",
                                              ULocalizationService.Instance.Get("UIView", "ClanDetail", "ClanInfoName"), cmdBasedata.szClanName);
            clanInfoLeader.text = String.Format("{0}<color=#ffffff>{1}</color>",
                                                ULocalizationService.Instance.Get("UIView", "ClanDetail", "ClanInfoLeader"), cmdBasedata.szShaikhName);
            clanInfoTotalFight.text = String.Format("{0}<color=#ffffff>{1}</color>",
                                                    ULocalizationService.Instance.Get("UIView", "ClanDetail", "ClanInfoTotalFight"), cmdBasedata.nTotalFight);
            clanInfoRank.text = String.Format("{0}<color=#ffffff>{1}</color>",
                                              ULocalizationService.Instance.Get("UIView", "ClanDetail", "ClanInfoRank"), cmdBasedata.nPlace);
            clanInfoWeekActivity.text = String.Format("{0}<color=#ffffff>{1}</color>",
                                                      ULocalizationService.Instance.Get("UIView", "ClanDetail", "ClanInfoWeekActivity"), cmdBasedata.nWeekActivity);

            NoticeInputField.placeholder.GetComponent <Text>().text = cmdBasedata.szNotice;

            int nOnlineCount = 0;
            List <cmd_clan_memberlist> clanMemberList = LogicDataCenter.clanDataManager.ClanMemberData;

            for (int i = 0; i < clanMemberList.Count; ++i)
            {
                if (clanMemberList[i].nIsOnline > 0)
                {
                    ++nOnlineCount;
                }
            }
            clanInfoMemberCount.text = String.Format("{0}<color=#ffffff>{1}/{2}</color>",
                                                     ULocalizationService.Instance.Get("UIView", "ClanDetail", "ClanInfoMemberCount"), nOnlineCount, cmdBasedata.nMemberCount);
            clanInfoKinCount.text = String.Format("{0}<color=#ffffff>{1}/{2}</color>",
                                                  ULocalizationService.Instance.Get("UIView", "ClanDetail", "ClanInfoKinCount"), cmdBasedata.nKinCount, cmdBasedata.nMaxKinCount);
            clanInfoWeekActivity.text = String.Format("{0}<color=#ffffff>{1}</color>",
                                                      ULocalizationService.Instance.Get("UIView", "ClanDetail", "ClanInfoWeekActivity"), cmdBasedata.nWeekActivity);

            if (EntityFactory.MainHeroView != null)
            {
                int selfID = EntityFactory.MainHeroView.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_ID);
                cmd_clan_memberlist selfData = clanMemberList.Find(x => x.nPDBID == selfID);
                if (selfData.nPDBID == selfID)
                {
                    selfInfoJob.text = String.Format("{0}<color=#ffffff>{1}</color>",
                                                     ULocalizationService.Instance.Get("UIView", "ClanDetail", "SelfInfoJob"), LogicDataCenter.clanDataManager.GetClanIdentityName(selfData.nIdentity));
                    selfInfoGaveThisWeek.text = String.Format("{0}<color=#ffffff>{1}</color>",
                                                              ULocalizationService.Instance.Get("UIView", "ClanDetail", "SelfInfoGaveThisWeek"), selfData.nDonateThisWeek);
                    selfInfoGaveTotal.text = String.Format("{0}<color=#ffffff>{1}</color>",
                                                           ULocalizationService.Instance.Get("UIView", "ClanDetail", "SelfInfoGaveTotal"), selfData.nDonateTotal);
                }

                if (selfID == cmdBasedata.nShaikhID)
                {
                    NoticeEditBtn.gameObject.SetActive(true);
                    NoticeSaveBtn.gameObject.SetActive(false);
                }
                else
                {
                    NoticeEditBtn.gameObject.SetActive(false);
                    NoticeSaveBtn.gameObject.SetActive(false);
                }
            }

            // 杯赛按钮设置
            int      nSelfID        = EntityFactory.MainHeroView.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_ID);
            string   strTip         = "";
            DateTime serverTime     = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Unspecified).AddSeconds(cmdBasedata.nServerTime);
            int      nNeedDay       = System.DateTime.DaysInMonth(serverTime.Year, serverTime.Month) - serverTime.Day + 1;
            bool     bCanFreePublic = GameLogicAPI.clanCanPublicLegendCup();

            CreateCupText.gameObject.SetActive(bCanFreePublic);
            if (cmdBasedata.lLegendCupID > 0)               // 比赛中
            {
                legendCupBtnText.text = ULocalizationService.Instance.Get("UIView", "ClanDetail", "CupProcessing");
                strTip = ULocalizationService.Instance.Get("UIView", "ClanDetail", "CupProcessingTip");
                ClearLegendCupBtnEffect();
            }
            else
            {
                if (nSelfID == cmdBasedata.nShaikhID)
                {
                    if (cmdBasedata.nLegendCupCount > 0)    // 免费发布
                    {
                        legendCupBtnText.text = ULocalizationService.Instance.Get("UIView", "ClanDetail", "CupFreePublic");
                        strTip = ULocalizationService.Instance.Get("UIView", "ClanDetail", "CupFreePublicTip");
                        CreateLegendCupBtnEffect();
                    }
                    else                                    // 付费发布
                    {
                        legendCupBtnText.text = ULocalizationService.Instance.Get("UIView", "ClanDetail", "CupChargePublic");
                        strTip = String.Format(ULocalizationService.Instance.Get("UIView", "ClanDetail", "CupChargePublicTip"), nNeedDay);
                        ClearLegendCupBtnEffect();
                    }
                }
                else                                        // 等待发布
                {
                    legendCupBtnText.text = ULocalizationService.Instance.Get("UIView", "ClanDetail", "CupWaitPublic");
                    strTip = ULocalizationService.Instance.Get("UIView", "ClanDetail", "CupWaitPublicTip");
                    ClearLegendCupBtnEffect();
                }
            }
            legendCupBtnTip.SetText(UTooltipParamName.BodyText, strTip);

            // 设置联盟解散提示
            SetDismissCountdownVisible();
        }