| | |
| | |
|
| | | public byte[] donateCntList;
|
| | | public event Action DonateCntListEvent;
|
| | | public event Action<bool> EnterOrQuitGuildEvent; //进入或退出公会事件
|
| | | public event Action<bool> EnterOrQuitGuildEvent; //true进入或false退出公会事件
|
| | |
|
| | |
|
| | | public override void Init()
|
| | |
| | | void OnPlayerLoginOk()
|
| | | {
|
| | | UpdateDonateRedPoint();
|
| | |
|
| | | QueryZBGFamilyInfo();
|
| | | }
|
| | |
|
| | | void PlayerDataRefreshEvent(PlayerDataType type)
|
| | |
| | | EnterOrQuitGuildEvent?.Invoke(false);
|
| | | }
|
| | |
|
| | | //注意上线通知公会数据时也会触发
|
| | | //注意上线通知公会数据时也会触发; 但断线重连不会触发
|
| | | public async UniTask AfterEnterGuild()
|
| | | {
|
| | | //这里还没有公会数据, 后续的包会更新公会数据
|
| | |
| | | public int zbgOrgPriceValue;
|
| | | public int zbgChangFamilyCD;
|
| | | public List<int> cutCntListForTalk = new List<int>();
|
| | |
|
| | | public int familyRecordMaxCount;
|
| | |
|
| | | void ParseConfig()
|
| | | {
|
| | |
| | | zbgOrgPriceValue = int.Parse(config.Numerical2);
|
| | | zbgChangFamilyCD = int.Parse(config.Numerical3);
|
| | | cutCntListForTalk = JsonMapper.ToObject<List<int>>(config.Numerical4);
|
| | |
|
| | | config = FuncConfigConfig.Get("FamilyNote");
|
| | | familyRecordMaxCount = int.Parse(config.Numerical1);
|
| | |
|
| | |
|
| | | config = FuncConfigConfig.Get("FamilyBillboardSet");
|
| | | rankShowMaxCnt = int.Parse(config.Numerical1);
|
| | | pageCnt = int.Parse(config.Numerical2);
|
| | | queryPointNum = int.Parse(config.Numerical3);
|
| | | }
|
| | |
|
| | |
|
| | |
| | | #region 公会自定义记录
|
| | | public void UpdateFamilyAction(HA513_tagMCFamilyActionInfo _package)
|
| | | {
|
| | | if (PlayerDatas.Instance.fairyData == null ||
|
| | | PlayerDatas.Instance.fairyData.fairy == null ||
|
| | | PlayerDatas.Instance.fairyData.fairy.FamilyID != _package.FamilyID)
|
| | | if (PlayerDatas.Instance.baseData.FamilyId != _package.FamilyID)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
| | | public List<int> pageIndexList = new List<int>(); //正常是按页查询,顺序添加即可
|
| | | public int curPageIndex;
|
| | | public int totalPageCount;
|
| | |
|
| | | public int lastPage = -1;
|
| | | public int pageCnt; //每页查询条数
|
| | | int queryPointNum; //查询点
|
| | | public int rankShowMaxCnt;
|
| | |
|
| | | public FairyData GetFairyDataByRank(int rank)
|
| | | {
|
| | | if (rank < 1)
|
| | | return null;
|
| | | int index = rank - 1;
|
| | | FairyData fairyData = GetFairyDataByIndex(index);
|
| | | return fairyData;
|
| | | }
|
| | |
|
| | | public FairyData GetFairyDataByIndex(int index)
|
| | | {
|
| | | if (pageIndexList.IsNullOrEmpty() || index < 0 || index >= pageIndexList.Count)
|
| | | return null;
|
| | | int fairyID = pageIndexList[index];
|
| | | FairyData fairyData = GetFairyData(fairyID);
|
| | | return fairyData;
|
| | | }
|
| | |
|
| | | public FairyData GetFairyData(int fairyID)
|
| | | {
|
| | | return guildsDict.TryGetValue(fairyID, out var data) ? data : null;
|
| | | }
|
| | |
|
| | | public void ResetQueryParam()
|
| | | {
|
| | | pageCnt = 20;
|
| | | lastPage = -1;
|
| | | queryPointNum = 12;
|
| | | }
|
| | |
|
| | | public void ListenRankPage(int index)
|
| | | {
|
| | | int page = index / pageCnt;
|
| | | if (index > page * pageCnt + queryPointNum)
|
| | | {
|
| | | if (lastPage >= page)
|
| | | return;
|
| | | lastPage = page;
|
| | |
|
| | | if (index >= rankShowMaxCnt)
|
| | | {
|
| | | //超过服务器已上榜的总数量,比如总榜单是100名,当前只有8名玩家上榜,往下滚动就不再查询
|
| | | return;
|
| | | }
|
| | | //Debug.LogFormat("分页查询:请求第 {0} 页 (当前index:{1})", page + 1, index);
|
| | | SendFindGuild(string.Empty, page + 1, pageCnt);
|
| | | }
|
| | | }
|
| | |
|
| | | //查找公会列表
|
| | | public void OnRefreshGuildViewList(HA523_tagMCFamilyViewList vNetData)
|
| | |
| | | return;
|
| | | }
|
| | | lastChangeMarkTime = Time.time;
|
| | | if (UIManager.Instance.IsOpened<GuildHallWin>())
|
| | | if ((netPack.Type == 1 || netPack.Type == 2) && UIManager.Instance.IsOpened<GuildBaseWin>())
|
| | | {
|
| | | RequestGuildData();
|
| | | }
|
| | |
| | | //登录后首次打开查询,换新仙盟查询
|
| | | public void QueryZBGFamilyInfo()
|
| | | {
|
| | | if (PlayerDatas.Instance.baseData.FamilyId == 0)
|
| | | {
|
| | | return;
|
| | | }
|
| | | if (isQueryZBGYet)
|
| | | return;
|
| | |
|
| | |
|
| | | QueryFamilyAction((int)PlayerDatas.Instance.baseData.FamilyId, ZBGFamilyActionType);
|
| | |
|
| | |
| | | return false;
|
| | | }
|
| | | bool restart = false;
|
| | | if (vNetData.FamilyActionList.Length == 1 && vNetData.FamilyActionList[0].Value1 == 1)
|
| | |
|
| | | for (int i = 0; i < vNetData.FamilyActionList.Length; i++)
|
| | | {
|
| | | int playerID = (int)vNetData.FamilyActionList[i].Value1;
|
| | | if (playerID != 1)
|
| | | {
|
| | | continue;
|
| | | }
|
| | | if (familyZBGActions.ContainsKey(1) && familyZBGActions[1].Time != vNetData.FamilyActionList[0].Time)
|
| | | {
|
| | | familyZBGActions.Clear();
|
| | |
| | | restart = true;
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | for (int i = 0; i < vNetData.FamilyActionList.Length; i++)
|
| | | {
|
| | |
| | | }
|
| | |
|
| | | #endregion
|
| | |
|
| | |
|
| | | #region 红点
|
| | |
|