Beispiel #1
0
        private void NotifyRefreshRankModel()
        {
            // 先刷新真实的排行数据
            var fightLeaderData = PlayerDataManager.Instance.FightLeaderMaster;
            int count           = fightLeaderData.Count;

            for (int i = 0; i < count; i++)
            {
                if (fightLeaderData[i] != null)
                {
                    rankTypes[fightLeaderData[i].TypeId] = 1;
                    var _e = new FightLeaderMasterRefreshModelView(fightLeaderData[i], fightLeaderData[i].TypeId);
                    EventDispatcher.Instance.DispatchEvent(_e);
                }
            }

            // 然后补全排行NPC数据
            for (int i = 0; i < 3; i++)
            {
                if (rankTypes[i] != 1)
                {
                    var _e = new FightLeaderMasterRefreshModelView(null, i);
                    EventDispatcher.Instance.DispatchEvent(_e);
                }
            }
        }
    private void OnModelRefresh(IEvent ievent)
    {
        FightLeaderMasterRefreshModelView e = ievent as FightLeaderMasterRefreshModelView;

        if (professionIndex != e.Index)
        {
            return;
        }
        RefreshModel(e.Info);
    }
Beispiel #3
0
        private IEnumerator FightRankListCoroutine(int rankType)
        {
            using (new BlockingLayerHelper(0))
            {
                var _serverId = PlayerDataManager.Instance.ServerId;
                var _msg      = NetManager.Instance.GetFightRankList(_serverId, rankType);
                yield return(_msg.SendAndWaitUntilDone());

                if (_msg.State == MessageState.Reply)
                {
                    if (_msg.ErrorCode == (int)ErrorCodes.OK)
                    {
                        if (null != PlayerDataManager.Instance.FightLeaderMaster)
                        {
                            PlayerDataManager.Instance.FightLeaderMaster.Clear();
                        }
                        var data = _msg.Response.RankData;
                        trueRankDataCount = data.Count;
                        if (0 == trueRankDataCount)
                        {
                            for (int i = 0; i < 3; i++)
                            {
                                var _e = new FightLeaderMasterRefreshModelView(null, i);
                                EventDispatcher.Instance.DispatchEvent(_e);
                            }
                        }
                        else
                        {
                            applyCount = 0;
                            for (int d = 0; d < data.Count; d++)
                            {
                                PlayerDataManager.Instance.ApplyPlayerInfo(data[d].Id, FightRankListRefurbishRole);
                            }
                        }
                    }
                    else
                    {
                        UIManager.Instance.ShowNetError(_msg.ErrorCode);
                        Logger.Error("GetRankList Error!............ErrorCode..." + _msg.ErrorCode);
                    }
                }
                else
                {
                    Logger.Error("FightRankList Error!............State..." + _msg.State);
                }
            }
        }